Skip to content
Snippets Groups Projects
Commit 8d47cc5d authored by Dmitry Kalinkin's avatar Dmitry Kalinkin
Browse files

femc_*,insert_*: enable caching

parent 7abd8ea3
No related branches found
No related tags found
No related merge requests found
...@@ -8,12 +8,12 @@ def get_n_events(wildcards): ...@@ -8,12 +8,12 @@ def get_n_events(wildcards):
rule femc_electron_generate: rule femc_electron_generate:
input: input:
script="benchmarks/femc_electron/analysis/gen_particles.cxx", script="benchmarks/femc_electron/analysis/gen_particles.cxx",
output:
GEN_FILE="sim_output/femc_electron/e-_{P}GeV.hepmc",
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
th_max=28, th_max=28,
th_min=2.0 th_min=2.0,
output:
GEN_FILE="sim_output/femc_electron/e-_{P}GeV.hepmc"
shell: shell:
""" """
mkdir -p sim_output/femc_electron mkdir -p sim_output/femc_electron
...@@ -22,17 +22,24 @@ root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "e-", {para ...@@ -22,17 +22,24 @@ root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "e-", {para
rule femc_electron_simulate: rule femc_electron_simulate:
input: input:
GEN_FILE="sim_output/femc_electron/e-_{P}GeV.hepmc" GEN_FILE="sim_output/femc_electron/e-_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_sim_e-_{P}GeV.edm4hep.root",
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
PHYSICS_LIST="FTFP_BERT" PHYSICS_LIST="FTFP_BERT",
output: DETECTOR_PATH=os.environ["DETECTOR_PATH"],
SIM_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_sim_e-_{P}GeV.edm4hep.root" DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell: shell:
""" """
# Running simulation # Running simulation
npsim \ npsim \
--compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \ --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--numberOfEvents {params.N_EVENTS} \ --numberOfEvents {params.N_EVENTS} \
--physicsList {params.PHYSICS_LIST} \ --physicsList {params.PHYSICS_LIST} \
--inputFiles {input.GEN_FILE} \ --inputFiles {input.GEN_FILE} \
...@@ -41,14 +48,18 @@ npsim \ ...@@ -41,14 +48,18 @@ npsim \
rule femc_electron_recon: rule femc_electron_recon:
input: input:
SIM_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_sim_e-_{P}GeV.edm4hep.root" SIM_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_sim_e-_{P}GeV.edm4hep.root",
output: output:
REC_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_rec_e-_{P}GeV.edm4eic.root" REC_FILE="sim_output/femc_electron/{DETECTOR_CONFIG}_rec_e-_{P}GeV.edm4eic.root",
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell: shell:
""" """
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPInsertRecHits,EcalEndcapPClusters -Pjana:nevents={params.N_EVENTS} env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPInsertRecHits,EcalEndcapPClusters -Pjana:nevents={params.N_EVENTS}
""" """
rule femc_electron_analysis: rule femc_electron_analysis:
......
...@@ -8,12 +8,12 @@ def get_n_events(wildcards): ...@@ -8,12 +8,12 @@ def get_n_events(wildcards):
rule femc_photon_generate: rule femc_photon_generate:
input: input:
script="benchmarks/femc_photon/analysis/gen_particles.cxx", script="benchmarks/femc_photon/analysis/gen_particles.cxx",
output:
GEN_FILE="sim_output/femc_photon/photon_{P}GeV.hepmc",
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
th_max=28, th_max=28,
th_min=2.0 th_min=2.0,
output:
GEN_FILE="sim_output/femc_photon/photon_{P}GeV.hepmc"
shell: shell:
""" """
mkdir -p sim_output/femc_photon mkdir -p sim_output/femc_photon
...@@ -22,17 +22,24 @@ root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "gamma", {p ...@@ -22,17 +22,24 @@ root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "gamma", {p
rule femc_photon_simulate: rule femc_photon_simulate:
input: input:
GEN_FILE="sim_output/femc_photon/photon_{P}GeV.hepmc" GEN_FILE="sim_output/femc_photon/photon_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_sim_photon_{P}GeV.edm4hep.root",
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
PHYSICS_LIST="FTFP_BERT" PHYSICS_LIST="FTFP_BERT",
output: DETECTOR_PATH=os.environ["DETECTOR_PATH"],
SIM_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_sim_photon_{P}GeV.edm4hep.root" DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell: shell:
""" """
# Running simulation # Running simulation
npsim \ npsim \
--compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \ --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--numberOfEvents {params.N_EVENTS} \ --numberOfEvents {params.N_EVENTS} \
--physicsList {params.PHYSICS_LIST} \ --physicsList {params.PHYSICS_LIST} \
--inputFiles {input.GEN_FILE} \ --inputFiles {input.GEN_FILE} \
...@@ -46,9 +53,13 @@ rule femc_photon_recon: ...@@ -46,9 +53,13 @@ rule femc_photon_recon:
REC_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_rec_photon_{P}GeV.edm4eic.root" REC_FILE="sim_output/femc_photon/{DETECTOR_CONFIG}_rec_photon_{P}GeV.edm4eic.root"
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell: shell:
""" """
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPInsertRecHits,EcalEndcapPClusters -Pjana:nevents={params.N_EVENTS} env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPInsertRecHits,EcalEndcapPClusters -Pjana:nevents={params.N_EVENTS}
""" """
rule femc_photon_analysis: rule femc_photon_analysis:
......
...@@ -8,12 +8,12 @@ def get_n_events(wildcards): ...@@ -8,12 +8,12 @@ def get_n_events(wildcards):
rule femc_pi0_generate: rule femc_pi0_generate:
input: input:
script="benchmarks/femc_pi0/analysis/gen_particles.cxx", script="benchmarks/femc_pi0/analysis/gen_particles.cxx",
output:
GEN_FILE="sim_output/femc_pi0/pi0_{P}GeV.hepmc",
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
th_max=28, th_max=28,
th_min=2.0 th_min=2.0,
output:
GEN_FILE="sim_output/femc_pi0/pi0_{P}GeV.hepmc"
shell: shell:
""" """
mkdir -p sim_output/femc_pi0 mkdir -p sim_output/femc_pi0
...@@ -22,17 +22,24 @@ root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "pi0", {par ...@@ -22,17 +22,24 @@ root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "pi0", {par
rule femc_pi0_simulate: rule femc_pi0_simulate:
input: input:
GEN_FILE="sim_output/femc_pi0/pi0_{P}GeV.hepmc" GEN_FILE="sim_output/femc_pi0/pi0_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
PHYSICS_LIST="FTFP_BERT" 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
output: output:
SIM_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_sim_pi0_{P}GeV.edm4hep.root" SIM_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_sim_pi0_{P}GeV.edm4hep.root"
shell: shell:
""" """
# Running simulation # Running simulation
npsim \ npsim \
--compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \ --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--numberOfEvents {params.N_EVENTS} \ --numberOfEvents {params.N_EVENTS} \
--physicsList {params.PHYSICS_LIST} \ --physicsList {params.PHYSICS_LIST} \
--inputFiles {input.GEN_FILE} \ --inputFiles {input.GEN_FILE} \
...@@ -46,9 +53,13 @@ rule femc_pi0_recon: ...@@ -46,9 +53,13 @@ rule femc_pi0_recon:
REC_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_rec_pi0_{P}GeV.edm4eic.root" REC_FILE="sim_output/femc_pi0/{DETECTOR_CONFIG}_rec_pi0_{P}GeV.edm4eic.root"
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell: shell:
""" """
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPInsertRecHits,EcalEndcapPClusters -Pjana:nevents={params.N_EVENTS} env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPInsertRecHits,EcalEndcapPClusters -Pjana:nevents={params.N_EVENTS}
""" """
rule femc_pi0_analysis: rule femc_pi0_analysis:
......
rule insert_muon_generate: rule insert_muon_generate:
input: input:
script="benchmarks/insert_muon/analysis/gen_particles.cxx", script="benchmarks/insert_muon/analysis/gen_particles.cxx",
output:
GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc",
params: params:
NEVENTS_GEN=5000, NEVENTS_GEN=5000,
th_max=7.0, th_max=7.0,
th_min=1.7 th_min=1.7,
output:
GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc"
shell: shell:
""" """
root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "mu-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})' root -l -b -q '{input.script}({params.NEVENTS_GEN},"{output.GEN_FILE}", "mu-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
...@@ -16,16 +16,22 @@ rule insert_muon_simulate: ...@@ -16,16 +16,22 @@ rule insert_muon_simulate:
input: input:
GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc", GEN_FILE="sim_output/insert_muon/mu-_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params: geometry_lib=find_epic_libraries(),
PHYSICS_LIST="FTFP_BERT"
output: output:
SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root" SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root",
params:
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: shell:
""" """
NEVENTS_SIM=1000 NEVENTS_SIM=1000
# Running simulation # Running simulation
npsim \ npsim \
--compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \ --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--skipNEvents $(( $NEVENTS_SIM * {wildcards.INDEX} )) \ --skipNEvents $(( $NEVENTS_SIM * {wildcards.INDEX} )) \
--numberOfEvents $NEVENTS_SIM \ --numberOfEvents $NEVENTS_SIM \
--physicsList {params.PHYSICS_LIST} \ --physicsList {params.PHYSICS_LIST} \
...@@ -35,13 +41,18 @@ npsim \ ...@@ -35,13 +41,18 @@ npsim \
rule insert_muon_recon: rule insert_muon_recon:
input: input:
SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root" SIM_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_sim_mu-_{P}GeV_{INDEX}.edm4hep.root",
output: output:
REC_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_rec_mu-_{P}GeV_{INDEX}.edm4hep.root" REC_FILE="sim_output/insert_muon/{DETECTOR_CONFIG}_rec_mu-_{P}GeV_{INDEX}.edm4hep.root",
params:
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell: shell:
""" """
NEVENTS_REC=1000 NEVENTS_REC=1000
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters -Pjana:nevents=$NEVENTS_REC env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters -Pjana:nevents=$NEVENTS_REC
""" """
rule insert_muon_analysis: rule insert_muon_analysis:
......
rule insert_neutron_generate: rule insert_neutron_generate:
input: input:
script="benchmarks/insert_neutron/analysis/gen_particles.cxx", script="benchmarks/insert_neutron/analysis/gen_particles.cxx",
output:
GEN_FILE="sim_output/insert_neutron/neutron_{P}GeV.hepmc",
params: params:
NEVENTS_GEN=1000, NEVENTS_GEN=1000,
th_max=5.7, th_max=5.7,
th_min=2.0 th_min=2.0,
output:
GEN_FILE="sim_output/insert_neutron/neutron_{P}GeV.hepmc"
shell: shell:
""" """
mkdir -p sim_output/insert_neutron mkdir -p sim_output/insert_neutron
...@@ -17,16 +17,22 @@ rule insert_neutron_simulate: ...@@ -17,16 +17,22 @@ rule insert_neutron_simulate:
input: input:
GEN_FILE="sim_output/insert_neutron/neutron_{P}GeV.hepmc", GEN_FILE="sim_output/insert_neutron/neutron_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
params: geometry_lib=find_epic_libraries(),
PHYSICS_LIST="FTFP_BERT"
output: output:
SIM_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_sim_neutron_{P}GeV_{INDEX}.edm4hep.root" SIM_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_sim_neutron_{P}GeV_{INDEX}.edm4hep.root",
params:
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: shell:
""" """
NEVENTS_SIM=200 NEVENTS_SIM=200
# Running simulation # Running simulation
npsim \ npsim \
--compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \ --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--skipNEvents $(( $NEVENTS_SIM * {wildcards.INDEX} )) \ --skipNEvents $(( $NEVENTS_SIM * {wildcards.INDEX} )) \
--numberOfEvents $NEVENTS_SIM \ --numberOfEvents $NEVENTS_SIM \
--physicsList {params.PHYSICS_LIST} \ --physicsList {params.PHYSICS_LIST} \
...@@ -36,13 +42,18 @@ npsim \ ...@@ -36,13 +42,18 @@ npsim \
rule insert_neutron_recon: rule insert_neutron_recon:
input: input:
SIM_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_sim_neutron_{P}GeV_{INDEX}.edm4hep.root" SIM_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_sim_neutron_{P}GeV_{INDEX}.edm4hep.root",
output: output:
REC_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_rec_neutron_{P}GeV_{INDEX}.edm4eic.root" REC_FILE="sim_output/insert_neutron/{DETECTOR_CONFIG}_rec_neutron_{P}GeV_{INDEX}.edm4eic.root",
params:
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell: shell:
""" """
NEVENTS_REC=200 NEVENTS_REC=200
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters -Pjana:nevents=$NEVENTS_REC env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters -Pjana:nevents=$NEVENTS_REC
""" """
rule insert_neutron_analysis: rule insert_neutron_analysis:
......
...@@ -7,12 +7,12 @@ def get_n_events(wildcards): ...@@ -7,12 +7,12 @@ def get_n_events(wildcards):
rule insert_tau_generate: rule insert_tau_generate:
input: input:
script="benchmarks/insert_tau/analysis/gen_particles.cxx", script="benchmarks/insert_tau/analysis/gen_particles.cxx",
output:
GEN_FILE="sim_output/insert_tau/tau-_{P}GeV.hepmc",
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
th_max=7.0, th_max=7.0,
th_min=1.7, th_min=1.7,
output:
GEN_FILE="sim_output/insert_tau/tau-_{P}GeV.hepmc",
shell: shell:
""" """
root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "tau-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})' root -l -b -q '{input.script}({params.N_EVENTS},"{output.GEN_FILE}", "tau-", {params.th_min}, {params.th_max}, 0., 360., {wildcards.P})'
...@@ -22,16 +22,22 @@ rule insert_tau_simulate: ...@@ -22,16 +22,22 @@ rule insert_tau_simulate:
input: input:
GEN_FILE="sim_output/insert_tau/tau-_{P}GeV.hepmc", GEN_FILE="sim_output/insert_tau/tau-_{P}GeV.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
SIM_FILE="sim_output/insert_tau/{DETECTOR_CONFIG}_sim_tau-_{P}GeV_{INDEX}.edm4hep.root",
params: params:
N_EVENTS=get_n_events, N_EVENTS=get_n_events,
PHYSICS_LIST="FTFP_BERT", PHYSICS_LIST="FTFP_BERT",
output: DETECTOR_PATH=os.environ["DETECTOR_PATH"],
SIM_FILE="sim_output/insert_tau/{DETECTOR_CONFIG}_sim_tau-_{P}GeV_{INDEX}.edm4hep.root" DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell: shell:
""" """
# Running simulation # Running simulation
npsim \ npsim \
--compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \ --compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--numberOfEvents {params.N_EVENTS} \ --numberOfEvents {params.N_EVENTS} \
--skipNEvents $(( {params.N_EVENTS} * {wildcards.INDEX} )) \ --skipNEvents $(( {params.N_EVENTS} * {wildcards.INDEX} )) \
--physicsList {params.PHYSICS_LIST} \ --physicsList {params.PHYSICS_LIST} \
...@@ -42,13 +48,17 @@ npsim \ ...@@ -42,13 +48,17 @@ npsim \
rule insert_tau_recon: rule insert_tau_recon:
input: input:
SIM_FILE="sim_output/insert_tau/{DETECTOR_CONFIG}_sim_tau-_{P}GeV_{INDEX}.edm4hep.root", SIM_FILE="sim_output/insert_tau/{DETECTOR_CONFIG}_sim_tau-_{P}GeV_{INDEX}.edm4hep.root",
params:
N_EVENTS=get_n_events,
output: output:
REC_FILE="sim_output/insert_tau/{DETECTOR_CONFIG}_rec_tau-_{P}GeV_{INDEX}.edm4eic.root", REC_FILE="sim_output/insert_tau/{DETECTOR_CONFIG}_rec_tau-_{P}GeV_{INDEX}.edm4eic.root",
params:
N_EVENTS=get_n_events,
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell: shell:
""" """
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Pdd4hep:xml_files=$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPClusters,LFHCALClusters -Pjana:nevents={params.N_EVENTS} env DETECTOR_CONFIG={params.DETECTOR_CONFIG} \
eicrecon {input.SIM_FILE} -Ppodio:output_file={output.REC_FILE} -Ppodio:output_collections=MCParticles,HcalEndcapPInsertRecHits,HcalEndcapPInsertClusters,HcalEndcapPInsertSubcellHits,EcalEndcapPInsertRecHits,EcalEndcapPInsertClusters,EcalEndcapPClusters,LFHCALClusters -Pjana:nevents={params.N_EVENTS}
""" """
rule insert_tau_analysis: rule insert_tau_analysis:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment