From 0e7f6346d4318ae9df38a6325f47397bfadfa011 Mon Sep 17 00:00:00 2001
From: "Stephen A. Wood" <saw@jlab.org>
Date: Fri, 12 Jan 2018 15:37:42 -0500
Subject: [PATCH] Updated scripts for replay of coincidence runs

---
 .../COIN/PRODUCTION/replay_production_coin.C  | 15 +++++++++++-
 .../PRODUCTION/replay_production_hms_coin.C   | 20 ++++++++++------
 .../PRODUCTION/replay_production_shms_coin.C  | 23 +++++++++++--------
 3 files changed, 41 insertions(+), 17 deletions(-)

diff --git a/SCRIPTS/COIN/PRODUCTION/replay_production_coin.C b/SCRIPTS/COIN/PRODUCTION/replay_production_coin.C
index 88824dba..81625e34 100644
--- a/SCRIPTS/COIN/PRODUCTION/replay_production_coin.C
+++ b/SCRIPTS/COIN/PRODUCTION/replay_production_coin.C
@@ -50,6 +50,11 @@ void replay_production_coin (Int_t RunNumber = 0, Int_t MaxEvent = 0) {
 
   // Set up the equipment to be analyzed.
   THcHallCSpectrometer* SHMS = new THcHallCSpectrometer("P", "SHMS");
+  SHMS->SetEvtType(1);
+  SHMS->AddEvtType(4);
+  SHMS->AddEvtType(5);
+  SHMS->AddEvtType(6);
+  SHMS->AddEvtType(7);
   gHaApps->Add(SHMS);
   // Add Noble Gas Cherenkov to SHMS apparatus
   THcCherenkov* pngcer = new THcCherenkov("ngcer", "Noble Gas Cherenkov");
@@ -105,7 +110,12 @@ void replay_production_coin (Int_t RunNumber = 0, Int_t MaxEvent = 0) {
   //=:=:=
 
   // Set up the equipment to be analyzed.
-  THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
+  THcHallCSpectrometer* HMS = new THcHallCSpectrometer("H", "HMS");
+  HMS->SetEvtType(2);
+  HMS->AddEvtType(4);
+  HMS->AddEvtType(5);
+  HMS->AddEvtType(6);
+  HMS->AddEvtType(7);
   gHaApps->Add(HMS);
   // Add drift chambers to HMS apparatus
   THcDC* hdc = new THcDC("dc", "Drift Chambers");
@@ -162,6 +172,9 @@ void replay_production_coin (Int_t RunNumber = 0, Int_t MaxEvent = 0) {
   gHaApps->Add(TRG);
   // Add trigger detector to trigger apparatus
   THcTrigDet* coin = new THcTrigDet("coin", "Coincidence Trigger Information");
+  // Suppress missing reference time warnings for these event types
+  coin->SetEvtType(1);
+  coin->AddEvtType(2);
   TRG->AddDetector(coin); 
   // Add event handler for prestart event 125.
   THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
diff --git a/SCRIPTS/HMS/PRODUCTION/replay_production_hms_coin.C b/SCRIPTS/HMS/PRODUCTION/replay_production_hms_coin.C
index 8e317bf4..66220af9 100644
--- a/SCRIPTS/HMS/PRODUCTION/replay_production_hms_coin.C
+++ b/SCRIPTS/HMS/PRODUCTION/replay_production_hms_coin.C
@@ -43,15 +43,13 @@ void replay_production_hms_coin(Int_t RunNumber=0, Int_t MaxEvent=0) {
   gHcDetectorMap->Load("MAPS/HMS/DETEC/STACK/hms_stack.map");
   gHcParms->Load("PARAM/HMS/GEN/h_fadc_debug.param");
 
-  // Add trigger apparatus
-  THaApparatus* TRG = new THcTrigApp("T", "TRG");
-  gHaApps->Add(TRG);
-  // Add trigger detector to trigger apparatus
-  THcTrigDet* hms = new THcTrigDet("hms", "HMS Trigger Information");
-  TRG->AddDetector(hms);
-
   // Set up the equipment to be analyzed.
   THcHallCSpectrometer* HMS = new THcHallCSpectrometer("H", "HMS");
+  HMS->SetEvtType(2);
+  HMS->AddEvtType(4);
+  HMS->AddEvtType(5);
+  HMS->AddEvtType(6);
+  HMS->AddEvtType(7);
   gHaApps->Add(HMS);
   // Add drift chambers to HMS apparatus
   THcDC* dc = new THcDC("dc", "Drift Chambers");
@@ -69,6 +67,14 @@ void replay_production_hms_coin(Int_t RunNumber=0, Int_t MaxEvent=0) {
   THcShower* cal = new THcShower("cal", "Calorimeter");
   HMS->AddDetector(cal);
 
+  // Add trigger apparatus
+  THaApparatus* TRG = new THcTrigApp("T", "TRG");
+  gHaApps->Add(TRG);
+  // Add trigger detector to trigger apparatus
+  THcTrigDet* hms = new THcTrigDet("hms", "HMS Trigger Information");
+  hms->SetSpectName("H");
+  TRG->AddDetector(hms);
+
   // Include golden track information
   THaGoldenTrack* gtr = new THaGoldenTrack("H.gtr", "HMS Golden Track", "H");
   gHaPhysics->Add(gtr);
diff --git a/SCRIPTS/SHMS/PRODUCTION/replay_production_shms_coin.C b/SCRIPTS/SHMS/PRODUCTION/replay_production_shms_coin.C
index 2b74de20..e79bf564 100644
--- a/SCRIPTS/SHMS/PRODUCTION/replay_production_shms_coin.C
+++ b/SCRIPTS/SHMS/PRODUCTION/replay_production_shms_coin.C
@@ -43,17 +43,13 @@ void replay_production_shms_coin (Int_t RunNumber = 0, Int_t MaxEvent = 0) {
   gHcDetectorMap->Load("MAPS/SHMS/DETEC/STACK/shms_stack.map");
   gHcParms->Load("PARAM/SHMS/GEN/p_fadc_debug.param");
 
-  // Add trigger apparatus
-  THaApparatus* TRG = new THcTrigApp("T", "TRG");
-  gHaApps->Add(TRG);
-
-  
-  // Add trigger detector to trigger apparatus
-  THcTrigDet* shms = new THcTrigDet("shms", "SHMS Trigger Information");
-  TRG->AddDetector(shms);
-
   // Set up the equipment to be analyzed.
   THcHallCSpectrometer* SHMS = new THcHallCSpectrometer("P", "SHMS");
+  SHMS->SetEvtType(1);
+  SHMS->AddEvtType(4);
+  SHMS->AddEvtType(5);
+  SHMS->AddEvtType(6);
+  SHMS->AddEvtType(7);
   gHaApps->Add(SHMS);
   // Add Noble Gas Cherenkov to SHMS apparatus
   THcCherenkov* ngcer = new THcCherenkov("ngcer", "Noble Gas Cherenkov");
@@ -75,6 +71,15 @@ void replay_production_shms_coin (Int_t RunNumber = 0, Int_t MaxEvent = 0) {
   THcShower* cal = new THcShower("cal", "Calorimeter");
   SHMS->AddDetector(cal);
 
+  // Add trigger apparatus
+  THaApparatus* TRG = new THcTrigApp("T", "TRG");
+  gHaApps->Add(TRG);
+  
+  // Add trigger detector to trigger apparatus
+  THcTrigDet* shms = new THcTrigDet("shms", "SHMS Trigger Information");
+  shms->SetSpectName("P");
+  TRG->AddDetector(shms);
+
   // Include golden track information
   THaGoldenTrack* gtr = new THaGoldenTrack("P.gtr", "SHMS Golden Track", "P");
   gHaPhysics->Add(gtr);
-- 
GitLab