SND@LHC Software
Loading...
Searching...
No Matches
SNDLHCEventHeader Class Reference

#include <SNDLHCEventHeader.h>

Inheritance diagram for SNDLHCEventHeader:
Collaboration diagram for SNDLHCEventHeader:

Public Member Functions

 SNDLHCEventHeader ()
 
 SNDLHCEventHeader (Int_t runN, uint64_t evtNumber, int64_t timestamp, uint64_t flags, int16_t bunchType)
 
virtual ~SNDLHCEventHeader ()
 
void SetRunId (uint64_t runid)
 
void SetEventTime (int64_t time)
 
void SetInputFileId (int id)
 
void SetEventNumber (int id)
 
void SetUTCtimestamp (int64_t UTCtstamp)
 
void SetFlags (uint64_t flags)
 
void SetBunchType (int16_t bunchType)
 
uint64_t GetRunId ()
 
int64_t GetEventTime ()
 
int GetInputFileId ()
 
int GetEventNumber ()
 
std::string GetTimeAsString ()
 
int64_t GetUTCtimestamp () const
 
uint16_t GetFillNumber () const
 
int GetAccMode () const
 
int GetBeamMode () const
 
uint64_t GetFlags ()
 
std::map< std::string, bool > GetFastNoiseFilters ()
 
std::map< std::string, bool > GetAdvNoiseFilters ()
 
std::vector< std::string > GetPassedFastNFCriteria ()
 
std::vector< std::string > GetPassedAdvNFCriteria ()
 
int16_t GetBunchType ()
 
bool isB1 ()
 
bool isB2 ()
 
bool isIP1 ()
 
bool isIP2 ()
 
bool isB1Only ()
 
bool isB2noB1 ()
 
bool isNoBeam ()
 
bool isNoFSData ()
 
virtual void Print (const Option_t *opt) const
 

Protected Member Functions

 SNDLHCEventHeader (const SNDLHCEventHeader &eventHeader)
 
SNDLHCEventHeader operator= (const SNDLHCEventHeader &eventHeader)
 

Protected Attributes

uint64_t fRunId
 
int64_t fEventTime
 
int fInputFileId
 
int fEventNumber
 
int64_t fUTCtimestamp
 
uint64_t fFlags
 
uint16_t fFillNumber
 
int fAccMode
 
int fBeamMode
 
int16_t fBunchType
 

Detailed Description

Event header class based on FairEventHeader

Definition at line 14 of file SNDLHCEventHeader.h.

Constructor & Destructor Documentation

◆ SNDLHCEventHeader() [1/3]

SNDLHCEventHeader::SNDLHCEventHeader ( )

Default constructor

Definition at line 29 of file SNDLHCEventHeader.cxx.

◆ SNDLHCEventHeader() [2/3]

SNDLHCEventHeader::SNDLHCEventHeader ( Int_t  runN,
uint64_t  evtNumber,
int64_t  timestamp,
uint64_t  flags,
int16_t  bunchType 
)

Constructor with arguments

Definition at line 44 of file SNDLHCEventHeader.cxx.

45{
46 SetRunId(runN);
47 SetEventTime(timestamp);
48 SetEventNumber(evtNumber);
49 SetFlags(flags);
50 SetBunchType(bunchType);
51}
void SetBunchType(int16_t bunchType)
void SetEventTime(int64_t time)
void SetRunId(uint64_t runid)
void SetFlags(uint64_t flags)
void SetEventNumber(int id)

◆ ~SNDLHCEventHeader()

SNDLHCEventHeader::~SNDLHCEventHeader ( )
virtual

Destructor

Definition at line 56 of file SNDLHCEventHeader.cxx.

56{ }

◆ SNDLHCEventHeader() [3/3]

SNDLHCEventHeader::SNDLHCEventHeader ( const SNDLHCEventHeader eventHeader)
protected

Copy constructor

Member Function Documentation

◆ GetAccMode()

int SNDLHCEventHeader::GetAccMode ( ) const
inline

Definition at line 45 of file SNDLHCEventHeader.h.

45{ return fAccMode; }

◆ GetAdvNoiseFilters()

map< string, bool > SNDLHCEventHeader::GetAdvNoiseFilters ( )

Definition at line 93 of file SNDLHCEventHeader.cxx.

94{
95 map<string, bool> AdvNoiseFilters{};
96
97 auto base = (fFlags & ADVANCED_FILTER_MASK) >> maskToShift(ADVANCED_FILTER_MASK);
98 AdvNoiseFilters["SciFi_Planes"] = base & ADVANCED_FILTER_SCIFI_PLANES;
99 AdvNoiseFilters["SciFi_Hits"] = base & ADVANCED_FILTER_SCIFI_HITS;
100 AdvNoiseFilters["US_Planes"] = base & ADVANCED_FILTER_US_PLANES;
101 AdvNoiseFilters["US_Hits"] = base & ADVANCED_FILTER_US_HITS;
102 AdvNoiseFilters["DSH_Planes"] = base & ADVANCED_FILTER_DSH_PLANES;
103 AdvNoiseFilters["DSH_Hits"] = base & ADVANCED_FILTER_DSH_HITS;
104 AdvNoiseFilters["DSV_Planes"] = base & ADVANCED_FILTER_DSV_PLANES;
105 AdvNoiseFilters["DSV_Hits"] = base & ADVANCED_FILTER_DSV_HITS;
106 AdvNoiseFilters["DS_Planes"] = base & ADVANCED_FILTER_DS_PLANES;
107 AdvNoiseFilters["VETO_Planes"] = base & ADVANCED_FILTER_VETO_PLANES;
108 AdvNoiseFilters["VETO_Hits"] = base & ADVANCED_FILTER_VETO_HITS;
109 AdvNoiseFilters["GLOBAL_Planes"] = base & ADVANCED_FILTER_GLOBAL_PLANES;
110
111 return AdvNoiseFilters;
112}
constexpr int maskToShift(uint64_t mask)

◆ GetBeamMode()

int SNDLHCEventHeader::GetBeamMode ( ) const
inline

Definition at line 46 of file SNDLHCEventHeader.h.

46{ return fBeamMode; }

◆ GetBunchType()

int16_t SNDLHCEventHeader::GetBunchType ( )
inline

Definition at line 52 of file SNDLHCEventHeader.h.

52{ return fBunchType; }

◆ GetEventNumber()

int SNDLHCEventHeader::GetEventNumber ( )
inline

Definition at line 41 of file SNDLHCEventHeader.h.

41{ return fEventNumber; }

◆ GetEventTime()

int64_t SNDLHCEventHeader::GetEventTime ( )
inline

Definition at line 39 of file SNDLHCEventHeader.h.

39{ return fEventTime; }

◆ GetFastNoiseFilters()

map< string, bool > SNDLHCEventHeader::GetFastNoiseFilters ( )

Definition at line 77 of file SNDLHCEventHeader.cxx.

78{
79 map<string, bool> FastNoiseFilters{};
80
81 auto base = (fFlags & FAST_FILTER_MASK) >> maskToShift(FAST_FILTER_MASK);
82 FastNoiseFilters["SciFi"] = base & FAST_FILTER_SCIFI;
83 FastNoiseFilters["SciFi_Total"] = base & FAST_FILTER_SCIFI_TOTAL;
84 FastNoiseFilters["US"] = base & FAST_FILTER_US;
85 FastNoiseFilters["US_Total"] = base & FAST_FILTER_US_TOTAL;
86 FastNoiseFilters["DS"] = base & FAST_FILTER_DS;
87 FastNoiseFilters["DS_Total"] = base & FAST_FILTER_DS_TOTAL;
88 FastNoiseFilters["Veto_Total"] = base & FAST_FILTER_VETO_TOTAL;
89
90 return FastNoiseFilters;
91}

◆ GetFillNumber()

uint16_t SNDLHCEventHeader::GetFillNumber ( ) const
inline

Definition at line 44 of file SNDLHCEventHeader.h.

44{ return fFillNumber; }

◆ GetFlags()

