From 33b4ca1bf469c6c0b71196f5934421bd46bb749c Mon Sep 17 00:00:00 2001
From: Jure Bericic <bericic@jlab.org>
Date: Mon, 27 Feb 2017 10:28:34 -0500
Subject: [PATCH] Added handler for prestart event 125 to all scripts.

---
 SCRIPTS/HMS/replay_hcal_test_stand.C    | 6 +++++-
 SCRIPTS/HMS/replay_hcer_test_stand.C    | 6 +++++-
 SCRIPTS/HMS/replay_hdc_test_stand.C     | 8 ++++++--
 SCRIPTS/HMS/replay_hhodo_test_stand.C   | 6 +++++-
 SCRIPTS/HMS/replay_htrig_test_stand.C   | 6 +++++-
 SCRIPTS/SHMS/replay_paero_test_stand.C  | 6 +++++-
 SCRIPTS/SHMS/replay_pcal_test_stand.C   | 6 +++++-
 SCRIPTS/SHMS/replay_pdc_test_stand.C    | 5 ++++-
 SCRIPTS/SHMS/replay_phgcer_test_stand.C | 6 +++++-
 SCRIPTS/SHMS/replay_phodo_test_stand.C  | 9 ++++++++-
 SCRIPTS/SHMS/replay_pngcer_test_stand.C | 6 +++++-
 SCRIPTS/SHMS/replay_ptrig_test_stand.C  | 6 +++++-
 12 files changed, 63 insertions(+), 13 deletions(-)

diff --git a/SCRIPTS/HMS/replay_hcal_test_stand.C b/SCRIPTS/HMS/replay_hcal_test_stand.C
index 5e0eeeea..c5b4b82e 100644
--- a/SCRIPTS/HMS/replay_hcal_test_stand.C
+++ b/SCRIPTS/HMS/replay_hcal_test_stand.C
@@ -32,7 +32,7 @@ void replay_hcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Load the Hall C style detector map
   gHcDetectorMap = new THcDetectorMap();
   gHcDetectorMap->Load("MAPS/HMS/DETEC/hcal.map");
-  
+
   // Set up the equipment to be analyzed.
   THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
   gHaApps->Add(HMS);
@@ -40,6 +40,10 @@ void replay_hcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   THcShower* cal = new THcShower("cal", "Calorimeter");
   HMS->AddDetector(cal);
 
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
diff --git a/SCRIPTS/HMS/replay_hcer_test_stand.C b/SCRIPTS/HMS/replay_hcer_test_stand.C
index 3e3c3047..83c50244 100644
--- a/SCRIPTS/HMS/replay_hcer_test_stand.C
+++ b/SCRIPTS/HMS/replay_hcer_test_stand.C
@@ -35,7 +35,7 @@ void replay_hcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Load the Hall C style detector map
   gHcDetectorMap = new THcDetectorMap();
   gHcDetectorMap->Load("MAPS/HMS/DETEC/hcer_htrig.map");
-  
+
   // Set up the equipment to be analyzed.
   THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
   gHaApps->Add(HMS);
@@ -50,6 +50,10 @@ void replay_hcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   THcTrigDet* hms = new THcTrigDet("hms", "HMS Trigger Information");
   TRG->AddDetector(hms);
 
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
diff --git a/SCRIPTS/HMS/replay_hdc_test_stand.C b/SCRIPTS/HMS/replay_hdc_test_stand.C
index 231e798f..6128bf52 100644
--- a/SCRIPTS/HMS/replay_hdc_test_stand.C
+++ b/SCRIPTS/HMS/replay_hdc_test_stand.C
@@ -39,7 +39,7 @@ void replay_hdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   gHcDetectorMap = new THcDetectorMap();
   //gHcDetectorMap->Load(gHcParms->GetString("g_decode_map_filename"));
   gHcDetectorMap->Load("MAPS/HMS/DETEC/hdc_htrig.map");
-  
+
   // Set up the equipment to be analyzed.
   THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
   gHaApps->Add(HMS);
@@ -56,7 +56,11 @@ void replay_hdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Add trigger detector to trigger apparatus
   THcTrigDet* hms = new THcTrigDet("hms", "HMS Trigger Information");
   TRG->AddDetector(hms);
