Warning, /detector_benchmarks/benchmarks/insert_muon/Snakefile is written in an unsupported language. File is not indexed.
0001 rule insert_muon_generate:
0002 input:
0003 script="benchmarks/insert_muon/analysis/gen_particles.cxx",
0004 output:
0005 GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc",
0006 params:
0007 NEVENTS_GEN=5000,
0008 th_max=7.0,
0009 th_min=1.7,
0010 shell:
0011 """
0012 root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "mu-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
0013 """
0014
0015 rule insert_muon_simulate:
0016 input:
0017 GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc",
0018 warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0019 geometry_lib=find_epic_libraries(),
0020 output:
0021 SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root",
0022 params:
0023 INDEX=lambda wildcards: wildcards.INDEX,
0024 PHYSICS_LIST="FTFP_BERT",
0025 DETECTOR_PATH=os.environ["DETECTOR_PATH"],
0026 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0027 DD4HEP_HASH=get_spack_package_hash("dd4hep"),
0028 NPSIM_HASH=get_spack_package_hash("npsim"),
0029 cache: True
0030 shell:
0031 """
0032 NEVENTS_SIM=1000
0033 # Running simulation
0034 npsim \
0035 --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
0036 --skipNEvents $(( $NEVENTS_SIM * {params.INDEX} )) \
0037 --numberOfEvents $NEVENTS_SIM \
0038 --physicsList {params.PHYSICS_LIST} \
0039 --inputFiles {input.GEN_FILE} \
0040 --outputFile {output.SIM_FILE}
0041 """
0042
0043 rule insert_muon_recon:
0044 input:
0045 SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root",
0046 output:
0047 REC_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_rec_mu-_{P}GeV_{INDEX}.edm4hep.root",
0048 params:
0049 DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0050 EICRECON_HASH=get_spack_package_hash("eicrecon"),
0051 cache: True
0052 shell:
0053 """
0054 NEVENTS_REC=1000
0055 env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
0056 eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters -Pjana:nevents=$NEVENTS_REC
0057 """
0058
0059 rule insert_muon_analysis:
0060 input:
0061 expand("sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root",
0062 P=[50],
0063 DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
0064 INDEX=range(5),
0065 ),
0066 script="benchmarks/insert_muon/analysis/muon_plots.py",
0067 output:
0068 results_dir=directory("results/{DETECTOR_CONFIG}/insert_muon"),
0069 shell:
0070 """
0071 mkdir -p {output.results_dir}
0072 python {input.script} {output.results_dir}
0073 """