ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::EventInfo_v1 Class Reference

Class describing the basic event information. More...

#include <EventInfo_v1.h>

Inheritance diagram for xAOD::EventInfo_v1:
Collaboration diagram for xAOD::EventInfo_v1:

Classes

class  StreamTag
 Class describing a stream tag on the event. More...
struct  PileUpMixtureID
 Unique pile-up mixture identifier definition. More...
class  SubEvent
 Class describing the properties of one pileup sub-event. More...

Public Member Functions

 EventInfo_v1 ()
 Default constructor.
 EventInfo_v1 (const EventInfo_v1 &parent)
 Copy constructor.
EventInfo_v1 & operator= (const EventInfo_v1 &rhs)
 Assignment operator.
void toPersistent ()
 Prepare the object for writing.
void toTransient ()
 Cleanse the object after being read in.
std::string toString () const
 Convert to a string representation.
Basic event information
uint32_t runNumber () const
 The current event's run number.
void setRunNumber (uint32_t value)
 Set the current event's run number.
uint64_t eventNumber () const
 The current event's event number.
void setEventNumber (uint64_t value)
 Set the current event's event number.
uint32_t lumiBlock () const
 The current event's luminosity block number.
void setLumiBlock (uint32_t value)
 Set the current event's luminosity block number.
uint32_t timeStamp () const
 POSIX time in seconds from 1970. January 1st.
void setTimeStamp (uint32_t value)
 Set the POSIX time of the event.
uint32_t timeStampNSOffset () const
 Nanosecond time offset wrt. the time stamp.
void setTimeStampNSOffset (uint32_t value)
 Set the nanosecond offset wrt. the time stamp.
uint32_t bcid () const
 The bunch crossing ID of the event.
void setBCID (uint32_t value)
 Set the bunch crossing ID of the event.
uint32_t detectorMask0 () const
 Bit field indicating which TTC zones are present in the event.
void setDetectorMask0 (uint32_t value)
 Set the bit field indicating with TTC timezones were present.
uint32_t detectorMask1 () const
 Bit field indicating which TTC zones are present in the event.
void setDetectorMask1 (uint32_t value)
 Set the bit field indicating with TTC timezones were present.
uint32_t detectorMask2 () const
 Bit field indicating which TTC zones are present in the event.
void setDetectorMask2 (uint32_t value)
 Set the bit field indicating with TTC timezones were present.
uint32_t detectorMask3 () const
 Bit field indicating which TTC zones are present in the event.
void setDetectorMask3 (uint32_t value)
 Set the bit field indicating with TTC timezones were present.
uint64_t detectorMask () const
 Bit field indicating which TTC zones are present in the event.
void setDetectorMask (uint32_t mask0, uint32_t mask1)
 Set the bit fields indicating with TTC timezones were present.
void setDetectorMask (uint64_t mask)
 Set the bit fields indicating with TTC timezones were present.
uint64_t detectorMaskExt () const
 Bit field indicating which TTC zones are present in the event.
void setDetectorMaskExt (uint32_t mask2, uint32_t mask3)
 Set the bit fields indicating with TTC timezones were present.
void setDetectorMaskExt (uint64_t mask)
 Set the bit fields indicating with TTC timezones were present.
Trigger related information
uint32_t statusElement () const
 Trigger status element.
void setStatusElement (uint32_t value)
 Set the trigger status element.
uint32_t extendedLevel1ID () const
 The extended Level-1 identifier.
void setExtendedLevel1ID (uint32_t value)
 Set the extended Level-1 identifier.
uint16_t level1TriggerType () const
 The Level-1 trigger type.
void setLevel1TriggerType (uint16_t value)
 Set the Level-1 trigger type.
const std::vector< StreamTag > & streamTags () const
 Get the streams that the event was put in.
void setStreamTags (const std::vector< StreamTag > &value)
 Set the streams that the event was put in.
Beam spot information
float beamPosX () const
 X coordinate of the beam spot position.
float beamPosY () const
 Y coordinate of the beam spot position.
float beamPosZ () const
 Z coordinate of the beam spot position.
void setBeamPos (float x, float y, float z)
 Set the beam spot position.
float beamPosSigmaX () const
 The width of the beam spot in the X direction.
float beamPosSigmaY () const
 The width of the beam spot in the Y direction.
float beamPosSigmaZ () const
 The length of the beam spot in the Z direction.
void setBeamPosSigma (float x, float y, float z)
 Set the size of the beam spot.
float beamPosSigmaXY () const
 The beam spot shape's X-Y correlation.
void setBeamPosSigmaXY (float value)
 Set the beam spot shape's X-Y correlation.
float beamTiltXZ () const
 The beam's tilt in radians in XZ.
void setBeamTiltXZ (float value)
 Set the beam's tilt in radians in XZ.
float beamTiltYZ () const
 The beam's tilt in radians in YZ.
void setBeamTiltYZ (float value)
 Set the beam's tilt in radians in YZ.
uint32_t beamStatus () const
 The beam spot's status word.
void setBeamStatus (uint32_t value)
 Set the beam spot's status word.
float beamSpotWeight () const
 Weight for beam spot size reweighting.
bool hasBeamSpotWeight () const
 Check if weight for beam spot size reweighting exists.
void setBeamSpotWeight (float value)
 Set weight for beam spot size reweighting.
Functions used by pile-up digitisation
StoreGateSvc *evtStore ATLAS_NOT_CONST_THREAD_SAFE () const
 Get the pointer to the event store associated with this event.
void setEvtStore (StoreGateSvc *svc)
 Set the pointer to the event store associated with this event.

Private Member Functions

std::vector< EventInfo_v1::SubEvent > makeSubEvents () const

Private Attributes

CxxUtils::CachedValue< std::vector< StreamTag > > m_streamTags
 Cached stream tag objects.
CxxUtils::CachedValue< std::vector< SubEvent > > m_subEvents
 Cached sub-event objects.
StoreGateSvc * m_evtStore
 Transient pointer to the StoreGateSvc instance associated with the event (Needed for pile-up digitisation).

Event type information

enum  EventType { IS_SIMULATION = 1 , IS_TESTBEAM = 2 , IS_CALIBRATION = 4 }
 Event type codes that can be set/checked in the bitmask. More...
typedef std::vector< std::pair< std::string, std::string > > DetDescrTags_t
 Type of the detector description tags.
const DetDescrTags_t & detDescrTags () const
 The detector description tags.
void setDetDescrTags (const DetDescrTags_t &value)
 Set the detector description tags.
uint32_t mcChannelNumber () const
 The MC generator's channel number.
void setMCChannelNumber (uint32_t value)
 Set the MC generator's channel number.
uint64_t mcEventNumber () const
 The MC generator's event number.
void setMCEventNumber (uint64_t value)
 Set the MC generator's event number.
const std::vector< float > & mcEventWeights () const
 The weights of all the MC events used in the simulation.
void setMCEventWeights (const std::vector< float > &value)
 Set the weights of all the MC events used in the simulation.
float mcEventWeight (size_t i=0) const
 The weight of one specific MC event used in the simulation.
uint32_t eventTypeBitmask () const
 The event type bitmask.
void setEventTypeBitmask (uint32_t value)
 Set the event type bitmask.
bool eventType (EventType type) const
 Check for one particular bitmask value.

Pileup information

enum  PileUpType {
  Unknown = 99 , Signal = 0 , MinimumBias = 1 , Cavern = 2 ,
  HaloGas = 3 , HighPtMinimumBias = 4 , ZeroBias = 5 , PileUp_NTYPES
}
 Enumerator describing the types of pileup events. More...
float actualInteractionsPerCrossing () const
 Average interactions per crossing for the current BCID - for in-time pile-up.
void setActualInteractionsPerCrossing (float value)
 Set average interactions per crossing for the current BCID.
float averageInteractionsPerCrossing () const
 Average interactions per crossing for all BCIDs - for out-of-time pile-up.
void setAverageInteractionsPerCrossing (float value)
 Set average interactions per crossing for all BCIDs.
PileUpMixtureID pileUpMixtureID () const
 Unique pile-up mixture identifier.
void setPileUpMixtureID (const PileUpMixtureID &value)
 Set unique pile-up mixture identifier.
uint64_t pileUpMixtureIDLowBits () const
 Unique pile-up mixture identifier low bits.
void setPileUpMixtureIDLowBits (uint64_t value)
 Set unique pile-up mixture identifier low bits.
uint64_t pileUpMixtureIDHighBits () const
 Unique pile-up mixture identifier high bits.
void setPileUpMixtureIDHighBits (uint64_t value)
 Set unique pile-up mixture identifier high bits.
const std::vector< SubEvent > & subEvents () const
 Get the pileup events that were used in the simulation.
void setSubEvents (const std::vector< SubEvent > &value)
 Set the pileup events that were used in the simulation.
void addSubEvent (const SubEvent &subEvent)
 Add one sub-event to the existing list.
void clearSubEvents ()
 Clear all the currently held sub-events.
static const std::string & PileUpType2Name (PileUpType typ)
 Convert PileUpType enum value to string.
static PileUpType PileUpInt2Type (unsigned short typ)
 Convert int to PileUpType enum value.

Detector information

enum  EventFlagSubDet {
  Pixel = 0 , SCT = 1 , TRT = 2 , LAr = 3 ,
  Tile = 4 , Muon = 5 , ForwardDet = 6 , Core = 7 ,
  Background = 8 , Lumi = 9 , nDets = 10
}
 Sub-detector types for which we store event-level flags. More...
enum  EventFlagErrorState { NotSet = 0 , Warning = 1 , Error = 2 }
 States that a given sub-detector could be in. More...
enum  BackgroundEventFlag {
  MBTSTimeDiffHalo = 0 , MBTSTimeDiffCol = 1 , LArECTimeDiffHalo = 2 , LArECTimeDiffCol = 3 ,
  PixMultiplicityHuge = 4 , PixSPNonEmpty = 5 , SCTMultiplicityHuge = 6 , SCTSPNonEmpty = 7 ,
  CSCTimeDiffHalo = 8 , CSCTimeDiffCol = 9 , BCMTimeDiffHalo = 10 , BCMTimeDiffCol = 11 ,
  MuonTimingCol = 12 , MuonTimingCosmic = 13 , MBTSBeamVeto = 14 , BCMBeamVeto = 15 ,
  LUCIDBeamVeto = 16 , HaloMuonSegment = 17 , HaloClusterShape = 18 , HaloMuonOneSided = 19 ,
  HaloMuonTwoSided = 20 , HaloTileClusterPattern = 21 , BeamGasPixel = 22 , CosmicStandAlone = 23 ,
  CosmicStandAloneTight = 24 , CosmicCombined = 25 , CosmicCombinedTight = 26 , BkgdResvBit1 = 27 ,
  BkgdResvBit2 = 28 , BkgdResvBit3 = 29 , BkgdResvBit4 = 30 , BkgdResvBit5 = 31 ,
  NBackgroundWords = 32
}
 Enum for bits in Background EventFlag word. More...
uint32_t eventFlags (EventFlagSubDet subDet) const
 Get the event flags for a particular sub-detector.
bool isEventFlagBitSet (EventFlagSubDet subDet, size_t bit) const
 Check one particular bit of one particular sub-detector.
bool setEventFlags (EventFlagSubDet subDet, uint32_t flags)
 Set the event flags for a particular sub-detector.
bool setEventFlagBit (EventFlagSubDet subDet, size_t bit) const
 Set one particular bit of one particular sub-detector.
bool resetEventFlagBit (EventFlagSubDet subDet, size_t bit)
 Reset one particular bit of one particular sub-detector.
EventFlagErrorState errorState (EventFlagSubDet subDet) const
 Get the error state for a particular sub-detector.
bool setErrorState (EventFlagSubDet subDet, EventFlagErrorState state)
 Set the error state for a particular sub-detector.
bool updateEventFlagBit (const EventFlagSubDet subDet, const size_t bit) const
 Change detector flags with update semantics.
bool updateEventFlags (const EventFlagSubDet subDet, const uint32_t flags_in) const
 Turn on a set of event flags for one particular sub-detector.
bool updateErrorState (const EventFlagSubDet subDet, const EventFlagErrorState state) const
 Update the error state for one particular sub-detector.

Detailed Description

Class describing the basic event information.

This is a replacement for the offline EventInfo class, to be used in xAOD files. It stores the same information as its parent, but in much simpler format. Practically in the same format in which we store(d) event information in D3PDs.

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 43 of file EventInfo_v1.h.

Member Typedef Documentation

◆ DetDescrTags_t

typedef std::vector< std::pair< std::string, std::string > > xAOD::EventInfo_v1::DetDescrTags_t

Type of the detector description tags.

Definition at line 124 of file EventInfo_v1.h.

Member Enumeration Documentation

◆ BackgroundEventFlag

Enum for bits in Background EventFlag word.

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 353 of file EventInfo_v1.h.

353 {
355 MBTSTimeDiffCol = 1,
359 PixSPNonEmpty = 5,
361 SCTSPNonEmpty = 7,
362 CSCTimeDiffHalo = 8,
363 CSCTimeDiffCol = 9,
364 BCMTimeDiffHalo = 10,
365 BCMTimeDiffCol = 11,
366 MuonTimingCol = 12,
367 MuonTimingCosmic = 13,
368 MBTSBeamVeto = 14,
369 BCMBeamVeto = 15,
370 LUCIDBeamVeto = 16,
371 HaloMuonSegment = 17,
372 HaloClusterShape = 18,
373 HaloMuonOneSided = 19,
374 HaloMuonTwoSided = 20,
376 BeamGasPixel = 22,
377 CosmicStandAlone = 23,
379 CosmicCombined = 25,
381 BkgdResvBit1 = 27,
382 BkgdResvBit2 = 28,
383 BkgdResvBit3 = 29,
384 BkgdResvBit4 = 30,
385 BkgdResvBit5 = 31,
387 };

◆ EventFlagErrorState

States that a given sub-detector could be in.

Enumerator
NotSet 

The flag was not set to anything.

Warning 

The sub-detector issued a warning.

Error 

The sub-detector issued an error.

Definition at line 346 of file EventInfo_v1.h.

346 {
347 NotSet = 0,
348 Warning = 1,
349 Error = 2
350 };
@ Warning
The sub-detector issued a warning.
@ NotSet
The flag was not set to anything.
@ Error
The sub-detector issued an error.

◆ EventFlagSubDet

Sub-detector types for which we store event-level flags.

Enumerator
Pixel 

The pixel tracker.

SCT 

The SCT.

TRT 

The TRT.

LAr 

The LAr calorimeter.

Tile 

The Tile calorimeter.

Muon 

The muon spectrometer.

ForwardDet 

The forward detectors.

Core 

Core flags describing the event.

Background 

The beam background detectors.

Lumi 

The luminosity detectors.

nDets 

Number of sub-detector type in this enumeration.

Definition at line 331 of file EventInfo_v1.h.

331 {
332 Pixel = 0,
333 SCT = 1,
334 TRT = 2,
335 LAr = 3,
336 Tile = 4,
337 Muon = 5,
338 ForwardDet = 6,
339 Core = 7,
340 Background = 8,
341 Lumi = 9,
342 nDets = 10
343 };
@ Background
The beam background detectors.
@ Tile
The Tile calorimeter.
@ Muon
The muon spectrometer.
@ Core
Core flags describing the event.
@ Pixel
The pixel tracker.
@ ForwardDet
The forward detectors.
@ LAr
The LAr calorimeter.
@ Lumi
The luminosity detectors.
@ nDets
Number of sub-detector type in this enumeration.

◆ EventType

Event type codes that can be set/checked in the bitmask.

Enumerator
IS_SIMULATION 

true: simulation, false: data

IS_TESTBEAM 

true: testbeam, false: full detector

IS_CALIBRATION 

true: calibration, false: physics

Definition at line 149 of file EventInfo_v1.h.

149 {
151 IS_SIMULATION = 1,
153 IS_TESTBEAM = 2,
156 };
@ IS_CALIBRATION
true: calibration, false: physics
@ IS_SIMULATION
true: simulation, false: data
@ IS_TESTBEAM
true: testbeam, false: full detector

◆ PileUpType

Enumerator describing the types of pileup events.

Enumerator
Unknown 

Type not known/specified.

Signal 

The signal event.

MinimumBias 

(Low pT) Minimum bias pileup event

Cavern 

Cavern background pileup event.

HaloGas 

Halo-gas non-collision background.

HighPtMinimumBias 

High pT Minimum bias pileup event.

ZeroBias 

Zero bias pileup event.

PileUp_NTYPES 

Definition at line 264 of file EventInfo_v1.h.

264 {
265 Unknown = 99,
266 Signal = 0,
267 MinimumBias = 1,
268 Cavern = 2,
269 HaloGas = 3,
271 ZeroBias = 5,
273 }; // enum PileUpType
@ HaloGas
Halo-gas non-collision background.
@ HighPtMinimumBias
High pT Minimum bias pileup event.
@ MinimumBias
(Low pT) Minimum bias pileup event
@ ZeroBias
Zero bias pileup event.
@ Signal
The signal event.
@ Cavern
Cavern background pileup event.
@ Unknown
Type not known/specified.

Constructor & Destructor Documentation

◆ EventInfo_v1() [1/2]

xAOD::EventInfo_v1::EventInfo_v1 ( )

Default constructor.

Definition at line 53 of file EventInfo_v1.cxx.

55 m_subEvents(), m_evtStore( nullptr ) {
56
57 }
CxxUtils::CachedValue< std::vector< StreamTag > > m_streamTags
Cached stream tag objects.
StoreGateSvc * m_evtStore
Transient pointer to the StoreGateSvc instance associated with the event (Needed for pile-up digitisa...
CxxUtils::CachedValue< std::vector< SubEvent > > m_subEvents
Cached sub-event objects.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.

◆ EventInfo_v1() [2/2]

xAOD::EventInfo_v1::EventInfo_v1 ( const EventInfo_v1 & parent)

Copy constructor.

Definition at line 59 of file EventInfo_v1.cxx.

60 : SG::AuxElement(parent), m_streamTags(),
62 m_evtStore( parent.m_evtStore ) {
63
64 makePrivateStore( parent );
65 }
void makePrivateStore()
Create a new (empty) private store for this object.

Member Function Documentation

◆ actualInteractionsPerCrossing()

float xAOD::EventInfo_v1::actualInteractionsPerCrossing ( ) const

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

Definition at line 348 of file EventInfo_v1.cxx.

348 {
349
350 // If the value is not available, then return 0.0, but allow users to
351 // find out about this issue.
354 return 0.0f;
355 }
356 return accActualInteractionsPerCrossing( *this );
357 }
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
void pileupUnsetHook()
Function that would be possible to use to debug what client is trying to access pileup values from an...
static const SG::Accessor< float > accActualInteractionsPerCrossing("actualInteractionsPerCrossing")
Accessor for "actualInteractionsPerCrossing".

◆ addSubEvent()

void xAOD::EventInfo_v1::addSubEvent ( const SubEvent & subEvent)

Add one sub-event to the existing list.

Definition at line 603 of file EventInfo_v1.cxx.

603 {
604
605 // First, make sure that the persistent and transient variables are in
606 // sync:
607 subEvents();
608
609 // Now, add the new sub-event:
610 std::vector<SubEvent> subEvents = *m_subEvents.ptr();
611 subEvents.push_back( subEvent );
612 m_subEvents.store (std::move (subEvents));
613 timeAcc( *this ).push_back( subEvent.time() );
614 indexAcc( *this ).push_back( subEvent.index() );
615 typeAcc( *this ).push_back( static_cast< uint16_t >( subEvent.type() ) );
616 linkAcc( *this ).push_back( subEvent.link() );
617
618 return;
619 }
uint16_t index() const
Get the index of the sub-event.
const ElementLink< EventInfoContainer_v1 > & link() const
Get a link to the EventInfo object describing the pileup event.
int16_t time() const
Get the time wrt. the signal event (which has time() == 0).
PileUpType type() const
Get the type of the pileup event.
const std::vector< SubEvent > & subEvents() const
Get the pileup events that were used in the simulation.
static const SG::Accessor< std::vector< uint16_t > > typeAcc("subEventType")
static const SG::Accessor< std::vector< uint16_t > > indexAcc("subEventIndex")
static const SG::Accessor< std::vector< ElementLink< EventInfoContainer_v1 > > > linkAcc("subEventLink")
static const SG::Accessor< std::vector< int16_t > > timeAcc("subEventTime")
setWord1 uint16_t

◆ ATLAS_NOT_CONST_THREAD_SAFE()

StoreGateSvc *evtStore xAOD::EventInfo_v1::ATLAS_NOT_CONST_THREAD_SAFE ( ) const

Get the pointer to the event store associated with this event.

◆ averageInteractionsPerCrossing()

float xAOD::EventInfo_v1::averageInteractionsPerCrossing ( ) const

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

Definition at line 365 of file EventInfo_v1.cxx.

365 {
366
367 // If the value is not available, then return 0.0, but allow users to
368 // find out about this issue.
371 return 0.0f;
372 }
373 return accAverageInteractionsPerCrossing( *this );
374 }
static const SG::Accessor< float > accAverageInteractionsPerCrossing("averageInteractionsPerCrossing")
Accessor for "averageInteractionsPerCrossing".

◆ bcid()

uint32_t xAOD::EventInfo_v1::bcid ( ) const

The bunch crossing ID of the event.

◆ beamPosSigmaX()

float xAOD::EventInfo_v1::beamPosSigmaX ( ) const

The width of the beam spot in the X direction.

◆ beamPosSigmaXY()

float xAOD::EventInfo_v1::beamPosSigmaXY ( ) const

The beam spot shape's X-Y correlation.

◆ beamPosSigmaY()

float xAOD::EventInfo_v1::beamPosSigmaY ( ) const

The width of the beam spot in the Y direction.

◆ beamPosSigmaZ()

float xAOD::EventInfo_v1::beamPosSigmaZ ( ) const

The length of the beam spot in the Z direction.

◆ beamPosX()

float xAOD::EventInfo_v1::beamPosX ( ) const

X coordinate of the beam spot position.

◆ beamPosY()

float xAOD::EventInfo_v1::beamPosY ( ) const

Y coordinate of the beam spot position.

◆ beamPosZ()

float xAOD::EventInfo_v1::beamPosZ ( ) const

Z coordinate of the beam spot position.

◆ beamSpotWeight()

float xAOD::EventInfo_v1::beamSpotWeight ( ) const

Weight for beam spot size reweighting.

Definition at line 944 of file EventInfo_v1.cxx.

944 {
945 // If the value is not available, then return 1.0
946 if( ! hasBeamSpotWeight() ) return 1.0f;
947 return accBeamSpotWeight( *this );
948 }
bool hasBeamSpotWeight() const
Check if weight for beam spot size reweighting exists.
setBeamTiltXZ static setBeamStatus const SG::Accessor< float > accBeamSpotWeight("beamSpotWeight")
Accessor for "BeamSpotWeight".

◆ beamStatus()

uint32_t xAOD::EventInfo_v1::beamStatus ( ) const

The beam spot's status word.

◆ beamTiltXZ()

float xAOD::EventInfo_v1::beamTiltXZ ( ) const

The beam's tilt in radians in XZ.

◆ beamTiltYZ()

float xAOD::EventInfo_v1::beamTiltYZ ( ) const

The beam's tilt in radians in YZ.

◆ clearSubEvents()

void xAOD::EventInfo_v1::clearSubEvents ( )

Clear all the currently held sub-events.

Definition at line 621 of file EventInfo_v1.cxx.

621 {
622
623 // Clear both the transient and persistent variables:
624 m_subEvents.store (std::vector<SubEvent>());
625 m_subEvents.reset();
626 timeAcc( *this ).clear(); indexAcc( *this ).clear();
627 typeAcc( *this ).clear(); linkAcc( *this ).clear();
628
629 return;
630 }

◆ detDescrTags()

const DetDescrTags_t & xAOD::EventInfo_v1::detDescrTags ( ) const

The detector description tags.

◆ detectorMask()

setEventNumber setTimeStamp setBCID setDetectorMask1 setDetectorMask3 uint64_t xAOD::EventInfo_v1::detectorMask ( ) const

Bit field indicating which TTC zones are present in the event.

Definition at line 114 of file EventInfo_v1.cxx.

114 {
115
116 return ( ( static_cast< uint64_t >( detectorMask1() ) << 32 ) |
117 detectorMask0() );
118 }
uint32_t detectorMask1() const
Bit field indicating which TTC zones are present in the event.
uint32_t detectorMask0() const
Bit field indicating which TTC zones are present in the event.

◆ detectorMask0()

uint32_t xAOD::EventInfo_v1::detectorMask0 ( ) const

Bit field indicating which TTC zones are present in the event.

◆ detectorMask1()

uint32_t xAOD::EventInfo_v1::detectorMask1 ( ) const

Bit field indicating which TTC zones are present in the event.

◆ detectorMask2()

uint32_t xAOD::EventInfo_v1::detectorMask2 ( ) const

Bit field indicating which TTC zones are present in the event.

◆ detectorMask3()

uint32_t xAOD::EventInfo_v1::detectorMask3 ( ) const

Bit field indicating which TTC zones are present in the event.

◆ detectorMaskExt()

uint64_t xAOD::EventInfo_v1::detectorMaskExt ( ) const

Bit field indicating which TTC zones are present in the event.

Definition at line 135 of file EventInfo_v1.cxx.

135 {
136
137 return ( ( static_cast< uint64_t >( detectorMask3() ) << 32 ) |
138 detectorMask2() );
139 }
uint32_t detectorMask3() const
Bit field indicating which TTC zones are present in the event.
uint32_t detectorMask2() const
Bit field indicating which TTC zones are present in the event.

◆ errorState()

EventInfo_v1::EventFlagErrorState xAOD::EventInfo_v1::errorState ( EventFlagSubDet subDet) const

Get the error state for a particular sub-detector.

Definition at line 791 of file EventInfo_v1.cxx.

791 {
792
793 // Get the value in one go:
794 return static_cast< EventFlagErrorState >(
795 ( ( *eventFlagsConstAccessorsV1( subDet ) )( *this ) >> EF_ERROR_SHIFT ) &
796 0xF );
797 }
EventFlagErrorState
States that a given sub-detector could be in.
static const uint32_t EF_ERROR_SHIFT
Shift used to store the sub-detector error states.
const SG::AtomicConstAccessor< uint32_t > * eventFlagsConstAccessorsV1(EventInfo_v1::EventFlagSubDet subDet)
Helper function for accessing event flag variables, for const access.

◆ eventFlags()

uint32_t xAOD::EventInfo_v1::eventFlags ( EventFlagSubDet subDet) const

Get the event flags for a particular sub-detector.

Definition at line 671 of file EventInfo_v1.cxx.

671 {
672
673 return ( ( *eventFlagsConstAccessorsV1( subDet ) )( *this ) &
674 EF_BITS );
675 }
static const uint32_t EF_BITS
Bits that store the "user defined" detector flags.

◆ eventNumber()

uint64_t xAOD::EventInfo_v1::eventNumber ( ) const

The current event's event number.

◆ eventType()

bool xAOD::EventInfo_v1::eventType ( EventType type) const

Check for one particular bitmask value.

◆ eventTypeBitmask()

uint32_t xAOD::EventInfo_v1::eventTypeBitmask ( ) const

The event type bitmask.

◆ extendedLevel1ID()

uint32_t xAOD::EventInfo_v1::extendedLevel1ID ( ) const

The extended Level-1 identifier.

◆ hasBeamSpotWeight()

bool xAOD::EventInfo_v1::hasBeamSpotWeight ( ) const

Check if weight for beam spot size reweighting exists.

Definition at line 940 of file EventInfo_v1.cxx.

940 {
941 return accBeamSpotWeight.isAvailable( *this );
942 }

◆ isEventFlagBitSet()

bool xAOD::EventInfo_v1::isEventFlagBitSet ( EventFlagSubDet subDet,
size_t bit ) const

Check one particular bit of one particular sub-detector.

Definition at line 677 of file EventInfo_v1.cxx.

678 {
679
680 // A little sanity check:
681 if( bit >= EF_ERROR_SHIFT ) {
682 throw std::runtime_error( "EventInfo_v1::isEventFlagBitSet: Asked for "
683 "non-existent bit" );
684 }
685
686 // Get the value of the flags:
687 uint32_t value = ( *eventFlagsConstAccessorsV1( subDet ) )( *this );
688
689 // Dig out the bit we are asking for:
690 return ( ( value >> bit ) & 0x1 );
691 }
setEventNumber uint32_t

◆ level1TriggerType()

uint16_t xAOD::EventInfo_v1::level1TriggerType ( ) const

The Level-1 trigger type.

◆ lumiBlock()

uint32_t xAOD::EventInfo_v1::lumiBlock ( ) const

The current event's luminosity block number.

◆ makeSubEvents()

std::vector< EventInfo_v1::SubEvent > xAOD::EventInfo_v1::makeSubEvents ( ) const
private

Definition at line 491 of file EventInfo_v1.cxx.

492 {
493 std::vector< SubEvent > subEvents;
494
495 // Check if any of the information is available:
496 if( ( ! timeAcc.isAvailable( *this ) ) &&
497 ( ! indexAcc.isAvailable( *this ) ) &&
498 ( ! linkAcc.isAvailable( *this ) ) &&
499 ( ! typeAcc.isAvailable( *this ) ) )
500 {
501 // If not, return right away:
502 return subEvents;
503 }
504 // A little sanity check:
505 size_t size = 0;
506 if( timeAcc.isAvailable( *this ) ) {
507 size = timeAcc( *this ).size();
508 } else if( indexAcc.isAvailable( *this ) ) {
509 size = indexAcc( *this ).size();
510 } else if( linkAcc.isAvailable( *this ) ) {
511 size = linkAcc( *this ).size();
512 } else if( typeAcc.isAvailable( *this ) ) {
513 size = typeAcc( *this ).size();
514 } else {
515 std::println( std::cerr, "xAOD::EventInfo_v1 ERROR Logic error in subEvents()" );
516 return subEvents;
517 }
518 if( ( timeAcc.isAvailable( *this ) &&
519 ( size != timeAcc( *this ).size() ) ) ||
520 ( indexAcc.isAvailable( *this ) &&
521 ( size != indexAcc( *this ).size() ) ) ||
522 ( linkAcc.isAvailable( *this ) &&
523 ( size != linkAcc( *this ).size() ) ) ||
524 ( typeAcc.isAvailable( *this ) &&
525 ( size != typeAcc( *this ).size() ) ) ) {
526 std::println( std::cerr, "xAOD::EventInfo_v1 ERROR Data corruption found in "
527 "the sub-event information" );
528 std::println( std::cerr, "subEventTime = {}",
529 ( timeAcc.isAvailable( *this ) ? timeAcc( *this ) :
530 std::vector< int16_t >() ) );
531 std::println( std::cerr, "subEventIndex = {}",
532 ( indexAcc.isAvailable( *this ) ? indexAcc( *this ) :
533 std::vector< uint16_t >() ) );
534
536 {
537 return std::format ("{}:{}", el.dataID(), el.index());
538 };
539 const std::vector< ElementLink< EventInfoContainer_v1 > >& links =
540 linkAcc.isAvailable( *this ) ? linkAcc( *this ) :
541 std::vector< ElementLink< EventInfoContainer_v1 > >();
542 auto linksform = links | std::views::transform (format_el);
543
544 std::println( std::cerr, "subEventLink = {}", linksform );
545 std::println( std::cerr,"subEventType = {}",
546 ( typeAcc.isAvailable( *this ) ? typeAcc( *this ) :
547 std::vector< uint16_t >() ) );
548 return subEvents;
549 }
550 // Fill up the cache:
551 for( size_t i = 0; i < size; ++i ) {
552 const int16_t time =
553 timeAcc.isAvailable( *this ) ? timeAcc( *this )[ i ] : 0;
554 const uint16_t index =
555 indexAcc.isAvailable( *this ) ? indexAcc( *this )[ i ] : 0;
557 linkAcc.isAvailable( *this ) ? linkAcc( *this )[ i ] :
559 const PileUpType type =
560 ( typeAcc.isAvailable( *this ) ?
561 static_cast< PileUpType >( typeAcc( *this )[ i ] ) :
562 Unknown );
563 subEvents.emplace_back( time, index, type, link );
564 }
565
566 return subEvents;
567 }
size_t size() const
Number of registered mappings.
PileUpType
Enumerator describing the types of pileup events.
time(flags, cells_name, *args, **kw)
str index
Definition DeMoScan.py:362
pointer & link(pointer p) const
Return a reference to the link for an element.
DataVector< EventInfo_v1 > EventInfoContainer_v1
Container type for event info objects.
setScaleOne setStatusOne setSaturated int16_t

◆ mcChannelNumber()

uint32_t xAOD::EventInfo_v1::mcChannelNumber ( ) const

The MC generator's channel number.

◆ mcEventNumber()

uint64_t xAOD::EventInfo_v1::mcEventNumber ( ) const

The MC generator's event number.

◆ mcEventWeight()

setMCChannelNumber setMCEventWeights float xAOD::EventInfo_v1::mcEventWeight ( size_t i = 0) const

The weight of one specific MC event used in the simulation.

Definition at line 174 of file EventInfo_v1.cxx.

174 {
175
176 // Throw an exception when asked for an impossible index:
177 return mcEventWeights().at( i );
178 }
const std::vector< float > & mcEventWeights() const
The weights of all the MC events used in the simulation.

◆ mcEventWeights()

const std::vector< float > & xAOD::EventInfo_v1::mcEventWeights ( ) const

The weights of all the MC events used in the simulation.

◆ operator=()

EventInfo_v1 & xAOD::EventInfo_v1::operator= ( const EventInfo_v1 & rhs)

Assignment operator.

Definition at line 67 of file EventInfo_v1.cxx.

67 {
68
69 if (&rhs != this) {
70 // Clear out the caches:
71 m_streamTags.store (std::vector< StreamTag >());
72 m_streamTags.reset();
73 m_subEvents.store (std::vector< SubEvent >());
74 m_subEvents.reset();
75
76 // Copy the event store pointer:
77 m_evtStore = rhs.m_evtStore;
78
79 // Copy the auxiliary variables:
80 SG::AuxElement::operator=( rhs );
81 }
82
83 // Return this object:
84 return *this;
85 }

◆ PileUpInt2Type()

EventInfo_v1::PileUpType xAOD::EventInfo_v1::PileUpInt2Type ( unsigned short typ)
static

Convert int to PileUpType enum value.

Definition at line 646 of file EventInfo_v1.cxx.

647 {
648 static const PileUpType typEnum[PileUp_NTYPES+1] = {
649 Unknown /*99*/, Signal /*0*/, MinimumBias /*1*/, Cavern /*2*/, HaloGas /*3*/, ZeroBias /*4*/
650 };
651 int t = (typ==99)? 0: (int)typ+1;
652 assert( t <= PileUp_NTYPES );
653 return typEnum[t];
654 }
setRawEt setRawPhi int

◆ pileUpMixtureID()

setPileUpMixtureIDHighBits EventInfo_v1::PileUpMixtureID xAOD::EventInfo_v1::pileUpMixtureID ( ) const

Unique pile-up mixture identifier.

Definition at line 389 of file EventInfo_v1.cxx.

389 {
390
391 PileUpMixtureID id{};
392
393 // We need to check if the values are actually stored
396 id.lowBits = pileUpMixtureIDLowBits();
397 id.highBits = pileUpMixtureIDHighBits();
398 }
399
400 return id;
401
402 }
uint64_t pileUpMixtureIDLowBits() const
Unique pile-up mixture identifier low bits.
uint64_t pileUpMixtureIDHighBits() const
Unique pile-up mixture identifier high bits.
XAOD_AUXDATA_DEPRECATED bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if an aux variable is available for reading.
static const SG::Accessor< uint64_t > accHigh("pileUpMixtureIDHighBits")
static const SG::Accessor< uint64_t > accLow("pileUpMixtureIDLowBits")
Unique pile-up mixture identifier definition.

◆ pileUpMixtureIDHighBits()

uint64_t xAOD::EventInfo_v1::pileUpMixtureIDHighBits ( ) const

Unique pile-up mixture identifier high bits.

◆ pileUpMixtureIDLowBits()

uint64_t xAOD::EventInfo_v1::pileUpMixtureIDLowBits ( ) const

Unique pile-up mixture identifier low bits.

◆ PileUpType2Name()

const std::string & xAOD::EventInfo_v1::PileUpType2Name ( PileUpType typ)
static

Convert PileUpType enum value to string.

Definition at line 632 of file EventInfo_v1.cxx.

633 {
634 static const std::string typNam[PileUp_NTYPES+1] = {
635 "Unknown" /*99*/,
636 "Signal" /*0*/,
637 "MinimumBias" /*1*/,
638 "Cavern" /*2*/,
639 "HaloGas"/*3*/,
640 "ZeroBias"/*4*/ };
641 int t = (typ==Unknown)? 0: (int)typ+1;
642 assert( t <= PileUp_NTYPES );
643 return typNam[t];
644 }

◆ resetEventFlagBit()

bool xAOD::EventInfo_v1::resetEventFlagBit ( EventFlagSubDet subDet,
size_t bit )

Reset one particular bit of one particular sub-detector.

Definition at line 746 of file EventInfo_v1.cxx.

747 {
748 // Get the accessor:
749 const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
750 if( ! acc ) {
751 return false;
752 }
753
754 // Check if the bit makes sense:
755 if( bit >= EF_ERROR_SHIFT ) {
756 return false;
757 }
758
759 // Set the new value:
760 ( *acc )( *this ) &= ~( 1u << bit );
761
762 // Tell the user that we were successful:
763 return true;
764 }
constexpr unsigned int bit(int n)
const SG::AtomicDecorator< uint32_t > * eventFlagsAccessorsV1(EventInfo_v1::EventFlagSubDet subDet)
Helper function for accessing event flag variables.
static const SG::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.

◆ runNumber()

uint32_t xAOD::EventInfo_v1::runNumber ( ) const

The current event's run number.

◆ setActualInteractionsPerCrossing()

void xAOD::EventInfo_v1::setActualInteractionsPerCrossing ( float value)

Set average interactions per crossing for the current BCID.

Definition at line 359 of file EventInfo_v1.cxx.

359 {
360
362 return;
363 }

◆ setAverageInteractionsPerCrossing()

void xAOD::EventInfo_v1::setAverageInteractionsPerCrossing ( float value)

Set average interactions per crossing for all BCIDs.

Definition at line 376 of file EventInfo_v1.cxx.

376 {
377
379 return;
380 }

◆ setBCID()

void xAOD::EventInfo_v1::setBCID ( uint32_t value)

Set the bunch crossing ID of the event.

◆ setBeamPos()

void xAOD::EventInfo_v1::setBeamPos ( float x,
float y,
float z )

Set the beam spot position.

Definition at line 890 of file EventInfo_v1.cxx.

890 {
891
892 // The accessor objects:
893 static const Accessor< float > accX( "beamPosX" );
894 static const Accessor< float > accY( "beamPosY" );
895 static const Accessor< float > accZ( "beamPosZ" );
896
897 // Set the variables:
898 accX( *this ) = x;
899 accY( *this ) = y;
900 accZ( *this ) = z;
901
902 return;
903 }
#define y
#define x
#define z

◆ setBeamPosSigma()

void xAOD::EventInfo_v1::setBeamPosSigma ( float x,
float y,
float z )

Set the size of the beam spot.

Definition at line 909 of file EventInfo_v1.cxx.

909 {
910
911 // The accessor objects:
912 static const Accessor< float > accX( "beamPosSigmaX" );
913 static const Accessor< float > accY( "beamPosSigmaY" );
914 static const Accessor< float > accZ( "beamPosSigmaZ" );
915
916 // Set the variables:
917 accX( *this ) = x;
918 accY( *this ) = y;
919 accZ( *this ) = z;
920
921 return;
922 }

◆ setBeamPosSigmaXY()

void xAOD::EventInfo_v1::setBeamPosSigmaXY ( float value)

Set the beam spot shape's X-Y correlation.

◆ setBeamSpotWeight()

void xAOD::EventInfo_v1::setBeamSpotWeight ( float value)

Set weight for beam spot size reweighting.

Definition at line 950 of file EventInfo_v1.cxx.

950 {
951 accBeamSpotWeight( *this ) = value;
952 return;
953 }

◆ setBeamStatus()

void xAOD::EventInfo_v1::setBeamStatus ( uint32_t value)

Set the beam spot's status word.

◆ setBeamTiltXZ()

void xAOD::EventInfo_v1::setBeamTiltXZ ( float value)

Set the beam's tilt in radians in XZ.

◆ setBeamTiltYZ()

void xAOD::EventInfo_v1::setBeamTiltYZ ( float value)

Set the beam's tilt in radians in YZ.

◆ setDetDescrTags()

void xAOD::EventInfo_v1::setDetDescrTags ( const DetDescrTags_t & value)

Set the detector description tags.

◆ setDetectorMask() [1/2]

void xAOD::EventInfo_v1::setDetectorMask ( uint32_t mask0,
uint32_t mask1 )

Set the bit fields indicating with TTC timezones were present.

Definition at line 120 of file EventInfo_v1.cxx.

120 {
121
122 setDetectorMask0( mask0 );
123 setDetectorMask1( mask1 );
124 return;
125 }
void setDetectorMask1(uint32_t value)
Set the bit field indicating with TTC timezones were present.
void setDetectorMask0(uint32_t value)
Set the bit field indicating with TTC timezones were present.

◆ setDetectorMask() [2/2]

void xAOD::EventInfo_v1::setDetectorMask ( uint64_t mask)

Set the bit fields indicating with TTC timezones were present.

Definition at line 127 of file EventInfo_v1.cxx.

127 {
128
129 setDetectorMask0( static_cast< uint32_t >( mask & 0xffffffff ) );
130 setDetectorMask1( static_cast< uint32_t >( ( mask >> 32 ) &
131 0xffffffff ) );
132 return;
133 }

◆ setDetectorMask0()

void xAOD::EventInfo_v1::setDetectorMask0 ( uint32_t value)

Set the bit field indicating with TTC timezones were present.

◆ setDetectorMask1()

void xAOD::EventInfo_v1::setDetectorMask1 ( uint32_t value)

Set the bit field indicating with TTC timezones were present.

◆ setDetectorMask2()

void xAOD::EventInfo_v1::setDetectorMask2 ( uint32_t value)

Set the bit field indicating with TTC timezones were present.

◆ setDetectorMask3()

void xAOD::EventInfo_v1::setDetectorMask3 ( uint32_t value)

Set the bit field indicating with TTC timezones were present.

◆ setDetectorMaskExt() [1/2]

void xAOD::EventInfo_v1::setDetectorMaskExt ( uint32_t mask2,
uint32_t mask3 )

Set the bit fields indicating with TTC timezones were present.

Definition at line 141 of file EventInfo_v1.cxx.

141 {
142
143 setDetectorMask2( mask2 );
145 return;
146 }
static const uint32_t mask3
void setDetectorMask2(uint32_t value)
Set the bit field indicating with TTC timezones were present.
void setDetectorMask3(uint32_t value)
Set the bit field indicating with TTC timezones were present.

◆ setDetectorMaskExt() [2/2]

void xAOD::EventInfo_v1::setDetectorMaskExt ( uint64_t mask)

Set the bit fields indicating with TTC timezones were present.

Definition at line 148 of file EventInfo_v1.cxx.

148 {
149
150 setDetectorMask2( static_cast< uint32_t >( mask & 0xffffffff ) );
151 setDetectorMask3( static_cast< uint32_t >( ( mask >> 32 ) &
152 0xffffffff ) );
153 return;
154 }

◆ setErrorState()

bool xAOD::EventInfo_v1::setErrorState ( EventFlagSubDet subDet,
EventFlagErrorState state )

Set the error state for a particular sub-detector.

Definition at line 799 of file EventInfo_v1.cxx.

800 {
801
802 // Get the accessor:
803 const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
804 if( ! acc ) {
805 return false;
806 }
807
808 // Check its value:
809 if( ( state != NotSet ) && ( state != Warning ) && ( state != Error ) ) {
810 return false;
811 }
812
813 // Construct the new value:
814 std::atomic<uint32_t>& a = (*acc)(*this);
815 uint32_t orig = a;
816 uint32_t value = ( ( orig & EF_BITS ) |
817 ( static_cast< uint32_t >( state ) <<
818 EF_ERROR_SHIFT ) );
819 while (!a.compare_exchange_strong (orig, value)) {
820 CxxUtils::stall();
821 value = ( ( orig & EF_BITS ) |
822 ( static_cast< uint32_t >( state ) <<
823 EF_ERROR_SHIFT ) );
824 }
825
826 // Tell the user that we were successful:
827 return true;
828 }
static Double_t a

◆ setEventFlagBit()

bool xAOD::EventInfo_v1::setEventFlagBit ( EventFlagSubDet subDet,
size_t bit ) const

Set one particular bit of one particular sub-detector.

Definition at line 715 of file EventInfo_v1.cxx.

716 {
717 return updateEventFlagBit (subDet, bit);
718 }
bool updateEventFlagBit(const EventFlagSubDet subDet, const size_t bit) const
Change detector flags with update semantics.

◆ setEventFlags()

bool xAOD::EventInfo_v1::setEventFlags ( EventFlagSubDet subDet,
uint32_t flags )

Set the event flags for a particular sub-detector.

Definition at line 693 of file EventInfo_v1.cxx.

693 {
694
695 // Get the accessor:
696 const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
697 if( ! acc ) {
698 return false;
699 }
700
701 // Construct the value that we want to store, taking the current error
702 // flags into account:
703 std::atomic<uint32_t>& a = (*acc)(*this);
704 uint32_t orig = a;
705 uint32_t value = ( ( orig & EF_ERROR_BITS ) | ( flags & EF_BITS ) );
706 while (!a.compare_exchange_strong (orig, value)) {
707 CxxUtils::stall();
708 value = ( ( orig & EF_ERROR_BITS ) | ( flags & EF_BITS ) );
709 }
710
711 // Tell the user that we were successful:
712 return true;
713 }
static const uint32_t EF_ERROR_BITS
Bits that store the error state of the sub-detectors.

◆ setEventNumber()

void xAOD::EventInfo_v1::setEventNumber ( uint64_t value)

Set the current event's event number.

◆ setEventTypeBitmask()

void xAOD::EventInfo_v1::setEventTypeBitmask ( uint32_t value)

Set the event type bitmask.

◆ setEvtStore()

void xAOD::EventInfo_v1::setEvtStore ( StoreGateSvc * svc)

Set the pointer to the event store associated with this event.

Definition at line 964 of file EventInfo_v1.cxx.

964 {
965
966 m_evtStore = svc;
967 return;
968 }
AthROOTErrorHandlerSvc * svc

◆ setExtendedLevel1ID()

void xAOD::EventInfo_v1::setExtendedLevel1ID ( uint32_t value)

Set the extended Level-1 identifier.

◆ setLevel1TriggerType()

void xAOD::EventInfo_v1::setLevel1TriggerType ( uint16_t value)

Set the Level-1 trigger type.

◆ setLumiBlock()

void xAOD::EventInfo_v1::setLumiBlock ( uint32_t value)

Set the current event's luminosity block number.

◆ setMCChannelNumber()

void xAOD::EventInfo_v1::setMCChannelNumber ( uint32_t value)

Set the MC generator's channel number.

◆ setMCEventNumber()

void xAOD::EventInfo_v1::setMCEventNumber ( uint64_t value)

Set the MC generator's event number.

◆ setMCEventWeights()

void xAOD::EventInfo_v1::setMCEventWeights ( const std::vector< float > & value)

Set the weights of all the MC events used in the simulation.

◆ setPileUpMixtureID()

void xAOD::EventInfo_v1::setPileUpMixtureID ( const PileUpMixtureID & value)

Set unique pile-up mixture identifier.

Definition at line 404 of file EventInfo_v1.cxx.

404 {
405
408
409 }
void setPileUpMixtureIDHighBits(uint64_t value)
Set unique pile-up mixture identifier high bits.
void setPileUpMixtureIDLowBits(uint64_t value)
Set unique pile-up mixture identifier low bits.

◆ setPileUpMixtureIDHighBits()

void xAOD::EventInfo_v1::setPileUpMixtureIDHighBits ( uint64_t value)

Set unique pile-up mixture identifier high bits.

◆ setPileUpMixtureIDLowBits()

void xAOD::EventInfo_v1::setPileUpMixtureIDLowBits ( uint64_t value)

Set unique pile-up mixture identifier low bits.

◆ setRunNumber()

void xAOD::EventInfo_v1::setRunNumber ( uint32_t value)

Set the current event's run number.

◆ setStatusElement()

void xAOD::EventInfo_v1::setStatusElement ( uint32_t value)

Set the trigger status element.

◆ setStreamTags()

void xAOD::EventInfo_v1::setStreamTags ( const std::vector< StreamTag > & value)

Set the streams that the event was put in.

Definition at line 310 of file EventInfo_v1.cxx.

310 {
311
312 // Update the cached information:
313 m_streamTags.store (value);
314
315 // Clear the persistent information:
316 names( *this ).clear(); types( *this ).clear(); olb( *this ).clear();
317 robsets( *this ).clear(); detsets( *this ).clear();
318
319 // Fill the persistent information:
320 std::vector< StreamTag >::const_iterator itr = value.begin();
321 std::vector< StreamTag >::const_iterator end = value.end();
322 for( ; itr != end; ++itr ) {
323 names( *this ).push_back( itr->name() );
324 types( *this ).push_back( itr->type() );
325 olb( *this ).push_back( itr->obeysLumiblock() );
326 robsets( *this ).push_back( itr->robs() );
327 detsets( *this ).push_back( itr->dets() );
328 }
329
330 return;
331 }
static const std::vector< std::string > types
static const EventInfo_v1::Accessor< std::vector< std::set< uint32_t > > > detsets("streamTagDets")
static const EventInfo_v1::Accessor< std::vector< std::set< uint32_t > > > robsets("streamTagRobs")
static const EventInfo_v1::Accessor< std::vector< char > > olb("streamTagObeysLumiblock")
static const SG::Accessor< std::vector< std::string > > names("thrNames")
Accessor for the names of the passed thresholds.

◆ setSubEvents()

void xAOD::EventInfo_v1::setSubEvents ( const std::vector< SubEvent > & value)

Set the pileup events that were used in the simulation.

Definition at line 581 of file EventInfo_v1.cxx.

581 {
582
583 // Update the cached information:
584 m_subEvents.store (value);
585
586 // Clear the persistent information:
587 timeAcc( *this ).clear(); indexAcc( *this ).clear();
588 typeAcc( *this ).clear(); linkAcc( *this ).clear();
589
590 // Fill the persistent information:
591 std::vector< SubEvent >::const_iterator itr = value.begin();
592 std::vector< SubEvent >::const_iterator end = value.end();
593 for( ; itr != end; ++itr ) {
594 timeAcc( *this ).push_back( itr->time() );
595 indexAcc( *this ).push_back( itr->index() );
596 typeAcc( *this ).push_back( static_cast< uint16_t >( itr->type() ) );
597 linkAcc( *this ).push_back( itr->link() );
598 }
599
600 return;
601 }

◆ setTimeStamp()

void xAOD::EventInfo_v1::setTimeStamp ( uint32_t value)

Set the POSIX time of the event.

◆ setTimeStampNSOffset()

void xAOD::EventInfo_v1::setTimeStampNSOffset ( uint32_t value)

Set the nanosecond offset wrt. the time stamp.

◆ statusElement()

uint32_t xAOD::EventInfo_v1::statusElement ( ) const

Trigger status element.

◆ streamTags()

const std::vector< EventInfo_v1::StreamTag > & xAOD::EventInfo_v1::streamTags ( ) const

Get the streams that the event was put in.

Definition at line 254 of file EventInfo_v1.cxx.

254 {
255
256 // Cache the new information if necessary:
257 if( !m_streamTags.isValid() ) {
258 std::vector< StreamTag > tags;
259
260 // A little sanity check:
261 if( ( names( *this ).size() != types( *this ).size() ) ||
262 ( names( *this ).size() != olb( *this ).size() ) ||
263 ( robsets.isAvailable( *this ) &&
264 ( names( *this ).size() != robsets( *this ).size() ) ) ||
265 ( detsets.isAvailable( *this ) &&
266 ( names( *this ).size() != detsets( *this ).size() ) ) ) {
267 std::println( std::cerr, "<xAOD::EventInfo_v1::streamTags> ERROR "
268 "Corrupt information found!" );
269 std::println( std::cerr, " streamTagNames = {}", names( *this ) );
270 std::println( std::cerr, " streamTagTypes = {}", types( *this ) );
271 std::println( std::cerr, " streamTagObeysLumiblock = {}", olb( *this ) );
272 std::print( std::cerr, " streamTagRobs = " );
273 if( robsets.isAvailable( *this ) ) {
274 std::println( std::cerr, "N/A" );
275 } else {
276 std::println( std::cerr, "{}", robsets( *this ) );
277 }
278 std::print( std::cerr, " streamTagDets = " );
279 if( detsets.isAvailable( *this ) ) {
280 std::println( std::cerr, "N/A" );
281 } else {
282 std::println( std::cerr, "{}", detsets( *this ) );
283 }
284 }
285
286 else {
287 // Fill the tags.
288 for( size_t i = 0; i < names( *this ).size(); ++i ) {
289 static const std::set< uint32_t > dummySet;
290 tags.emplace_back( names( *this )[ i ],
291 types( *this )[ i ],
292 olb( *this )[ i ],
293 ( robsets.isAvailable( *this ) ?
294 robsets( *this )[ i ] :
295 dummySet ),
296 ( detsets.isAvailable( *this ) ?
297 detsets( *this )[ i ] :
298 dummySet ) );
299 }
300 }
301
302 // Set the cache.
303 m_streamTags.set (std::move (tags));
304 }
305
306 // Return the cached object:
307 return *m_streamTags.ptr();
308 }
std::vector< std::string > tags
Definition hcg.cxx:107

◆ subEvents()

const std::vector< EventInfo_v1::SubEvent > & xAOD::EventInfo_v1::subEvents ( ) const

Get the pileup events that were used in the simulation.

Definition at line 570 of file EventInfo_v1.cxx.

570 {
571
572 // Cache the new information if necessary:
573 if( !m_subEvents.isValid() ) {
575 }
576
577 // Return the cached vector:
578 return *m_subEvents.ptr();
579 }
std::vector< EventInfo_v1::SubEvent > makeSubEvents() const

◆ timeStamp()

uint32_t xAOD::EventInfo_v1::timeStamp ( ) const

POSIX time in seconds from 1970. January 1st.

◆ timeStampNSOffset()

uint32_t xAOD::EventInfo_v1::timeStampNSOffset ( ) const

Nanosecond time offset wrt. the time stamp.

◆ toPersistent()

void xAOD::EventInfo_v1::toPersistent ( )

Prepare the object for writing.

Definition at line 970 of file EventInfo_v1.cxx.

970 {
971
972 // Check if the ElementLink variable is available, and writable:
973 if( linkAcc.isAvailableWritable( *this ) ) {
974 // Prepare the ElementLink objects for ROOT I/O:
975 std::vector< ElementLink< EventInfoContainer_v1 > >::iterator
976 el_itr = linkAcc( *this ).begin();
977 std::vector< ElementLink< EventInfoContainer_v1 > >::iterator
978 el_end = linkAcc( *this ).end();
979 for( ; el_itr != el_end; ++el_itr ) {
980 el_itr->toPersistent();
981 }
982 }
983
984 return;
985 }
JetConstituentVector::iterator iterator

◆ toString()

std::string xAOD::EventInfo_v1::toString ( ) const

Convert to a string representation.

Definition at line 1009 of file EventInfo_v1.cxx.

1009 {
1010 return std::format(
1011 "[Run,Evt,Lumi,Time,BunchCross,DetMask] = [{},{},{},{}:{},{},{:#018x}]",
1012 runNumber(),
1013 eventNumber(),
1014 lumiBlock(),
1015 timeStamp(),
1017 bcid(),
1018 detectorMask() );
1019 }
uint32_t lumiBlock() const
The current event's luminosity block number.
uint32_t bcid() const
The bunch crossing ID of the event.
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
uint32_t runNumber() const
The current event's run number.
uint32_t timeStampNSOffset() const
Nanosecond time offset wrt. the time stamp.
uint64_t eventNumber() const
The current event's event number.
uint64_t detectorMask() const
Bit field indicating which TTC zones are present in the event.

◆ toTransient()

void xAOD::EventInfo_v1::toTransient ( )

Cleanse the object after being read in.

As it is now fairly complicated to prepare an EventInfo object for usage after it's been read in from a branch, it seemed to make sense to put the code that's used to do this, into a separate function.

It tries to do the right thing in all situations...

Definition at line 992 of file EventInfo_v1.cxx.

992 {
993
994 m_streamTags.reset();
995 m_subEvents.reset();
996#ifdef XAOD_STANDALONE
997 m_evtStore = nullptr;
998#else
1000#endif
1001
1002 if( usingStandaloneStore() ) {
1003 setStore( ( SG::IAuxStore* ) nullptr );
1004 }
1005
1006 return;
1007 }
IProxyDict * proxyDictFromEventContext()
Return the IProxyDict for this thread's current context.
bool usingStandaloneStore() const
Test to see if this object is currently using a standalone store.
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.

◆ updateErrorState()

bool xAOD::EventInfo_v1::updateErrorState ( const EventFlagSubDet subDet,
const EventFlagErrorState state ) const

Update the error state for one particular sub-detector.

The error state may only be increased by this method. If STATE is less than the current error state, then this method will return false and leave the current state unchanged.

Definition at line 830 of file EventInfo_v1.cxx.

832 {
833 // Check its value:
834 if( ( state != NotSet ) && ( state != Warning ) && ( state != Error ) ) {
835 return false;
836 }
837
838 // Return without trying to write if the desired state is
839 // already set.
840 if (errorState (subDet) == state) {
841 return true;
842 }
843
844 // Get the accessor:
845 const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
846 if( ! acc ) {
847 return false;
848 }
849
850 // Construct the new value:
851 std::atomic<uint32_t>& a = (*acc)(*this);
852 uint32_t orig = a;
853
854 // Only allow increasing the error state in an update.
855 if (state < ((orig >> EF_ERROR_SHIFT) & 0xf)) {
856 return false;
857 }
858
859 uint32_t value = ( ( orig & EF_BITS ) |
860 ( static_cast< uint32_t >( state ) <<
861 EF_ERROR_SHIFT ) );
862 while (!a.compare_exchange_strong (orig, value)) {
863 if (state < ((orig >> EF_ERROR_SHIFT) & 0xf)) {
864 return false;
865 }
866
867 value = ( ( orig & EF_BITS ) |
868 ( static_cast< uint32_t >( state ) <<
869 EF_ERROR_SHIFT ) );
870
871 CxxUtils::stall();
872 }
873
874 // Tell the user that we were successful:
875 return true;
876 }
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.

◆ updateEventFlagBit()

bool xAOD::EventInfo_v1::updateEventFlagBit ( const EventFlagSubDet subDet,
const size_t bit ) const

Change detector flags with update semantics.

This means that we can set bits but not reset them, and that the error state can move higher (NotSet -> Warning -> Error) but not the other way. These methods are const, so they can be called on an existing EventInfo, but will fail with an exception if the detector flag word has been locked. This will happen on input if the flag word has already been set to something; it could also happen if the flag word is written explicitly with a DecorationHandle.

Be aware that no dependency tracking is done for these flags, so something that is reading them should ensure that whatever writes them runs first. In most cases, setting event flags goes along with producing some data item; in those cases, it should suffice for the reader to have a dependency on this data item. In other cases, one might need to use explicit DecorationHandle's or produce a dummy data item. Set one particular bit of one particular sub-detector

Definition at line 720 of file EventInfo_v1.cxx.

721 {
722 // Check if the bit makes sense:
723 if( bit >= EF_ERROR_SHIFT ) {
724 return false;
725 }
726
727 // Don't try to write if the requested flag is already set.
728 uint32_t existingFlags = (*eventFlagsConstAccessorsV1( subDet ))( *this );
729 if (existingFlags & (1u << bit)) {
730 return true;
731 }
732
733 // Get the accessor:
734 const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
735 if( ! acc ) {
736 return false;
737 }
738
739 // Set the new value:
740 ( *acc )( *this ) |= ( 1u << bit );
741
742 // Tell the user that we were successful:
743 return true;
744 }

◆ updateEventFlags()

bool xAOD::EventInfo_v1::updateEventFlags ( const EventFlagSubDet subDet,
const uint32_t flags_in ) const

Turn on a set of event flags for one particular sub-detector.

This does a logical OR of the exising flags and FLAGS.

Definition at line 766 of file EventInfo_v1.cxx.

768 {
769 uint32_t flags = flags_in & EF_BITS;
770
771 // Don't try to write if all requested flags are already set.
772 uint32_t existingFlags = (*eventFlagsConstAccessorsV1( subDet ))( *this );
773 if ((existingFlags | flags) == existingFlags) {
774 return true;
775 }
776
777 // Get the accessor:
778 const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
779 if( ! acc ) {
780 return false;
781 }
782
783 // Set the new value:
784 ( *acc )( *this ) |= ( flags & EF_BITS );
785
786 // Tell the user that we were successful:
787 return true;
788 }

Member Data Documentation

◆ m_evtStore

StoreGateSvc* xAOD::EventInfo_v1::m_evtStore
private

Transient pointer to the StoreGateSvc instance associated with the event (Needed for pile-up digitisation).

Definition at line 521 of file EventInfo_v1.h.

◆ m_streamTags

CxxUtils::CachedValue<std::vector< StreamTag > > xAOD::EventInfo_v1::m_streamTags
private

Cached stream tag objects.

Definition at line 514 of file EventInfo_v1.h.

◆ m_subEvents

CxxUtils::CachedValue<std::vector< SubEvent> > xAOD::EventInfo_v1::m_subEvents
private

Cached sub-event objects.

Definition at line 516 of file EventInfo_v1.h.


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