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

#include <CondInputLoader.h>

Inheritance diagram for CondInputLoader:

Public Member Functions

 CondInputLoader (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters:
virtual StatusCode initialize () override
virtual StatusCode start () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual bool isReEntrant () const override final
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
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
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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)

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void extraDeps_update_handler (Gaudi::Details::PropertyBase &)
RootType loadDict (CLID clid)
RootType loadDict (const std::string &name)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< DataObjIDColl > m_load {this,"Load",{},"List of objects to be loaded"}
 Containers.
DataObjIDColl m_handlesToCreate
std::vector< SG::VarHandleKeym_vhk
Gaudi::Property< bool > m_dumpCondStore
Gaudi::Property< bool > m_dumpCondSvc
Gaudi::Property< bool > m_abort
ServiceHandle< StoreGateSvcm_condStore
ServiceHandle< ICondSvc > m_condSvc
ServiceHandle< IIOVSvcm_IOVSvc
ServiceHandle< IIOVDbSvcm_IOVDbSvc
ServiceHandle< IClassIDSvc > m_clidSvc
ServiceHandle< Athena::IRCUSvcm_rcuSvc
ServiceHandle< IDictLoaderSvcm_dictLoader { this, "DictLoaderSvc", "AthDictLoaderSvc", "" }
ServiceHandle< ITPCnvSvcm_tpCnvSvc { this, "TPCnvSvc", "AthTPCnvSvc", "" }
std::map< std::string, std::string > m_keyFolderMap
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 CondInputLoader.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

◆ CondInputLoader()

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

Constructor with parameters:

Definition at line 58 of file CondInputLoader.cxx.

59 :
60 ::AthReentrantAlgorithm( name, pSvcLocator ),
61 m_condStore("StoreGateSvc/ConditionStore", name),
62 m_condSvc("CondSvc",name),
63 m_IOVSvc("IOVSvc",name),
64 m_IOVDbSvc("IOVDbSvc",name),
65 m_clidSvc("ClassIDSvc",name),
66 m_rcuSvc("Athena::RCUSvc",name)
67{
68 //
69 // Property declaration
70 //
71 auto props = getProperties();
72 for( Gaudi::Details::PropertyBase* prop : props ) {
73 if (prop->name() == "ExtraOutputs" || prop->name() == "ExtraInputs") {
74 prop->declareUpdateHandler
76 }
77 }
78}
ServiceHandle< IIOVSvc > m_IOVSvc
ServiceHandle< IClassIDSvc > m_clidSvc
ServiceHandle< IIOVDbSvc > m_IOVDbSvc
ServiceHandle< ICondSvc > m_condSvc
ServiceHandle< Athena::IRCUSvc > m_rcuSvc
void extraDeps_update_handler(Gaudi::Details::PropertyBase &)
ServiceHandle< StoreGateSvc > m_condStore

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ 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>

◆ 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 CondInputLoader::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 308 of file CondInputLoader.cxx.

309{
310 ATH_MSG_DEBUG ("Executing " << name() << "...");
311
312 EventIDBase now;
313 if (!ctx.valid()) {
314 ATH_MSG_WARNING("EventContext not valid! This should not happen!");
315 const xAOD::EventInfo* thisEventInfo;
316 if(evtStore()->retrieve(thisEventInfo)!=StatusCode::SUCCESS) {
317 ATH_MSG_ERROR("Unable to get Event Info");
318 return StatusCode::FAILURE;
319 }
320 now.set_run_number(thisEventInfo->runNumber());
321 now.set_event_number(thisEventInfo->eventNumber());
322 now.set_lumi_block(thisEventInfo->lumiBlock());
323 now.set_time_stamp(thisEventInfo->timeStamp());
324 now.set_time_stamp_ns_offset(thisEventInfo->timeStampNSOffset());
325 }
326 else {
327 now.set_run_number(ctx.eventID().run_number());
328 now.set_event_number(ctx.eventID().event_number());
329 now.set_lumi_block(ctx.eventID().lumi_block());
330 now.set_time_stamp(ctx.eventID().time_stamp());
331 now.set_time_stamp_ns_offset(ctx.eventID().time_stamp_ns_offset());
332 }
333
334 EventIDBase now_event = now;
335 now.set_event_number (EventIDBase::UNDEFEVT);
336
337 // For a MC event, the run number we need to use to look up the conditions
338 // may be different from that of the event itself. Override the run
339 // number with the conditions run number from the event context,
340 // if it is defined.
341 EventIDBase::number_type conditionsRun =
343 if (conditionsRun != EventIDBase::UNDEFNUM) {
344 now.set_run_number (conditionsRun);
345 }
346
347 StatusCode sc(StatusCode::SUCCESS);
348 std::string tag;
349 for (auto &vhk: m_vhk) {
350 ATH_MSG_DEBUG( "handling id: " << vhk.fullKey() << " key: " << vhk.key() );
351
352 CondContBase* ccb(0);
353 if (! m_condStore->retrieve(ccb, vhk.key()).isSuccess()) {
354 ATH_MSG_ERROR( "unable to get CondContBase* for " << vhk.fullKey()
355 << " from ConditionStore" );
356 sc = StatusCode::FAILURE;
357 continue;
358 }
359
360 if (ccb->valid(now)) {
361 ATH_MSG_DEBUG( " CondObj " << vhk.fullKey() << " is still valid at " << now_event );
362 continue;
363 }
364
365 const std::string& dbKey = m_keyFolderMap.at(vhk.key());
366 if (m_IOVSvc->createCondObj( ccb, vhk.fullKey(), now ).isFailure()) {
367 ATH_MSG_ERROR("unable to create Cond object for " << vhk.fullKey() << " dbKey: "
368 << dbKey);
369 sc = StatusCode::FAILURE;
370 continue;
371 }
372 }
373
374 if (m_dumpCondStore) {
375 ATH_MSG_DEBUG(m_condStore->dump());
376 }
377
378 if (m_dumpCondSvc) {
379 std::ostringstream ost;
380 m_condSvc->dump(ost);
381 ATH_MSG_DEBUG(ost.str());
382 }
383 return sc;
384}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
EventIDBase::number_type conditionsRun() const
std::vector< SG::VarHandleKey > m_vhk
std::map< std::string, std::string > m_keyFolderMap
Gaudi::Property< bool > m_dumpCondSvc
Gaudi::Property< bool > m_dumpCondStore
uint32_t lumiBlock() const
The current event's luminosity block number.
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.
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
::StatusCode StatusCode
StatusCode definition for legacy code.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110
EventInfo_v1 EventInfo
Definition of the latest event info version.

◆ extraDeps_update_handler()

void CondInputLoader::extraDeps_update_handler ( Gaudi::Details::PropertyBase & )
private

Definition at line 391 of file CondInputLoader.cxx.

392{
393 // do nothing
394}

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< 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 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode CondInputLoader::finalize ( )
overridevirtual

Definition at line 227 of file CondInputLoader.cxx.

228{
229 ATH_MSG_INFO ("Finalizing " << name() << "...");
230
231 return StatusCode::SUCCESS;
232}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode CondInputLoader::initialize ( )
overridevirtual

Definition at line 85 of file CondInputLoader.cxx.

86{
87 ATH_MSG_INFO ("Initializing " << name() << "...");
88
89 ATH_CHECK( m_condSvc.retrieve() );
90 ATH_CHECK( m_condStore.retrieve() );
91 ATH_CHECK( m_clidSvc.retrieve() );
92 ATH_CHECK( m_rcuSvc.retrieve() );
93 ATH_CHECK( m_dictLoader.retrieve() );
94 ATH_CHECK( m_tpCnvSvc.retrieve() );
95
96 // Trigger read of IOV database
97 ServiceHandle<IIOVSvc> ivs("IOVSvc",name());
98 ATH_CHECK( ivs.retrieve() );
99
100 // Update the SG keys if different from Folder Names
101 ATH_CHECK( m_IOVDbSvc.retrieve() );
102 std::vector<std::string> keys = m_IOVDbSvc->getKeyList();
103 IIOVDbSvc::KeyInfo info;
104 DataObjIDColl handles_to_load;
105
106 for (const std::string& key : keys) {
107 if( m_IOVDbSvc->getKeyInfo(key, info) ) {
108 m_keyFolderMap[key] = info.folderName;
109 } else {
110 ATH_MSG_WARNING("unable to retrieve keyInfo for " << key );
111 }
112 }
113
114 // We can get warnings later if we don't get this defined first.
115 TClass::GetClass ("coral::AttributeList", true, false);
116
117 for (const auto& itr : m_keyFolderMap) { //loop over keys of IOVDbSvc
118 for (auto id : m_load) {
119 if (id.key() == itr.second) {//CondInputLoader deals with this folder
120 if (itr.second != itr.first) {
121 ATH_MSG_DEBUG(" mapping folder " << id.key() << " to SGkey "
122 << itr.first);
123 id.updateKey( itr.first );
124 }//end if folder-name doesn't match SG key
125
126 SG::VarHandleKey vhk(id.clid(),id.key(),Gaudi::DataHandle::Writer,
128 handles_to_load.emplace(vhk.fullKey());
129
130 // Loading root dictionaries in a multithreaded environment
131 // is unreliable.
132 // So try to be sure all dictionaries are loaded now.
133 RootType rt = loadDict (id.clid());
134
135 // Special case for LArConditionsSubset classes.
136 if (rt.Class()) {
137 size_t nbases = rt.BaseSize();
138 std::string pat = "LArConditionsContainer<";
139 for (size_t ibase = 0; ibase < nbases; ++ibase) {
140 std::string basename = rt.BaseAt(ibase).Name();
141 if (basename.starts_with( pat)) {
142 std::string subset = "LArConditionsSubset<" + basename.substr (pat.size(), std::string::npos);
143 loadDict (subset);
144 loadDict ("LArConditionsSubset_p1");
145 }
146 }
147 }
148
149 break; //quit loop over m_load
150 } // end if CondInputLoader deals with this folder
151 }//end loop over m_load
152 }//end loop over m_keyFolderMap
153
154 m_load = handles_to_load;
155 m_handlesToCreate = handles_to_load;
156
157 // Add in all the base classes known to StoreGate, in case a handle
158 // is read via its base class. These will be added to the output deps,
159 // and also registered with the CondSvc, as the scheduler needs this
160 // info.
161
162 std::ostringstream ost;
163 ost << "Adding base classes:";
164 for (auto &e : sortedDataObjIDColl (handles_to_load)) {
165 // ignore empty keys
166 if (e->key().empty()) continue;
167
168 ost << "\n + " << *e << " ->";
169 CLID clid = e->clid();
170 const SG::BaseInfoBase* bib = SG::BaseInfoBase::find( clid );
171 if ( ! bib ) {
172 ost << " no bases";
173 } else {
174 for (CLID clid2 : bib->get_bases()) {
175 if (clid2 != clid) {
176 std::string base("UNKNOWN");
177 m_clidSvc->getTypeNameOfID(clid2,base).ignore();
178 ost << " " << base << " (" << clid2 << ")";
179 SG::VarHandleKey vhk(clid2,e->key(),Gaudi::DataHandle::Writer,
181 m_load.value().emplace(vhk.fullKey());
182 // Again, make sure all needed dictionaries are loaded.
183 m_dictLoader->load_type (clid2, true);
184 }
185 }
186 }
187 }
188 ATH_MSG_INFO(ost.str());
189
190
191 // Update the properties, set the ExtraOutputs for Alg deps
192 const Gaudi::Details::PropertyBase &p = getProperty("Load");
193
194 ATH_MSG_DEBUG("setting prop ExtraOutputs to " << p.toString());
195 if (!setProperty("ExtraOutputs", p).isSuccess()) {
196 ATH_MSG_ERROR("failed setting property ExtraOutputs");
197 return StatusCode::FAILURE;
198 }
199
200 StatusCode sc(StatusCode::SUCCESS);
201 std::ostringstream str;
202 str << "Will create WriteCondHandle dependencies for the following DataObjects:";
203 for (auto &e : sortedDataObjIDColl(m_load)) {
204 str << "\n + " << *e;
205 if (e->key().empty()) {
206 sc = StatusCode::FAILURE;
207 str << " ERROR: empty key is not allowed!";
208 } else {
209 SG::VarHandleKey vhk(e->clid(),e->key(),Gaudi::DataHandle::Writer,
211 if (m_condSvc->regHandle(this, vhk).isFailure()) {
212 ATH_MSG_ERROR("Unable to register WriteCondHandle " << vhk.fullKey());
213 sc = StatusCode::FAILURE;
214 }
215 ATH_MSG_DEBUG("Ignoring proxy: " << vhk.key());
216 m_IOVSvc->ignoreProxy(vhk.fullKey().clid(), vhk.key());
217 }
218 }
219 ATH_MSG_INFO(str.str());
220
221 return sc;
222}
#define ATH_CHECK
Evaluate an expression and check for errors.
uint32_t CLID
The Class ID type.
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
TTypeAdapter RootType
Definition RootType.h:211
ServiceHandle< IDictLoaderSvc > m_dictLoader
DataObjIDColl m_handlesToCreate
Gaudi::Property< DataObjIDColl > m_load
Containers.
ServiceHandle< ITPCnvSvc > m_tpCnvSvc
RootType loadDict(CLID clid)
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition BaseInfo.cxx:570
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
Definition BaseInfo.cxx:304
@ CONDITION_STORE
Definition StoreID.h:28
static const std::string & storeName(const StoreID::type &s)
Definition StoreID.cxx:77
std::string Name() const
Definition RootType.cxx:361
TBaseAdapter BaseAt(size_t nth) const
Definition RootType.cxx:778
TClass * Class() const
Definition RootType.h:183
size_t BaseSize() const
Definition RootType.cxx:754
std::string base
Definition hcg.cxx:81
T getProperty(const asg::IAsgTool *interface_tool, const std::string &prop_name)
std::string basename(std::string name)
Definition utils.cxx:207

◆ 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()

◆ isReEntrant()

virtual bool CondInputLoader::isReEntrant ( ) const
inlinefinaloverridevirtual

Definition at line 42 of file CondInputLoader.h.

42{ return false; }

◆ loadDict() [1/2]

RootType CondInputLoader::loadDict ( CLID clid)
private

Definition at line 414 of file CondInputLoader.cxx.

415{
416 std::string name;
417 if (m_clidSvc->getTypeNameOfID (clid, name).isSuccess()) {
418 return loadDict (name);
419 }
420 return RootType();
421}

◆ loadDict() [2/2]

RootType CondInputLoader::loadDict ( const std::string & name)
private

Definition at line 398 of file CondInputLoader.cxx.

399{
400 // First try to load the persistent class dictionary.
401 std::unique_ptr<ITPCnvBase> tpcnv = m_tpCnvSvc->t2p_cnv_unique (name);
402 if (tpcnv) {
403 RootType rtp = m_dictLoader->load_type (tpcnv->persistentTInfo());
404 if (rtp.Class()) {
405 return rtp;
406 }
407 }
408
409 // Otherwise try to load the dictionary for the class itself.
410 return m_dictLoader->load_type (name);
411}

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ start()

StatusCode CondInputLoader::start ( )
overridevirtual

Definition at line 237 of file CondInputLoader.cxx.

238{
239 //
240 // now create the CondCont<T>. This has to be done after initialize(),
241 // as we need to make sure that all Condition Objects have been instantiated
242 // so as to fill the static condition obj registry via REGISTER_CC
243 //
244 // we use a VHK to store the info instead of a DataObjIDColl, as this saves
245 // us the trouble of stripping out the storename from the key later.
246 //
247
248 m_vhk.clear(); // in case of multiple start transitions
249
250 bool fail(false);
251 for (const DataObjID* ditr : sortedDataObjIDColl (m_handlesToCreate)) {
252 SG::VarHandleKey vhk(ditr->clid(),ditr->key(),Gaudi::DataHandle::Writer);
253 if ( ! m_condStore->contains<CondContBase>( vhk.key() ) ){
254 std::string tp("UNKNOWN");
255 if (m_clidSvc->getTypeNameOfID(ditr->clid(),tp).isFailure()) {
256 ATH_MSG_WARNING("unable to convert clid " << ditr->clid() << " to a classname."
257 << "This is a BAD sign, but will try to continue");
258 }
260 CondContainer::CondContFactory::Instance().Create( *m_rcuSvc, ditr->clid(), ditr->key() );
261 if (cb == 0) {
262 // try to force a load of libraries using ROOT
263 (void)TClass::GetClass (tp.c_str());
264 cb =
265 CondContainer::CondContFactory::Instance().Create( *m_rcuSvc, ditr->clid(), ditr->key() );
266 }
267 if (cb == 0) {
268 ATH_MSG_ERROR("failed to create CondCont<" << tp
269 << "> clid=" << ditr->clid()
270 << " : no factory found");
271 fail = true;
272 } else {
273 ATH_MSG_INFO("created CondCont<" << tp << "> with key '"
274 << ditr->key() << "'");
275 if (m_condStore->recordObject(cb, vhk.key(), true, false) == nullptr) {
276 ATH_MSG_ERROR("while creating a CondContBase for "
277 << vhk.fullKey());
278 fail = true;
279 } else {
280 m_vhk.emplace_back(std::move(vhk));
281 }
282 }
283 } else {
284 m_vhk.emplace_back(std::move(vhk));
285 }
286 }
287
288 if (fail && m_abort) {
289 ATH_MSG_FATAL("Unable to setup some of the requested CondCont<T>. "
290 << "Aborting");
291 return StatusCode::FAILURE;
292 }
293
294 // Let the conditions service know that we've finished creating
295 // conditions containers.
296 ServiceHandle<ICondSvcSetupDone> condSvcDone ("CondSvc", name());
297 ATH_CHECK( condSvcDone.retrieve() );
298 ATH_CHECK( condSvcDone->setupDone() );
299
300 return StatusCode::SUCCESS;
301
302}
#define ATH_MSG_FATAL(x)
SG::DataObjectSharedPtr< DataObject > Create(Athena::IRCUSvc &rcusvc, const CLID &clid, const std::string &key) const
static CondContFactory & Instance()
Gaudi::Property< bool > m_abort
CxxUtils::RefCountedPtr< T > DataObjectSharedPtr
fail(message)

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< 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.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< 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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
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_abort

Gaudi::Property<bool> CondInputLoader::m_abort
private
Initial value:
{this, "AbortIfInitFails", true,
"Abort execution if unable to create the CondCont<T> in first event"}

Definition at line 64 of file CondInputLoader.h.

64 {this, "AbortIfInitFails", true,
65 "Abort execution if unable to create the CondCont<T> in first event"};

◆ m_clidSvc

ServiceHandle<IClassIDSvc> CondInputLoader::m_clidSvc
private

Definition at line 72 of file CondInputLoader.h.

◆ m_condStore

ServiceHandle<StoreGateSvc> CondInputLoader::m_condStore
private

Definition at line 68 of file CondInputLoader.h.

◆ m_condSvc

ServiceHandle<ICondSvc> CondInputLoader::m_condSvc
private

Definition at line 69 of file CondInputLoader.h.

◆ 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_dictLoader

ServiceHandle<IDictLoaderSvc> CondInputLoader::m_dictLoader { this, "DictLoaderSvc", "AthDictLoaderSvc", "" }
private

Definition at line 74 of file CondInputLoader.h.

75{ this, "DictLoaderSvc", "AthDictLoaderSvc", "" };

◆ m_dumpCondStore

Gaudi::Property<bool> CondInputLoader::m_dumpCondStore
private
Initial value:
{ this, "DumpCondStore", false,
"dump the ConditionStore at the end execute"}

Definition at line 60 of file CondInputLoader.h.

60 { this, "DumpCondStore", false,
61 "dump the ConditionStore at the end execute"};

◆ m_dumpCondSvc

Gaudi::Property<bool> CondInputLoader::m_dumpCondSvc
private
Initial value:
{ this, "DumpCondSvc", false,
"dump the CondSvc at the end execute"}

Definition at line 62 of file CondInputLoader.h.

62 { this, "DumpCondSvc", false,
63 "dump the CondSvc at the end execute"};

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_handlesToCreate

DataObjIDColl CondInputLoader::m_handlesToCreate
private

Definition at line 57 of file CondInputLoader.h.

◆ m_IOVDbSvc

ServiceHandle<IIOVDbSvc> CondInputLoader::m_IOVDbSvc
private

Definition at line 71 of file CondInputLoader.h.

◆ m_IOVSvc

ServiceHandle<IIOVSvc> CondInputLoader::m_IOVSvc
private

Definition at line 70 of file CondInputLoader.h.

◆ m_keyFolderMap

std::map<std::string,std::string> CondInputLoader::m_keyFolderMap
private

Definition at line 79 of file CondInputLoader.h.

◆ m_load

Gaudi::Property<DataObjIDColl> CondInputLoader::m_load {this,"Load",{},"List of objects to be loaded"}
private

Containers.

Definition at line 56 of file CondInputLoader.h.

56{this,"Load",{},"List of objects to be loaded"};

◆ m_rcuSvc

ServiceHandle<Athena::IRCUSvc> CondInputLoader::m_rcuSvc
private

Definition at line 73 of file CondInputLoader.h.

◆ m_tpCnvSvc

ServiceHandle<ITPCnvSvc> CondInputLoader::m_tpCnvSvc { this, "TPCnvSvc", "AthTPCnvSvc", "" }
private

Definition at line 76 of file CondInputLoader.h.

77{ this, "TPCnvSvc", "AthTPCnvSvc", "" };

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhk

std::vector< SG::VarHandleKey > CondInputLoader::m_vhk
private

Definition at line 58 of file CondInputLoader.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: