Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
277d1b6
Calorimeter pid bic notebook
tonnysoyyo Mar 2, 2026
b81a623
Add bic pid benchmark
tonnysoyyo Mar 9, 2026
cbccb2a
Fix some things in bic_pid
tonnysoyyo Mar 9, 2026
1d75227
Include bic_pid in execution
tonnysoyyo Mar 29, 2026
95242e9
Fix the shell command substitution
tonnysoyyo Mar 30, 2026
35989a0
Add new change in config
tonnysoyyo Mar 30, 2026
5ca3769
Add new correction to the code
tonnysoyyo Mar 30, 2026
859a327
A correction in the Snakefile of the repo (add bic_pid snakefile)
tonnysoyyo Apr 5, 2026
d440bbe
Add some corrections in the Snakefile and config.yml for the errors i…
tonnysoyyo Apr 5, 2026
e4588b5
Fix config.yml to solve the problem of the bench:bic_pid
tonnysoyyo Apr 6, 2026
6af00e1
Fix bench:bic_pid to solve the user authorization problme
tonnysoyyo Apr 6, 2026
ac283e7
warmup problem
tonnysoyyo Apr 16, 2026
bdada3b
Go back to the changes
tonnysoyyo Apr 16, 2026
c7d507a
Test warmup
tonnysoyyo Apr 17, 2026
9dad473
Solve new problem in bench:bic_pid
tonnysoyyo Apr 17, 2026
632077b
changes in sim and bench
tonnysoyyo Apr 17, 2026
0c70b7e
Remove warmup and transfered things
tonnysoyyo Apr 17, 2026
7cd8385
Check again the timeout
tonnysoyyo Apr 19, 2026
1eef1f9
Solve situation with files
tonnysoyyo Apr 19, 2026
79c70de
Solve new error
tonnysoyyo Apr 20, 2026
d8fb95e
Change errors in bic_pid.org file
tonnysoyyo Apr 20, 2026
abf19f7
Changes in config and requirements
tonnysoyyo Apr 20, 2026
2153f43
Solve problem with requirements of tf
tonnysoyyo Apr 20, 2026
2759b0e
SOlve problem with config file
tonnysoyyo Apr 20, 2026
9749d8f
Solve problem with config file
tonnysoyyo Apr 20, 2026
3447243
Solve problem with bench:bic_pid script
tonnysoyyo Apr 20, 2026
627146b
Solve the problem with transferred_sim_output
tonnysoyyo Apr 26, 2026
3c47eab
Restore bench:bic_pid
tonnysoyyo Apr 26, 2026
b20e2cf
Solve problem with the reinstalled Tensorflow
tonnysoyyo Apr 27, 2026
0ff7adb
Delete line in config.yml file
tonnysoyyo Apr 27, 2026
db33647
Solve protobuf mismatch in config.yml file
tonnysoyyo Apr 27, 2026
337f497
Test new eic_tf
tonnysoyyo May 3, 2026
1fbe7bd
Solve problem with --user installation
tonnysoyyo May 3, 2026
aec9db4
Use temporary solution for protobuf
tonnysoyyo May 3, 2026
c6ad32b
Inspect mismatch error
tonnysoyyo May 3, 2026
cc3a60e
Test new protobuf
tonnysoyyo May 13, 2026
4e26ec7
Test new environment solution
tonnysoyyo May 17, 2026
6891692
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 17, 2026
36cce02
Add code to generate inputs
tonnysoyyo May 17, 2026
a511ee9
Solve merge
tonnysoyyo May 17, 2026
218219c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 17, 2026
0ee50f8
Test again
tonnysoyyo May 17, 2026
a4cac71
Use the correct environment
tonnysoyyo May 18, 2026
97506ac
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 18, 2026
c01ce13
Install environment
tonnysoyyo May 18, 2026
f0d10e9
Merge remote-tracking branch 'refs/remotes/origin/259-ml-model-for-ep…
tonnysoyyo May 18, 2026
23e1d6c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 18, 2026
b4706c1
Create environment again
tonnysoyyo May 18, 2026
348b159
Solve python interpreter problem
tonnysoyyo May 18, 2026
0d7d321
Solve syntax problem
tonnysoyyo May 18, 2026
170d5de
Solve syntax problem again
tonnysoyyo May 18, 2026
51d312a
Solve tensorflow compability problem
tonnysoyyo May 25, 2026
a6f880b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 25, 2026
ff926b2
Solve problme of indexation
tonnysoyyo May 25, 2026
d225eda
Solve snakemake problem
tonnysoyyo May 25, 2026
2c0b237
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 25, 2026
b92b42f
Solve PuLP compability
tonnysoyyo May 25, 2026
8aa4cc3
Merge remote-tracking branch 'refs/remotes/origin/259-ml-model-for-ep…
tonnysoyyo May 25, 2026
cf610b4
Continue solving PuLP installation
tonnysoyyo May 25, 2026
3805f5b
Add subprocess in snakefile root repo
tonnysoyyo May 25, 2026
578748d
Add the line to use the correct environment
tonnysoyyo May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ include:
- local: 'benchmarks/backwards_ecal/config.yml'
- local: 'benchmarks/beamline/config.yml'
- local: 'benchmarks/calo_pid/config.yml'
- local: 'benchmarks/bic_pid/config.yml'
- local: 'benchmarks/campaign/config.yml'
- local: 'benchmarks/ecal_gaps/config.yml'
- local: 'benchmarks/far_forward_dvcs/config.yml'
Expand Down
2 changes: 2 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ configfile: "snakemake.yml"

import functools
import os
import subprocess
from snakemake.logging import logger


Expand Down Expand Up @@ -48,6 +49,7 @@ include: "benchmarks/backwards_ecal/Snakefile"
include: "benchmarks/barrel_ecal/Snakefile"
include: "benchmarks/beamline/Snakefile"
include: "benchmarks/calo_pid/Snakefile"
include: "benchmarks/bic_pid/Snakefile"
include: "benchmarks/campaign/Snakefile"
include: "benchmarks/ecal_gaps/Snakefile"
include: "benchmarks/far_forward_dvcs/Snakefile"
Expand Down
129 changes: 129 additions & 0 deletions benchmarks/bic_pid/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
from glob import glob
import os

def format_energy_for_dd4hep(s):
return s.rstrip("kMGeV") + "*" + s.lstrip("0123456789")


def theta_min_from_phase_space(s):
return s.replace("deg", "").split("to")[0]


def theta_max_from_phase_space(s):
return s.replace("deg", "").split("to")[1]


rule bic_pid_sim:
input:
warmup="warmup.edm4hep.root",
geometry_lib=find_epic_libraries(),
output:
"sim_output/bic_pid/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root",
log:
"sim_output/bic_pid/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root.log",
wildcard_constraints:
PARTICLE="(e-|pi-)",
ENERGY="[0-9]+[kMG]eV",
PHASE_SPACE="[0-9]+to[0-9]+deg",
INDEX=r"\d{4}",
params:
N_EVENTS=1000,
SEED=lambda wildcards: "1" + wildcards.INDEX,
DETECTOR_PATH=os.environ["DETECTOR_PATH"],
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
ENERGY=lambda wildcards: format_energy_for_dd4hep(wildcards.ENERGY),
THETA_MIN=lambda wildcards: theta_min_from_phase_space(wildcards.PHASE_SPACE),
THETA_MAX=lambda wildcards: theta_max_from_phase_space(wildcards.PHASE_SPACE),
DD4HEP_HASH=get_spack_package_hash("dd4hep"),
NPSIM_HASH=get_spack_package_hash("npsim"),
cache: True
shell:
r"""
set -m
npsim \
--runType batch \
--enableGun \
--gun.momentumMin "{params.ENERGY}" \
--gun.momentumMax "{params.ENERGY}" \
--gun.thetaMin "{params.THETA_MIN}*deg" \
--gun.thetaMax "{params.THETA_MAX}*deg" \
--gun.particle {wildcards.PARTICLE} \
--gun.distribution eta \
--random.seed {params.SEED} \
--filter.tracker edep0 \
-v WARNING \
--numberOfEvents {params.N_EVENTS} \
--compactFile {params.DETECTOR_PATH}/{params.DETECTOR_CONFIG}.xml \
--outputFile {output} > {log} 2>&1
"""


rule bic_pid_recon:
input:
sim="sim_output/bic_pid/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root",
warmup="warmup.edm4hep.root",
output:
"sim_output/bic_pid/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.edm4eic.root",
log:
"sim_output/bic_pid/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.edm4eic.root.log",
wildcard_constraints:
PARTICLE="(e-|pi-)",
ENERGY="[0-9]+[kMG]eV",
PHASE_SPACE="[0-9]+to[0-9]+deg",
INDEX=r"\d{4}",
params:
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
cache: True
shell:
"""
DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
exec eicrecon {input.sim} -Ppodio:output_file={output} \
-Ppodio:output_collections=MCParticles,EcalBarrelScFiRecHits,EcalBarrelImagingRecHits
"""


rule bic_pid_input_list:
output:
"listing/bic_pid/{DETECTOR_CONFIG}/{PARTICLE}.lst",
params:
energy="1GeV",
phase_space="45to135deg",
run:
pattern = (
f"sim_output/bic_pid/{wildcards.DETECTOR_CONFIG}/{wildcards.PARTICLE}/"
f"{params.energy}/{params.phase_space}/"
f"{wildcards.PARTICLE}_{params.energy}_{params.phase_space}.*.eicrecon.edm4eic.root"
)
files = sorted(glob(pattern))

if len(files) != 100:
raise ValueError(
f"Expected 100 files for {wildcards.PARTICLE}, found {len(files)}.\n"
f"Pattern used: {pattern}"
)

os.makedirs(os.path.dirname(output[0]), exist_ok=True)
with open(output[0], "wt") as fp:
fp.write("\n".join(files))


rule bic_pid:
input:
electrons="listing/bic_pid/{DETECTOR_CONFIG}/e-.lst",
pions="listing/bic_pid/{DETECTOR_CONFIG}/pi-.lst",
matplotlibrc=".matplotlibrc",
script="benchmarks/bic_pid/bic_pid.py",
output:
directory("results/{DETECTOR_CONFIG}/bic_pid")
shell:
"""
env \
MATPLOTLIBRC={input.matplotlibrc} \
DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
PLOT_TITLE={wildcards.DETECTOR_CONFIG} \
INPUT_ELECTRONS="{input.electrons}" \
INPUT_PIONS="{input.pions}" \
OUTPUT_DIR={output} \
python {input.script}
"""
Loading
Loading