Hall C ROOT/C++ Analyzer (hcana)
THcRFTime.h
Go to the documentation of this file.
1 #ifndef ROOT_THcRFTime
2 #define ROOT_THcRFTime
3 
5 // THcRFTime Physics Module //
6 // Author: Stephen JD Kay //
7 // University of Regina //
8 // Date: 12/04/21 (April 12th 2021) //
9 // Based on THcCoinTime class from C Yero //
11 
12 #include "THaEvData.h"
13 #include "THaCutList.h"
14 #include "VarDef.h"
15 #include "VarType.h"
16 #include "TClonesArray.h"
17 
18 #include <cstring>
19 #include <cstdio>
20 #include <cstdlib>
21 #include <iostream>
22 
23 #include "THaPhysicsModule.h"
24 #include "THaOutput.h"
25 #include "THcHitList.h"
26 #include "THcTrigDet.h"
27 #include "THcHodoscope.h"
28 #include "THcHallCSpectrometer.h"
29 #include "THaTrack.h"
30 #include "THaEpicsEvtHandler.h"
31 
32 class THcRFTime : public THaPhysicsModule {
33 public:
34  // Single arm required? Single arm name specified
35  THcRFTime( const char* name, const char* description, const char* hadArmName="",
36  const char* elecArmName="", const char* RFname="");
37 
38  virtual ~THcRFTime();
39 
40  virtual EStatus Init( const TDatime& run_time );
41  virtual Int_t Process( const THaEvData& );
42 
43  void Reset( Option_t* opt="" );
44  void Clear( Option_t* opt="" );
45 
46  protected:
47 
48  // Event Information
50 
51  virtual Int_t ReadDatabase( const TDatime& date);
52  virtual Int_t DefineVariables( EMode mode = kDefine );
53 
54  // Data needed for adding RF time dist as a Leaf Variable
55  // Need offset and bunch spacing too
56  TString fHodName; // Name of hodoscope
57  TString fCoinDetName; // Name of Coin Trigger
58  TString fhadArmName; // Name of hadron arm
59  TString felecArmName; // Name of electron arm
60 
61  // A bit misleading for these to be "hadron" and "electron" spectrometers
62  THcHallCSpectrometer* fhadSpectro; // Hadron Spectrometer object
63  THcHallCSpectrometer* felecSpectro; // Electron Spectrometer object
64  THcTrigDet* fCoinDet; // Coin Trigger detector object
65  THaEpicsEvtHandler* fEpicsHandler; // Not working, need another include?
66 
67  THaTrack* theSHMSTrack;
68  THaTrack* theHMSTrack;
69 
70  THcHodoscope* fHod; // Hodscope object
71 
75 
78  Double_t HMS_RFtime; // HMS RF time
79  Double_t SHMS_RFtime; // SHMS RF time
80  Double_t HMS_FPtime; //HMS focal plane time
81  Double_t SHMS_FPtime; //SHMS focal plane time
82 
83  Double_t fHMS_RFtimeDist; // These are the two quantities we actually want to try to determine and produce in the end
85 
86  // Variables and stuff used in the CoinTime path length correction calculations
87  // May want to re-use some of these in the future
88  //-----Declare Variables used in HMS/SHMS RF. time correction-----
89  // This is just the coin timing stuff now, will need similar for RF
90  // Double_t lightSpeed;
91  //Double_t elecMass;
92  //Double_t positronMass;
93 
94  //hadron masses (the e- could be in coincidence with any of the hadrons)
95  //Double_t protonMass;
96  //Double_t kaonMass;
97  //Double_t pionMass;
98 
99  // These variables and calculations are probably still good
100  //Double_t SHMScentralPathLen;
101  //Double_t HMScentralPathLen;
102 
103  //Double_t DeltaSHMSpathLength;
104  //Double_t DeltaHMSpathLength;
105 
106  // Coin time values, not needed, delete soon
107  /*
108  Double_t fROC1_RAW_CoinTime;
109  Double_t fROC2_RAW_CoinTime;
110  Double_t fTRIG1_RAW_CoinTime;
111  Double_t fTRIG4_RAW_CoinTime;
112 
113  Double_t fROC1_epCoinTime;
114  Double_t fROC2_epCoinTime;
115  Double_t fTRIG1_epCoinTime;
116  Double_t fTRIG4_epCoinTime;
117 
118  Double_t fROC1_eKCoinTime;
119  Double_t fROC2_eKCoinTime;
120  Double_t fTRIG1_eKCoinTime;
121  Double_t fTRIG4_eKCoinTime;
122 
123  Double_t fROC1_ePiCoinTime;
124  Double_t fROC2_ePiCoinTime;
125  Double_t fTRIG1_ePiCoinTime;
126  Double_t fTRIG4_ePiCoinTime;
127 
128  Double_t fROC1_ePosCoinTime; //electron-positron coin time
129  Double_t fROC2_ePosCoinTime;
130  Double_t fTRIG1_ePosCoinTime; //electron-positron coin time
131  Double_t fTRIG4_ePosCoinTime;
132  */
133 
134  //Double_t elec_coinCorr;
135  //Double_t elecArm_BetaCalc;
136  //Double_t elec_hodFPtime;
137 
138  //Double_t had_coinCorr_proton;
139  // Double_t hadArm_BetaCalc_proton;
140 
141  //Double_t had_coinCorr_Kaon;
142  //Double_t hadArm_BetaCalc_Kaon;
143 
144  //Double_t had_coinCorr_Pion;
145  //Double_t hadArm_BetaCalc_Pion;
146 
147  //Double_t had_coinCorr_Positron;
148  //Double_t hadArm_BetaCalc_Positron;
149 
150  // Still needed as part of difference calculation? Keep?
151  //Double_t elec_P; //electron golden track momentum
152  //Double_t elec_dP; //electron golden track delta-> (P-P0 / P0)
153  //Double_t elec_xptar; //electron golden track theta (xptar, :)
154 
155  //Double_t had_P; //hadron golden track momentum
156  //Double_t had_xfp; //hadron x-focal plane
157  //Double_t had_xpfp; //hadron xp focal plane
158  //Double_t had_ypfp; //hadron yp focal plane
159 
160  //--------------------------------------------------------------------
161 
162  ClassDef(THcRFTime,0) // RF Time Module
163 };
164 
165 #endif
const char Option_t
TString fCoinDetName
Definition: THcRFTime.h:57
Double_t fSHMS_RFtimeDist
Definition: THcRFTime.h:84
THcHallCSpectrometer * felecSpectro
Definition: THcRFTime.h:63
Double_t SHMS_RF_Offset
Definition: THcRFTime.h:73
Double_t HMS_RF_Offset
Definition: THcRFTime.h:72
int Int_t
Int_t fNhits
Definition: THcRFTime.h:49
Double_t SHMS_RFtime
Definition: THcRFTime.h:79
virtual Int_t DefineVariables(EMode mode=kDefine)
Definition: THcRFTime.cxx:155
Double_t fHMS_RFtimeDist
Definition: THcRFTime.h:83
#define ClassDef(name, id)
THcTrigDet * fCoinDet
Definition: THcRFTime.h:64
THcHodoscope * fHod
Definition: THcRFTime.h:70
TString felecArmName
Definition: THcRFTime.h:59
virtual Int_t ReadDatabase(const TDatime &date)
Definition: THcRFTime.cxx:123
A mock detector to hold trigger related data.
Definition: THcTrigDet.h:16
virtual EStatus Init(const TDatime &run_time)
Definition: THcRFTime.cxx:79
Double_t SHMS_FPtime
Definition: THcRFTime.h:81
TString fhadArmName
Definition: THcRFTime.h:58
THcRFTime(const char *name, const char *description, const char *hadArmName="", const char *elecArmName="", const char *RFname="")
Definition: THcRFTime.cxx:38
THcHallCSpectrometer * fhadSpectro
Definition: THcRFTime.h:62
THaTrack * theHMSTrack
Definition: THcRFTime.h:68
Double_t HMS_RFtime
Definition: THcRFTime.h:78
void Clear(Option_t *opt="")
Definition: THcRFTime.cxx:61
Double_t Bunch_Spacing_Override
Definition: THcRFTime.h:74
double Double_t
virtual Int_t Process(const THaEvData &)
Definition: THcRFTime.cxx:171
TString fHodName
Definition: THcRFTime.h:56
THaTrack * theSHMSTrack
Definition: THcRFTime.h:67
THaEpicsEvtHandler * fEpicsHandler
Definition: THcRFTime.h:65
Double_t HMS_FPtime
Definition: THcRFTime.h:80
void Reset(Option_t *opt="")
Definition: THcRFTime.cxx:71
virtual ~THcRFTime()
Definition: THcRFTime.cxx:53
Generic hodoscope consisting of multiple planes with multiple paddles with phototubes on both ends...
Definition: THcHodoscope.h:37
Double_t Bunch_Spacing_Epics
Definition: THcRFTime.h:77
char name[80]
Double_t Bunch_Spacing
Definition: THcRFTime.h:76
A standard Hall C spectrometer apparatus.