BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnEventHeader.h
Go to the documentation of this file.
1#ifndef BMNEVENTHEADER_H
2#define BMNEVENTHEADER_H
3
4#include <map>
5#include <unordered_map>
6#include <vector>
7// ROOT
8#include "TTimeStamp.h"
9// FairRoot
10#include "FairEventHeader.h"
11// BmnRoot
12#include "BmnEnums.h"
13#include "BmnFunctionSet.h"
14#include "BmnTrigInfo.h"
15#include "BmnTrigUnion.h"
16
17using SysClock = std::chrono::system_clock;
18using SysPoint = std::chrono::time_point<SysClock>;
19using std::map;
20using std::unordered_map;
21using std::vector;
22
24{
25 private:
26 /** Event Header branch name **/
28
29 /** Event Id **/
31 /** Period Id **/
32 UInt_t fPeriodId;
33 /** Event Time in TTimeStamp **/
35 /** VSP Trigger Time in TTimeStamp **/
37 /** Event Type (payload = 0 or pedestal = 1) **/
39 /** Tripped Gems (1 bit for 1 GEM module) **/
41 /** start of new spill **/
43 /** T0 information for current event**/
47 // UInt_t fTrigUnion;
50 vector<uint32_t> fInputsVec;
51
52 unordered_map<UInt_t, Long64_t> fTimeShift;
53
54 public:
55 /** Default constructor */
57
58 /** Constructor */
60 UInt_t event_id,
61 TTimeStamp event_time,
62 BmnEventType event_type,
63 Bool_t trip,
64 BmnTrigInfo& trig_info);
65
66 /** Constructor */
68 UInt_t event_id,
69 TTimeStamp event_time,
70 BmnEventType event_type,
71 Bool_t trip,
72 BmnTrigInfo& trig_info,
73 unordered_map<UInt_t, Long64_t> time_shift);
74
75 /** Destructor */
76 virtual ~BmnEventHeader();
77
78 virtual void Register(Bool_t Persistence = kTRUE)
79 {
80 // FairRootManager::Instance()->Register(fHeaderName.Data(), "EvtHeader", this, Persistence);
81 }
82
83 void Clear();
84
85 /** Get Event Header branch name */
87
88 /** Get the event ID for this event */
90
91 /** Get the period ID for this event */
93
94 /** Get the time for this event */
97
98 /** Get the time for this event */
100
101 /** Get the type of this event */
103
104 /** Get the trip word for this event */
106
107 /** Get wether new spill is started */
109
112
113 /** Get the spill statistics */
115
116 // /** Get the trigger state */
117 // BmnTrigUnion GetTrigState()
118 // {
119 // BmnTrigUnion u;
120 // u.storage = fTrigUnion;
121 // return u;
122 // }
123
124 // UInt_t GetTrigStateWord() { return fTrigUnion; }
125
126 /** Get Input signal states, after reduction */
128
129 /** Get Input signal states, before reduction */
131
132 /** Get Input signal vector, each word is a state of input trigger states in a TRC clock time slice */
133 vector<uint32_t>& GetInputSignalsVector() { return fInputsVec; }
134
135 unordered_map<UInt_t, Long64_t>& GetTimeShift() { return fTimeShift; }
136
137 /** Set Event Header branch name */
138 void SetHeaderName(TString header_name) { fHeaderName = header_name; }
139
140 /** Set the event ID for this event
141 * @param event_id : unique event id
142 */
143 void SetEventId(UInt_t event_id) { fEventId = event_id; }
144
145 /** Set the period ID for this event
146 * @param period_id : period id
147 */
148 void SetPeriodId(UInt_t period_id) { fPeriodId = period_id; }
149
150 /** Set the time for this event in */
151 void SetEventTimeTS(TTimeStamp event_time) { fEventTimeTS = event_time; }
153
154 /** Set the time for this event in */
155 void SetVspTS(TTimeStamp event_time) { fEventVspTS = event_time; }
156
157 /** Set the type for this event
158 * @param event_type : type (0 or 1)
159 */
160 void SetEventType(BmnEventType event_type) { fEventType = event_type; }
161
162 void SetTripWord(Bool_t flag) { fTripWord = flag; }
163
164 void SetSpillStart(Bool_t flag) { fSpillStart = flag; }
165
167 {
168 fStartSignalTime = time;
169 fStartSignalWidth = width;
170 }
171
172 void SetTrigInfo(BmnTrigInfo& trig_info) { fTrigInfo.SetFrom(trig_info); }
173
174 // /** Set the trigger state */
175 // void SetTrigState(BmnTrigUnion& v) { fTrigUnion = v.storage; }
176
177 /** Set the Input signal states, after reduction */
179
180 /** Set the Input signal states, before reduction */
182
183 /** Set the Input signals vector, each word is a state of input trigger states in a TRC clock time slice */
184 void SetInputSignalsVector(vector<uint32_t> v) { fInputsVec = v; }
185
186 void SetTimeShift(unordered_map<UInt_t, Long64_t> time_shift) { fTimeShift = time_shift; }
187
189};
190
191#endif /* BMNEVENTHEADER_H */
__m128 v
Definition P4_F32vec4.h:1
bool Bool_t
unsigned int UInt_t
double Double_t
constexpr Bool_t kTRUE
#define ClassDef(name, id)
BmnEventType
Define type of event.
Definition BmnEnums.h:143
std::chrono::system_clock SysClock
std::chrono::time_point< SysClock > SysPoint
Double_t fStartSignalWidth
Bool_t fTripWord
Tripped Gems (1 bit for 1 GEM module).
vector< uint32_t > & GetInputSignalsVector()
Get Input signal vector, each word is a state of input trigger states in a TRC clock time slice.
unordered_map< UInt_t, Long64_t > & GetTimeShift()
void SetStartSignalInfo(Double_t time, Double_t width)
UInt_t GetPeriodId()
Get the period ID for this event.
BmnEventHeader(UInt_t run_id, UInt_t event_id, TTimeStamp event_time, BmnEventType event_type, Bool_t trip, BmnTrigInfo &trig_info)
Constructor.
BmnEventHeader()
Default constructor.
BmnEventHeader(UInt_t run_id, UInt_t event_id, TTimeStamp event_time, BmnEventType event_type, Bool_t trip, BmnTrigInfo &trig_info, unordered_map< UInt_t, Long64_t > time_shift)
Constructor.
SysPoint GetEventTimeTP()
TTimeStamp fEventTimeTS
Event Time in TTimeStamp.
void SetEventType(BmnEventType event_type)
Set the type for this event.
UInt_t GetInputSignalsBR()
Get Input signal states, before reduction.
Bool_t GetTripWord()
Get the trip word for this event.
unordered_map< UInt_t, Long64_t > fTimeShift
UInt_t GetEventId()
Get the event ID for this event.
Double_t GetStartSignalWidth()
UInt_t fPeriodId
Period Id.
void SetInputSignalsAR(UInt_t v)
Set the Input signal states, after reduction.
void SetTimeShift(unordered_map< UInt_t, Long64_t > time_shift)
void SetHeaderName(TString header_name)
Set Event Header branch name.
void SetSpillStart(Bool_t flag)
Double_t fStartSignalTime
T0 information for current event.
Double_t GetStartSignalTime()
BmnTrigInfo fTrigInfo
UInt_t fEventId
Event Id.
void SetInputSignalsVector(vector< uint32_t > v)
Set the Input signals vector, each word is a state of input trigger states in a TRC clock time slice.
virtual void Register(Bool_t Persistence=kTRUE)
TTimeStamp GetEventTimeTS()
Get the time for this event.
void SetVspTS(TTimeStamp event_time)
Set the time for this event in.
vector< uint32_t > fInputsVec
TString fHeaderName
Event Header branch name.
void SetEventTimeTS(TTimeStamp event_time)
Set the time for this event in.
Bool_t fSpillStart
start of new spill
Bool_t GetSpillStart()
Get wether new spill is started.
TTimeStamp fEventVspTS
VSP Trigger Time in TTimeStamp.
TTimeStamp GetVspTS()
Get the time for this event.
virtual ~BmnEventHeader()
Destructor.
TString GetHeaderName()
Get Event Header branch name.
void SetTripWord(Bool_t flag)
BmnTrigInfo & GetTrigInfo()
Get the spill statistics.
void SetTrigInfo(BmnTrigInfo &trig_info)
UInt_t GetInputSignalsAR()
Get Input signal states, after reduction.
BmnEventType fEventType
Event Type (payload = 0 or pedestal = 1).
void SetInputSignalsBR(UInt_t v)
Set the Input signal states, before reduction.
void SetPeriodId(UInt_t period_id)
Set the period ID for this event.
BmnEventType GetEventType()
Get the type of this event.
void SetEventTimeTP(SysPoint event_time)
void SetEventId(UInt_t event_id)
Set the event ID for this event.
static SysPoint TimeStamp2TP(TTimeStamp p)
static TTimeStamp TimePoint2TS(SysPoint p)
Class BmnTrigInfo Trigger counters of the current spill from U40VE card.
Definition BmnTrigInfo.h:15
Define enumerations used in tracking.
std::chrono::time_point< SysClock > SysPoint