Hall C ROOT/C++ Analyzer (hcana)
THcHelicityScaler.h
Go to the documentation of this file.
1 #ifndef THcHelicityScaler_
2 #define THcHelicityScaler_
3 
5 //
6 // THcHelicityScaler
7 // class to handle Helicity scaler events
8 //
10 
11 #include "THaEvtTypeHandler.h"
12 #include "THcScalerEvtHandler.h"
13 #include "Decoder.h"
14 #include <string>
15 #include <vector>
16 #include <algorithm>
17 #include <set>
18 #include "TTree.h"
19 #include "TString.h"
20 #include <cstring>
21 
22 
23 class THcHelicity;
24 class HCScalerLoc;
25 
26 class THcHelicityScaler : public THaEvtTypeHandler {
27 
28 public:
29 
30  THcHelicityScaler(const char*, const char*);
31  virtual ~THcHelicityScaler();
32 
33  Int_t Analyze(THaEvData *evdata);
34  Int_t AnalyzeBuffer(UInt_t *rdata);
36 
37  virtual EStatus Init( const TDatime& run_time);
38  virtual Int_t ReadDatabase(const TDatime& date );
39  virtual Int_t End( THaRunBase* r=0 );
40 
41  virtual void SetUseFirstEvent(Bool_t b = kFALSE) {fUseFirstEvent = b;}
42  virtual void SetDelayedType(int evtype);
43  virtual void SetROC(Int_t roc) {fROC=roc;}
44  virtual void SetBankID(Int_t bankid) {fBankID=bankid;}
45  virtual void SetNScalerChannels(Int_t n) {fNScalerChannels = n;}
46  virtual Int_t GetNevents() { return fNTrigsInBuf;}
47  virtual Int_t GetNcycles() { return fNTriggers;}
48  virtual Int_t GetEvNum() { return evNumber;}
52  virtual Bool_t IsSeedGood() {return fNBits>=30;}
53 
54 private:
55 
56  //------------C.Y. Sep 20, 2020 :: Added Utility Function Prototypes----------------
57  void AddVars(TString name, TString desc, UInt_t iscal, UInt_t ichan, UInt_t ikind);
58  void DefVars();
59  static size_t FindNoCase(const std::string& sdata, const std::string& skey);
60 
61  std::vector<Decoder::GenScaler*> scalers;
62  std::vector<HCScalerLoc*> scalerloc;
63  //----------------------------------------------------------------------------------
64 
65  Int_t RanBit30(Int_t ranseed);
66  void MakeParms();
67 
69  // Helicity Scaler variables
70  Int_t fNTrigsInBuf; /* # of helicity scaler reads in last event */
74  //
77 
81 
89  //Double_t *fCharge;
90 
93  //Double_t fTime;
94  //Double_t fTimeAsymmetry;
96 
97  //---- C.Y.: 12/14/2020 Variables for quartet-by-quartet asymmetry/error calculations ----
99 
100  Int_t fQuartetCount; //keep track of number of quartets
101 
102  //quartet-by-quartet time asymmetry variables
109 
110  //quartet-by-quartet scaler counts asymmetry variables
112  Double_t *fScalSum; //reminder: need to initialize
117 
118  //quartet-by-quartet charge asymmetry variables
125 
126 
127 
128 
129  //----------------------
130 
131 
132 
133  //----C.Y. Nov 26, 2020----
135 
136  std::vector<UInt_t*> fDelayedEvents;
138  Int_t fNScalerChannels; // Number of scaler channels/event
139 
143  //---C.Y. Sep 2020 : Added additional BCM-related variables--
153  std::vector <std::string> fBCM_Name;
154 
155  //----C.Y. Sep 20, 2020 : Added additional variables-----
156  // (required by utility functions and scaler tree output)
171  std::set<UInt_t> fRocSet;
172  std::set<UInt_t> fModuleSet;
173  //--------------------------------------------------------
174 
177 
178 
179  ClassDef(THcHelicityScaler,0) // Scaler Event handler
180 
181 };
182 
183 #endif
Double_t * fBCM_SatQuadratic
virtual void SetBankID(Int_t bankid)
Double_t * fChargeAsymSum2
THcHelicityScaler(const char *, const char *)
Double_t fbcm_Current_Threshold
Int_t AnalyzeBuffer(UInt_t *rdata)
Double_t * fAsymmetryError
Double_t * fBCM_delta_charge
Double_t * fScalCycle[4]
Event handler for Hall C helicity scalers.
Double_t * fChargeCycle[4]
Int_t fHelicityHistory[200]
std::vector< std::string > fBCM_Name
virtual Int_t End(THaRunBase *r=0)
virtual Int_t GetReportedActual()
virtual Int_t * GetHelicityHistoryP()
virtual Bool_t IsSeedGood()
int Int_t
bool Bool_t
std::vector< UInt_t * > fDelayedEvents
Double_t * fHScalers[2]
#define ClassDef(name, id)
Determine the beam helicity for the current event.
Definition: THcHelicity.h:18
virtual void SetUseFirstEvent(Bool_t b=kFALSE)
Double_t * fChargeAsymmetry
virtual Int_t GetNcycles()
ROOT::R::TRInterface & r
virtual Int_t GetEvNum()
Int_t AnalyzeHelicityScaler(UInt_t *p)
void AddVars(TString name, TString desc, UInt_t iscal, UInt_t ichan, UInt_t ikind)
unsigned int UInt_t
THcHelicityScaler & operator=(const THcHelicityScaler &fh)
std::vector< Decoder::GenScaler * > scalers
Int_t Analyze(THaEvData *evdata)
static size_t FindNoCase(const std::string &sdata, const std::string &skey)
virtual Int_t GetReportedSeed()
double Double_t
virtual void SetROC(Int_t roc)
virtual Int_t ReadDatabase(const TDatime &date)
std::set< UInt_t > fRocSet
std::vector< HCScalerLoc * > scalerloc
Double_t * fChargeAsymmetryError
virtual EStatus Init(const TDatime &run_time)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Int_t RanBit30(Int_t ranseed)
std::set< UInt_t > fModuleSet
virtual void SetDelayedType(int evtype)
virtual Int_t GetNevents()
Double_t * fScalAsymmetryError
virtual void SetNScalerChannels(Int_t n)