Back to home page

EIC code displayed by LXR

 
 

    


Warning, /detector_benchmarks/benchmarks/zdc_lambda/Snakefile is written in an unsupported language. File is not indexed.

0001 rule zdc_lambda_generate:
0002     input:
0003         script="benchmarks/zdc_lambda/analysis/gen_lambda_decay.cxx",
0004     output:
0005         GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
0006     params:
0007         N_EVENTS=1000,
0008         P=lambda wildcards: wildcards.P,
0009     shell:
0010         """
0011 root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{params.P},{params.P})'
0012 """
0013 
0014 rule zdc_lambda_simulate:
0015     input:
0016         GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
0017         warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0018         geometry_lib=find_epic_libraries(),
0019     output:
0020         SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root",
0021     params:
0022         N_EVENTS=200,
0023         INDEX=lambda wildcards: wildcards.INDEX,
0024         SEED=lambda wildcards: "1" + wildcards.INDEX,
0025         PHYSICS_LIST="FTFP_BERT",
0026         DETECTOR_PATH=os.environ["DETECTOR_PATH"],
0027         DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0028         DD4HEP_HASH=get_spack_package_hash("dd4hep"),
0029         NPSIM_HASH=get_spack_package_hash("npsim"),
0030     cache: True
0031     shell:
0032         """
0033 exec npsim \
0034    --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
0035    --random.seed {params.SEED} \
0036    --skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
0037    --numberOfEvents {params.N_EVENTS} \
0038    --physicsList {params.PHYSICS_LIST} \
0039    --inputFiles {input.GEN_FILE} \
0040    --outputFile {output.SIM_FILE}
0041 """
0042 
0043 rule zdc_lambda_recon:
0044     input:
0045         SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root",
0046         warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0047     output:
0048         REC_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root",
0049     params:
0050         N_EVENTS=200,
0051         DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0052         EICRECON_HASH=get_spack_package_hash("eicrecon"),
0053     cache: True
0054     shell:
0055         """
0056 env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
0057   eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCClusters,HcalFarForwardZDCRecHits,HcalFarForwardZDCSubcellHits,ReconstructedFarForwardZDCLambdas,ReconstructedFarForwardZDCLambdaDecayProductsCM -Pjana:nevents={params.N_EVENTS}
0058 """
0059 
0060 rule zdc_lambda_analysis:
0061     input:
0062         expand("sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root",
0063             P=[100, 125, 150,175, 200, 225, 250, 275],
0064             DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
0065             INDEX=range(5),
0066         ),
0067         script="benchmarks/zdc_lambda/analysis/lambda_plots.py",
0068     output:
0069         results_dir=directory("results/{DETECTOR_CONFIG}/zdc_lambda"),
0070     shell:
0071         """
0072 mkdir -p {output.results_dir}
0073 python {input.script} {output.results_dir}
0074 """