Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaG0HelicityReader.h
Go to the documentation of this file.
1#ifndef Podd_THaG0HelicityReader_h_
2#define Podd_THaG0HelicityReader_h_
3
5//
6// THaG0HelicityReader
7//
8// Routines for decoding G0 helicity hardware
9//
11
12#include "Rtypes.h"
13
14class THaEvData;
15class TDatime;
16
18
19public:
21 virtual ~THaG0HelicityReader() = default;
22
23 Bool_t GetValidTime() const { return fValidTime; }
24
25 // Get ROC helicity information (for debugging)
26 Int_t GetQrt() const { return fQrt; }
27 Int_t GetGate() const { return fGate; }
28 Int_t GetReading() const { return fPresentReading; }
29
30protected:
31
32 // Used by ReadDatabase
33 enum EROC { kHel = 0, kTime, kROC2, kROC3 };
34 class ROCinfo {
35 public:
37 Bool_t valid() const;
38 UInt_t roc; // ROC to read out
39 UInt_t header; // Headers to search for (0 = ignore)
40 UInt_t index; // Index into buffer
41 };
42
43 virtual void Clear( Option_t* opt="" );
44 virtual Int_t ReadData( const THaEvData& evdata );
45 Int_t ReadDatabase( const char* dbfilename, const char* prefix,
46 const TDatime& date, int debug_flag = 0 );
47
48 Int_t fPresentReading; // Current helicity reading
49 Int_t fQrt; // Current QRT
50 Int_t fGate; // Current gate
51
52 Double_t fTimestamp; // Event time from 105 kHz clock
53 Double_t fOldT1; // Last event's timestamps
56 Bool_t fValidTime; // fTimestamp valid
57
58 // ROC information
59 // If a header is zero the index is taken to be from the start of
60 // the ROC (0 = first word of ROC), otherwise it's from the header
61 // (0 = first word after header).
62 ROCinfo fROCinfo[kROC3+1]; // Primary readouts and two redundant clocks
63 // helroc, timeroc, time2roc, time3roc
64 Int_t fG0Debug; // Debug level
65 Bool_t fHaveROCs; // Required ROCs are defined
66 Bool_t fNegGate; // Invert polarity of gate, so that 0=active
67
68private:
69
70 static UInt_t FindWord( const THaEvData& evdata, const ROCinfo& info );
71
72 ClassDef(THaG0HelicityReader,2) // Helper class for reading G0 helicity data
73
74};
75
76#endif
int Int_t
unsigned int UInt_t
bool Bool_t
const UInt_t kMaxUInt
double Double_t
const char Option_t
#define ClassDef(name, id)
virtual ~THaG0HelicityReader()=default
virtual Int_t ReadData(const THaEvData &evdata)
Int_t ReadDatabase(const char *dbfilename, const char *prefix, const TDatime &date, int debug_flag=0)
ROCinfo fROCinfo[kROC3+1]
static UInt_t FindWord(const THaEvData &evdata, const ROCinfo &info)
virtual void Clear(Option_t *opt="")
Bool_t GetValidTime() const