uint64_t SNDLHCEventHeader::GetFlags ( )
inline

Definition at line 47 of file SNDLHCEventHeader.h.

47{ return fFlags; }

◆ GetInputFileId()

int SNDLHCEventHeader::GetInputFileId ( )
inline

Definition at line 40 of file SNDLHCEventHeader.h.

40{ return fInputFileId; }

◆ GetPassedAdvNFCriteria()

vector< string > SNDLHCEventHeader::GetPassedAdvNFCriteria ( )

Definition at line 124 of file SNDLHCEventHeader.cxx.

125{
126 map<string, bool> AdvNoiseFilters = GetAdvNoiseFilters();
127 vector<string> passed;
128 for ( auto it : AdvNoiseFilters )
129 if ( it.second == true ) passed.push_back(it.first);
130
131 return passed;
132}
std::map< std::string, bool > GetAdvNoiseFilters()
int second
Definition hepunit.py:85

◆ GetPassedFastNFCriteria()

vector< string > SNDLHCEventHeader::GetPassedFastNFCriteria ( )

Definition at line 114 of file SNDLHCEventHeader.cxx.

115{
116 map<string, bool> FastNoiseFilters = GetFastNoiseFilters();
117 vector<string> passed;
118 for ( auto it : FastNoiseFilters )
119 if ( it.second == true ) passed.push_back(it.first);
120
121 return passed;
122}
std::map< std::string, bool > GetFastNoiseFilters()

◆ GetRunId()

uint64_t SNDLHCEventHeader::GetRunId ( )
inline

Getters

Definition at line 38 of file SNDLHCEventHeader.h.

38{ return fRunId; }

◆ GetTimeAsString()

string SNDLHCEventHeader::GetTimeAsString ( )

Definition at line 68 of file SNDLHCEventHeader.cxx.

69{
70 time_t time = fUTCtimestamp;
71 struct tm *GMTtime;
72 GMTtime = gmtime(&time);
73
74 return asctime(GMTtime);
75}

◆ GetUTCtimestamp()

int64_t SNDLHCEventHeader::GetUTCtimestamp ( ) const
inline

Definition at line 43 of file SNDLHCEventHeader.h.

43{ return fUTCtimestamp; }

◆ isB1()

bool SNDLHCEventHeader::isB1 ( )

Functions to check bunch xing type

Definition at line 149 of file SNDLHCEventHeader.cxx.

150{
151 return fBunchType%10==1;
152}

◆ isB1Only()

bool SNDLHCEventHeader::isB1Only ( )

Definition at line 154 of file SNDLHCEventHeader.cxx.

155{
156 /* b1 and not IP1 and not b2 */
157 return isB1() && !isIP1() && !isB2();
158}

◆ isB2()

bool SNDLHCEventHeader::isB2 ( )

Definition at line 144 of file SNDLHCEventHeader.cxx.

145{
146 return (fBunchType/10)%10==1;
147}

◆ isB2noB1()

bool SNDLHCEventHeader::isB2noB1 ( )

Definition at line 160 of file SNDLHCEventHeader.cxx.

161{
162 /* b2 and not b1 */
163 return isB2() && !isB1();
164}

◆ isIP1()

bool SNDLHCEventHeader::isIP1 ( )

Definition at line 139 of file SNDLHCEventHeader.cxx.

140{
141 return (fBunchType/100)%10==1;
142}

◆ isIP2()

bool SNDLHCEventHeader::isIP2 ( )

Definition at line 134 of file SNDLHCEventHeader.cxx.

135{
136 return (fBunchType/1000)%10==1;
137}

◆ isNoBeam()

bool SNDLHCEventHeader::isNoBeam ( )

Definition at line 166 of file SNDLHCEventHeader.cxx.

167{
168 /* not b1 and not b2
169 Also, its return must be False in case
170 no filling scheme data is available (fBunchType=-1) */
171 return fBunchType%10==0 && (fBunchType/10)%10==0;
172}

◆ isNoFSData()

bool SNDLHCEventHeader::isNoFSData ( )

Definition at line 174 of file SNDLHCEventHeader.cxx.

