Warning, /detector_benchmarks/benchmarks/zdc_neutron/Snakefile is written in an unsupported language. File is not indexed.
0001 # Generate the single neutrons and put them into a HepMC file
0002 rule zdc_neutron_hepmc:
0003 input:
0004 script = "benchmarks/zdc_neutron/gen_forward_neutrons.cxx",
0005 output:
0006 hepmcfile="sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.hepmc",
0007 params:
0008 num_events=1000,
0009 shell:
0010 """
0011 root -l -b -q '{input.script}({params.num_events}, 0, "{output.hepmcfile}")'
0012 """
0013
0014 # Run the generated events through the Geant simulation
0015 rule zdc_neutron_sim:
0016 input:
0017 hepmcfile="sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.hepmc",
0018 warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0019 output:
0020 "sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4hep.root",
0021 params:
0022 num_events=100,
0023 shell:
0024 """
0025 set -m # monitor mode to prevent lingering processes
0026 exec npsim \
0027 --runType batch \
0028 -v WARNING \
0029 --compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \
0030 --numberOfEvents {params.num_events} \
0031 --inputFiles {input.hepmcfile} \
0032 --outputFile {output}
0033 """
0034
0035
0036 # Process the file produced in the previous step through EICRecon
0037 rule zdc_neutron_reco:
0038 input:
0039 "sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4hep.root",
0040 output:
0041 "sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4eic.root",
0042 shell:
0043 """
0044 set -m # monitor mode to prevent lingering processes
0045 exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
0046 eicrecon {input} -Ppodio:output_file={output} \
0047 -Ppodio:output_collections=MCParticles,EcalFarForwardZDCRawHits,EcalFarForwardZDCRecHits,EcalFarForwardZDCClusters,HcalFarForwardZDCRawHits,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,ReconstructedFarForwardZDCNeutrons
0048 """
0049
0050
0051 # Run the analysis scripts
0052 rule zdc_neutron_analyses:
0053 input:
0054 geant_script = "benchmarks/zdc_neutron/analysis/fwd_neutrons_geant.C",
0055 data_geant = "sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4hep.root",
0056 recon_script = "benchmarks/zdc_neutron/analysis/fwd_neutrons_recon.C",
0057 data_recon = "sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4eic.root",
0058 output:
0059 geant_analysis_out = "results/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons_geant.pdf",
0060 recon_analysis_out = "results/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons_recon.pdf",
0061 shell:
0062 """
0063 root -l -b -q '{input.geant_script}("{input.data_geant}","{output.geant_analysis_out}")'
0064 root -l -b -q '{input.recon_script}("{input.data_recon}","{output.recon_analysis_out}")'
0065 """