Back to home page

EIC code displayed by LXR

 
 

    


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

0001 import os
0002 
0003 
0004 rule zdc_lyso_sim_hepmc:
0005     input:
0006         script = "benchmarks/zdc_lyso/gen_particles.cxx",
0007     output:
0008         hepmcfile="data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc",
0009     log:
0010         "data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc.log",
0011     params:
0012         num_events=1000,
0013     shell:
0014         """
0015 root -l -b -q '{input.script}({params.num_events}, "{output.hepmcfile}", "{wildcards.PARTICLE}", {wildcards.THETA_MIN}, {wildcards.THETA_MAX}, 0, 360, {wildcards.BEAM_ENERGY})'
0016 """
0017 
0018 
0019 rule zdc_lyso_sim:
0020     input:
0021         hepmcfile="data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc",
0022         warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0023     output:
0024         "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.edm4hep.root",
0025     log:
0026         "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.edm4hep.root.log",
0027     params:
0028         num_events=1000,
0029     shell:
0030         """
0031 npsim \
0032   --runType batch \
0033   -v WARNING \
0034   --compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \
0035   --numberOfEvents {params.num_events} \
0036   --inputFiles {input.hepmcfile} \
0037   --outputFile {output}
0038 """
0039 
0040 
0041 rule zdc_lyso_reco:
0042     input:
0043         "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.edm4hep.root",
0044     output:
0045         "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.eicrecon.tree.edm4eic.root",
0046     log:
0047         "sim_output/zdc_lyso/{DETECTOR_CONFIG}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.eicrecon.tree.edm4eic.root.log",
0048     shell:
0049         """
0050 eicrecon -Ppodio:output_collections=HcalFarForwardZDCRawHits,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,EcalFarForwardZDCRawHits,EcalFarForwardZDCRecHits,EcalFarForwardZDCClusters,MCParticles {input}
0051 mv podio_output.root {output}
0052 """
0053 
0054 
0055 rule zdc_lyso_analysis:
0056     input:
0057         expand("sim_output/zdc_lyso/{{DETECTOR_CONFIG}}_{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.eicrecon.tree.edm4eic.root",
0058                PARTICLE=["gamma"],
0059                BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"],
0060                THETA_MIN=["0"],
0061                THETA_MAX=["0.3"]),      
0062         script="benchmarks/zdc_lyso/analysis/analysis.py",
0063     output:
0064         "results/{DETECTOR_CONFIG}/zdc_lyso/plots.pdf",
0065     shell:
0066         """
0067 python {input.script}
0068 """
0069 
0070 
0071 # Examples of invocation
0072 rule zdc_lyso_hepmc:
0073     input:
0074         expand("data/{PARTICLE}_{BEAM_ENERGY}GeV_theta_{THETA_MIN}deg_thru_{THETA_MAX}deg.hepmc",
0075                PARTICLE=["gamma"],
0076                BEAM_ENERGY=["0.005", "0.01", "0.05", "0.1", "0.5", "1.0"],
0077                THETA_MIN=["0"],
0078                THETA_MAX=["0.3"])
0079 
0080 
0081 rule zdc_lyso_local:
0082    input:
0083         "results/" + os.environ["DETECTOR_CONFIG"] + "/zdc_lyso/plots.pdf",
0084    message:
0085         "See output in {input[0]}"
0086