Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcTimeSyncEvtHandler.h
Go to the documentation of this file.
1#ifndef THcTimeSyncEvtHandler_
2#define THcTimeSyncEvtHandler_
3
5//
6// THcTimeSyncEvtHandler
7//
9
10#include "THaEvtTypeHandler.h"
11#include "Decoder.h"
12#include <string>
13#include <vector>
14#include <map>
15
16//class THaRunBase;
17//class THaEvData;
18
20
21public:
22
23 THcTimeSyncEvtHandler(const char* name, const char* description);
24 virtual ~THcTimeSyncEvtHandler();
25
26 virtual Int_t Analyze(THaEvData *evdata);
27 virtual EStatus Init( const TDatime& run_time);
28 virtual void PrintStats();
29 virtual void SetExpectedOffset(Int_t roc, Int_t offset);
30 virtual void AddExpectedOffset(Int_t roc, Int_t offset);
31 virtual Int_t End( THaRunBase* r=0 );
32 virtual Int_t SetRewriteFile(const char *filename);
33 virtual void SetBadROC(Int_t roc) {fBadROC = roc;}
34 virtual void SetResync(Bool_t b) {fResync = b;}
35 virtual void SetBadSyncSizeTrigger(Int_t sizetrigger) {fBadSyncSizeTrigger = sizetrigger;}
36 virtual Int_t AllTdcsPresent(UInt_t *bank);
37private:
38
39 virtual void InitStats();
40 virtual void AccumulateStats(Bool_t sync);
41
43 Int_t fMasterRoc; // ROC with the TI master
44 Int_t fNEvents; // Number of events analyzed
50 Int_t fBadROC; // ROC to check and filter sync problems
51 Bool_t fResync; // If true, stop correcting events on sync
53 Bool_t fLastEventWasSync; // True when last event was sync event
55 UInt_t fTdcMask; // Bit Pattern of TDC in ROC being checked
56
57 Decoder::THaCodaFile* fCodaOut; // The CODA output file
59
60 typedef struct RocTimes {
64 std::map<Int_t, UInt_t> fadcTimesMap;
65 std::map<Int_t, UInt_t> ftdcEvCountMap;
67 fadcTimesMap.clear();
68 ftdcEvCountMap.clear();
69 }
71
92
93 std::map<Int_t, RocTimes_t *> CrateTimeMap;
94 std::map<Int_t, RocStats_t *> CrateStatsMap;
95 std::map<Int_t, Int_t> ExpectedOffsetMap;
96
99
100 ClassDef(THcTimeSyncEvtHandler,0) // Hall C event type 125
101
102};
103
104#endif
int Int_t
unsigned int UInt_t
ROOT::R::TRInterface & r
bool Bool_t
const Bool_t kFALSE
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Event handler to check TI and FADC synchronization.
std::map< Int_t, Int_t > ExpectedOffsetMap
virtual Int_t SetRewriteFile(const char *filename)
virtual void SetBadSyncSizeTrigger(Int_t sizetrigger)
struct THcTimeSyncEvtHandler::RocStats RocStats_t
virtual Int_t Analyze(THaEvData *evdata)
Decoder::THaCodaFile * fCodaOut
struct THcTimeSyncEvtHandler::RocTimes RocTimes_t
virtual Int_t AllTdcsPresent(UInt_t *bank)
std::map< Int_t, RocStats_t * > CrateStatsMap
virtual void AccumulateStats(Bool_t sync)
std::map< Int_t, RocTimes_t * > CrateTimeMap
virtual void SetBadROC(Int_t roc)
virtual void SetExpectedOffset(Int_t roc, Int_t offset)
virtual Int_t End(THaRunBase *r=0)
THcTimeSyncEvtHandler & operator=(const THcTimeSyncEvtHandler &fh)
virtual void AddExpectedOffset(Int_t roc, Int_t offset)
THcTimeSyncEvtHandler(const THcTimeSyncEvtHandler &fh)
virtual void SetResync(Bool_t b)
std::map< Int_t, Int_t > fadcLateSlipCountMap
std::map< Int_t, Int_t > ftdcEvCountOffsetMap
std::map< Int_t, Int_t > ftdcEvCountWrongMap
std::map< Int_t, Int_t > fadcEarlySlipCountMap
std::map< Int_t, Int_t > fadcOffsetMap
std::map< Int_t, UInt_t > fadcTimesMap
std::map< Int_t, UInt_t > ftdcEvCountMap