-  
+
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   //THcScalerEvtHandler *hscaler = new THcScalerEvtHandler("HS", "HC scaler event type 0");
   //hscaler->SetDebugFile("HScaler.txt");
   //gHaEvtHandlers->Add(hscaler);
diff --git a/SCRIPTS/HMS/replay_hhodo_test_stand.C b/SCRIPTS/HMS/replay_hhodo_test_stand.C
index 9f240f42..4c01e049 100644
--- a/SCRIPTS/HMS/replay_hhodo_test_stand.C
+++ b/SCRIPTS/HMS/replay_hhodo_test_stand.C
@@ -35,7 +35,7 @@ void replay_hhodo_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Load the Hall C style detector map
   gHcDetectorMap = new THcDetectorMap();
   gHcDetectorMap->Load("MAPS/HMS/DETEC/hhodo_htrig.map");
-  
+
   // Set up the equipment to be analyzed.
   THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
   gHaApps->Add(HMS);
@@ -50,6 +50,10 @@ void replay_hhodo_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   THcTrigDet* hms = new THcTrigDet("hms", "HMS Trigger Information");
   TRG->AddDetector(hms);
 
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
diff --git a/SCRIPTS/HMS/replay_htrig_test_stand.C b/SCRIPTS/HMS/replay_htrig_test_stand.C
index 77b0ce8c..98001305 100644
--- a/SCRIPTS/HMS/replay_htrig_test_stand.C
+++ b/SCRIPTS/HMS/replay_htrig_test_stand.C
@@ -42,7 +42,11 @@ void replay_htrig_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Add trigger detector to trigger apparatus
   THcTrigDet* hms = new THcTrigDet("hms", "HMS Trigger Information");
   TRG->AddDetector(hms);
-  
+
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
diff --git a/SCRIPTS/SHMS/replay_paero_test_stand.C b/SCRIPTS/SHMS/replay_paero_test_stand.C
index c934c040..aabfbfa8 100644
--- a/SCRIPTS/SHMS/replay_paero_test_stand.C
+++ b/SCRIPTS/SHMS/replay_paero_test_stand.C
@@ -35,7 +35,7 @@ void replay_paero_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Load the Hall C style detector map
   gHcDetectorMap = new THcDetectorMap();
   gHcDetectorMap->Load("MAPS/SHMS/DETEC/paero_ptrig.map");
-  
+
   // Set up the equipment to be analyzed.
   THaApparatus* SHMS = new THcHallCSpectrometer("P", "SHMS");
   gHaApps->Add(SHMS);
@@ -50,6 +50,10 @@ void replay_paero_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   THcTrigDet* shms = new THcTrigDet("shms", "SHMS Trigger Information");
   TRG->AddDetector(shms);
 
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
diff --git a/SCRIPTS/SHMS/replay_pcal_test_stand.C b/SCRIPTS/SHMS/replay_pcal_test_stand.C
index 161eeeac..17abdea4 100644
--- a/SCRIPTS/SHMS/replay_pcal_test_stand.C
+++ b/SCRIPTS/SHMS/replay_pcal_test_stand.C
@@ -32,7 +32,7 @@ void replay_pcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Load the Hall C style detector map
   gHcDetectorMap = new THcDetectorMap();
   gHcDetectorMap->Load("MAPS/SHMS/DETEC/pcal.map");
-  
+
   // Set up the equipment to be analyzed.
   THaApparatus* SHMS = new THcHallCSpectrometer("P", "SHMS");
   gHaApps->Add(SHMS);
@@ -40,6 +40,10 @@ void replay_pcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   THcShower* cal = new THcShower("cal", "Calorimeter");
   SHMS->AddDetector(cal);
 
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
diff --git a/SCRIPTS/SHMS/replay_pdc_test_stand.C b/SCRIPTS/SHMS/replay_pdc_test_stand.C
index 0db32feb..0b1e8c75 100644
--- a/SCRIPTS/SHMS/replay_pdc_test_stand.C
+++ b/SCRIPTS/SHMS/replay_pdc_test_stand.C
@@ -39,10 +39,13 @@ void replay_pdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Set up the equipment to be analyzed.
   THaApparatus* SHMS = new THcHallCSpectrometer("P", "SHMS");
   gHaApps->Add(SHMS);
-
   // Add SHMS drift chambers
   SHMS->AddDetector(new THcDC("dc", "Drift Chambers"));
 
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Additional detectors:
   //HMS->AddDetector(new THcHodoscope("hod", "Hodoscope"));
   //HMS->AddDetector(new THcShower("cal", "Shower"));
diff --git a/SCRIPTS/SHMS/replay_phgcer_test_stand.C b/SCRIPTS/SHMS/replay_phgcer_test_stand.C
index d5e06b3a..53e1a432 100644
--- a/SCRIPTS/SHMS/replay_phgcer_test_stand.C
+++ b/SCRIPTS/SHMS/replay_phgcer_test_stand.C
@@ -35,7 +35,7 @@ void replay_phgcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Load the Hall C style detector map
   gHcDetectorMap = new THcDetectorMap();
   gHcDetectorMap->Load("MAPS/SHMS/DETEC/phgcer_ptrig.map");
-  
+
   // Set up the equipment to be analyzed.
   THaApparatus* SHMS = new THcHallCSpectrometer("P", "SHMS");
   gHaApps->Add(SHMS);
@@ -50,6 +50,10 @@ void replay_phgcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   THcTrigDet* shms = new THcTrigDet("shms", "SHMS Trigger Information");
   TRG->AddDetector(shms);
 
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
diff --git a/SCRIPTS/SHMS/replay_phodo_test_stand.C b/SCRIPTS/SHMS/replay_phodo_test_stand.C
index 3827cba1..4ce629fc 100644
--- a/SCRIPTS/SHMS/replay_phodo_test_stand.C
+++ b/SCRIPTS/SHMS/replay_phodo_test_stand.C
@@ -35,13 +35,16 @@ void replay_phodo_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Load the Hall C style detector map
   gHcDetectorMap = new THcDetectorMap();
   gHcDetectorMap->Load("MAPS/SHMS/DETEC/phodo_ptrig.map");
-  
+
   // Set up the equipment to be analyzed.
   THaApparatus* SHMS = new THcHallCSpectrometer("P", "SHMS");
   gHaApps->Add(SHMS);
   // Add hodoscope to HMS apparatus
   THcHodoscope* hod = new THcHodoscope("hod", "Hodoscope");
   SHMS->AddDetector(hod);
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
 
   // Add trigger apparatus
   THaApparatus* TRG = new THcTrigApp("T", "TRG");
@@ -50,6 +53,10 @@ void replay_phodo_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   THcTrigDet* shms = new THcTrigDet("shms", "SHMS Trigger Information");
   TRG->AddDetector(shms);
 
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
diff --git a/SCRIPTS/SHMS/replay_pngcer_test_stand.C b/SCRIPTS/SHMS/replay_pngcer_test_stand.C
index 506a267e..5efeae36 100644
--- a/SCRIPTS/SHMS/replay_pngcer_test_stand.C
+++ b/SCRIPTS/SHMS/replay_pngcer_test_stand.C
@@ -35,7 +35,7 @@ void replay_pngcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Load the Hall C style detector map
   gHcDetectorMap = new THcDetectorMap();
   gHcDetectorMap->Load("MAPS/SHMS/DETEC/pngcer_ptrig.map");
-  
+
   // Set up the equipment to be analyzed.
   THaApparatus* SHMS = new THcHallCSpectrometer("P", "SHMS");
   gHaApps->Add(SHMS);
@@ -50,6 +50,10 @@ void replay_pngcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   THcTrigDet* shms = new THcTrigDet("shms", "SHMS Trigger Information");
   TRG->AddDetector(shms);
 
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
diff --git a/SCRIPTS/SHMS/replay_ptrig_test_stand.C b/SCRIPTS/SHMS/replay_ptrig_test_stand.C
index 2c83591e..fabb4601 100644
--- a/SCRIPTS/SHMS/replay_ptrig_test_stand.C
+++ b/SCRIPTS/SHMS/replay_ptrig_test_stand.C
@@ -42,7 +42,11 @@ void replay_ptrig_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
   // Add trigger detector to trigger apparatus
   THcTrigDet* shms = new THcTrigDet("shms", "SHMS Trigger Information");
   TRG->AddDetector(shms);
-  
+
+  // Add handler for prestart event 125.
+  THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
+  gHaEvtHandlers->Add(ev125);
+
   // Set up the analyzer - we use the standard one,
   // but this could be an experiment-specific one as well.
   // The Analyzer controls the reading of the data, executes
-- 
GitLab