Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef THcTimeSyncEvtHandler_
#define THcTimeSyncEvtHandler_
/////////////////////////////////////////////////////////////////////
//
// THcTimeSyncEvtHandler
//
/////////////////////////////////////////////////////////////////////
#include "THaEvtTypeHandler.h"
#include <string>
#include <vector>
#include <map>
class THcTimeSyncEvtHandler : public THaEvtTypeHandler {
public:
THcTimeSyncEvtHandler(const char* name, const char* description);
virtual ~THcTimeSyncEvtHandler();
virtual Int_t Analyze(THaEvData *evdata);
virtual EStatus Init( const TDatime& run_time);
virtual void PrintStats();
virtual void SetExpectedOffset(Int_t roc, Int_t offset);
virtual void AddExpectedOffset(Int_t roc, Int_t offset);
// Float_t GetData(const std::string& tag);
private:
virtual void InitStats();
virtual void AccumulateStats();
Bool_t fFirstTime;
Int_t fMasterRoc; // ROC with the TI master
Int_t fNEvents; // Number of events analyzed
typedef struct RocTimes {
Bool_t has_ti_ttime;
UInt_t ti_ttime;
std::map<Int_t, UInt_t> fadcTimesMap;
RocTimes() : has_ti_ttime(kFALSE) {fadcTimesMap.clear();}
} RocTimes_t;
typedef struct RocStats {
Int_t ti_ttime_offset;
Int_t ti_earlyslipcount;
Int_t ti_lateslipcount;
Int_t fadc_expected_offset;
std::map<Int_t, Int_t> fadcOffsetMap;
std::map<Int_t, Int_t> fadcEarlySlipCountMap;
std::map<Int_t, Int_t> fadcLateSlipCountMap;
RocStats() : ti_ttime_offset(0), ti_earlyslipcount(0), ti_lateslipcount(0),
fadc_expected_offset(0)
{
fadcOffsetMap.clear();
fadcEarlySlipCountMap.clear();
fadcLateSlipCountMap.clear();
}
} RocStats_t;
std::map<Int_t, RocTimes_t *> CrateTimeMap;
std::map<Int_t, RocStats_t *> CrateStatsMap;
std::map<Int_t, Int_t> ExpectedOffsetMap;
THcTimeSyncEvtHandler(const THcTimeSyncEvtHandler& fh);
THcTimeSyncEvtHandler& operator=(const THcTimeSyncEvtHandler& fh);
ClassDef(THcTimeSyncEvtHandler,0) // Hall C event type 125
};
#endif