From 05004437375388fdfe54e440eec4f1bc6f078517 Mon Sep 17 00:00:00 2001
From: FASER Reco <faserrec@lxplus708.cern.ch>
Date: Mon, 3 Oct 2022 23:09:47 +0200
Subject: [PATCH 1/5] Update ACTS XML geometry file path

---
 Control/CalypsoExample/Reconstruction/scripts/faserMDC_reco.py | 2 +-
 Control/CalypsoExample/Reconstruction/scripts/faser_reco.py    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Control/CalypsoExample/Reconstruction/scripts/faserMDC_reco.py b/Control/CalypsoExample/Reconstruction/scripts/faserMDC_reco.py
index 2c1121383..fe322e6e9 100755
--- a/Control/CalypsoExample/Reconstruction/scripts/faserMDC_reco.py
+++ b/Control/CalypsoExample/Reconstruction/scripts/faserMDC_reco.py
@@ -73,7 +73,7 @@ ConfigFlags.Input.ProjectName = "data20"
 ConfigFlags.GeoModel.Align.Dynamic    = False
 
 # For tracking
-ConfigFlags.TrackingGeometry.MaterialSource = "/cvmfs/faser.cern.ch/repo/sw/database/DBRelease/1.0.9/acts/material-maps.json"
+ConfigFlags.TrackingGeometry.MaterialSource = "/cvmfs/faser.cern.ch/repo/sw/database/DBRelease/1.1.0/acts/material-maps.json"
 
 # TI12 Cosmics geometry
 if runtype == "TI12Data":
diff --git a/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py b/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py
index d0c6fc6d2..bb5dcb2d8 100755
--- a/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py
+++ b/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py
@@ -103,7 +103,7 @@ ConfigFlags.GeoModel.Align.Dynamic    = False
 
 useCKF = True
 # Enable ACTS material corrections, this crashes testbeam geometries
-ConfigFlags.TrackingGeometry.MaterialSource = "/cvmfs/faser.cern.ch/repo/sw/database/DBRelease/1.0.9/acts/material-maps.json"
+ConfigFlags.TrackingGeometry.MaterialSource = "/cvmfs/faser.cern.ch/repo/sw/database/DBRelease/1.1.0/acts/material-maps.json"
 
 # TI12 Cosmics geometry
 if runtype == "TI12Data":
-- 
GitLab


From 86948663ef16e11e1b7a00a9d3df80e10fbd3081 Mon Sep 17 00:00:00 2001
From: FaserMC <fasermc@cern.ch>
Date: Fri, 11 Nov 2022 18:59:55 +0100
Subject: [PATCH 2/5] Patches for running MC in r0010

---
 ...FaserMC-MDC_PG_muon_fasernu_1000GeV-101312.json | 14 ++++++++++++++
 .../FaserMC-MDC_PG_muon_fasernu_100GeV-101310.json | 14 ++++++++++++++
 .../FaserMC-MDC_PG_muon_fasernu_10GeV-101308.json  | 14 ++++++++++++++
 .../FaserMC-MDC_PG_muon_fasernu_300GeV-101311.json | 14 ++++++++++++++
 .../FaserMC-MDC_PG_muon_fasernu_30GeV-101309.json  | 14 ++++++++++++++
 .../FaserMC-MDC_PG_muon_fasernu_logE-101307.json   |  2 +-
 ...FaserMC-MDC_PG_pion_fasernu_1000GeV-121106.json | 14 ++++++++++++++
 .../FaserMC-MDC_PG_pion_fasernu_100GeV-121104.json | 14 ++++++++++++++
 .../FaserMC-MDC_PG_pion_fasernu_10GeV-121102.json  | 14 ++++++++++++++
 .../FaserMC-MDC_PG_pion_fasernu_300GeV-121105.json | 14 ++++++++++++++
 .../FaserMC-MDC_PG_pion_fasernu_30GeV-121103.json  | 14 ++++++++++++++
 .../scripts/submit_faserMDC_particlegun.sh         | 12 ++++++------
 .../Reconstruction/scripts/submit_faserMDC_reco.sh |  4 ++--
 13 files changed, 149 insertions(+), 9 deletions(-)
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_1000GeV-101312.json
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_100GeV-101310.json
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_10GeV-101308.json
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_300GeV-101311.json
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_30GeV-101309.json
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_1000GeV-121106.json
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_100GeV-121104.json
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_10GeV-121102.json
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_300GeV-121105.json
 create mode 100644 Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_30GeV-121103.json

diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_1000GeV-101312.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_1000GeV-101312.json
new file mode 100644
index 000000000..ee3ac4eef
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_1000GeV-101312.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 5000,
+    "mass": 105.66,
+    "maxE": 1000.0,
+    "minE": 1000.0,
+    "pid": [-13, 13],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 101312,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_muon_fasernu_1000GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_100GeV-101310.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_100GeV-101310.json
new file mode 100644
index 000000000..8c949c0bc
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_100GeV-101310.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 5000,
+    "mass": 105.66,
+    "maxE": 100.0,
+    "minE": 100.0,
+    "pid": [-13, 13],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 101310,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_muon_fasernu_100GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_10GeV-101308.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_10GeV-101308.json
new file mode 100644
index 000000000..66abf1a6f
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_10GeV-101308.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 5000,
+    "mass": 105.66,
+    "maxE": 10.0,
+    "minE": 10.0,
+    "pid": [-13, 13],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 101308,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_muon_fasernu_10GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_300GeV-101311.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_300GeV-101311.json
new file mode 100644
index 000000000..5307647e9
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_300GeV-101311.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 5000,
+    "mass": 105.66,
+    "maxE": 300.0,
+    "minE": 300.0,
+    "pid": [-13, 13],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 101311,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_muon_fasernu_300GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_30GeV-101309.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_30GeV-101309.json
new file mode 100644
index 000000000..6eda07ec3
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_30GeV-101309.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 5000,
+    "mass": 105.66,
+    "maxE": 30.0,
+    "minE": 30.0,
+    "pid": [-13, 13],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 101309,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_muon_fasernu_30GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_logE-101307.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_logE-101307.json
index db2954f99..3e57b2d30 100644
--- a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_logE-101307.json
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_muon_fasernu_logE-101307.json
@@ -4,7 +4,7 @@
     "maxE": 5000.0,
     "minE": 10.0,
     "pid": [-13, 13],
-    "radius": -25.,
+    "radius": -25.0,
     "angle": 0.0006,
     "run": 101307,
     "sampler": "log",
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_1000GeV-121106.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_1000GeV-121106.json
new file mode 100644
index 000000000..513974d4c
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_1000GeV-121106.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 500,
+    "mass": 105.66,
+    "maxE": 1000.0,
+    "minE": 1000.0,
+    "pid": [211, -211],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 121106,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_pion_fasernu_1000GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_100GeV-121104.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_100GeV-121104.json
new file mode 100644
index 000000000..79b23b151
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_100GeV-121104.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 1000,
+    "mass": 105.66,
+    "maxE": 100.0,
+    "minE": 100.0,
+    "pid": [211, -211],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 121104,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_pion_fasernu_100GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_10GeV-121102.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_10GeV-121102.json
new file mode 100644
index 000000000..7cec4dd2d
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_10GeV-121102.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 1000,
+    "mass": 105.66,
+    "maxE": 10.0,
+    "minE": 10.0,
+    "pid": [211, -211],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 121102,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_pion_fasernu_10GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_300GeV-121105.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_300GeV-121105.json
new file mode 100644
index 000000000..255af7e27
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_300GeV-121105.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 1000,
+    "mass": 105.66,
+    "maxE": 300.0,
+    "minE": 300.0,
+    "pid": [211, -211],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 121105,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_pion_fasernu_300GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_30GeV-121103.json b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_30GeV-121103.json
new file mode 100644
index 000000000..6c2513302
--- /dev/null
+++ b/Control/CalypsoExample/Generation/data/mdc/FaserMC-MDC_PG_pion_fasernu_30GeV-121103.json
@@ -0,0 +1,14 @@
+{
+    "file_length": 1000,
+    "mass": 105.66,
+    "maxE": 30.0,
+    "minE": 30.0,
+    "pid": [211, -211],
+    "radius": -25.0,
+    "angle": 0.0006,
+    "run": 121103,
+    "sampler": "const",
+    "segment": 0,
+    "short": "MDC_PG_pion_fasernu_30GeV",
+    "zpos": -3990.0
+}
diff --git a/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh b/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh
index 5d704e9a5..b2edda7c3 100755
--- a/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh
+++ b/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh
@@ -199,8 +199,8 @@ if ! [ -z "$outdest" ]
 then
     ls -l
     echo "copy *-HITS.root to $outdest"
-    mkdir -p $outdest
-    eos cp *-HITS.root ${outdest}/ || true
+    # mkdir -p $outdest # This is a bit flaky, just use -p below
+    eos cp -p -S *-HITS.root ${outdest}/ || true
 fi
 #
 # Also copy log file
@@ -209,13 +209,13 @@ then
     cd ..
     ls -l
     echo "copy $logfile to $logdest"
-    mkdir -p $logdest
-    eos cp $logfile $logdest/$logfile
+    # mkdir -p $logdest # This is a bit flaky, just use -p below
+    eos cp -p -S $logfile $logdest/$logfile
 elif ! [ -z "$outdest" ]
 then 
     cd ..
     ls -l
     echo "copy $logfile to $outdest"
-    mkdir -p $outdest
-    eos cp $logfile $outdest/$logfile
+    # mkdir -p $outdest
+    eos cp -p -S $logfile $outdest/$logfile
 fi
diff --git a/Control/CalypsoExample/Reconstruction/scripts/submit_faserMDC_reco.sh b/Control/CalypsoExample/Reconstruction/scripts/submit_faserMDC_reco.sh
index e4d93ba64..002377a59 100755
--- a/Control/CalypsoExample/Reconstruction/scripts/submit_faserMDC_reco.sh
+++ b/Control/CalypsoExample/Reconstruction/scripts/submit_faserMDC_reco.sh
@@ -163,7 +163,7 @@ else
     tagstr="--reco=$tag"
 fi
 #
