BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnSpillHeader.h
Go to the documentation of this file.
1
#ifndef BMNSPILLHEADER_H
2
#define BMNSPILLHEADER_H
3
// STL
4
#include <chrono>
5
#include <map>
6
#include <unordered_map>
7
// ROOT
8
#include <
TTimeStamp.h
>
9
// bmnroot
10
#include "
BmnAliases.h
"
11
#include "
BmnEnums.h
"
12
#include "
BmnFunctionSet.h
"
13
#include "
RawTypes.h
"
14
15
using
SysClock
= std::chrono::system_clock;
16
using
SysPoint
= std::chrono::time_point<SysClock>;
17
using
std::array;
18
using
std::string;
19
using
std::vector;
20
21
typedef
std::map<string, vector<std::pair<SysPoint, UInt_t>>>
ScalerNameSliceCntMap
;
22
23
class
BmnSpillHeader
:
public
TObject
24
{
25
private
:
26
/** Event Id **/
27
UInt_t
fEventIdStart
;
28
/** Event Id **/
29
UInt_t
fEventIdEnd
;
30
/** Event count **/
31
UInt_t
fEventCnt
;
32
/** Period Id **/
33
UInt_t
fPeriodId;
34
/** Spill Id **/
35
UInt_t
fSpillId
;
36
// SysPoint fStartTS;
37
// SysPoint fStopTS;
38
// SysPoint fFirstEventTS;
39
// SysPoint fLastEventTS;
40
TTimeStamp
fStartTS
;
41
TTimeStamp
fStopTS
;
42
TTimeStamp
fFirstEventTS
;
43
TTimeStamp
fLastEventTS
;
44
// ScalerNameSliceCntMap fScalers; // name -> count for each time slice
45
MapString2Cnt
fScalersTotal
;
// name -> total spill MSC count
46
// vector<uint64_t> fScalersVec;
47
MapString2Cnt
fEventTrigCount
;
// name -> total spill trigger (TRC bit inside events)
48
49
// Name2SerCh fScalersMap;
50
array<UInt_t, kT0_BIN_BLOCK_WORDS>
fRawT0Cntrs
;
51
52
UInt_t
fBeamTrigger
;
53
UInt_t
fBTnBusy
;
54
UInt_t
fL0
;
55
UInt_t
fTrigProtection
;
56
UInt_t
fBC1
;
57
UInt_t
fBC2
;
58
UInt_t
fBC3
;
59
UInt_t
fAccepted
;
60
UInt_t
fCand
;
61
UInt_t
fBP
;
62
UInt_t
fAP
;
63
UInt_t
fRj
;
64
UInt_t
fAll
;
65
UInt_t
fAvail
;
66
67
public
:
68
/** Constructor */
69
BmnSpillHeader
(
UInt_t
period_id = 0,
UInt_t
event_id = 0);
70
71
/** Destructor */
72
virtual
~BmnSpillHeader
();
73
74
void
Clear
();
75
76
/** Get the the first event ID for the spill */
77
UInt_t
GetFirstEventId
() {
return
fEventIdStart
; }
78
/** Get the the last event ID for the spill */
79
UInt_t
GetLastEventId
() {
return
fEventIdEnd
; }
80
/** Get the event count in the spill */
81
UInt_t
GetNEvents
() {
return
fEventCnt
; }
82
83
/** Get the period ID */
84
UInt_t
GetPeriodId
() {
return
fPeriodId
; }
85
86
/** Get the spill ID */
87
UInt_t
GetSpillId
() {
return
fSpillId
; }
88
89
// ScalerNameSliceCntMap& ScalersVec() { return fScalers; }
90
91
// vector<uint64_t>& ScalersVec() { return fScalersVec; }
92
93
MapString2Cnt
&
Scalers
() {
return
fScalersTotal
; }
94
95
MapString2Cnt
&
EventTriggerCnt
() {
return
fEventTrigCount
; }
96
97
array<UInt_t, kT0_BIN_BLOCK_WORDS>&
RawT0Counters
() {
return
fRawT0Cntrs
; }
98
99
/** Get the start TS */
100
const
SysPoint
GetStartTime
() {
return
BmnFunctionSet::TimeStamp2TP
(
fStartTS
); }
101
102
/** Get the stop TS */
103
const
SysPoint
GetStopTime
() {
return
BmnFunctionSet::TimeStamp2TP
(
fStopTS
); }
104
105
/** Get the start TS */
106
const
TTimeStamp
&
GetStartTS
() {
return
fStartTS
; }
107
// const TTimeStamp GetStartTS() { return BmnFunctionSet::TimePoint2TS(fStartTS); }
108
109
/** Get the stop TS */
110
const
TTimeStamp
&
GetStopTS
() {
return
fStopTS
; }
111
// const TTimeStamp GetStopTS() { return BmnFunctionSet::TimePoint2TS(fStopTS); }
112
113
/** Get time the first event in the spill */
114
const
SysPoint
GetFirstEventTime
() {
return
BmnFunctionSet::TimeStamp2TP
(
fFirstEventTS
); }
115
116
/** Get time the last event in the spill */
117
const
SysPoint
GetLastEventTime
() {
return
BmnFunctionSet::TimeStamp2TP
(
fLastEventTS
); }
118
119
/** Get time the first event in the spill */
120
const
TTimeStamp
&
GetFirstEventTS
() {
return
fFirstEventTS
; }
121
// const TTimeStamp GetFirstEventTS() { return BmnFunctionSet::TimePoint2TS(fFirstEventTS); }
122
123
/** Get time the last event in the spill */
124
const
TTimeStamp
&
GetLastEventTS
() {
return
fLastEventTS
; }
125
// const TTimeStamp GetLastEventTS() { return BmnFunctionSet::TimePoint2TS(fLastEventTS); }
126
127
void
SetCand
(
UInt_t
_v) {
fCand
= _v; }
128
129
UInt_t
GetCand
() {
return
fCand
; }
130
131
void
SetAccepted
(
UInt_t
_v) {
fAccepted
= _v; }
132
133
UInt_t
GetAccepted
() {
return
fAccepted
; }
134
135
void
SetBefo
(
UInt_t
_v) {
fBP
= _v; }
136
137
UInt_t
GetBefo
() {
return
fBP
; }
138
139
void
SetAfter
(
UInt_t
_v) {
fAP
= _v; }
140
141
UInt_t
GetAfter
() {
return
fAP
; }
142
143
void
SetRjct
(
UInt_t
_v) {
fRj
= _v; }
144
145
UInt_t
GetRjct
() {
return
fRj
; }
146
147
void
SetAll
(
UInt_t
_v) {
fAll
= _v; }
148
149
UInt_t
GetAll
() {
return
fAll
; }
150
151
void
SetAvail
(
UInt_t
_v) {
fAvail
= _v; }
152
153
UInt_t
GetAvail
() {
return
fAvail
; }
154
155
void
SetBT
(
UInt_t
_v) {
fBeamTrigger
= _v; }
156
157
UInt_t
GetBT
() {
return
fBeamTrigger
; }
158
159
void
SetBTnBusy
(
UInt_t
_v) {
fBTnBusy
= _v; }
160
161
UInt_t
GetBTnBusy
() {
return
fBTnBusy
; }
162
163
void
SetL0
(
UInt_t
_v) {
fL0
= _v; }
164
165
UInt_t
GetL0
() {
return
fL0
; }
166
167
void
SetProt
(
UInt_t
_v) {
fTrigProtection
= _v; }
168
169
UInt_t
GetProt
() {
return
fTrigProtection
; }
170
171
void
SetBC1
(
UInt_t
_v) {
fBC1
= _v; }
172
173
UInt_t
GetBC1
() {
return
fBC1
; }
174
175
void
SetBC2
(
UInt_t
_v) {
fBC2
= _v; }
176
177
UInt_t
GetBC2
() {
return
fBC2
; }
178
179
void
SetBC3
(
UInt_t
_v) {
fBC3
= _v; }
180
181
UInt_t
GetBC3
() {
return
fBC3
; }
182
183
/** Set the first event ID for the spill
184
* @param event_id : unique event id
185
*/
186
void
SetFirstEventId
(
UInt_t
event_id) {
fEventIdStart
= event_id; }
187
188
/** Set the last event ID for the spill
189
* @param event_id : unique event id
190
*/
191
void
SetLastEventId
(
UInt_t
event_id) {
fEventIdEnd
= event_id; }
192
193
/** Set the event count in the spill */
194
void
SetNEvents
(
UInt_t
events) {
fEventCnt
= events; }
195
196
/** Set the period ID
197
* @param period_id : unique period id
198
*/
199
void
SetPeriodId
(
UInt_t
period_id) {
fPeriodId
= period_id; }
200
201
/** Set the spill ID
202
* @param spill : spill id
203
*/
204
void
SetSpillId
(
UInt_t
spill) {
fSpillId
= spill; }
205
206
/** Set the time for spill start */
207
void
SetStartTime
(
const
SysPoint
& time) {
fStartTS
=
BmnFunctionSet::TimePoint2TS
(time); }
208
209
/** Set the time for spill stop */
210
void
SetStopTime
(
const
SysPoint
& time) {
fStopTS
=
BmnFunctionSet::TimePoint2TS
(time); }
211
212
/** Set the time for spill start */
213
void
SetStartTS
(
const
TTimeStamp
& ts) {
fStartTS
= ts; }
214
// void SetStartTS(TTimeStamp ts) { fStartTS = BmnFunctionSet::TimeStamp2TP(ts); }
215
216
/** Set the time for spill stop */
217
void
SetStopTS
(
const
TTimeStamp
& ts) {
fStopTS
= ts; }
218
// void SetStopTS(TTimeStamp ts) { fStopTS = BmnFunctionSet::TimeStamp2TP(ts); }
219
220
/** Set the time for the first event in the spill */
221
void
SetFirstEventTime
(
const
SysPoint
& time) {
fFirstEventTS
=
BmnFunctionSet::TimePoint2TS
(time); }
222
223
/** Set the time for the last event in the spill */
224
void
SetLastEventTime
(
const
SysPoint
& time) {
fLastEventTS
=
BmnFunctionSet::TimePoint2TS
(time); }
225
226
/** Set the time for the first event in the spill */
227
void
SetFirstEventTS
(
const
TTimeStamp
& ts) {
fFirstEventTS
= ts; }
228
// void SetFirstEventTS(TTimeStamp ts) { fFirstEventTS = BmnFunctionSet::TimeStamp2TP(ts); }
229
230
/** Set the time for the last event in the spill */
231
void
SetLastEventTS
(
const
TTimeStamp
& ts) {
fLastEventTS
= ts; }
232
// void SetLastEventTS(TTimeStamp ts) { fLastEventTS = BmnFunctionSet::TimeStamp2TP(ts); }
233
234
ClassDef
(
BmnSpillHeader
, 12)
235
};
236
237
#endif
/* BMNSPILLHEADER_H */
UInt_t
unsigned int UInt_t
ClassDef
#define ClassDef(name, id)
TTimeStamp.h
SysClock
std::chrono::system_clock SysClock
Definition
BmnFunctionSet.h:17
SysPoint
std::chrono::time_point< SysClock > SysPoint
Definition
BmnFunctionSet.h:18
MapString2Cnt
std::unordered_map< std::string, uint64_t > MapString2Cnt
Definition
BmnAliases.h:11
ScalerNameSliceCntMap
std::map< string, vector< std::pair< SysPoint, UInt_t > > > ScalerNameSliceCntMap
Definition
BmnSpillHeader.h:21
BmnFunctionSet::TimeStamp2TP
static SysPoint TimeStamp2TP(TTimeStamp p)
Definition
BmnFunctionSet.cxx:606
BmnFunctionSet::TimePoint2TS
static TTimeStamp TimePoint2TS(SysPoint p)
Definition
BmnFunctionSet.cxx:599
BmnSpillHeader
Definition
BmnSpillHeader.h:24
BmnSpillHeader::fLastEventTS
TTimeStamp fLastEventTS
Definition
BmnSpillHeader.h:43
BmnSpillHeader::fAccepted
UInt_t fAccepted
Definition
BmnSpillHeader.h:59
BmnSpillHeader::fStartTS
TTimeStamp fStartTS
Definition
BmnSpillHeader.h:40
BmnSpillHeader::fFirstEventTS
TTimeStamp fFirstEventTS
Definition
BmnSpillHeader.h:42
BmnSpillHeader::GetFirstEventTime
const SysPoint GetFirstEventTime()
Get time the first event in the spill.
Definition
BmnSpillHeader.h:114
BmnSpillHeader::GetFirstEventId
UInt_t GetFirstEventId()
Get the the first event ID for the spill.
Definition
BmnSpillHeader.h:77
BmnSpillHeader::SetSpillId
void SetSpillId(UInt_t spill)
Set the spill ID.
Definition
BmnSpillHeader.h:204
BmnSpillHeader::fScalersTotal
MapString2Cnt fScalersTotal
Definition
BmnSpillHeader.h:45
BmnSpillHeader::fAll
UInt_t fAll
Definition
BmnSpillHeader.h:64
BmnSpillHeader::fEventIdEnd
UInt_t fEventIdEnd
Event Id.
Definition
BmnSpillHeader.h:29
BmnSpillHeader::GetAll
UInt_t GetAll()
Definition
BmnSpillHeader.h:149
BmnSpillHeader::fBP
UInt_t fBP
Definition
BmnSpillHeader.h:61
BmnSpillHeader::BmnSpillHeader
BmnSpillHeader(UInt_t period_id=0, UInt_t event_id=0)
Constructor.
BmnSpillHeader::GetFirstEventTS
const TTimeStamp & GetFirstEventTS()
Get time the first event in the spill.
Definition
BmnSpillHeader.h:120
BmnSpillHeader::SetBC3
void SetBC3(UInt_t _v)
Definition
BmnSpillHeader.h:179
BmnSpillHeader::~BmnSpillHeader
virtual ~BmnSpillHeader()
Destructor.
BmnSpillHeader::SetLastEventTS
void SetLastEventTS(const TTimeStamp &ts)
Set the time for the last event in the spill.
Definition
BmnSpillHeader.h:231
BmnSpillHeader::GetBC1
UInt_t GetBC1()
Definition
BmnSpillHeader.h:173
BmnSpillHeader::SetStartTS
void SetStartTS(const TTimeStamp &ts)
Set the time for spill start.
Definition
BmnSpillHeader.h:213
BmnSpillHeader::fSpillId
UInt_t fSpillId
Spill Id.
Definition
BmnSpillHeader.h:35
BmnSpillHeader::GetStartTS
const TTimeStamp & GetStartTS()
Get the start TS.
Definition
BmnSpillHeader.h:106
BmnSpillHeader::SetStartTime
void SetStartTime(const SysPoint &time)
Set the time for spill start.
Definition
BmnSpillHeader.h:207
BmnSpillHeader::GetBTnBusy
UInt_t GetBTnBusy()
Definition
BmnSpillHeader.h:161
BmnSpillHeader::SetBC2
void SetBC2(UInt_t _v)
Definition
BmnSpillHeader.h:175
BmnSpillHeader::GetBefo
UInt_t GetBefo()
Definition
BmnSpillHeader.h:137
BmnSpillHeader::SetBT
void SetBT(UInt_t _v)
Definition
BmnSpillHeader.h:155
BmnSpillHeader::SetLastEventId
void SetLastEventId(UInt_t event_id)
Set the last event ID for the spill.
Definition
BmnSpillHeader.h:191
BmnSpillHeader::GetLastEventTS
const TTimeStamp & GetLastEventTS()
Get time the last event in the spill.
Definition
BmnSpillHeader.h:124
BmnSpillHeader::GetAfter
UInt_t GetAfter()
Definition
BmnSpillHeader.h:141
BmnSpillHeader::GetLastEventId
UInt_t GetLastEventId()
Get the the last event ID for the spill.
Definition
BmnSpillHeader.h:79
BmnSpillHeader::GetNEvents
UInt_t GetNEvents()
Get the event count in the spill.
Definition
BmnSpillHeader.h:81
BmnSpillHeader::fAvail
UInt_t fAvail
Definition
BmnSpillHeader.h:65
BmnSpillHeader::Clear
void Clear()
BmnSpillHeader::GetStopTime
const SysPoint GetStopTime()
Get the stop TS.
Definition
BmnSpillHeader.h:103
BmnSpillHeader::GetSpillId
UInt_t GetSpillId()
Get the spill ID.
Definition
BmnSpillHeader.h:87
BmnSpillHeader::SetAccepted
void SetAccepted(UInt_t _v)
Definition
BmnSpillHeader.h:131
BmnSpillHeader::fBTnBusy
UInt_t fBTnBusy
Definition
BmnSpillHeader.h:53
BmnSpillHeader::SetBC1
void SetBC1(UInt_t _v)
Definition
BmnSpillHeader.h:171
BmnSpillHeader::SetBTnBusy
void SetBTnBusy(UInt_t _v)
Definition
BmnSpillHeader.h:159
BmnSpillHeader::EventTriggerCnt
MapString2Cnt & EventTriggerCnt()
Definition
BmnSpillHeader.h:95
BmnSpillHeader::GetLastEventTime
const SysPoint GetLastEventTime()
Get time the last event in the spill.
Definition
BmnSpillHeader.h:117
BmnSpillHeader::GetPeriodId
UInt_t GetPeriodId()
Get the period ID.
Definition
BmnSpillHeader.h:84
BmnSpillHeader::fEventTrigCount
MapString2Cnt fEventTrigCount
Definition
BmnSpillHeader.h:47
BmnSpillHeader::SetStopTS
void SetStopTS(const TTimeStamp &ts)
Set the time for spill stop.
Definition
BmnSpillHeader.h:217
BmnSpillHeader::SetAvail
void SetAvail(UInt_t _v)
Definition
BmnSpillHeader.h:151
BmnSpillHeader::fCand
UInt_t fCand
Definition
BmnSpillHeader.h:60
BmnSpillHeader::SetProt
void SetProt(UInt_t _v)
Definition
BmnSpillHeader.h:167
BmnSpillHeader::GetStartTime
const SysPoint GetStartTime()
Get the start TS.
Definition
BmnSpillHeader.h:100
BmnSpillHeader::SetAll
void SetAll(UInt_t _v)
Definition
BmnSpillHeader.h:147
BmnSpillHeader::fBC1
UInt_t fBC1
Definition
BmnSpillHeader.h:56
BmnSpillHeader::fRj
UInt_t fRj
Definition
BmnSpillHeader.h:63
BmnSpillHeader::GetL0
UInt_t GetL0()
Definition
BmnSpillHeader.h:165
BmnSpillHeader::fBC2
UInt_t fBC2
Definition
BmnSpillHeader.h:57
BmnSpillHeader::fL0
UInt_t fL0
Definition
BmnSpillHeader.h:54
BmnSpillHeader::fEventCnt
UInt_t fEventCnt
Event count.
Definition
BmnSpillHeader.h:31
BmnSpillHeader::SetLastEventTime
void SetLastEventTime(const SysPoint &time)
Set the time for the last event in the spill.
Definition
BmnSpillHeader.h:224
BmnSpillHeader::Scalers
MapString2Cnt & Scalers()
Definition
BmnSpillHeader.h:93
BmnSpillHeader::GetAvail
UInt_t GetAvail()
Definition
BmnSpillHeader.h:153
BmnSpillHeader::SetFirstEventId
void SetFirstEventId(UInt_t event_id)
Set the first event ID for the spill.
Definition
BmnSpillHeader.h:186
BmnSpillHeader::RawT0Counters
array< UInt_t, kT0_BIN_BLOCK_WORDS > & RawT0Counters()
Definition
BmnSpillHeader.h:97
BmnSpillHeader::GetBC3
UInt_t GetBC3()
Definition
BmnSpillHeader.h:181
BmnSpillHeader::GetCand
UInt_t GetCand()
Definition
BmnSpillHeader.h:129
BmnSpillHeader::fEventIdStart
UInt_t fEventIdStart
Event Id.
Definition
BmnSpillHeader.h:27
BmnSpillHeader::SetBefo
void SetBefo(UInt_t _v)
Definition
BmnSpillHeader.h:135
BmnSpillHeader::fStopTS
TTimeStamp fStopTS
Definition
BmnSpillHeader.h:41
BmnSpillHeader::GetStopTS
const TTimeStamp & GetStopTS()
Get the stop TS.
Definition
BmnSpillHeader.h:110
BmnSpillHeader::SetL0
void SetL0(UInt_t _v)
Definition
BmnSpillHeader.h:163
BmnSpillHeader::GetRjct
UInt_t GetRjct()
Definition
BmnSpillHeader.h:145
BmnSpillHeader::SetCand
void SetCand(UInt_t _v)
Definition
BmnSpillHeader.h:127
BmnSpillHeader::SetRjct
void SetRjct(UInt_t _v)
Definition
BmnSpillHeader.h:143
BmnSpillHeader::SetNEvents
void SetNEvents(UInt_t events)
Set the event count in the spill.
Definition
BmnSpillHeader.h:194
BmnSpillHeader::GetAccepted
UInt_t GetAccepted()
Definition
BmnSpillHeader.h:133
BmnSpillHeader::GetBC2
UInt_t GetBC2()
Definition
BmnSpillHeader.h:177
BmnSpillHeader::GetBT
UInt_t GetBT()
Definition
BmnSpillHeader.h:157
BmnSpillHeader::fAP
UInt_t fAP
Definition
BmnSpillHeader.h:62
BmnSpillHeader::fBeamTrigger
UInt_t fBeamTrigger
Definition
BmnSpillHeader.h:52
BmnSpillHeader::GetProt
UInt_t GetProt()
Definition
BmnSpillHeader.h:169
BmnSpillHeader::SetPeriodId
void SetPeriodId(UInt_t period_id)
Set the period ID.
Definition
BmnSpillHeader.h:199
BmnSpillHeader::fPeriodId
UInt_t fPeriodId
Period Id.
Definition
BmnSpillHeader.h:33
BmnSpillHeader::fRawT0Cntrs
array< UInt_t, kT0_BIN_BLOCK_WORDS > fRawT0Cntrs
Definition
BmnSpillHeader.h:50
BmnSpillHeader::SetFirstEventTS
void SetFirstEventTS(const TTimeStamp &ts)
Set the time for the first event in the spill.
Definition
BmnSpillHeader.h:227
BmnSpillHeader::fBC3
UInt_t fBC3
Definition
BmnSpillHeader.h:58
BmnSpillHeader::SetStopTime
void SetStopTime(const SysPoint &time)
Set the time for spill stop.
Definition
BmnSpillHeader.h:210
BmnSpillHeader::SetAfter
void SetAfter(UInt_t _v)
Definition
BmnSpillHeader.h:139
BmnSpillHeader::SetFirstEventTime
void SetFirstEventTime(const SysPoint &time)
Set the time for the first event in the spill.
Definition
BmnSpillHeader.h:221
BmnSpillHeader::fTrigProtection
UInt_t fTrigProtection
Definition
BmnSpillHeader.h:55
TObject
TTimeStamp
BmnAliases.h
BmnEnums.h
Define enumerations used in tracking.
BmnFunctionSet.h
SysPoint
std::chrono::time_point< SysClock > SysPoint
Definition
BmnSpillHeader.h:16
RawTypes.h
install
include
BmnSpillHeader.h
Generated on
for BmnRoot by
1.17.0