Back to home page

EIC code displayed by LXR

 
 

    


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

0001 rule far_forward_dvcs_compile:
0002     input:
0003         "benchmarks/far_forward_dvcs/analysis/analyze_DVCS_eicrecon_cxx.so",
0004 
0005 # Process the generated HepMC files through the simulation
0006 rule far_forward_dvcs_sim:
0007     input:
0008         warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
0009         geometry_lib=find_epic_libraries(),
0010     output:
0011         "sim_output/far_forward_dvcs/{DETECTOR_CONFIG}/DVCS.{INDEX}.ab.hiAcc.{EBEAM}x{PBEAM}.edm4hep.root",
0012     params:
0013         N_EVENTS=1000,
0014         EBEAM=lambda wildcards: wildcards.EBEAM,
0015         INDEX=lambda wildcards: wildcards.INDEX,
0016         PBEAM=lambda wildcards: wildcards.PBEAM,
0017         SEED=lambda wildcards: "1" + wildcards.INDEX,
0018         DETECTOR_PATH=os.environ["DETECTOR_PATH"],
0019         DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0020         DD4HEP_HASH=get_spack_package_hash("dd4hep"),
0021         NPSIM_HASH=get_spack_package_hash("npsim"),
0022     cache: True
0023     shell:
0024         """
0025 npsim \
0026   --runType batch \
0027   --part.minimalKineticEnergy 1000*GeV  \
0028   --random.seed {params.SEED} \
0029   --filter.tracker edep0 \
0030   -v WARNING \
0031   --numberOfEvents {params.N_EVENTS} \
0032   --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
0033   --inputFiles root://dtn-eic.jlab.org//volatile/eic/EPIC/EVGEN/EXCLUSIVE/DVCS_ABCONV/{params.EBEAM}x{params.PBEAM}/DVCS.{params.INDEX}.ab.hiAcc.{params.EBEAM}x{params.PBEAM}.hepmc3.tree.root \
0034   --outputFile {output}
0035 """
0036 
0037 rule foo:
0038     input:
0039         'sim_output/far_forward_dvcs/epic_craterlake_10x100/DVCS.1.ab.hiAcc.10x100.edm4hep.root'
0040 
0041 # Process the files produced in the previous step through EICRecon
0042 rule far_forward_dvcs_reco:
0043     input:
0044         sim="sim_output/far_forward_dvcs/{DETECTOR_CONFIG}/DVCS.{INDEX}.ab.hiAcc.{EBEAM}x{PBEAM}.edm4hep.root",
0045         warmup=ancient("warmup/{DETECTOR_CONFIG}.edm4hep.root"),
0046     output:
0047         "sim_output/far_forward_dvcs/{DETECTOR_CONFIG}/DVCS.{INDEX}.ab.hiAcc.{EBEAM}x{PBEAM}.eicrecon.edm4eic.root",
0048     params:
0049         DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
0050         EBEAM=lambda wildcards: wildcards.EBEAM,
0051         PBEAM=lambda wildcards: wildcards.PBEAM,
0052         INDEX=lambda wildcards: wildcards.INDEX,
0053         EICRECON_HASH=get_spack_package_hash("eicrecon"),
0054     cache: True
0055     shell:
0056         """
0057 set -m # monitor mode to prevent lingering processes
0058 exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
0059   eicrecon {input.sim} -Ppodio:output_file={output} \
0060   -Ppodio:output_collections=B0ECalClusters,B0TrackerHits,B0TrackerRecHits,EcalEndcapPTruthClusters,ForwardOffMRecParticles,ForwardRomanPotRecParticles,MCParticles,MCParticlesHeadOnFrameNoBeamFX,ReconstructedChargedParticles,ReconstructedTruthSeededChargedParticles,ZDCEcalClusters
0061 """
0062 
0063 #Process the merged file through the plotting script
0064 rule far_forward_dvcs_plots:
0065     input:
0066         workflow.source_path("analysis/render.hpp"),
0067         workflow.source_path("analysis/detectorResolution.hpp"),
0068         script="benchmarks/far_forward_dvcs/analysis/analyze_DVCS_eicrecon.cxx",
0069         script_compiled="benchmarks/far_forward_dvcs/analysis/analyze_DVCS_eicrecon_cxx.so",
0070         reco="sim_output/far_forward_dvcs/{DETECTOR_CONFIG}/DVCS.1.ab.hiAcc.{EBEAM}x{PBEAM}.eicrecon.edm4eic.root",
0071     output:
0072         dir=directory("results/far_forward_dvcs/{DETECTOR_CONFIG}/{EBEAM}x{PBEAM}"),
0073         list=temp("results/far_forward_dvcs/{DETECTOR_CONFIG}/{EBEAM}x{PBEAM}.lst"),
0074     wildcard_constraints:
0075         EBEAM=r"\d+",
0076         PBEAM=r"\d+",
0077     shell:
0078         """
0079 mkdir -p "{output.dir}"
0080 echo "{input.reco}" > "{output.list}"
0081 root -l -b -q '{input.script}+("{output.list}", "{output.dir}")'
0082 """
0083 
0084 #Examples of invocation
0085 rule far_forward_dvcs_run_locally:
0086     input:
0087         "results/far_forward_dvcs/epic_craterlake_10x100/10x100/",
0088         "results/far_forward_dvcs/epic_craterlake_5x41/5x41/",
0089     message:
0090         "See output in {input[0]} {input[1]}"