-faser_reco.py "--nevents=$nevents" $tagstr "$file_path" 
+faser_reco.py "--nevents=$nevents" --isMC $tagstr "$file_path" 
 #
 # Print out ending time
 date
@@ -180,7 +180,7 @@ then
     eos mkdir -p $outdest
     # Keep this line from stopping script, so we might get a log file
     # || true ensures script continues even if copy fails
-    eos cp *-xAOD.root ${outdest}/ || true   
+    eos cp -p *-xAOD.root ${outdest}/ || true   
 fi
 #
 # Copy log file second
-- 
GitLab


From 3b2148a1fa2823aaf3487b23cb5eb5cc955a5828 Mon Sep 17 00:00:00 2001
From: Eric Torrence <eric.torrence@cern.ch>
Date: Fri, 11 Nov 2022 19:18:25 +0100
Subject: [PATCH 3/5] Update submit_faserMDC_particlegun.sh

---
 .../Generation/scripts/submit_faserMDC_particlegun.sh     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh b/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh
index b2edda7c3..10af1c2a5 100755
--- a/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh
+++ b/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh
@@ -199,7 +199,7 @@ if ! [ -z "$outdest" ]
 then
     ls -l
     echo "copy *-HITS.root to $outdest"
-    # mkdir -p $outdest # This is a bit flaky, just use -p below
+    eos mkdir -p $outdest 
     eos cp -p -S *-HITS.root ${outdest}/ || true
 fi
 #
@@ -209,13 +209,13 @@ then
     cd ..
     ls -l
     echo "copy $logfile to $logdest"
-    # mkdir -p $logdest # This is a bit flaky, just use -p below
-    eos cp -p -S $logfile $logdest/$logfile
+    eos mkdir -p $logdest 
+    eos cp -S $logfile $logdest/$logfile
 elif ! [ -z "$outdest" ]
 then 
     cd ..
     ls -l
     echo "copy $logfile to $outdest"
-    # mkdir -p $outdest
+    eos mkdir -p $outdest
     eos cp -p -S $logfile $outdest/$logfile
 fi
-- 
GitLab


From 4da685f2c7ea769828a78f269aa1104053379e1b Mon Sep 17 00:00:00 2001
From: Eric Torrence <eric.torrence@cern.ch>
Date: Fri, 11 Nov 2022 19:21:15 +0100
Subject: [PATCH 4/5] Update submit_faserMDC_particlegun.sh

---
 .../Generation/scripts/submit_faserMDC_particlegun.sh       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh b/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh
index 10af1c2a5..08f21dbfc 100755
--- a/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh
+++ b/Control/CalypsoExample/Generation/scripts/submit_faserMDC_particlegun.sh
@@ -200,7 +200,7 @@ then
     ls -l
     echo "copy *-HITS.root to $outdest"
     eos mkdir -p $outdest 
-    eos cp -p -S *-HITS.root ${outdest}/ || true
+    eos cp *-HITS.root ${outdest}/ || true
 fi
 #
 # Also copy log file
@@ -210,12 +210,12 @@ then
     ls -l
     echo "copy $logfile to $logdest"
     eos mkdir -p $logdest 
-    eos cp -S $logfile $logdest/$logfile
+    eos cp $logfile $logdest/$logfile
 elif ! [ -z "$outdest" ]
 then 
     cd ..
     ls -l
     echo "copy $logfile to $outdest"
     eos mkdir -p $outdest
-    eos cp -p -S $logfile $outdest/$logfile
+    eos cp $logfile $outdest/$logfile
 fi
-- 
GitLab


From 2f96038407c386f7776d8fad40bfdcbdadbbcf8a Mon Sep 17 00:00:00 2001
From: Eric Torrence <eric.torrence@cern.ch>
Date: Fri, 11 Nov 2022 19:26:31 +0100
Subject: [PATCH 5/5] Update submit_faserMDC_reco.sh

---
 .../Reconstruction/scripts/submit_faserMDC_reco.sh              | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Control/CalypsoExample/Reconstruction/scripts/submit_faserMDC_reco.sh b/Control/CalypsoExample/Reconstruction/scripts/submit_faserMDC_reco.sh
index 002377a59..0f9cb4479 100755
--- a/Control/CalypsoExample/Reconstruction/scripts/submit_faserMDC_reco.sh
+++ b/Control/CalypsoExample/Reconstruction/scripts/submit_faserMDC_reco.sh
@@ -180,7 +180,7 @@ then
     eos mkdir -p $outdest
     # Keep this line from stopping script, so we might get a log file
     # || true ensures script continues even if copy fails
-    eos cp -p *-xAOD.root ${outdest}/ || true   
+    eos cp *-xAOD.root ${outdest}/ || true   
 fi
 #
 # Copy log file second
-- 
GitLab