CbmRoot
CbmTofStarData2019.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmTofStarData2019 -----
4 // ----- Created 13.01.2017 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
8 #ifndef CbmTofStarData2019_H
9 #define CbmTofStarData2019_H
10 
11 #include "gDpbMessv100.h"
12 
13 #include "Rtypes.h"
14 
15 #include <vector>
16 
18 public:
19  // Constructors
20  CbmTofStarTrigger2019(ULong64_t ulGdpbTsFullIn,
21  ULong64_t ulStarTsFullIn,
22  UInt_t uStarTokenIn,
23  UInt_t uStarDaqCmdIn,
24  UInt_t uStarTrigCmdIn,
25  UShort_t usGdpbId = 0);
26 
27  // Destructor
29 
30  // Setters
31  inline void SetFullGdpbTs(ULong64_t ulGdpbTsFullIn) {
32  fulGdpbTsFull = ulGdpbTsFullIn;
33  }
34  inline void SetFullStarTs(ULong64_t ulStarTsFullIn) {
35  fulStarTsFull = ulStarTsFullIn;
36  }
37  inline void SetStarToken(UInt_t uStarTokenIn) { fuStarToken = uStarTokenIn; }
38  inline void SetStarDaqCmd(UInt_t uStarDaqCmdIn) {
39  fusStarDaqCmd = uStarDaqCmdIn;
40  }
41  inline void SetStarTRigCmd(UInt_t uStarTrigCmdIn) {
42  fusStarTrigCmd = uStarTrigCmdIn;
43  }
44 
45  // Accessors
46  inline ULong64_t GetFullGdpbTs() const { return fulGdpbTsFull; }
47  inline ULong64_t GetFullStarTs() const { return fulStarTsFull; }
48  inline UInt_t GetStarToken() const { return fuStarToken; }
49  inline UShort_t GetStarDaqCmd() const { return fusStarDaqCmd; }
50  inline UShort_t GetStarTrigCmd() const { return fusStarTrigCmd; }
51  UInt_t GetStarTrigerWord() const;
52  UInt_t GetFullGdpbEpoch() const;
53  std::vector<gdpbv100::FullMessage> GetGdpbMessages() const;
54 
55  // Operators
56  bool operator<(const CbmTofStarTrigger2019& other) const;
57 
58 private:
59  UShort_t fusGdpbId;
60  ULong64_t fulGdpbTsFull;
61  ULong64_t fulStarTsFull;
62  UInt_t fuStarToken;
63  UShort_t fusStarDaqCmd;
64  UShort_t fusStarTrigCmd;
65 
66  // CbmTofStarTrigger2019(const CbmTofStarTrigger2019&);
67  // CbmTofStarTrigger2019 operator=(const CbmTofStarTrigger2019&);
68 
69  // ClassDef(CbmTofStarTrigger2019, 1)
70 };
71 
73  // Methods implementation can be found at the end of CbmTsMonitorTofStar.cxx!
74 public:
75  // Constructors
77  CbmTofStarSubevent2019(CbmTofStarTrigger2019 triggerIn, UShort_t sourceIdIn);
80 
81  // Destructor
83 
84  // Setters
85  inline void SetTrigger(CbmTofStarTrigger2019 triggerIn) {
86  fTrigger = triggerIn;
87  fbTriggerSet = kTRUE;
88  }
89  inline void SetSource(UShort_t sourceIdIn) {
90  fusSourceId = sourceIdIn;
93  | ((sourceIdIn & kulSourceIdMask) << kulSourceIdOffset);
94  }
95  inline void SetBadEventFlag(Bool_t bFlagState = kTRUE) {
96  bFlagState ? (fulEventStatusFlags |= kulFlagBadEvt)
98  }
99  inline void SetOverlapEventFlag(Bool_t bFlagState = kTRUE) {
100  bFlagState ? (fulEventStatusFlags |= kulFlagOverlapEvt)
102  }
103  inline void SetEmptyEventFlag(Bool_t bFlagState = kTRUE) {
104  bFlagState ? (fulEventStatusFlags |= kulFlagEmptyEvt)
106  }
107  inline void SetStartBorderEventFlag(Bool_t bFlagState = kTRUE) {
110  }
111  inline void SetEndBorderEventFlag(Bool_t bFlagState = kTRUE) {
112  bFlagState ? (fulEventStatusFlags |= kulFlagEndBorderEvt)
114  }
115  inline void SetIncompleteEventFlag(Bool_t bFlagState = kTRUE) {
116  bFlagState ? (fulEventStatusFlags |= kulFlagIncompleteEvt)
118  }
119  inline void AddMsg(const gdpbv100::FullMessage& msgIn) {
120  fvMsgBuffer.push_back(msgIn);
121  fuEventSizeBytes += 2 * sizeof(ULong64_t);
122  }
123 
124  // Accessors
125  inline CbmTofStarTrigger2019 GetTrigger() const { return fTrigger; }
126  inline UShort_t GetSource() const { return fusSourceId; }
127  inline Bool_t GetBadEventFlag() const {
128  return 0 < (fulEventStatusFlags & kulFlagBadEvt);
129  }
130  inline Bool_t GetOverlapEventFlag() const {
131  return 0 < (fulEventStatusFlags & kulFlagOverlapEvt);
132  }
133  inline Bool_t GetEmptyEventFlag() const {
134  return 0 < (fulEventStatusFlags & kulFlagEmptyEvt);
135  }
136  inline Bool_t GetStartBorderEventFlag() const {
138  }
139  inline Bool_t GetEndBorderEventFlag() const {
141  }
142  inline Bool_t GetIncompleteEventFlag() const {
144  }
145  inline Int_t GetEventSize() const { return fuEventSizeBytes; }
146  inline gdpbv100::Message GetMsg(UInt_t uMsgIdx) const;
147  inline UInt_t GetMsgBuffSize() const { return fvMsgBuffer.size(); }
148  inline static uint32_t GetMaxOutputSize() { return kuMaxOutputSize; }
149  inline Double_t GetEventTimeSec() const {
151  }
152 
153  // Content clearing
154  void ClearSubEvent();
155 
156  // Sort content of output buffer
157  void SortMessages();
158 
159  // Sub-event output
160  void* BuildOutput(Int_t& iOutputSizeBytes);
161 
162  // Sub-event input
163  Bool_t LoadInput(void* pBuff, Int_t iInputSizeBytes);
164 
165  // Print the heade and the messages in the buffer
166  void PrintSubEvent();
167 
168 private:
169  static const uint32_t kuMaxOutputSize = 131072; // 2^17
170  static const uint32_t kuMaxNbMsgs =
171  8190; // 4 * 64b in header => floor( (2^17 / 8 ) - 4) / 2
172  static const uint64_t kulFlagBadEvt = 0x1
173  << 0;
174  static const uint64_t kulFlagOverlapEvt =
175  0x1 << 1;
176  static const uint64_t kulFlagEmptyEvt = 0x1 << 2;
177  static const uint64_t kulFlagStartBorderEvt =
178  0x1 << 3;
179  static const uint64_t kulFlagEndBorderEvt =
180  0x1 << 4;
181  static const uint64_t kulFlagIncompleteEvt =
182  0x1 << 5;
183  static const uint64_t kulSourceIdOffset = 16;
184  static const uint64_t kulSourceIdMask = 0xFFFF;
185  static const uint64_t kulEventSizeOffset = 32;
186  static const uint64_t kulEventSizeMask = 0xFFFFFFFF;
187 
188  Bool_t fbTriggerSet;
190  UShort_t fusSourceId;
193  std::vector<gdpbv100::FullMessage> fvMsgBuffer;
195 
196 
197  // ClassDef(CbmTofStarSubevent2019, 1)
198 };
199 
200 #endif
gdpbv100::Message
Definition: gDpbMessv100.h:133
CbmTofStarTrigger2019::fusStarTrigCmd
UShort_t fusStarTrigCmd
Definition: CbmTofStarData2019.h:64
CbmTofStarSubevent2019::kulFlagStartBorderEvt
static const uint64_t kulFlagStartBorderEvt
Empty event.
Definition: CbmTofStarData2019.h:177
CbmTofStarSubevent2019::fuEventSizeBytes
UInt_t fuEventSizeBytes
Definition: CbmTofStarData2019.h:192
CbmTofStarSubevent2019::SetIncompleteEventFlag
void SetIncompleteEventFlag(Bool_t bFlagState=kTRUE)
Definition: CbmTofStarData2019.h:115
CbmTofStarSubevent2019::GetIncompleteEventFlag
Bool_t GetIncompleteEventFlag() const
Definition: CbmTofStarData2019.h:142
CbmTofStarSubevent2019::fvMsgBuffer
std::vector< gdpbv100::FullMessage > fvMsgBuffer
Definition: CbmTofStarData2019.h:193
gdpbv100::kdClockCycleSizeNs
const double kdClockCycleSizeNs
Definition: gDpbMessv100.h:10
CbmTofStarSubevent2019::kulEventSizeOffset
static const uint64_t kulEventSizeOffset
Definition: CbmTofStarData2019.h:185
CbmTofStarTrigger2019::operator<
bool operator<(const CbmTofStarTrigger2019 &other) const
strict weak ordering operator, assumes same TS cycle for both triggers
Definition: CbmTofStarData2019.cxx:29
CbmTofStarSubevent2019::GetOverlapEventFlag
Bool_t GetOverlapEventFlag() const
Definition: CbmTofStarData2019.h:130
CbmTofStarSubevent2019::operator=
CbmTofStarSubevent2019 operator=(const CbmTofStarSubevent2019 &)
Definition: CbmTofStarData2019.cxx:113
CbmTofStarSubevent2019::fusSourceId
UShort_t fusSourceId
Definition: CbmTofStarData2019.h:190
CbmTofStarSubevent2019::GetMaxOutputSize
static uint32_t GetMaxOutputSize()
Definition: CbmTofStarData2019.h:148
CbmTofStarTrigger2019::SetFullGdpbTs
void SetFullGdpbTs(ULong64_t ulGdpbTsFullIn)
Definition: CbmTofStarData2019.h:31
CbmTofStarSubevent2019::fulEventStatusFlags
ULong64_t fulEventStatusFlags
Definition: CbmTofStarData2019.h:191
CbmTofStarSubevent2019::kulFlagIncompleteEvt
static const uint64_t kulFlagIncompleteEvt
Event containing data from following overlap MS.
Definition: CbmTofStarData2019.h:181
CbmTofStarSubevent2019::SetOverlapEventFlag
void SetOverlapEventFlag(Bool_t bFlagState=kTRUE)
Definition: CbmTofStarData2019.h:99
CbmTofStarTrigger2019::GetStarTrigCmd
UShort_t GetStarTrigCmd() const
Definition: CbmTofStarData2019.h:50
CbmTofStarSubevent2019::GetStartBorderEventFlag
Bool_t GetStartBorderEventFlag() const
Definition: CbmTofStarData2019.h:136
CbmTofStarSubevent2019::GetMsgBuffSize
UInt_t GetMsgBuffSize() const
Definition: CbmTofStarData2019.h:147
CbmTofStarTrigger2019::GetStarTrigerWord
UInt_t GetStarTrigerWord() const
Definition: CbmTofStarData2019.cxx:36
CbmTofStarSubevent2019::SortMessages
void SortMessages()
Definition: CbmTofStarData2019.cxx:131
CbmTofStarTrigger2019::GetGdpbMessages
std::vector< gdpbv100::FullMessage > GetGdpbMessages() const
Definition: CbmTofStarData2019.cxx:50
CbmTofStarSubevent2019::GetBadEventFlag
Bool_t GetBadEventFlag() const
Definition: CbmTofStarData2019.h:127
CbmTofStarSubevent2019::GetEventSize
Int_t GetEventSize() const
Definition: CbmTofStarData2019.h:145
CbmTofStarSubevent2019::SetEmptyEventFlag
void SetEmptyEventFlag(Bool_t bFlagState=kTRUE)
Definition: CbmTofStarData2019.h:103
CbmTofStarTrigger2019::fusStarDaqCmd
UShort_t fusStarDaqCmd
Definition: CbmTofStarData2019.h:63
CbmTofStarTrigger2019::CbmTofStarTrigger2019
CbmTofStarTrigger2019(ULong64_t ulGdpbTsFullIn, ULong64_t ulStarTsFullIn, UInt_t uStarTokenIn, UInt_t uStarDaqCmdIn, UInt_t uStarTrigCmdIn, UShort_t usGdpbId=0)
Definition: CbmTofStarData2019.cxx:16
CbmTofStarSubevent2019::SetStartBorderEventFlag
void SetStartBorderEventFlag(Bool_t bFlagState=kTRUE)
Definition: CbmTofStarData2019.h:107
CbmTofStarSubevent2019::kulSourceIdMask
static const uint64_t kulSourceIdMask
Definition: CbmTofStarData2019.h:184
CbmTofStarTrigger2019::fulGdpbTsFull
ULong64_t fulGdpbTsFull
Definition: CbmTofStarData2019.h:60
CbmTofStarSubevent2019::kuMaxOutputSize
static const uint32_t kuMaxOutputSize
Definition: CbmTofStarData2019.h:169
CbmTofStarTrigger2019::GetStarDaqCmd
UShort_t GetStarDaqCmd() const
Definition: CbmTofStarData2019.h:49
CbmTofStarSubevent2019::GetSource
UShort_t GetSource() const
Definition: CbmTofStarData2019.h:126
CbmTofStarTrigger2019::GetFullGdpbEpoch
UInt_t GetFullGdpbEpoch() const
Definition: CbmTofStarData2019.cxx:43
CbmTofStarSubevent2019::fpulBuff
ULong64_t fpulBuff[kuMaxOutputSize]
Definition: CbmTofStarData2019.h:194
CbmTofStarSubevent2019::PrintSubEvent
void PrintSubEvent()
Definition: CbmTofStarData2019.cxx:228
CbmTofStarSubevent2019::kulEventSizeMask
static const uint64_t kulEventSizeMask
Definition: CbmTofStarData2019.h:186
CbmTofStarSubevent2019::GetEmptyEventFlag
Bool_t GetEmptyEventFlag() const
Definition: CbmTofStarData2019.h:133
CbmTofStarSubevent2019::kulFlagEndBorderEvt
static const uint64_t kulFlagEndBorderEvt
Event containing data from previous overlap MS.
Definition: CbmTofStarData2019.h:179
CbmTofStarSubevent2019::LoadInput
Bool_t LoadInput(void *pBuff, Int_t iInputSizeBytes)
Definition: CbmTofStarData2019.cxx:184
CbmTofStarTrigger2019::GetFullStarTs
ULong64_t GetFullStarTs() const
Definition: CbmTofStarData2019.h:47
CbmTofStarSubevent2019::kulFlagEmptyEvt
static const uint64_t kulFlagEmptyEvt
Event in overlap with the previous event.
Definition: CbmTofStarData2019.h:176
CbmTofStarTrigger2019::GetStarToken
UInt_t GetStarToken() const
Definition: CbmTofStarData2019.h:48
CbmTofStarTrigger2019::fuStarToken
UInt_t fuStarToken
Definition: CbmTofStarData2019.h:62
CbmTofStarSubevent2019::SetSource
void SetSource(UShort_t sourceIdIn)
Definition: CbmTofStarData2019.h:89
CbmTofStarSubevent2019::BuildOutput
void * BuildOutput(Int_t &iOutputSizeBytes)
Definition: CbmTofStarData2019.cxx:134
CbmTofStarSubevent2019::SetBadEventFlag
void SetBadEventFlag(Bool_t bFlagState=kTRUE)
Definition: CbmTofStarData2019.h:95
CbmTofStarTrigger2019::fulStarTsFull
ULong64_t fulStarTsFull
Definition: CbmTofStarData2019.h:61
CbmTofStarSubevent2019::AddMsg
void AddMsg(const gdpbv100::FullMessage &msgIn)
Definition: CbmTofStarData2019.h:119
CbmTofStarSubevent2019::fbTriggerSet
Bool_t fbTriggerSet
Definition: CbmTofStarData2019.h:188
CbmTofStarTrigger2019
Definition: CbmTofStarData2019.h:17
CbmTofStarTrigger2019::fusGdpbId
UShort_t fusGdpbId
Definition: CbmTofStarData2019.h:59
CbmTofStarTrigger2019::SetStarTRigCmd
void SetStarTRigCmd(UInt_t uStarTrigCmdIn)
Definition: CbmTofStarData2019.h:41
CbmTofStarSubevent2019::fTrigger
CbmTofStarTrigger2019 fTrigger
Definition: CbmTofStarData2019.h:189
gDpbMessv100.h
CbmTofStarSubevent2019::SetTrigger
void SetTrigger(CbmTofStarTrigger2019 triggerIn)
Definition: CbmTofStarData2019.h:85
CbmTofStarSubevent2019::GetMsg
gdpbv100::Message GetMsg(UInt_t uMsgIdx) const
CbmTofStarSubevent2019::SetEndBorderEventFlag
void SetEndBorderEventFlag(Bool_t bFlagState=kTRUE)
Definition: CbmTofStarData2019.h:111
CbmTofStarTrigger2019::~CbmTofStarTrigger2019
~CbmTofStarTrigger2019()
Definition: CbmTofStarData2019.h:28
CbmTofStarSubevent2019::kulSourceIdOffset
static const uint64_t kulSourceIdOffset
Incomplete event: at least one gDPB missed the trigger signal.
Definition: CbmTofStarData2019.h:183
CbmTofStarSubevent2019::kulFlagOverlapEvt
static const uint64_t kulFlagOverlapEvt
General flag for bad event.
Definition: CbmTofStarData2019.h:174
CbmTofStarSubevent2019::kulFlagBadEvt
static const uint64_t kulFlagBadEvt
Definition: CbmTofStarData2019.h:172
gdpbv100::FullMessage
Definition: gDpbMessv100.h:362
CbmTofStarSubevent2019
Definition: CbmTofStarData2019.h:72
CbmTofStarSubevent2019::ClearSubEvent
void ClearSubEvent()
Definition: CbmTofStarData2019.cxx:126
CbmTofStarSubevent2019::GetTrigger
CbmTofStarTrigger2019 GetTrigger() const
Definition: CbmTofStarData2019.h:125
CbmTofStarSubevent2019::CbmTofStarSubevent2019
CbmTofStarSubevent2019()
Definition: CbmTofStarData2019.cxx:85
CbmTofStarSubevent2019::kuMaxNbMsgs
static const uint32_t kuMaxNbMsgs
Definition: CbmTofStarData2019.h:170
CbmTofStarTrigger2019::GetFullGdpbTs
ULong64_t GetFullGdpbTs() const
Definition: CbmTofStarData2019.h:46
CbmTofStarTrigger2019::SetStarToken
void SetStarToken(UInt_t uStarTokenIn)
Definition: CbmTofStarData2019.h:37
CbmTofStarSubevent2019::GetEventTimeSec
Double_t GetEventTimeSec() const
Definition: CbmTofStarData2019.h:149
CbmTofStarSubevent2019::GetEndBorderEventFlag
Bool_t GetEndBorderEventFlag() const
Definition: CbmTofStarData2019.h:139
CbmTofStarTrigger2019::SetStarDaqCmd
void SetStarDaqCmd(UInt_t uStarDaqCmdIn)
Definition: CbmTofStarData2019.h:38
CbmTofStarSubevent2019::~CbmTofStarSubevent2019
~CbmTofStarSubevent2019()
Definition: CbmTofStarData2019.cxx:125
CbmTofStarTrigger2019::SetFullStarTs
void SetFullStarTs(ULong64_t ulStarTsFullIn)
Definition: CbmTofStarData2019.h:34