Skip to content
Snippets Groups Projects
Unverified Commit ccd83bb5 authored by Dmitry Kalinkin's avatar Dmitry Kalinkin Committed by GitHub
Browse files

treewide: set ddsim simulation seed (#180)

parent 4833ca67
No related branches found
No related tags found
No related merge requests found
Pipeline #123256 passed with warnings
......@@ -10,6 +10,7 @@ rule beamline_steering_sim:
"""
exec npsim \
--runType run \
--random.seed 1 \
--enableG4GPS \
--macroFile {input.macro} \
--compactFile $DETECTOR_PATH/epic_ip6_extended.xml \
......@@ -27,6 +28,7 @@ rule beamline_acceptance_sim:
"""
exec npsim \
--runType run \
--random.seed 1 \
--enableG4GPS \
--macroFile {input.macro} \
--compactFile $DETECTOR_PATH/epic_ip6_extended.xml \
......
......@@ -38,9 +38,9 @@ rule femc_electron_simulate:
cache: True
shell:
"""
# Running simulation
npsim \
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed 1 \
--numberOfEvents {params.N_EVENTS} \
--physicsList {params.PHYSICS_LIST} \
--inputFiles {input.GEN_FILE} \
......
......@@ -38,9 +38,9 @@ rule femc_photon_simulate:
cache: True
shell:
"""
# Running simulation
npsim \
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed 1 \
--numberOfEvents {params.N_EVENTS} \
--physicsList {params.PHYSICS_LIST} \
--inputFiles {input.GEN_FILE} \
......
......@@ -38,9 +38,9 @@ rule femc_pi0_simulate:
SIM_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_sim_pi0_{P}GeV.edm4hep.root"
shell:
"""
# Running simulation
npsim \
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed 1 \
--numberOfEvents {params.N_EVENTS} \
--physicsList {params.PHYSICS_LIST} \
--inputFiles {input.GEN_FILE} \
......
......@@ -22,6 +22,7 @@ rule insert_muon_simulate:
SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root",
params:
INDEX=lambda wildcards: wildcards.INDEX,
SEED=lambda wildcards: "1" + wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
......@@ -31,9 +32,9 @@ rule insert_muon_simulate:
shell:
"""
NEVENTS_SIM=1000
# Running simulation
npsim \
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed {params.SEED} \
--skipNEvents $(( $NEVENTS_SIM * {params.INDEX} )) \
--numberOfEvents $NEVENTS_SIM \
--physicsList {params.PHYSICS_LIST} \
......
......@@ -23,6 +23,7 @@ rule insert_neutron_simulate:
SIM_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_sim_neutron_{P}GeV_{INDEX}.edm4hep.root",
params:
INDEX=lambda wildcards: wildcards.INDEX,
SEED=lambda wildcards: "1" + wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
......@@ -32,9 +33,9 @@ rule insert_neutron_simulate:
shell:
"""
NEVENTS_SIM=200
# Running simulation
npsim \
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed {params.SEED} \
--skipNEvents $(( $NEVENTS_SIM * {params.INDEX} )) \
--numberOfEvents $NEVENTS_SIM \
--physicsList {params.PHYSICS_LIST} \
......
......@@ -29,6 +29,7 @@ rule insert_tau_simulate:
params:
N_EVENTS=get_n_events,
INDEX=lambda wildcards: wildcards.INDEX,
SEED=lambda wildcards: "1" + wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
......@@ -37,9 +38,9 @@ rule insert_tau_simulate:
cache: True
shell:
"""
# Running simulation
npsim \
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed {params.SEED} \
--numberOfEvents {params.N_EVENTS} \
--skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
--physicsList {params.PHYSICS_LIST} \
......
rule zdc_lambda_generate:
input:
script="benchmarks/zdc_lambda/analysis/gen_lambda_decay.cxx",
output:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
params:
N_EVENTS=1000,
P=lambda wildcards: wildcards.P,
shell:
"""
input:
script="benchmarks/zdc_lambda/analysis/gen_lambda_decay.cxx",
output:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
params:
N_EVENTS=1000,
P=lambda wildcards: wildcards.P,
shell:
"""
root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{params.P},{params.P})'
"""
rule zdc_lambda_simulate:
input:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root",
params:
N_EVENTS=200,
INDEX=lambda wildcards: wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
"""
# Running simulation
npsim \
input:
GEN_FILE="sim_output/zdc_lambda/lambda_decay_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root",
params:
N_EVENTS=200,
INDEX=lambda wildcards: wildcards.INDEX,
SEED=lambda wildcards: "1" + wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
"""
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed {params.SEED} \
--skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
--numberOfEvents {params.N_EVENTS} \
--physicsList {params.PHYSICS_LIST} \
......@@ -40,34 +41,34 @@ npsim \
"""
rule zdc_lambda_recon:
input:
SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
REC_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root",
params:
N_EVENTS=200,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell:
"""
input:
SIM_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_sim_lambda_dec_{P}GeV_{INDEX}.edm4hep.root",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
REC_FILE="sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root",
params:
N_EVENTS=200,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell:
"""
env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCClusters,HcalFarForwardZDCRecHits,HcalFarForwardZDCSubcellHits,ReconstructedFarForwardZDCLambdas,ReconstructedFarForwardZDCLambdaDecayProductsCM -Pjana:nevents={params.N_EVENTS}
"""
rule zdc_lambda_analysis:
input:
expand("sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root",
P=[100, 125, 150,175, 200, 225, 250, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_lambda/analysis/lambda_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_lambda"),
shell:
"""
input:
expand("sim_output/zdc_lambda/{DETECTOR_CONFIG}_rec_lambda_dec_{P}GeV_{INDEX}.edm4eic.root",
P=[100, 125, 150,175, 200, 225, 250, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_lambda/analysis/lambda_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_lambda"),
shell:
"""
mkdir -p {output.results_dir}
python {input.script} {output.results_dir}
"""
......@@ -38,10 +38,11 @@ rule zdc_lyso_sim:
cache: True
shell:
"""
npsim \
exec npsim \
--runType batch \
-v WARNING \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed 1 \
--numberOfEvents {params.num_events} \
--inputFiles {input.hepmcfile} \
--outputFile {output}
......
......@@ -22,11 +22,11 @@ rule zdc_neutron_sim:
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 \
--random.seed 1 \
--numberOfEvents {params.num_events} \
--inputFiles {input.hepmcfile} \
--outputFile {output}
......
rule zdc_photon_generate:
input:
script="benchmarks/zdc_photon/analysis/gen_particles.cxx",
output:
GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
params:
th_max=0.23,
th_min=0,
N_EVENTS=1000,
P=lambda wildcards: wildcards.P,
shell:
"""
input:
script="benchmarks/zdc_photon/analysis/gen_particles.cxx",
output:
GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
params:
th_max=0.23,
th_min=0,
N_EVENTS=1000,
P=lambda wildcards: wildcards.P,
shell:
"""
mkdir -p sim_output/zdc_photon
root -l -b -q '{input.script}('{params.N_EVENTS}',"{output.GEN_FILE}", "gamma", {params.th_min}, {params.th_max}, 0., 360., {params.P})'
"""
rule zdc_photon_simulate:
input:
GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root",
params:
N_EVENTS=200,
INDEX=lambda wildcards: wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
"""
# Running simulation
npsim \
input:
GEN_FILE="sim_output/zdc_photon/zdc_photon_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root",
params:
N_EVENTS=200,
INDEX=lambda wildcards: wildcards.INDEX,
SEED=lambda wildcards: "1" + wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
"""
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed {params.SEED} \
--physicsList {params.PHYSICS_LIST} \
--skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
--numberOfEvents {params.N_EVENTS} \
......@@ -43,34 +44,34 @@ npsim \
"""
rule zdc_photon_recon:
input:
SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
REC_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root",
params:
N_EVENTS=200,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell:
"""
input:
SIM_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_sim_zdc_photon_{P}GeV_{INDEX}.edm4hep.root",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
REC_FILE="sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root",
params:
N_EVENTS=200,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell:
"""
env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,HcalFarForwardZDCSubcellHits,ReconstructedFarForwardZDCNeutrals -Pjana:nevents={params.N_EVENTS}
"""
rule zdc_photon_analysis:
input:
expand("sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root",
P=[20, 30, 50, 70, 100, 150, 200, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_photon/analysis/zdc_photon_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_photon"),
shell:
"""
input:
expand("sim_output/zdc_photon/{DETECTOR_CONFIG}_rec_zdc_photon_{P}GeV_{INDEX}.edm4eic.root",
P=[20, 30, 50, 70, 100, 150, 200, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_photon/analysis/zdc_photon_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_photon"),
shell:
"""
mkdir -p {output.results_dir}
python {input.script} {output.results_dir}
"""
rule zdc_pi0_generate:
input:
script="benchmarks/zdc_pi0/analysis/gen_pi0_decay.cxx",
output:
GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc",
params:
N_EVENTS=1000,
P=lambda wildcards: wildcards.P,
shell:
"""
input:
script="benchmarks/zdc_pi0/analysis/gen_pi0_decay.cxx",
output:
GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc",
params:
N_EVENTS=1000,
P=lambda wildcards: wildcards.P,
shell:
"""
mkdir -p sim_output/zdc_pi0
root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{params.P},{params.P})'
"""
rule zdc_pi0_simulate:
input:
GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root",
params:
N_EVENTS=200,
INDEX=lambda wildcards: wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
"""
# Running simulation
npsim \
input:
GEN_FILE="sim_output/zdc_pi0/zdc_pi0_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root",
params:
N_EVENTS=200,
INDEX=lambda wildcards: wildcards.INDEX,
SEED=lambda wildcards: "1" + wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
"""
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed {params.SEED} \
--skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
--numberOfEvents {params.N_EVENTS} \
--physicsList {params.PHYSICS_LIST} \
......@@ -41,34 +42,34 @@ npsim \
"""
rule zdc_pi0_recon:
input:
SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
REC_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root",
params:
N_EVENTS=200,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell:
"""
input:
SIM_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_sim_zdc_pi0_{P}GeV_{INDEX}.edm4hep.root",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
REC_FILE="sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root",
params:
N_EVENTS=200,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell:
"""
env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCRecHits,HcalFarForwardZDCClusters,HcalFarForwardZDCSubcellHits -Pjana:nevents={params.N_EVENTS}
"""
rule zdc_pi0_analysis:
input:
expand("sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root",
P=[60, 80, 100, 130, 160],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_pi0/analysis/zdc_pi0_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_pi0"),
shell:
"""
input:
expand("sim_output/zdc_pi0/{DETECTOR_CONFIG}_rec_zdc_pi0_{P}GeV_{INDEX}.edm4eic.root",
P=[60, 80, 100, 130, 160],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_pi0/analysis/zdc_pi0_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_pi0"),
shell:
"""
mkdir -p {output.results_dir}
python {input.script} {output.results_dir}
"""
rule zdc_sigma_generate:
input:
script="benchmarks/zdc_sigma/analysis/gen_sigma_decay.cxx",
output:
GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc",
params:
N_EVENTS=100000,
P=lambda wildcards: wildcards.P,
shell:
"""
input:
script="benchmarks/zdc_sigma/analysis/gen_sigma_decay.cxx",
output:
GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc",
params:
N_EVENTS=100000,
P=lambda wildcards: wildcards.P,
shell:
"""
root -l -b -q '{input.script}({params.N_EVENTS},0,"{output.GEN_FILE}",{params.P},{params.P})'
"""
rule zdc_sigma_simulate:
input:
GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root",
params:
N_EVENTS=200,
INDEX=lambda wildcards: wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
"""
# Running simulation
npsim \
input:
GEN_FILE="sim_output/zdc_sigma/sigma_decay_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root",
params:
N_EVENTS=200,
INDEX=lambda wildcards: wildcards.INDEX,
SEED=lambda wildcards: "1" + wildcards.INDEX,
PHYSICS_LIST="FTFP_BERT",
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
"""
exec npsim \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--random.seed {params.SEED} \
--skipNEvents $(( {params.N_EVENTS} * {params.INDEX} )) \
--numberOfEvents {params.N_EVENTS} \
--physicsList {params.PHYSICS_LIST} \
......@@ -40,34 +41,34 @@ npsim \
"""
rule zdc_sigma_recon:
input:
SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
REC_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root",
params:
N_EVENTS=200,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell:
"""
input:
SIM_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_sim_sigma_dec_{P}GeV_{INDEX}.edm4hep.root",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
REC_FILE="sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root",
params:
N_EVENTS=200,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell:
"""
env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalFarForwardZDCClusters,HcalFarForwardZDCRecHits,HcalFarForwardZDCSubcellHits -Pjana:nevents={params.N_EVENTS}
"""
rule zdc_sigma_analysis:
input:
expand("sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root",
P=[100, 125, 150,175, 200, 225, 250, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_sigma/analysis/sigma_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_sigma"),
shell:
"""
input:
expand("sim_output/zdc_sigma/{DETECTOR_CONFIG}_rec_sigma_dec_{P}GeV_{INDEX}.edm4eic.root",
P=[100, 125, 150,175, 200, 225, 250, 275],
DETECTOR_CONFIG=["{DETECTOR_CONFIG}"],
INDEX=range(5),
),
script="benchmarks/zdc_sigma/analysis/sigma_plots.py",
output:
results_dir=directory("results/{DETECTOR_CONFIG}/zdc_sigma"),
shell:
"""
mkdir -p {output.results_dir}
python {input.script} {output.results_dir}
"""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment