Hall C ROOT/C++ Analyzer (hcana)
Go to the documentation of this file.
1 #ifndef Podd_THcHelicity_h_
2 #define Podd_THcHelicity_h_
5 //
6 // THcHelicity
7 //
8 // Helicity of the beam - from QWEAK electronics in delayed mode
9 //
12 #include "THaHelicityDet.h"
13 #include "THcHelicityReader.h"
15 class TH1F;
16 class THcHelicityScaler;
18 class THcHelicity : public THaHelicityDet, public THcHelicityReader {
20 public:
22  THcHelicity( const char* name, const char* description,
23  THaApparatus* a = NULL );
24  THcHelicity();
25  virtual ~THcHelicity();
27  virtual EStatus Init(const TDatime& date);
28  virtual void MakePrefix();
30  virtual Int_t Begin( THaRunBase* r=0 );
31  virtual void Clear( Option_t* opt = "" );
32  virtual Int_t Decode( const THaEvData& evdata );
33  virtual Int_t End( THaRunBase* r=0 );
34  virtual void SetDebug( Int_t level );
35  virtual void SetHelicityScaler(THcHelicityScaler *f);
37  void PrintEvent(Int_t evtnum);
39 protected:
40  void Setup(const char* name, const char* description);
41  std::string fKwPrefix;
43  void FillHisto();
44  void LoadHelicity(Int_t reportedhelicity, Int_t cyclecount, Int_t missedcycles);
45  Int_t RanBit30(Int_t ranseed);
46  Int_t GetSeed30(Int_t currentseed);
48  // Fixed Parameters
55  Double_t fTIPeriod; // Reversal period in TI time units
73  Bool_t fFoundQuartet; // True if quartet phase probably found.
75  Int_t fNCycle; // Count of # of helicity cycles
76  Int_t fNQuartet; // Quartet count
78  Int_t fQuartet[4]; // For finding and checking quartet pattern
80  Int_t fnQrt; // Position in quartet
81  Bool_t fHaveQRT; // QRT signal exists
88  // Offset between the ring reported value and the reported value
90  // delay of helicity (# windows)
92  //number of bit in the pseudo random helcity generator
93  std::vector<Int_t> fPatternSequence; // sequence of 0 and 1 in the pattern
94  Int_t fQWEAKNPattern; // maximum of event in the pattern
100  void SetErrorCode(Int_t error);
103  Int_t fEvtype; // Current CODA event type
108  static const Int_t NHIST = 2;
111  virtual Int_t DefineVariables( EMode mode = kDefine );
112  virtual Int_t ReadDatabase( const TDatime& date );
128  ClassDef(THcHelicity,0) // Beam helicity from QWEAK electronics in delayed mode
130 };
132 #endif
Bool_t fIsNewCycle
Definition: THcHelicity.h:74
Bool_t fHaveQRT
Definition: THcHelicity.h:81
void FillHisto()
Int_t fRingSeed_reported_initial
Definition: THcHelicity.h:49
long long Long64_t
Int_t fLastHelpCycle
Definition: THcHelicity.h:116
THcHelicityScaler * fglHelicityScaler
Definition: THcHelicity.h:114
Int_t fNQRTProblems
Definition: THcHelicity.h:82
const char Option_t
std::vector< Int_t > fPatternSequence
Definition: THcHelicity.h:93
Int_t fMPS
Definition: THcHelicity.h:67
virtual EStatus Init(const TDatime &date)
Definition: THcHelicity.cxx:64
Double_t fCycle
Definition: THcHelicity.h:59
Event handler for Hall C helicity scalers.
static const Int_t NHIST
Definition: THcHelicity.h:108
Int_t fPredictedHelicity
Definition: THcHelicity.h:68
Bool_t fDisabled
Definition: THcHelicity.h:106
Int_t fScaleQuartet
Definition: THcHelicity.h:117
int Int_t
bool Bool_t
virtual void SetHelicityScaler(THcHelicityScaler *f)
Int_t fQuartet[4]
Definition: THcHelicity.h:78
Bool_t fFirstEvProcessed
Definition: THcHelicity.h:61
Int_t fnQrt
Definition: THcHelicity.h:80
virtual Int_t ReadDatabase(const TDatime &date)
#define ClassDef(name, id)
virtual void Clear(Option_t *opt="")
Int_t fNCycle
Definition: THcHelicity.h:75
virtual Int_t DefineVariables(EMode mode=kDefine)
Int_t fQuadPattern[8]
Definition: THcHelicity.h:118
Determine the beam helicity for the current event.
Definition: THcHelicity.h:18
Double_t fPeriodCheck
Definition: THcHelicity.h:57
Int_t fScalerSeed
Definition: THcHelicity.h:121
Int_t fNQuartet
Definition: THcHelicity.h:76
Int_t fThisScaleHel
Definition: THcHelicity.h:124
virtual void SetDebug(Int_t level)
Int_t fLastLastScaleHel
Definition: THcHelicity.h:126
ROOT::R::TRInterface & r
Bool_t fFoundMPS
Definition: THcHelicity.h:72
Int_t RanBit30(Int_t ranseed)
Double_t fPeriodCheckOffset
Definition: THcHelicity.h:58
Long64_t fLastMPSTime
Definition: THcHelicity.h:65
Definition: THcHelicity.h:91
void Setup(const char *name, const char *description)
auto * a
Int_t fLastScaleHel
Definition: THcHelicity.h:125
Int_t fRingSeed_actual
Definition: THcHelicity.h:85
std::string fKwPrefix
Definition: THcHelicity.h:41
Int_t lastispos
Definition: THcHelicity.h:122
Long64_t fLastEvTime
Definition: THcHelicity.h:64
Bool_t HWPIN
Definition: THcHelicity.h:95
Bool_t fFoundQuartet
Definition: THcHelicity.h:73
Int_t fEvtype
Definition: THcHelicity.h:103
Int_t fQWEAKNPattern
Definition: THcHelicity.h:94
Int_t fQrt
Definition: THcHelicity.h:98
Int_t fReportedHelicity
Definition: THcHelicity.h:66
Int_t fLastActualHelicity
Definition: THcHelicity.h:104
double f(double x)
Int_t fHelDelay
Definition: THcHelicity.h:89
void SetErrorCode(Int_t error)
double Double_t
void LoadHelicity(Int_t reportedhelicity, Int_t cyclecount, Int_t missedcycles)
Int_t fActualHelicity
Definition: THcHelicity.h:69
Long64_t fFirstEvTime
Definition: THcHelicity.h:63
Double_t fFreq
Definition: THcHelicity.h:52
Int_t * fHelicityHistory
Definition: THcHelicity.h:115
Int_t fNBits
Definition: THcHelicity.h:79
Int_t fHelperHistory
Definition: THcHelicity.h:119
Int_t GetSeed30(Int_t currentseed)
virtual ~THcHelicity()
Definition: THcHelicity.cxx:54
Int_t fQuartetStartPredictedHelicity
Definition: THcHelicity.h:71
Int_t fNLastQuartet
Definition: THcHelicity.h:77
Double_t fErrorCode
Definition: THcHelicity.h:101
virtual void MakePrefix()
Int_t fFirstCycle
Definition: THcHelicity.h:50
Int_t fHelperQuartetHistory
Definition: THcHelicity.h:120
Int_t fQuartetStartHelicity
Definition: THcHelicity.h:70
TH1F * fHisto[NHIST]
Definition: THcHelicity.h:109
Double_t fTIPeriod
Definition: THcHelicity.h:55
Int_t fLastReportedHelicity
Definition: THcHelicity.h:62
virtual Int_t Decode(const THaEvData &evdata)
void PrintEvent(Int_t evtnum)
Bool_t fFixFirstCycle
Definition: THcHelicity.h:51
Double_t fRecommendedFreq
Definition: THcHelicity.h:53
char name[80]
Int_t fEvNumCheck
Definition: THcHelicity.h:105
Extract helicity information from FADC250 modules.
Int_t fRingSeed_reported
Definition: THcHelicity.h:84