175{
176 /* no filling scheme data available (fBunchType=-1) */
177 return fBunchType%10==-1;
178}

◆ operator=()

SNDLHCEventHeader SNDLHCEventHeader::operator= ( const SNDLHCEventHeader eventHeader)
protected

◆ Print()

void SNDLHCEventHeader::Print ( const Option_t *  opt) const
virtual

Output to screen

Definition at line 180 of file SNDLHCEventHeader.cxx.

181{
182
183 cout << "-I- SNDLHCEventHeader: run number " << fRunId
184 << " event number " << fEventNumber
185 << " timestamp " << fEventTime << endl
186 << " LHC fill number " << fFillNumber
187 << " LHC beam mode " << fBeamMode << endl;
188
189}

◆ SetBunchType()

void SNDLHCEventHeader::SetBunchType ( int16_t  bunchType)
inline

Definition at line 35 of file SNDLHCEventHeader.h.

35{ fBunchType = bunchType; };

◆ SetEventNumber()

void SNDLHCEventHeader::SetEventNumber ( int  id)
inline

◆ SetEventTime()

void SNDLHCEventHeader::SetEventTime ( int64_t  time)
inline

Definition at line 30 of file SNDLHCEventHeader.h.

30{ fEventTime = time; }

◆ SetFlags()

void SNDLHCEventHeader::SetFlags ( uint64_t  flags)

Definition at line 60 of file SNDLHCEventHeader.cxx.

61{
62 fFlags = flags;
63 fFillNumber = (fFlags & FILL_NUMBER_MASK);
64 fAccMode = (fFlags & ACCELERATOR_MODE_MASK) >> maskToShift(ACCELERATOR_MODE_MASK);
65 fBeamMode = (fFlags & BEAM_MODE_MASK) >> maskToShift(BEAM_MODE_MASK);
66}

◆ SetInputFileId()

void SNDLHCEventHeader::SetInputFileId ( int  id)
inline

Definition at line 31 of file SNDLHCEventHeader.h.

31{ fInputFileId = id; }

◆ SetRunId()

void SNDLHCEventHeader::SetRunId ( uint64_t  runid)
inline

Setters

Definition at line 29 of file SNDLHCEventHeader.h.

29{ fRunId = runid; }

◆ SetUTCtimestamp()

void SNDLHCEventHeader::SetUTCtimestamp ( int64_t  UTCtstamp)
inline

Definition at line 33 of file SNDLHCEventHeader.h.

33{ fUTCtimestamp = UTCtstamp; };

Member Data Documentation

◆ fAccMode

int SNDLHCEventHeader::fAccMode
protected

Definition at line 73 of file SNDLHCEventHeader.h.

◆ fBeamMode

int SNDLHCEventHeader::fBeamMode
protected

Definition at line 74 of file SNDLHCEventHeader.h.

◆ fBunchType

int16_t SNDLHCEventHeader::fBunchType
protected

Definition at line 76 of file SNDLHCEventHeader.h.

◆ fEventNumber

int SNDLHCEventHeader::fEventNumber
protected

Definition at line 69 of file SNDLHCEventHeader.h.

◆ fEventTime

int64_t SNDLHCEventHeader::fEventTime
protected

Definition at line 67 of file SNDLHCEventHeader.h.

◆ fFillNumber

uint16_t SNDLHCEventHeader::fFillNumber
protected

Definition at line 72 of file SNDLHCEventHeader.h.

◆ fFlags

uint64_t SNDLHCEventHeader::fFlags
protected

Definition at line 71 of file SNDLHCEventHeader.h.

◆ fInputFileId

int SNDLHCEventHeader::fInputFileId
protected

Definition at line 68 of file SNDLHCEventHeader.h.

◆ fRunId

uint64_t SNDLHCEventHeader::fRunId
protected

Definition at line 66 of file SNDLHCEventHeader.h.

◆ fUTCtimestamp

int64_t SNDLHCEventHeader::fUTCtimestamp
protected

Definition at line 70 of file SNDLHCEventHeader.h.


The documentation for this class was generated from the following files: