From d27f7830599cabd03388165f7da3a92a73d81530 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Tue, 25 Oct 2022 20:29:31 +0000
Subject: [PATCH] feat: ci single matrix job for e/pi, endcapN/barrel/endcapP

---
 benchmarks/single/config.yml                 | 21 +++++++++++++++++---
 benchmarks/single/e-_1GeV_135to177deg.steer  | 11 ++++++++++
 benchmarks/single/e-_1GeV_3to45deg.steer     | 11 ++++++++++
 benchmarks/single/pi-_1GeV_135to177deg.steer | 11 ++++++++++
 benchmarks/single/pi-_1GeV_3to45deg.steer    | 11 ++++++++++
 benchmarks/single/pi-_1GeV_45to135deg.steer  | 11 ++++++++++
 6 files changed, 73 insertions(+), 3 deletions(-)
 create mode 100644 benchmarks/single/e-_1GeV_135to177deg.steer
 create mode 100644 benchmarks/single/e-_1GeV_3to45deg.steer
 create mode 100644 benchmarks/single/pi-_1GeV_135to177deg.steer
 create mode 100644 benchmarks/single/pi-_1GeV_3to45deg.steer
 create mode 100644 benchmarks/single/pi-_1GeV_45to135deg.steer

diff --git a/benchmarks/single/config.yml b/benchmarks/single/config.yml
index 4d3a8d4a..0e5167fb 100644
--- a/benchmarks/single/config.yml
+++ b/benchmarks/single/config.yml
@@ -9,24 +9,39 @@ single:simulate:
   timeout: 2 hours
   stage: simulate
   needs: ["common:detector"]
+  parallel:
+    matrix:
+      - particle: ['e-', 'pi-']
+        energy: ['1GeV']
+        angle: ['3to45deg', '45to135deg', '135to177deg']
   script:
-    - bash benchmarks/single/simulate.sh e-_1GeV_45to135deg
+    - bash benchmarks/single/simulate.sh ${particle}_${energy}_${angle}
 
 single:reconstruct:
   extends: .phy_benchmark
   timeout: 2 hours
   stage: reconstruct
   needs: ["single:simulate"]
+  parallel:
+    matrix:
+      - particle: ['e-', 'pi-']
+        energy: ['1GeV']
+        angle: ['3to45deg', '45to135deg', '135to177deg']
   script:
-    - bash benchmarks/single/reconstruct.sh e-_1GeV_45to135deg
+    - bash benchmarks/single/reconstruct.sh ${particle}_${energy}_${angle}
 
 single:analyze:
   extends: .phy_benchmark
   timeout: 2 hours
   stage: analyze
   needs: ["single:reconstruct", "single:compile"]
+  parallel:
+    matrix:
+      - particle: ['e-', 'pi-']
+        energy: ['1GeV']
+        angle: ['3to45deg', '45to135deg', '135to177deg']
   script:
-    - bash benchmarks/single/analyze.sh e-_1GeV_45to135deg
+    - bash benchmarks/single/analyze.sh ${particle}_${energy}_${angle}
 
 single:results:
   stage: collect
diff --git a/benchmarks/single/e-_1GeV_135to177deg.steer b/benchmarks/single/e-_1GeV_135to177deg.steer
new file mode 100644
index 00000000..f5ddf317
--- /dev/null
+++ b/benchmarks/single/e-_1GeV_135to177deg.steer
@@ -0,0 +1,11 @@
+from DDSim.DD4hepSimulation import DD4hepSimulation
+from g4units import mm, GeV, MeV, degree
+SIM = DD4hepSimulation()
+
+SIM.gun.energy = 1*GeV
+SIM.gun.particle = "e-"
+SIM.gun.position = (0.0, 0.0, 0.0)
+SIM.gun.direction = (0.0, 0.0, 1.0)
+SIM.gun.distribution = "cos(theta)"
+SIM.gun.thetaMin = 135*degree
+SIM.gun.thetaMax = 177*degree
diff --git a/benchmarks/single/e-_1GeV_3to45deg.steer b/benchmarks/single/e-_1GeV_3to45deg.steer
new file mode 100644
index 00000000..f547e2e1
--- /dev/null
+++ b/benchmarks/single/e-_1GeV_3to45deg.steer
@@ -0,0 +1,11 @@
+from DDSim.DD4hepSimulation import DD4hepSimulation
+from g4units import mm, GeV, MeV, degree
+SIM = DD4hepSimulation()
+
+SIM.gun.energy = 1*GeV
+SIM.gun.particle = "e-"
+SIM.gun.position = (0.0, 0.0, 0.0)
+SIM.gun.direction = (0.0, 0.0, 1.0)
+SIM.gun.distribution = "cos(theta)"
+SIM.gun.thetaMin = 3*degree
+SIM.gun.thetaMax = 45*degree
diff --git a/benchmarks/single/pi-_1GeV_135to177deg.steer b/benchmarks/single/pi-_1GeV_135to177deg.steer
new file mode 100644
index 00000000..6cedafa2
--- /dev/null
+++ b/benchmarks/single/pi-_1GeV_135to177deg.steer
@@ -0,0 +1,11 @@
+from DDSim.DD4hepSimulation import DD4hepSimulation
+from g4units import mm, GeV, MeV, degree
+SIM = DD4hepSimulation()
+
+SIM.gun.energy = 1*GeV
+SIM.gun.particle = "pi-"
+SIM.gun.position = (0.0, 0.0, 0.0)
+SIM.gun.direction = (0.0, 0.0, 1.0)
+SIM.gun.distribution = "cos(theta)"
+SIM.gun.thetaMin = 135*degree
+SIM.gun.thetaMax = 177*degree
diff --git a/benchmarks/single/pi-_1GeV_3to45deg.steer b/benchmarks/single/pi-_1GeV_3to45deg.steer
new file mode 100644
index 00000000..f547e2e1
--- /dev/null
+++ b/benchmarks/single/pi-_1GeV_3to45deg.steer
@@ -0,0 +1,11 @@
+from DDSim.DD4hepSimulation import DD4hepSimulation
+from g4units import mm, GeV, MeV, degree
+SIM = DD4hepSimulation()
+
+SIM.gun.energy = 1*GeV
+SIM.gun.particle = "e-"
+SIM.gun.position = (0.0, 0.0, 0.0)
+SIM.gun.direction = (0.0, 0.0, 1.0)
+SIM.gun.distribution = "cos(theta)"
+SIM.gun.thetaMin = 3*degree
+SIM.gun.thetaMax = 45*degree
diff --git a/benchmarks/single/pi-_1GeV_45to135deg.steer b/benchmarks/single/pi-_1GeV_45to135deg.steer
new file mode 100644
index 00000000..3ec2dac7
--- /dev/null
+++ b/benchmarks/single/pi-_1GeV_45to135deg.steer
@@ -0,0 +1,11 @@
+from DDSim.DD4hepSimulation import DD4hepSimulation
+from g4units import mm, GeV, MeV, degree
+SIM = DD4hepSimulation()
+
+SIM.gun.energy = 1*GeV
+SIM.gun.particle = "pi-"
+SIM.gun.position = (0.0, 0.0, 0.0)
+SIM.gun.direction = (0.0, 0.0, 1.0)
+SIM.gun.distribution = "cos(theta)"
+SIM.gun.thetaMin = 45*degree
+SIM.gun.thetaMax = 135*degree
-- 
GitLab