ATLAS Offline Software
Loading...
Searching...
No Matches
MergedEventInfo Class Reference

This class provides general information about an event. More...

#include <MergedEventInfo.h>

Inheritance diagram for MergedEventInfo:
Collaboration diagram for MergedEventInfo:

Public Types

enum for event flags which indicate the subsystem

detector to which the flags belong

enum  EventFlagSubDet {
  Pixel , SCT , TRT , LAr ,
  Tile , Muon , ForwardDet , Core ,
  Background , Lumi , nDets
}
enum for event errors states
enum  EventFlagErrorState { NotSet , Warning , Error }
enum for bits in Background EventFlag word
enum  BackgroundEventFlag {
  MBTSTimeDiffHalo , MBTSTimeDiffCol , LArECTimeDiffHalo , LArECTimeDiffCol ,
  PixMultiplicityHuge , PixSPNonEmpty , SCTMultiplicityHuge , SCTSPNonEmpty ,
  CSCTimeDiffHalo , CSCTimeDiffCol , BCMTimeDiffHalo , BCMTimeDiffCol ,
  MuonTimingCol , MuonTimingCosmic , MBTSBeamVeto , BCMBeamVeto ,
  LUCIDBeamVeto , HaloMuonSegment , HaloClusterShape , HaloMuonOneSided ,
  HaloMuonTwoSided , HaloTileClusterPattern , BeamGasPixel , CosmicStandAlone ,
  CosmicStandAloneTight , CosmicCombined , CosmicCombinedTight , BkgdResvBit1 ,
  BkgdResvBit2 , BkgdResvBit3 , BkgdResvBit4 , BkgdResvBit5 ,
  NBackgroundWords
}

Public Member Functions

structors
 MergedEventInfo ()
 POOL required.
 MergedEventInfo (const EventInfo &origEvent, EventID::number_type newRunNo, EventID::number_type newEvtNo, EventID::number_type newTimeStamp=0)
 the constructor to be used
virtual ~MergedEventInfo ()
 MergedEventInfo (const MergedEventInfo &)=default
 MergedEventInfo (MergedEventInfo &&)=default
MergedEventInfooperator= (const MergedEventInfo &)=default
MergedEventInfooperator= (MergedEventInfo &&)=default
Event information accessors
EventIDevent_ID ()
 the unique identification of the event.
EventTypeevent_type ()
 the type of the event, e.g. simulation, testbeam, etc
const EventTypeevent_type () const
TriggerInfotrigger_info ()
 trigger information (ptr may be NULL)
const TriggerInfotrigger_info () const
unsigned int eventFlags (EventFlagSubDet subDet) const
 event flags for a particular sub-detector
const std::vector< unsigned int > & eventFlags () const
 All event flags.
bool isEventFlagBitSet (EventFlagSubDet subDet, unsigned char bit) const
 check for a event flag bit for a particular sub-detector
EventFlagErrorState errorState (EventFlagSubDet subDet) const
 return error state for a particular sub-detector
bool setEventFlags (EventFlagSubDet subDet, unsigned int flags)
 Set event flag for a particular sub detector - maximun size is 28 bits.
bool setEventFlagBit (EventFlagSubDet subDet, unsigned char bit, bool set=true)
 Set a bit for an event flag of a particular sub detector.
bool setErrorState (EventFlagSubDet subDet, EventFlagErrorState errorState)
 Set error state flag for a particular sub detector.
float actualInteractionsPerCrossing () const
 Access to number of interactions per crossing:
float averageInteractionsPerCrossing () const
 average interactions per crossing for all BCIDs - for out-of-time pile-up

Public Attributes

 parser
 required
 help
 args = parser.parse_args()
 output = sys.stdout
bool opened = False
 log = logging.getLogger('EventInfo')
 flags = initConfigFlags()
 Files
 cfg = MainServicesCfg(flags)
 sequenceName
 ctype
 cname
 sc = cfg.run()

Private Types

template<class T>
using owner = T

Event information accessors

EventID m_newEventID
const EventIDevent_ID () const
 the new identification of the event.
const EventIDorigEvent_ID () const
 the original identification of the event.

Event information setting

std::unique_ptr< EventIDm_event_ID
std::unique_ptr< EventTypem_event_type
std::unique_ptr< TriggerInfom_trigger_info
std::vector< unsigned int > m_event_flags {std::vector<unsigned int>(nDets, 0)}
void setTriggerInfo (owner< TriggerInfo * > pTrig)
 Add TriggerInfo to existing object.
void setTriggerInfo (std::unique_ptr< TriggerInfo > pTrig)
void setActualInteractionsPerCrossing (float interactions)
 Setting the number of interactions per crossing:
void setAverageInteractionsPerCrossing (float interactions)
 average interactions per crossing for all BCIDs - for out-of-time pile-up
enum  {
  EF_BITS = 0x0FFFFFFF , EF_ERROR_BITS = 0xF0000000 , EF_ERROR_SHIFT = 28 , ACTUAL_INTERACTS_BITS = 0x0000FFFF ,
  AVE_INTERACTS_BITS = 0xFFFF0000 , AVE_INTERACTS_SHIFT = 16
}
void setEventID (owner< EventID * > pid)
void setEventID (std::unique_ptr< EventID > pid)
void setEventType (owner< EventType * >)
void setEventType (std::unique_ptr< EventType > pType)

DataObject-like clid accessors

const CLIDclID () const
static const CLIDclassID ()

Detailed Description

This class provides general information about an event.

It extends MergedEventInfo with a list of sub-evts (the original and the bkg ones)

Definition at line 34 of file MergedEventInfo.h.

Member Typedef Documentation

◆ owner

template<class T>
using EventInfo::owner = T
privateinherited

Definition at line 54 of file EventInfo/EventInfo/EventInfo.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
privateinherited
Enumerator
EF_BITS 
EF_ERROR_BITS 
EF_ERROR_SHIFT 
ACTUAL_INTERACTS_BITS 
AVE_INTERACTS_BITS 
AVE_INTERACTS_SHIFT 

Definition at line 207 of file EventInfo/EventInfo/EventInfo.h.

207 {
208 EF_BITS = 0x0FFFFFFF,
209 EF_ERROR_BITS = 0xF0000000,
210 EF_ERROR_SHIFT = 28,
211 ACTUAL_INTERACTS_BITS = 0x0000FFFF,
212 AVE_INTERACTS_BITS = 0xFFFF0000,
213 AVE_INTERACTS_SHIFT = 16
214 };

◆ BackgroundEventFlag

enum EventInfo::BackgroundEventFlag
inherited
Enumerator
MBTSTimeDiffHalo 
MBTSTimeDiffCol 
LArECTimeDiffHalo 
LArECTimeDiffCol 
PixMultiplicityHuge 
PixSPNonEmpty 
SCTMultiplicityHuge 
SCTSPNonEmpty 
CSCTimeDiffHalo 
CSCTimeDiffCol 
BCMTimeDiffHalo 
BCMTimeDiffCol 
MuonTimingCol 
MuonTimingCosmic 
MBTSBeamVeto 
BCMBeamVeto 
LUCIDBeamVeto 
HaloMuonSegment 
HaloClusterShape 
HaloMuonOneSided 
HaloMuonTwoSided 
HaloTileClusterPattern 
BeamGasPixel 
CosmicStandAlone 
CosmicStandAloneTight 
CosmicCombined 
CosmicCombinedTight 
BkgdResvBit1 
BkgdResvBit2 
BkgdResvBit3 
BkgdResvBit4 
BkgdResvBit5 
NBackgroundWords 

Definition at line 76 of file EventInfo/EventInfo/EventInfo.h.

76 {
77 MBTSTimeDiffHalo, MBTSTimeDiffCol,
78 LArECTimeDiffHalo, LArECTimeDiffCol,
79 PixMultiplicityHuge, PixSPNonEmpty,
80 SCTMultiplicityHuge, SCTSPNonEmpty,
81 CSCTimeDiffHalo, CSCTimeDiffCol,
82 BCMTimeDiffHalo, BCMTimeDiffCol,
83 MuonTimingCol, MuonTimingCosmic,
84 MBTSBeamVeto,
85 BCMBeamVeto,
86 LUCIDBeamVeto,
87 HaloMuonSegment, HaloClusterShape,
88 HaloMuonOneSided, HaloMuonTwoSided,
89 HaloTileClusterPattern,
90 BeamGasPixel,
91 CosmicStandAlone, CosmicStandAloneTight,
92 CosmicCombined, CosmicCombinedTight,
93 BkgdResvBit1, BkgdResvBit2,
94 BkgdResvBit3, BkgdResvBit4,
95 BkgdResvBit5,
96 NBackgroundWords
97 };

◆ EventFlagErrorState

enum EventInfo::EventFlagErrorState
inherited
Enumerator
NotSet 
Warning 
Error 

Definition at line 66 of file EventInfo/EventInfo/EventInfo.h.

66 {
67 NotSet, Warning, Error
68 };

◆ EventFlagSubDet

enum EventInfo::EventFlagSubDet
inherited
Enumerator
Pixel 
SCT 
TRT 
LAr 
Tile 
Muon 
ForwardDet 
Core 
Background 
Lumi 
nDets 

Definition at line 60 of file EventInfo/EventInfo/EventInfo.h.

60 {
61 Pixel, SCT, TRT, LAr, Tile, Muon, ForwardDet, Core, Background, Lumi, nDets
62 };
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition HitInfo.h:33

Constructor & Destructor Documentation

◆ MergedEventInfo() [1/4]

MergedEventInfo::MergedEventInfo ( )

POOL required.

Definition at line 14 of file MergedEventInfo.cxx.

14 :

◆ MergedEventInfo() [2/4]

MergedEventInfo::MergedEventInfo ( const EventInfo & origEvent,
EventID::number_type newRunNo,
EventID::number_type newEvtNo,
EventID::number_type newTimeStamp = 0 )

the constructor to be used

Definition at line 17 of file MergedEventInfo.cxx.

20 :
21 EventInfo(origEvent), m_newEventID(newRunNo, newEvtNo, newTimeStamp) {}

◆ ~MergedEventInfo()

MergedEventInfo::~MergedEventInfo ( )
virtual

Definition at line 23 of file MergedEventInfo.cxx.

23{}

◆ MergedEventInfo() [3/4]

MergedEventInfo::MergedEventInfo ( const MergedEventInfo & )
default

◆ MergedEventInfo() [4/4]

MergedEventInfo::MergedEventInfo ( MergedEventInfo && )
default

Member Function Documentation

◆ actualInteractionsPerCrossing()

float EventInfo::actualInteractionsPerCrossing ( ) const
inlineinherited

Access to number of interactions per crossing:

actual interactions per crossing for the current BCID - for in-time pile-up

average interactions per crossing for the current (or actual) BCID - for in-time pile-up

Definition at line 283 of file EventInfo/EventInfo/EventInfo.h.

283 {
284 float result = -999.99f;
285
286 if (Lumi < m_event_flags.size()) {
287 unsigned int interactions = m_event_flags[Lumi];
288 result = (float) (interactions & ACTUAL_INTERACTS_BITS);
289 result *= 0.01;
290 }
291 return result;
292}

◆ averageInteractionsPerCrossing()

float EventInfo::averageInteractionsPerCrossing ( ) const
inlineinherited

average interactions per crossing for all BCIDs - for out-of-time pile-up

Definition at line 296 of file EventInfo/EventInfo/EventInfo.h.

296 {
297 float result = -999.99f;
298
299 if (Lumi < m_event_flags.size()) {
300 unsigned int interactions = m_event_flags[Lumi];
301 result = (float) ((interactions & AVE_INTERACTS_BITS) >> AVE_INTERACTS_SHIFT);
302 result *= 0.01;
303 }
304 return result;
305}

◆ classID()

const CLID & MergedEventInfo::classID ( )
inlinestatic

◆ clID()

const CLID & MergedEventInfo::clID ( ) const
inline

Definition at line 85 of file MergedEventInfo.h.

85 {
86 return classID();
87}
static const CLID & classID()

◆ errorState()

EventInfo::EventFlagErrorState EventInfo::errorState ( EventFlagSubDet subDet) const
inlineinherited

return error state for a particular sub-detector

test for error state for a particular sub-detector

Definition at line 274 of file EventInfo/EventInfo/EventInfo.h.

274 {
275 if ((unsigned) subDet < m_event_flags.size()) {
276 return(EventFlagErrorState((EF_ERROR_BITS & m_event_flags[subDet]) >> EF_ERROR_SHIFT));
277 }
278 return NotSet;
279}

◆ event_ID() [1/2]

EventID * EventInfo::event_ID ( )
inlineinherited

the unique identification of the event.

Definition at line 224 of file EventInfo/EventInfo/EventInfo.h.

224 {
225 return m_event_ID.get();
226}

◆ event_ID() [2/2]

const EventID * MergedEventInfo::event_ID ( ) const
inline

the new identification of the event.

Definition at line 75 of file MergedEventInfo.h.

75 {
76 return &m_newEventID;
77}

◆ event_type() [1/2]

EventType * EventInfo::event_type ( )
inlineinherited

the type of the event, e.g. simulation, testbeam, etc

Definition at line 234 of file EventInfo/EventInfo/EventInfo.h.

234 {
235 return m_event_type.get();
236}

◆ event_type() [2/2]

const EventType * EventInfo::event_type ( ) const
inlineinherited

Definition at line 239 of file EventInfo/EventInfo/EventInfo.h.

239 {
240 return m_event_type.get();
241}

◆ eventFlags() [1/2]

const std::vector< unsigned int > & EventInfo::eventFlags ( ) const
inlineinherited

All event flags.

Definition at line 268 of file EventInfo/EventInfo/EventInfo.h.

268 {
269 return m_event_flags;
270}

◆ eventFlags() [2/2]

unsigned int EventInfo::eventFlags ( EventFlagSubDet subDet) const
inlineinherited

event flags for a particular sub-detector

Definition at line 254 of file EventInfo/EventInfo/EventInfo.h.

254 {
255 if ((unsigned) subDet < m_event_flags.size()) return(EF_BITS & m_event_flags[subDet]);
256
257 return(0xFFFFFFFF);
258}

◆ isEventFlagBitSet()

bool EventInfo::isEventFlagBitSet ( EventFlagSubDet subDet,
unsigned char bit ) const
inlineinherited

check for a event flag bit for a particular sub-detector

Definition at line 261 of file EventInfo/EventInfo/EventInfo.h.

261 {
262 if (subDet < m_event_flags.size() && bit < EF_ERROR_SHIFT) return((1u << bit) & m_event_flags[subDet]);
263
264 return(false);
265}

◆ operator=() [1/2]

MergedEventInfo & MergedEventInfo::operator= ( const MergedEventInfo & )
default

◆ operator=() [2/2]

MergedEventInfo & MergedEventInfo::operator= ( MergedEventInfo && )
default

◆ origEvent_ID()

const EventID * MergedEventInfo::origEvent_ID ( ) const
inline

the original identification of the event.

Definition at line 80 of file MergedEventInfo.h.

80 {
81 return EventInfo::event_ID();
82}
EventID * event_ID()
the unique identification of the event.

◆ setActualInteractionsPerCrossing()

void EventInfo::setActualInteractionsPerCrossing ( float interactions)
inherited

Setting the number of interactions per crossing:

actual interactions per crossing for the current BCID - for in-time pile-up

Definition at line 156 of file EventInfo.cxx.

156 {
157 // pack interaction into 16 bits saving the precision to the 0.01
158 // level
159 unsigned int ivalue = (unsigned int) (interactions * 100.f);
160
161 if (ivalue > ACTUAL_INTERACTS_BITS) {
162 std::cout <<
163 "EventInfo::setActualInteractionsPerCrossing *** ERROR ***: trying to store too large of value: interactions/ivalue/max value: "
164 << interactions << " " << ivalue << " " << ACTUAL_INTERACTS_BITS << std::endl;
165 }
166 ivalue &= ACTUAL_INTERACTS_BITS;
167 // If event_flags has been cleared on input, reset size AND INCLUDE lumi
168 if (m_event_flags.size() < nDets) m_event_flags.resize(nDets, 0);
169 m_event_flags[Lumi] |= ivalue; // store lower 16 bits
170}

◆ setAverageInteractionsPerCrossing()

void EventInfo::setAverageInteractionsPerCrossing ( float interactions)
inherited

average interactions per crossing for all BCIDs - for out-of-time pile-up

Definition at line 173 of file EventInfo.cxx.

173 {
174 // pack interaction into 16 bits saving the precision to the 0.01
175 // level
176 unsigned int ivalue = (unsigned int) (interactions * 100.f);
177
178 if (ivalue > ACTUAL_INTERACTS_BITS) {
179 std::cout <<
180 "EventInfo::setAverageInteractionsPerCrossing *** ERROR ***: trying to store too large of value: interactions/ivalue/max value: "
181 << interactions << " " << ivalue << " " << ACTUAL_INTERACTS_BITS << std::endl;
182 }
183 ivalue = (ivalue << AVE_INTERACTS_SHIFT) & AVE_INTERACTS_BITS;
184 // If event_flags has been cleared on input, reset size AND INCLUDE lumi
185 if (m_event_flags.size() < nDets) m_event_flags.resize(nDets, 0);
186 m_event_flags[Lumi] |= ivalue; // store upper 16 bits
187}

◆ setErrorState()

bool EventInfo::setErrorState ( EventFlagSubDet subDet,
EventFlagErrorState errorState )
inherited

Set error state flag for a particular sub detector.

Returns true is successfully inserted (i.e. valid subDet).

Definition at line 139 of file EventInfo.cxx.

139 {
140 // If event_flags has been cleared on input, reset size to just
141 // before lumi
142 if (m_event_flags.size() < (unsigned int) Lumi) m_event_flags.resize(Lumi, 0);
143 // check that subdet index is in range and that we have a valid error state
144 if ((unsigned) subDet < m_event_flags.size() &&
145 (errorState == NotSet || errorState == Warning || errorState == Error)) {
146 // Combine potentially-existing flags with new error states
147 m_event_flags[subDet] =
148 (unsigned int) ((EF_BITS & m_event_flags[subDet]) | ((unsigned int) errorState << EF_ERROR_SHIFT));
149 return(true);
150 }
151 return(false);
152}

◆ setEventFlagBit()

bool EventInfo::setEventFlagBit ( EventFlagSubDet subDet,
unsigned char bit,
bool set = true )
inherited

Set a bit for an event flag of a particular sub detector.

bit range is 0 - 27. Returns true is successfully inserted (i.e. valid subDet and bit value). Use 'set = false' to unset the bit, default it true.

Definition at line 120 of file EventInfo.cxx.

120 {
121 // If event_flags has been cleared on input, reset size to just
122 // before lumi
123 if (m_event_flags.size() < (unsigned int) Lumi) m_event_flags.resize(Lumi, 0);
124 if ((unsigned) subDet < m_event_flags.size() && bit < EF_ERROR_SHIFT) {
125 if (set) {
126 m_event_flags[subDet] = (EF_ERROR_BITS & m_event_flags[subDet]) |
127 ((1u << bit) | m_event_flags[subDet]);
128 } else {
129 unsigned int mask = EF_BITS ^ (1u << bit);
130 m_event_flags[subDet] = (EF_ERROR_BITS & m_event_flags[subDet]) |
131 (mask & m_event_flags[subDet]);
132 }
133 return(true);
134 }
135 return(false);
136}
STL class.

◆ setEventFlags()

bool EventInfo::setEventFlags ( EventFlagSubDet subDet,
unsigned int flags )
inherited

Set event flag for a particular sub detector - maximun size is 28 bits.

The bits beyond this will be ignored. Returns true is successfully inserted (i.e. valid subDet).

Definition at line 107 of file EventInfo.cxx.

107 {
108 // If event_flags has been cleared on input, reset size to just
109 // before lumi
110 if (m_event_flags.size() < (unsigned int) Lumi) m_event_flags.resize(Lumi, 0);
111 if ((unsigned) subDet < m_event_flags.size()) {
112 // Combine potentially-existing error states with new flags
113 m_event_flags[subDet] = (EF_ERROR_BITS & m_event_flags[subDet]) | (EF_BITS & flags);
114 return(true);
115 }
116 return(false);
117}

◆ setEventID() [1/2]

void EventInfo::setEventID ( owner< EventID * > pid)
protectedinherited

Definition at line 82 of file EventInfo.cxx.

82 {
83 m_event_ID.reset(pid);
84}

◆ setEventID() [2/2]

void EventInfo::setEventID ( std::unique_ptr< EventID > pid)
protectedinherited

Definition at line 86 of file EventInfo.cxx.

86 {
87 m_event_ID = std::move(pid);
88}

◆ setEventType() [1/2]

void EventInfo::setEventType ( owner< EventType * > pType)
protectedinherited

Definition at line 90 of file EventInfo.cxx.

90 {
91 m_event_type.reset(pType);
92}

◆ setEventType() [2/2]

void EventInfo::setEventType ( std::unique_ptr< EventType > pType)
protectedinherited

Definition at line 94 of file EventInfo.cxx.

94 {
95 m_event_type = std::move(pType);
96}

◆ setTriggerInfo() [1/2]

void EventInfo::setTriggerInfo ( owner< TriggerInfo * > pTrig)
inherited

Add TriggerInfo to existing object.

Definition at line 98 of file EventInfo.cxx.

98 {
99 m_trigger_info.reset(pTrig);
100}

◆ setTriggerInfo() [2/2]

void EventInfo::setTriggerInfo ( std::unique_ptr< TriggerInfo > pTrig)
inherited

Definition at line 102 of file EventInfo.cxx.

102 {
103 m_trigger_info = std::move(pTrig);
104}

◆ trigger_info() [1/2]

TriggerInfo * EventInfo::trigger_info ( )
inlineinherited

trigger information (ptr may be NULL)

Definition at line 244 of file EventInfo/EventInfo/EventInfo.h.

244 {
245 return m_trigger_info.get();
246}

◆ trigger_info() [2/2]

const TriggerInfo * EventInfo::trigger_info ( ) const
inlineinherited

Definition at line 249 of file EventInfo/EventInfo/EventInfo.h.

249 {
250 return m_trigger_info.get();
251}

Member Data Documentation

◆ args

EventInfo.args = parser.parse_args()
inherited

Definition at line 77 of file EventInfo.py.

◆ cfg

EventInfo.cfg = MainServicesCfg(flags)
inherited

Definition at line 107 of file EventInfo.py.

◆ cname

EventInfo.cname
inherited

Definition at line 120 of file EventInfo.py.

◆ ctype

EventInfo.ctype
inherited

Definition at line 120 of file EventInfo.py.

◆ Files

EventInfo.Files
inherited

Definition at line 98 of file EventInfo.py.

◆ flags

EventInfo.flags = initConfigFlags()
inherited

Definition at line 97 of file EventInfo.py.

◆ help

EventInfo.help
inherited

Definition at line 71 of file EventInfo.py.

◆ log

EventInfo.log = logging.getLogger('EventInfo')
inherited

Definition at line 89 of file EventInfo.py.

◆ m_event_flags

std::vector<unsigned int> EventInfo::m_event_flags {std::vector<unsigned int>(nDets, 0)}
privateinherited

Definition at line 218 of file EventInfo/EventInfo/EventInfo.h.

218{std::vector<unsigned int>(nDets, 0)};

◆ m_event_ID

std::unique_ptr<EventID> EventInfo::m_event_ID
privateinherited

Definition at line 215 of file EventInfo/EventInfo/EventInfo.h.

◆ m_event_type

std::unique_ptr<EventType> EventInfo::m_event_type
privateinherited

Definition at line 216 of file EventInfo/EventInfo/EventInfo.h.

◆ m_newEventID

EventID MergedEventInfo::m_newEventID
private

Definition at line 69 of file MergedEventInfo.h.

◆ m_trigger_info

std::unique_ptr<TriggerInfo> EventInfo::m_trigger_info
privateinherited

Definition at line 217 of file EventInfo/EventInfo/EventInfo.h.

◆ opened

bool EventInfo.opened = False
inherited

Definition at line 82 of file EventInfo.py.

◆ output

EventInfo.output = sys.stdout
inherited

Definition at line 81 of file EventInfo.py.

◆ parser

EventInfo.parser
inherited
Initial value:
= argparse.ArgumentParser(description='Output run number (mc channel number in case of Monte Carlo),'
' event number of events in POOL file(s)')

Definition at line 68 of file EventInfo.py.

◆ required

EventInfo.required
inherited

Definition at line 70 of file EventInfo.py.

◆ sc

EventInfo.sc = cfg.run()
inherited

Definition at line 136 of file EventInfo.py.

◆ sequenceName

EventInfo.sequenceName
inherited

Definition at line 117 of file EventInfo.py.


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