Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
detector_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
detector_benchmarks
Commits
ef5512da
Commit
ef5512da
authored
5 months ago
by
Dmitry Kalinkin
Browse files
Options
Downloads
Patches
Plain Diff
backwards_ecal: add support for campaign processing
parent
a49302a2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/backwards_ecal/Snakefile
+55
-3
55 additions, 3 deletions
benchmarks/backwards_ecal/Snakefile
benchmarks/backwards_ecal/config.yml
+2
-2
2 additions, 2 deletions
benchmarks/backwards_ecal/config.yml
with
57 additions
and
5 deletions
benchmarks/backwards_ecal/Snakefile
+
55
−
3
View file @
ef5512da
...
...
@@ -77,12 +77,64 @@ rule backwards_ecal_local_sim_list:
fp.write("\n".join(input))
if False:
rule backwards_ecal_campaign_sim_list:
output:
"listing/backwards_ecal/{CAMPAIGN}/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}.lst",
params:
search_path=lambda wildcards: f"EPIC/RECO/{wildcards.CAMPAIGN}/epic_craterlake/SINGLE/{wildcards.PARTICLE}/{wildcards.ENERGY}/{wildcards.PHASE_SPACE}/",
shell: """
xrdfs root://dtn-eic.jlab.org/ ls /work/eic2/{params.search_path} \
| awk '{{ print "root://dtn-eic.jlab.org/"$1; }}' \
| sort \
> {output}
if [ ! -s {output} ]; then
echo "Got an empty file listing for path \"\""
exit 1
fi
"""
else:
checkpoint backwards_ecal_campaign_sim_list_checkpoint:
output:
"listing/backwards_ecal/{CAMPAIGN}/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}.lst.orig",
params:
search_path=lambda wildcards: f"EPIC/RECO/{wildcards.CAMPAIGN}/epic_craterlake/SINGLE/{wildcards.PARTICLE}/{wildcards.ENERGY}/{wildcards.PHASE_SPACE}/",
shell: """
xrdfs root://dtn-eic.jlab.org/ ls /work/eic2/{params.search_path} \
| sed -e 's#^/work/eic2/##' \
| sort \
> {output}
if [ ! -s {output} ]; then
echo "Got an empty file listing for path \"\""
exit 1
fi
"""
def get_backwards_ecal_campaign_sim_list(wildcards):
with checkpoints.backwards_ecal_campaign_sim_list_checkpoint.get(**wildcards).output[0].open() as fp:
return [line.rstrip() for line in fp.readlines()]
rule backwards_ecal_campaign_sim_list:
input:
# depend on paths from the file list
get_backwards_ecal_campaign_sim_list,
orig_list="listing/backwards_ecal/{CAMPAIGN}/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}.lst.orig",
output:
"listing/backwards_ecal/{CAMPAIGN}/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}.lst",
shell: """
cp {input.orig_list} {output}
"""
ruleorder: backwards_ecal_local_sim_list > backwards_ecal_campaign_sim_list
DETECTOR_CONFIG=os.environ["DETECTOR_CONFIG"]
rule backwards_ecal:
input:
expand(
"listing/backwards_ecal/
local
/" + DETECTOR_CONFIG + "/{PARTICLE}/{ENERGY}/{PHASE_SPACE}.lst",
"listing/backwards_ecal/
{{CAMPAIGN}}
/" + DETECTOR_CONFIG + "/{PARTICLE}/{ENERGY}/{PHASE_SPACE}.lst",
PARTICLE=["pi-", "e-"],
ENERGY=[
"100MeV",
...
...
@@ -99,14 +151,14 @@ rule backwards_ecal:
matplotlibrc=".matplotlibrc",
script="benchmarks/backwards_ecal/backwards_ecal.py",
output:
directory("results/backwards_ecal")
directory("results/backwards_ecal
/{CAMPAIGN}/
")
shell:
"""
env \
MATPLOTLIBRC={input.matplotlibrc} \
DETECTOR_CONFIG=""" + DETECTOR_CONFIG + """ \
PLOT_TITLE=""" + DETECTOR_CONFIG + """ \
INPUT_PATH_FORMAT=listing/backwards_ecal/
local
/""" + DETECTOR_CONFIG + """/{{particle}}/{{energy}}/130to177deg.lst \
INPUT_PATH_FORMAT=listing/backwards_ecal/
{wildcards.CAMPAIGN}
/""" + DETECTOR_CONFIG + """/{{particle}}/{{energy}}/130to177deg.lst \
OUTPUT_DIR={output} \
python {input.script}
"""
This diff is collapsed.
Click to expand it.
benchmarks/backwards_ecal/config.yml
+
2
−
2
View file @
ef5512da
...
...
@@ -26,7 +26,7 @@ bench:backwards_ecal:
script
:
-
export PYTHONUSERBASE=$LOCAL_DATA_PATH/deps
-
pip install -r benchmarks/backwards_ecal/requirements.txt
-
snakemake $SNAKEMAKE_FLAGS --cores 1 backwards_ecal
-
snakemake $SNAKEMAKE_FLAGS --cores 1
results/
backwards_ecal
/local
collect_results:backwards_ecal
:
extends
:
.det_benchmark
...
...
@@ -36,5 +36,5 @@ collect_results:backwards_ecal:
script
:
-
ls -lrht
-
mv results{,_save}/
# move results directory out of the way to preserve it
-
snakemake $SNAKEMAKE_FLAGS --cores 1 --delete-all-output backwards_ecal
-
snakemake $SNAKEMAKE_FLAGS --cores 1 --delete-all-output
results/
backwards_ecal
/local
-
mv results{_save,}/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment