Back to home page

EIC code displayed by LXR

 
 

    


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

0001 SIMOUTDIR="sim_output/beamline/"
0002 ANALYSISDIR=SIMOUTDIR+"analysis/"
0003 
0004 rule beamline_steering_sim:
0005     input:
0006         warmup="warmup/epic_ip6_extended.edm4hep.root",
0007         macro=workflow.source_path("beamlineGPS.mac"),
0008     output:
0009         SIMOUTDIR+"beamlineTest{CAMPAIGN}.edm4hep.root",
0010     shell:
0011         """
0012             exec npsim \
0013             --runType run \
0014             --random.seed 1 \
0015             --enableG4GPS \
0016             --macroFile {input.macro} \
0017             --compactFile $DETECTOR_PATH/epic_ip6_extended.xml \
0018             --printLevel WARNING \
0019             --outputFile {output} \
0020             --physics.rangecut 100*m
0021         """
0022 
0023 rule beamline_acceptance_sim:
0024     input:
0025         warmup="warmup/epic_ip6_extended.edm4hep.root",
0026         macro=workflow.source_path("acceptanceGPS.mac"),
0027     output:
0028         SIMOUTDIR+"acceptanceTest{CAMPAIGN}.edm4hep.root",
0029     shell:
0030         """
0031             exec npsim \
0032             --runType run \
0033             --random.seed 1 \
0034             --enableG4GPS \
0035             --macroFile {input.macro} \
0036             --compactFile $DETECTOR_PATH/epic_ip6_extended.xml \
0037             --printLevel WARNING \
0038             --outputFile {output} \
0039             --physics.rangecut 100*m
0040         """
0041 
0042 rule beamline_steering_analysis:
0043     params:
0044         warmup="warmup/epic_ip6_extended.edm4hep.root",
0045         xml=os.getenv("DETECTOR_PATH")+"/epic_ip6_extended.xml",
0046     input:
0047         script=workflow.source_path("beamlineAnalysis.C"),
0048         header=workflow.source_path("shared_functions.h"),
0049         data=SIMOUTDIR+"beamlineTest{CAMPAIGN}.edm4hep.root",
0050     output:
0051         rootfile=ANALYSISDIR+"beamlineTestAnalysis{CAMPAIGN}.root",
0052         beamspot_canvas=ANALYSISDIR+"beamspot_{CAMPAIGN}.png",
0053         x_px_canvas=ANALYSISDIR+"x_px_{CAMPAIGN}.png",
0054         y_py_canvas=ANALYSISDIR+"y_py_{CAMPAIGN}.png",
0055         fitted_position_means_stdevs_canvas=ANALYSISDIR+"fitted_position_means_stdevs_{CAMPAIGN}.png",
0056         fitted_momentum_means_stdevs_canvas=ANALYSISDIR+"fitted_momentum_means_stdevs_{CAMPAIGN}.png",
0057         pipe_parameter_canvas=ANALYSISDIR+"pipe_parameter_{CAMPAIGN}.png",
0058     shell:
0059         """
0060             root -l -b -q '{input.script}("{input.data}", "{output.rootfile}", "{params.xml}",
0061             "{output.beamspot_canvas}", "{output.x_px_canvas}", "{output.y_py_canvas}",
0062             "{output.fitted_position_means_stdevs_canvas}", "{output.fitted_momentum_means_stdevs_canvas}",
0063             "{output.pipe_parameter_canvas}")'
0064         """
0065 
0066 rule beamline_acceptance_analysis:
0067     params:
0068         warmup="warmup/epic_ip6_extended.edm4hep.root",
0069         xml=os.getenv("DETECTOR_PATH")+"/epic_ip6_extended.xml",
0070     input:
0071         script=workflow.source_path("acceptanceAnalysis.C"),
0072         header=workflow.source_path("shared_functions.h"),
0073         data=SIMOUTDIR+"acceptanceTest{CAMPAIGN}.edm4hep.root",
0074     output:
0075         rootfile=ANALYSISDIR+"acceptanceTestAnalysis{CAMPAIGN}.root",
0076         beampipe_canvas=ANALYSISDIR+"acceptance_in_beampipe_{CAMPAIGN}.png",
0077         etheta_canvas=ANALYSISDIR+"acceptance_energy_theta_{CAMPAIGN}.png",
0078         etheta_acceptance_canvas=ANALYSISDIR+"acceptance_energy_theta_acceptance_{CAMPAIGN}.png",
0079         entries_canvas=ANALYSISDIR+"acceptance_entries_{CAMPAIGN}.png",
0080     shell:
0081         """
0082             root -l -b -q '{input.script}("{input.data}", "{output.rootfile}", "{params.xml}", "{output.beampipe_canvas}","{output.etheta_canvas}","{output.etheta_acceptance_canvas}",
0083             "{output.entries_canvas}")'
0084         """
0085 
0086 rule beamline:
0087     input:
0088         ANALYSISDIR+"beamlineTestAnalysis{CAMPAIGN}.root",
0089         ANALYSISDIR+"beamspot_{CAMPAIGN}.png",
0090         ANALYSISDIR+"x_px_{CAMPAIGN}.png",
0091         ANALYSISDIR+"y_py_{CAMPAIGN}.png",
0092         ANALYSISDIR+"fitted_position_means_stdevs_{CAMPAIGN}.png",
0093         ANALYSISDIR+"fitted_momentum_means_stdevs_{CAMPAIGN}.png",
0094         ANALYSISDIR+"pipe_parameter_{CAMPAIGN}.png",  
0095         ANALYSISDIR+"acceptanceTestAnalysis{CAMPAIGN}.root",
0096         ANALYSISDIR+"acceptance_in_beampipe_{CAMPAIGN}.png",
0097         ANALYSISDIR+"acceptance_energy_theta_{CAMPAIGN}.png",
0098         ANALYSISDIR+"acceptance_energy_theta_acceptance_{CAMPAIGN}.png",     
0099         ANALYSISDIR+"acceptance_entries_{CAMPAIGN}.png", 
0100     output:
0101         directory("results/beamline/{CAMPAIGN}/")
0102     shell:
0103         """
0104             mkdir {output}        
0105             cp {input} {output}
0106         """
0107 
0108 rule beamline_local:
0109     input:
0110         "results/beamline/local/"