-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added benchmark for single neutron in the ZDC (#99)
- Loading branch information
1 parent
e30c6f3
commit 5b43263
Showing
8 changed files
with
855 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Detector Benchmark for single neutron in the ZDC | ||
================================================= | ||
|
||
## Overview | ||
This benchmark generates single-neutron events. The neutrons are generated with 100 GeV total momentum; polar angles of 0-6 mRad with respect to the proton/ion beam direction, uniform over cosine of the polar angle; and uniform azimuthal angles with respect to the proton/ion beam direction. The benchmark creates acceptance and reconstruction performance plots. | ||
|
||
## Contacts | ||
[Barak Schmookler]([email protected]) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Generate the single neutrons and put them into a HepMC file | ||
rule zdc_neutron_hepmc: | ||
input: | ||
script = "benchmarks/zdc_neutron/gen_forward_neutrons.cxx", | ||
output: | ||
hepmcfile="sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.hepmc", | ||
params: | ||
num_events=1000, | ||
shell: | ||
""" | ||
root -l -b -q '{input.script}({params.num_events}, 0, "{output.hepmcfile}")' | ||
""" | ||
|
||
# Run the generated events through the Geant simulation | ||
rule zdc_neutron_sim: | ||
input: | ||
hepmcfile="sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.hepmc", | ||
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", | ||
output: | ||
"sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4hep.root", | ||
params: | ||
num_events=100, | ||
shell: | ||
""" | ||
set -m # monitor mode to prevent lingering processes | ||
exec npsim \ | ||
--runType batch \ | ||
-v WARNING \ | ||
--compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \ | ||
--numberOfEvents {params.num_events} \ | ||
--inputFiles {input.hepmcfile} \ | ||
--outputFile {output} | ||
""" | ||
|
||
|
||
# Process the file produced in the previous step through EICRecon | ||
rule zdc_neutron_reco: | ||
input: | ||
"sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4hep.root", | ||
output: | ||
"sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4eic.root", | ||
shell: | ||
""" | ||
set -m # monitor mode to prevent lingering processes | ||
exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \ | ||
eicrecon {input} -Ppodio:output_file={output} \ | ||
-Ppodio:output_collections=MCParticles,EcalFarForwardZDCRawHits,EcalFarForwardZDCRecHits,EcalFarForwardZDCClusters,HcalFarForwardZDCRawHits,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,ReconstructedFarForwardZDCNeutrons | ||
""" | ||
|
||
|
||
# Run the analysis scripts | ||
rule zdc_neutron_analyses: | ||
input: | ||
geant_script = "benchmarks/zdc_neutron/analysis/fwd_neutrons_geant.C", | ||
data_geant = "sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4hep.root", | ||
recon_script = "benchmarks/zdc_neutron/analysis/fwd_neutrons_recon.C", | ||
data_recon = "sim_output/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons.edm4eic.root", | ||
output: | ||
geant_analysis_out = "results/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons_geant.pdf", | ||
recon_analysis_out = "results/zdc_neutron/{DETECTOR_CONFIG}/fwd_neutrons_recon.pdf", | ||
shell: | ||
""" | ||
root -l -b -q '{input.geant_script}("{input.data_geant}","{output.geant_analysis_out}")' | ||
root -l -b -q '{input.recon_script}("{input.data_recon}","{output.recon_analysis_out}")' | ||
""" |
Oops, something went wrong.