BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
EventHeader.h
Go to the documentation of this file.
1#ifndef Event_EVENTHeader_H
2#define Event_EVENTHeader_H
3
4#include <iostream>
5#include "GaudiKernel/Kernel.h"
6#include "GaudiKernel/StreamBuffer.h"
7#include "GaudiKernel/DataObject.h"
9
10extern const CLID& CLID_EventHeader;
11
12/** class EventHeader
13* brief Essential header information of the event.
14* It can be identified by "/Event" on the TDS.
15*
16* It contains:
17* - run number
18* - event number
19**/
20
21namespace Event{
22
23class EventHeader : public DataObject {
24
25public:
26
28 : DataObject(), m_event(-1), m_run(-1), m_etsT1(0), m_etsT2(0) {}
29
30 virtual ~EventHeader() {}
31
32 /// Retrieve reference to class definition structure
33 virtual const CLID& clID() const { return EventHeader::classID(); }
34 static const CLID& classID() { return CLID_EventHeader; }
35
36 /// Retrieve event number
37 int eventNumber () const { return m_event; }
38 /// Update event number
39 void setEventNumber (int value) { m_event = value; }
40
41 /// Retrieve run number
42 int runNumber () const { return m_run; }
43 /// Update run number
44 void setRunNumber (int value) { m_run = value; }
45
46 unsigned int time() const { return m_time; }
47
48 void setTime(int value) { m_time = value; }
49
50/// Retrieve EventTag
51 unsigned int eventTag(){return m_EventTag; }
52 /// Update EventTag
53 void setEventTag(unsigned int value){ m_EventTag=value;}
54
55 /// Retrieve flags
56 unsigned int flag1() { return m_flag1; };
57 unsigned int flag2() { return m_flag2; };
58 /// Update flags
59 void setFlag1(unsigned int value) { m_flag1 = value; }
60 void setFlag2(unsigned int value) { m_flag2 = value; }
61
62 /// Retrieve ETS
63 unsigned long etsT1() { return m_etsT1&0x000000FFFFFFFFFF; }
64 unsigned long rawEtsT1() { return ((m_etsT2>>24)&0x000000FFFF000000) | (m_etsT1>>40); }
65 unsigned long etsT2() { return m_etsT2&0x000000FFFFFFFFFF; }
66 int etsFlag() { return (m_etsT2>>40)&0xFF; }
67
68 /// Update ETS
69 void setEtsT1(unsigned long value) { m_etsT1 = (m_etsT1&0xFFFFFF0000000000) | (value&0x000000FFFFFFFFFF); }
70 inline void setRawEtsT1(unsigned long value);
71 void setEtsT2(unsigned long value) { m_etsT2 = (m_etsT2&0xFFFFFF0000000000) | (value&0x000000FFFFFFFFFF); }
72 void setEtsFlag(int flag) { m_etsT2 = (m_etsT2&0xFFFF00FFFFFFFFFF) | (long(flag&0xFF)<<40); }
73
74private:
75 /// Event number
76 int m_event;
77
78 /// Run number
79 int m_run;
80
81 unsigned int m_time;
82
83 // EventTag
84 unsigned int m_EventTag ;
85
86 // flag1-HV, bit(11):has-MDC-HV, bit(8-10):MDC-HV-status
87 // bit(7):has-TOF-HV, bit(4-6):TOF-HV-status
88 // bit(3):has-MUC-HV, bit(0-2):MUC-HV-status
89 unsigned int m_flag1;
90
91 // flag2
92 unsigned int m_flag2;
93
94 // ETS time
95 unsigned long m_etsT1;
96 unsigned long m_etsT2;
97};
98
99inline void EventHeader::setRawEtsT1(unsigned long value)
100{
101 m_etsT1 = (m_etsT1&0x000000FFFFFFFFFF) | (value<<40);
102 m_etsT2 = (m_etsT2&0x0000FFFFFFFFFFFF) | ((value>>24)<<48);
103}
104
105} // namespace Event
106#endif // Event_EVENTHeader_H
107
const CLID & CLID_EventHeader
Definition: EventModel.cxx:196
void setRawEtsT1(unsigned long value)
Definition: EventHeader.h:99
void setEtsFlag(int flag)
Definition: EventHeader.h:72
int eventNumber() const
Retrieve event number.
Definition: EventHeader.h:37
unsigned long rawEtsT1()
Definition: EventHeader.h:64
void setRunNumber(int value)
Update run number.
Definition: EventHeader.h:44
virtual ~EventHeader()
Definition: EventHeader.h:30
void setTime(int value)
Definition: EventHeader.h:48
void setFlag1(unsigned int value)
Update flags.
Definition: EventHeader.h:59
int runNumber() const
Retrieve run number.
Definition: EventHeader.h:42
unsigned long etsT2()
Definition: EventHeader.h:65
unsigned int flag2()
Definition: EventHeader.h:57
unsigned int flag1()
Retrieve flags.
Definition: EventHeader.h:56
void setEventNumber(int value)
Update event number.
Definition: EventHeader.h:39
unsigned int eventTag()
Retrieve EventTag.
Definition: EventHeader.h:51
void setFlag2(unsigned int value)
Definition: EventHeader.h:60
unsigned int time() const
Definition: EventHeader.h:46
void setEtsT2(unsigned long value)
Definition: EventHeader.h:71
void setEtsT1(unsigned long value)
Update ETS.
Definition: EventHeader.h:69
unsigned long etsT1()
Retrieve ETS.
Definition: EventHeader.h:63
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: EventHeader.h:33
static const CLID & classID()
Definition: EventHeader.h:34
void setEventTag(unsigned int value)
Update EventTag.
Definition: EventHeader.h:53
Definition: Event.h:21