ATLAS Offline Software
Loading...
Searching...
No Matches
xAODMaker::EventInfoOverlay Class Reference

#include <EventInfoOverlay.h>

Inheritance diagram for xAODMaker::EventInfoOverlay:
Collaboration diagram for xAODMaker::EventInfoOverlay:

Public Member Functions

 EventInfoOverlay (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode decorationsToKeep (const xAOD::EventInfo *signalEvent, std::vector< std::string > &keep_ids) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
SG::ReadHandleKey< xAOD::EventInfom_bkgInputKey { this, "BkgInputKey", "Bkg_EventInfo", "ReadHandleKey for Background xAOD::EventInfo" }
SG::ReadHandleKey< xAOD::EventInfom_signalInputKey { this, "SignalInputKey", "Sig_EventInfo", "ReadHandleKey for Signal xAOD::EventInfo" }
SG::WriteHandleKey< xAOD::EventInfom_outputKey { this, "OutputKey", "EventInfo", "WriteHandleKey for Output xAOD::EventInfo" }
Gaudi::Property< bool > m_dataOverlay { this, "DataOverlay", false, "True if running data overlay" }
Gaudi::Property< bool > m_validateBeamSpot { this, "ValidateBeamSpot", false, "validate input beamspot size" }
Gaudi::Property< uint32_t > m_mcChannelNumber { this, "MCChannelNumber", 0, "sample MC channel number" }
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 29 of file EventInfoOverlay.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ EventInfoOverlay()

xAODMaker::EventInfoOverlay::EventInfoOverlay ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 18 of file EventInfoOverlay.cxx.

19 : AthReentrantAlgorithm(name, pSvcLocator) {}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ decorationsToKeep()

StatusCode xAODMaker::EventInfoOverlay::decorationsToKeep ( const xAOD::EventInfo * signalEvent,
std::vector< std::string > & keep_ids ) const
private

Definition at line 48 of file EventInfoOverlay.cxx.

49 {
50 // Get the aux type registry in order to decode aux IDs
51 SG::AuxTypeRegistry& registry = SG::AuxTypeRegistry::instance();
52
53 // Get the aux IDs from the signal event info; we need some of them
54 auto signalAIDs = signalEvent->getAuxIDs();
55 for (const auto id : signalAIDs) {
56 if (registry.getName(id).find("mcFilter") != std::string::npos) { // TODO This could be made configurable in future.
57 keep_ids.push_back(registry.getName(id));
58 }
59 }
60 return StatusCode::SUCCESS;
61 }
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
static AuxTypeRegistry & instance()
Return the singleton registry instance.

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode xAODMaker::EventInfoOverlay::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 65 of file EventInfoOverlay.cxx.

66{
67 ATH_MSG_DEBUG("execute() begin");
68
69 SG::ReadHandle<xAOD::EventInfo> bkgEvent(m_bkgInputKey, ctx);
70 if (!bkgEvent.isValid()) {
71 ATH_MSG_ERROR("Could not get background xAOD::EventInfo " << bkgEvent.name() << " from store " << bkgEvent.store());
72 return StatusCode::FAILURE;
73 }
74 ATH_MSG_DEBUG("Found background xAOD::EventInfo " << bkgEvent.name() << " in store " << bkgEvent.store());
75
76 SG::ReadHandle<xAOD::EventInfo> signalEvent(m_signalInputKey, ctx);
77 if (!signalEvent.isValid()) {
78 ATH_MSG_ERROR("Could not get signal xAOD::EventInfo " << signalEvent.name() << " from store " << signalEvent.store());
79 return StatusCode::FAILURE;
80 }
81 ATH_MSG_DEBUG("Found signal xAOD::EventInfo " << signalEvent.name() << " in store " << signalEvent.store());
82
83 std::vector<std::string> keep_ids;
84#if !defined(XAOD_ANALYSIS)
85 ATH_CHECK(decorationsToKeep(signalEvent.cptr(), keep_ids));
86#endif
87
88 auto outputEvent = std::make_unique<xAOD::EventInfo>();
89 auto outputEventAux = std::make_unique<xAOD::EventAuxInfo>();
90 outputEvent->setStore (outputEventAux.get());
91
92 // Copy the eventInfo data from background event
93 *outputEvent = *bkgEvent;
94 // Remove all subevents for now
95 outputEvent->clearSubEvents();
96
97 if (!m_dataOverlay.value()) {
98 outputEvent->setEventNumber(signalEvent->eventNumber());
99 }
100
101 // Propagate MC metadata
102 if (signalEvent->mcChannelNumber() == 0) {
103 if (m_mcChannelNumber.value() != 0) {
104 ATH_MSG_WARNING("Signal mcChannelNumber is 0, setting it to " << m_mcChannelNumber.value());
105 outputEvent->setMCChannelNumber(m_mcChannelNumber.value());
106 } else {
107 ATH_MSG_WARNING("Signal mcChannelNumber is 0");
108 outputEvent->setMCChannelNumber(signalEvent->mcChannelNumber());
109 }
110 } else {
111 if (m_mcChannelNumber.value() != 0 && signalEvent->mcChannelNumber() != m_mcChannelNumber.value()) {
112 ATH_MSG_WARNING("Signal mcChannelNumber (" << signalEvent->mcChannelNumber()
113 << ") and provided mcChannelNumber (" << m_mcChannelNumber.value() << ") do not match.");
114 }
115 outputEvent->setMCChannelNumber(signalEvent->mcChannelNumber());
116 }
117
118 if (signalEvent->mcEventNumber() == 0) {
119 if (signalEvent->eventNumber() != 0) {
120 ATH_MSG_WARNING("Signal mcEventNumber is 0, setting it to match the eventNumber (" << signalEvent->eventNumber() << ")");
121 outputEvent->setMCEventNumber(signalEvent->eventNumber());
122 } else {
123 ATH_MSG_ERROR("Signal eventNumber and mcEventNumber are 0");
124 return StatusCode::FAILURE;
125 }
126 } else {
127 outputEvent->setMCEventNumber(signalEvent->mcEventNumber());
128 }
129
130 if (signalEvent->mcEventWeights().empty()) {
131 ATH_MSG_ERROR("Signal mcEventWeights are empty. This should not happen.");
132 return StatusCode::FAILURE;
133 }
134 outputEvent->setMCEventWeights(signalEvent->mcEventWeights());
135
136 // MC+MC overlay should always be marked as simulation
137 if (!m_dataOverlay.value()) {
138 outputEvent->setEventTypeBitmask(xAOD::EventInfo::IS_SIMULATION);
139 }
140
141 // Propagate core event flags
142 outputEvent->setEventFlags(xAOD::EventInfo::Core,
143 signalEvent->eventFlags(xAOD::EventInfo::Core)
144 | bkgEvent->eventFlags(xAOD::EventInfo::Core) );
145 outputEvent->setErrorState(xAOD::EventInfo::Core,
146 std::max(signalEvent->errorState(xAOD::EventInfo::Core),
147 bkgEvent->errorState(xAOD::EventInfo::Core)));
148
149 // But clear other detector flags.
150 // They'll get set again during reconstruction, if appropriate.
151 for (unsigned idet = 0; idet < xAOD::EventInfo::nDets; ++idet) {
152 auto det = static_cast<xAOD::EventInfo::EventFlagSubDet> (idet);
153 if (det != xAOD::EventInfo::Core) {
154 outputEvent->setEventFlags (det, 0);
155 outputEvent->setErrorState (det, xAOD::EventInfo::NotSet);
156 }
157 }
158
159 // Ensure correct beam spot info
160#if !defined(XAOD_ANALYSIS) && !defined(GENERATIONBASE)
161 if (m_validateBeamSpot.value()) {
162 if (std::abs(signalEvent->beamPosSigmaZ() - bkgEvent->beamPosSigmaZ()) > 1e-5f) {
163 ATH_MSG_ERROR("Beam spot size does not match between signal and background events ("
164 << signalEvent->beamPosSigmaZ() << " vs " << bkgEvent->beamPosSigmaZ() << ")");
165 return StatusCode::FAILURE;
166 }
167 } else {
168 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx };
169 if (!beamSpotHandle.isValid()) {
170 ATH_MSG_ERROR("Beam spot information not valid");
171 return StatusCode::FAILURE;
172 }
173 outputEvent->setBeamPos( beamSpotHandle->beamPos()[ Amg::x ],
174 beamSpotHandle->beamPos()[ Amg::y ],
175 beamSpotHandle->beamPos()[ Amg::z ] );
176 outputEvent->setBeamPosSigma( beamSpotHandle->beamSigma( 0 ),
177 beamSpotHandle->beamSigma( 1 ),
178 beamSpotHandle->beamSigma( 2 ) );
179 outputEvent->setBeamPosSigmaXY( beamSpotHandle->beamSigmaXY() );
180 outputEvent->setBeamTiltXZ( beamSpotHandle->beamTilt( 0 ) );
181 outputEvent->setBeamTiltYZ( beamSpotHandle->beamTilt( 1 ) );
182 outputEvent->setBeamStatus( beamSpotHandle->beamStatus() );
183 }
184#endif
185
186 // Add decorations that are required
187 for (const std::string& id : keep_ids){
188 SG::ConstAccessor<float> origDecor(id);
189 SG::Accessor<float> filtDecor(id);
190 filtDecor(*outputEvent) = origDecor(*signalEvent);
191 }
192
193 // Creating output timings container
194 SG::WriteHandle<xAOD::EventInfo> outputEventH(m_outputKey, ctx);
195 ATH_CHECK(outputEventH.record(std::move(outputEvent), std::move(outputEventAux)));
196 ATH_MSG_DEBUG("Recorded output xAOD::EventInfo " << outputEventH.name() << " in store " << outputEventH.store());
197
198 ATH_MSG_DEBUG("execute() end");
199 return StatusCode::SUCCESS;
200}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Gaudi::Property< uint32_t > m_mcChannelNumber
SG::WriteHandleKey< xAOD::EventInfo > m_outputKey
SG::ReadHandleKey< xAOD::EventInfo > m_signalInputKey
Gaudi::Property< bool > m_validateBeamSpot
Gaudi::Property< bool > m_dataOverlay
SG::ReadHandleKey< xAOD::EventInfo > m_bkgInputKey
StatusCode decorationsToKeep(const xAOD::EventInfo *signalEvent, std::vector< std::string > &keep_ids) const
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
EventFlagSubDet
Sub-detector types for which we store event-level flags.
@ Core
Core flags describing the event.
@ nDets
Number of sub-detector type in this enumeration.
@ NotSet
The flag was not set to anything.
@ IS_SIMULATION
true: simulation, false: data

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ initialize()

StatusCode xAODMaker::EventInfoOverlay::initialize ( )
overridevirtual

Definition at line 22 of file EventInfoOverlay.cxx.

23{
24 ATH_MSG_DEBUG("Initializing...");
25
26 ATH_MSG_INFO("Data overlay: " << m_dataOverlay.value());
27 if (m_validateBeamSpot.value()) {
28 ATH_MSG_INFO("Will validate beam spot size");
29 }
30
31 // Check and initialize keys
32#if !defined(XAOD_ANALYSIS) && !defined(GENERATIONBASE)
33 ATH_CHECK(m_beamSpotKey.initialize());
34#endif
35
36 ATH_CHECK( m_bkgInputKey.initialize(!m_bkgInputKey.key().empty()) );
37 ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_bkgInputKey);
38 ATH_CHECK( m_signalInputKey.initialize() );
39 ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_signalInputKey);
40 ATH_CHECK( m_outputKey.initialize() );
41 ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputKey);
42
43 return StatusCode::SUCCESS;
44}
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

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.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> xAODMaker::EventInfoOverlay::m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
private

Definition at line 42 of file EventInfoOverlay.h.

42{ this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };

◆ m_bkgInputKey

SG::ReadHandleKey<xAOD::EventInfo> xAODMaker::EventInfoOverlay::m_bkgInputKey { this, "BkgInputKey", "Bkg_EventInfo", "ReadHandleKey for Background xAOD::EventInfo" }
private

Definition at line 45 of file EventInfoOverlay.h.

45{ this, "BkgInputKey", "Bkg_EventInfo", "ReadHandleKey for Background xAOD::EventInfo" };

◆ m_dataOverlay

Gaudi::Property<bool> xAODMaker::EventInfoOverlay::m_dataOverlay { this, "DataOverlay", false, "True if running data overlay" }
private

Definition at line 49 of file EventInfoOverlay.h.

49{ this, "DataOverlay", false, "True if running data overlay" };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_mcChannelNumber

Gaudi::Property<uint32_t> xAODMaker::EventInfoOverlay::m_mcChannelNumber { this, "MCChannelNumber", 0, "sample MC channel number" }
private

Definition at line 51 of file EventInfoOverlay.h.

51{ this, "MCChannelNumber", 0, "sample MC channel number" };

◆ m_outputKey

SG::WriteHandleKey<xAOD::EventInfo> xAODMaker::EventInfoOverlay::m_outputKey { this, "OutputKey", "EventInfo", "WriteHandleKey for Output xAOD::EventInfo" }
private

Definition at line 47 of file EventInfoOverlay.h.

47{ this, "OutputKey", "EventInfo", "WriteHandleKey for Output xAOD::EventInfo" };

◆ m_signalInputKey

SG::ReadHandleKey<xAOD::EventInfo> xAODMaker::EventInfoOverlay::m_signalInputKey { this, "SignalInputKey", "Sig_EventInfo", "ReadHandleKey for Signal xAOD::EventInfo" }
private

Definition at line 46 of file EventInfoOverlay.h.

46{ this, "SignalInputKey", "Sig_EventInfo", "ReadHandleKey for Signal xAOD::EventInfo" };

◆ m_validateBeamSpot

Gaudi::Property<bool> xAODMaker::EventInfoOverlay::m_validateBeamSpot { this, "ValidateBeamSpot", false, "validate input beamspot size" }
private

Definition at line 50 of file EventInfoOverlay.h.

50{ this, "ValidateBeamSpot", false, "validate input beamspot size" };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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