From 5d7fc4feab90e93a697a62bc5d1967979fd72c88 Mon Sep 17 00:00:00 2001
From: Maria <zurek@anl.gov>
Date: Sun, 8 Aug 2021 21:19:31 -0500
Subject: [PATCH] Add energy scan to rec_benchmark:run stage

---
 benchmarks/imaging_ecal/config.yml          | 14 ++++++++++++++
 benchmarks/imaging_ecal/run_emcal_barrel.sh |  6 ++++++
 2 files changed, 20 insertions(+)

diff --git a/benchmarks/imaging_ecal/config.yml b/benchmarks/imaging_ecal/config.yml
index 0eb3d818..340b6c96 100644
--- a/benchmarks/imaging_ecal/config.yml
+++ b/benchmarks/imaging_ecal/config.yml
@@ -26,3 +26,17 @@ imaging_ecal_pion0:
   script:
     - bash benchmarks/imaging_ecal/run_imcal_pion0.sh -t imcal_barrel_pion0 -p "pion0" -n 100
 
+imaging_ecal_energy_scan:
+  extends: .rec_benchmark
+  stage: run
+  timeout: 24 hours
+  # rules:
+  #   - if: '$RUN_EXTENDED_RECO_BENCHMARK == true'
+  script:
+    - bash benchmarks/imaging_ecal/run_emcal_barrel.sh -t emcal_barrel_${PARTICLE}_${ENERGY} -n 100 -p "${PARTICLE}" -e "${ENERGY}"
+  parallel:
+    matrix:
+      - ENERGY: ["1", "2", "5"]
+        PARTICLE: ["electron", "photon"]
+
+
diff --git a/benchmarks/imaging_ecal/run_emcal_barrel.sh b/benchmarks/imaging_ecal/run_emcal_barrel.sh
index 843e0feb..52b2bc40 100644
--- a/benchmarks/imaging_ecal/run_emcal_barrel.sh
+++ b/benchmarks/imaging_ecal/run_emcal_barrel.sh
@@ -7,6 +7,7 @@ function print_the_help {
   echo "  OPTIONS: "
   echo "    -n,--nevents     Number of events"
   echo "    -t,--nametag     name tag"
+  echo "    -e,--nametag     energy in GeV"  
   echo "    -p,--particle    particle type"
   echo "                     allowed types: pion0, pion+, pion-, kaon0, kaon+, kaon-, proton, neutron, electron, positron, photon"
   exit
@@ -32,6 +33,11 @@ do
       shift # past argument
       shift # past value
       ;;
+    -e|--energy)
+      export CB_EMCAL_ENERGY="$2"
+      shift # past argument
+      shift # past value
+      ;;
     -n|--nevents)
       export CB_EMCAL_NUMEV="$2"
       shift # past argument
-- 
GitLab