|
ATLAS Offline Software
|
#include <EventInfoSelectorTool.h>
|
| EventInfoSelectorTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Standard Service Constructor. More...
|
|
virtual | ~EventInfoSelectorTool () |
| Destructor. More...
|
|
virtual StatusCode | initialize () |
| IAthenaSelectorTool Interface method implementations: More...
|
|
virtual StatusCode | postInitialize () |
| Called at the end of initialize. More...
|
|
virtual StatusCode | preNext () const |
| Called at the beginning of next. More...
|
|
virtual StatusCode | postNext () const |
| Called at the end of next. More...
|
|
virtual StatusCode | preFinalize () |
| Called at the beginning of finalize. More...
|
|
virtual StatusCode | finalize () |
| Finalize AlgTool. More...
|
|
virtual StatusCode | convert (const EventInfo *aod, xAOD::EventInfo *xaod, bool pileUpInfo=false, bool copyPileUpLinks=true, const EventContext &ctx=Gaudi::Hive::currentContext()) const override |
| Function that fills an existing xAOD::EventInfo object with data. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Definition at line 24 of file EventInfoSelectorTool.h.
◆ StoreGateSvc_t
◆ EventInfoSelectorTool()
EventInfoSelectorTool::EventInfoSelectorTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~EventInfoSelectorTool()
EventInfoSelectorTool::~EventInfoSelectorTool |
( |
| ) |
|
|
virtual |
◆ convert()
StatusCode xAODMaker::EventInfoCnvTool::convert |
( |
const EventInfo * |
aod, |
|
|
xAOD::EventInfo * |
xaod, |
|
|
bool |
pileUpInfo = false , |
|
|
bool |
copyPileUpLinks = true , |
|
|
const EventContext & |
ctx = Gaudi::Hive::currentContext() |
|
) |
| const |
|
overridevirtualinherited |
Function that fills an existing xAOD::EventInfo object with data.
This is the important function of the tool.
It takes the EventInfo object available in Athena, and fills an xAOD::EventInfo object with its contents.
- Parameters
-
- Returns
StatusCode::SUCCESS
if all went fine, something else if not
Implements xAODMaker::IEventInfoCnvTool.
Definition at line 103 of file EventInfoCnvTool.cxx.
112 return StatusCode::SUCCESS;
130 std::vector< float > eventWeights;
151 for(
unsigned int i = 0;
i < aod->
event_type()->n_mc_event_weights();
163 std::vector< xAOD::EventInfo::StreamTag > streamTags;
164 std::vector< TriggerInfo::StreamTag >::const_iterator st_itr =
166 std::vector< TriggerInfo::StreamTag >::const_iterator st_end =
168 for( ; st_itr != st_end; ++st_itr ) {
169 streamTags.emplace_back( st_itr->name(), st_itr->type(),
170 st_itr->obeysLumiblock(),
171 st_itr->robs(), st_itr->dets() );
178 bool haveLumi =
false;
179 #if !defined(XAOD_ANALYSIS) && !defined(SIMULATIONBASE) && !defined(GENERATIONBASE)
182 if (lumiData->lbAverageLuminosity() != 0 ||
183 lumiData->lbAverageInteractionsPerCrossing() != 0)
185 float actualMu = 0.0;
186 const float muToLumi = lumiData->muToLumi();
187 if( std::abs( muToLumi ) > 0.00001 ) {
188 unsigned int bcid = ctx.eventID().bunch_crossing_id();
189 actualMu = lumiData->lbLuminosityPerBCIDVector().at(
bcid) / muToLumi;
193 lumiData->lbAverageInteractionsPerCrossing() );
197 #endif // not XAOD_ANALYSIS or SIMULATIONBASE or GENERATIONBASE
213 for( ; sd_itr != sd_end; ++sd_itr ) {
226 errorStateMap.find( aod->
errorState( sd_itr->second ) );
227 if( state == errorStateMap.end() ) {
229 <<
"Unknown error state found for sub-detector "
230 << sd_itr->second <<
": " << aod->
errorState( sd_itr->second );
231 return StatusCode::FAILURE;
241 if( puei && copyPileUpLinks ) {
243 std::vector< xAOD::EventInfo::SubEvent > subEvents;
246 for( ; itr !=
end; ++itr ) {
250 switch (itr->type()) {
273 << itr->type() <<
") encountered" );
282 subEvents.emplace_back( itr->time(),
291 #if !defined(XAOD_ANALYSIS) && !defined(GENERATIONBASE)
296 beamSpotHandle->beamPos()[
Amg::y ],
297 beamSpotHandle->beamPos()[
Amg::z ] );
299 beamSpotHandle->beamSigma( 1 ),
300 beamSpotHandle->beamSigma( 2 ) );
306 #endif // not XAOD_ANALYSIS or GENERATIONBASE
308 if (!eventWeights.empty()) {
314 ew (*xaod) = std::move (eventWeights);
318 ATH_MSG_DEBUG(
"Finished conversion EventInfo="<<aod<<
" xAOD::EventInfo="<<xaod<<
" content=" << *xaod );
321 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode EventInfoSelectorTool::finalize |
( |
| ) |
|
|
inlinevirtual |
◆ initialize()
StatusCode EventInfoSelectorTool::initialize |
( |
| ) |
|
|
inlinevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID() [1/2]
const InterfaceID & IAthenaSelectorTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ interfaceID() [2/2]
static const InterfaceID& xAODMaker::IEventInfoCnvTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ postInitialize()
StatusCode EventInfoSelectorTool::postInitialize |
( |
| ) |
|
|
inlinevirtual |
◆ postNext()
StatusCode EventInfoSelectorTool::postNext |
( |
| ) |
const |
|
virtual |
◆ preFinalize()
StatusCode EventInfoSelectorTool::preFinalize |
( |
| ) |
|
|
inlinevirtual |
◆ preNext()
StatusCode EventInfoSelectorTool::preNext |
( |
| ) |
const |
|
virtual |
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_aodKey
std::string xAODMaker::EventInfoSelectorTool::m_aodKey |
|
private |
◆ m_beamSpotInformationAvailable
bool xAODMaker::EventInfoCnvTool::m_beamSpotInformationAvailable {} |
|
privateinherited |
Internal flag for the availability of the beam spot information.
Definition at line 66 of file EventInfoCnvTool.h.
◆ m_beamSpotKey
◆ m_detStore
◆ m_disableBeamSpot
Gaudi::Property<bool> xAODMaker::EventInfoCnvTool::m_disableBeamSpot { this, "DisableBeamSpot", false, "disable beamspot" } |
|
privateinherited |
◆ m_evtStore
◆ m_lumiDataKey
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_xaodKey
std::string xAODMaker::EventInfoSelectorTool::m_xaodKey |
|
private |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
void setActualInteractionsPerCrossing(float value)
Set average interactions per crossing for the current BCID.
void setSubEvents(const std::vector< SubEvent > &value)
Set the pileup events that were used in the simulation.
const std::vector< StreamTag > & streamTags() const
get stream tags
void get_detdescr_tags(NameTagPairVec &pairs) const
Access DetDescr tags.
void setEventNumber(uint64_t value)
Set the current event's event number.
EventInfo_v1 EventInfo
Definition of the latest event info version.
float averageInteractionsPerCrossing() const
average interactions per crossing for all BCIDs - for out-of-time pile-up
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
@ HighPtMinimumBias
High pT Minimum bias pileup event.
@ MinimumBias
(Low pT) Minimum bias pileup event
Auxiliary information about the event.
@ IS_CALIBRATION
true: calibration, false: physics
void setBeamPos(float x, float y, float z)
Set the beam spot position.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
PileUpType
Enumerator describing the types of pileup events.
void setExtendedLevel1ID(uint32_t value)
Set the extended Level-1 identifier.
@ ZeroBias
Zero bias pileup event.
void setBeamPosSigma(float x, float y, float z)
Set the size of the beam spot.
void setDetDescrTags(const DetDescrTags_t &value)
Set the detector description tags.
bool empty() const
Test if the key is blank.
@ IS_SIMULATION
true: simulation, false: data
number_type detector_mask2(void) const
detector mask0 - bit field indicating which TTC zones have been built into the event,...
float mc_event_weight(unsigned int iweight=0) const
Access to MC weight.
SG::IAuxStore * getStore() const
Return the current store, as a non-const interface.
number_type mc_channel_number() const
Access to the MC generator channel number (was used as run number for generator events)
number_type detector_mask0(void) const
detector mask0 - bit field indicating which TTC zones have been built into the event,...
EventFlagErrorState errorState(EventFlagSubDet subDet) const
return error state for a particular sub-detector
virtual void setOwner(IDataHandleHolder *o)=0
void setBeamTiltYZ(float value)
Set the beam's tilt in radians in YZ.
void setBeamStatus(uint32_t value)
Set the beam spot's status word.
bool setEventFlags(EventFlagSubDet subDet, uint32_t flags)
Set the event flags for a particular sub-detector.
void setStreamTags(const std::vector< StreamTag > &value)
Set the streams that the event was put in.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
SubEvent::iterator beginSubEvt()
void setLevel1TriggerType(uint16_t value)
Set the Level-1 trigger type.
void resetWithKeyAndIndex(const ID_type &dataID, index_type elemID, IProxyDict *sg=0)
Set the link to an element given by string key and index.
bool setErrorState(EventFlagSubDet subDet, EventFlagErrorState state)
Set the error state for a particular sub-detector.
void setMCEventNumber(uint64_t value)
Set the MC generator's event number.
void setEventTypeBitmask(uint32_t value)
Set the event type bitmask.
Helper class to provide type-safe access to aux data.
std::vector< NameTagPair > NameTagPairVec
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
unsigned int eventFlags(EventFlagSubDet subDet) const
event flags for a particular sub-detector
void setDetectorMask(uint32_t mask0, uint32_t mask1)
Set the bit fields indicating with TTC timezones were present.
@ Unknown
Type not known/specified.
static const EventTypeCode IS_CALIBRATION
true: IS_CALIBRATION, false: IS_PHYSICS
EventID * event_ID()
the unique identification of the event.
@ HaloGas
Halo-gas non-collision background.
number_type detector_mask3(void) const
detector mask1 - bit field indicating which TTC zones have been built into the event,...
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
void setStatusElement(uint32_t value)
Set the trigger status element.
void setTimeStamp(uint32_t value)
Set the POSIX time of the event.
void setBCID(uint32_t value)
Set the bunch crossing ID of the event.
EventFlagErrorState
States that a given sub-detector could be in.
void setBeamPosSigmaXY(float value)
Set the beam spot shape's X-Y correlation.
number_type level1TriggerType() const
get level1 trigger type
static const EventTypeCode IS_SIMULATION
true: IS_SIMULATION, false: IS_DATA
EventAuxInfo_v3 EventAuxInfo
Definition of the latest event auxiliary info version.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
void setDetectorMaskExt(uint32_t mask2, uint32_t mask3)
Set the bit fields indicating with TTC timezones were present.
EventFlagSubDet
Sub-detector types for which we store event-level flags.
This class provides general information about an event. Event information is provided by the accessor...
void setAverageInteractionsPerCrossing(float value)
Set average interactions per crossing for all BCIDs.
setEventNumber setTimeStamp bcid
#define REPORT_MESSAGE(LVL)
Report a message.
Class describing the basic event information.
void setTimeStampNSOffset(uint32_t value)
Set the nanosecond offset wrt. the time stamp.
void setMCChannelNumber(uint32_t value)
Set the MC generator's channel number.
@ Signal
The signal event.
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
number_type extendedLevel1ID() const
get extended level1 ID
static const EventTypeCode IS_TESTBEAM
true: IS_TESTBEAM, false: IS_FROM_ATLAS_DET
uint64_t mc_event_number() const
Access to the MC generator event number.
bool test(EventTypeCode type_code) const
Tests for standard characteristics.
#define ATH_MSG_WARNING(x)
void setRunNumber(uint32_t value)
Set the current event's run number.
std::list< SubEvent >::const_iterator const_iterator
TriggerInfo * trigger_info()
trigger information (ptr may be NULL)
void setBeamTiltXZ(float value)
Set the beam's tilt in radians in XZ.
@ Cavern
Cavern background pileup event.
unsigned int n_mc_event_weights() const
Total number of MC weights.
virtual void lock()=0
Lock the container.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
void setLumiBlock(uint32_t value)
Set the current event's luminosity block number.
number_type statusElement() const
get status element
@ IS_TESTBEAM
true: testbeam, false: full detector
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
EventType * event_type()
the type of the event, e.g. simulation, testbeam, etc
SubEvent::iterator endSubEvt()
number_type detector_mask1(void) const
detector mask1 - bit field indicating which TTC zones have been built into the event,...
bool eventType(EventType type) const
Check for one particular bitmask value.
float actualInteractionsPerCrossing() const
Access to number of interactions per crossing: