 |
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/EventIDBase.h"
14 base_class(
name,svcLoc),
15 m_sgs(
"StoreGateSvc/ConditionStore",
name)
27 if (
sc.isSuccess() ) {
28 while ( cib != cie ) {
29 if ( cib->id() ==
id ) {
46 return StatusCode::SUCCESS;
57 ost <<
"CondSvc::dump()";
59 ost <<
"\ndumping id->alg map\n";
61 ost <<
"\n + " <<
id <<
" : " <<
alg->name();
64 ost <<
"\n\ndumping ConditionStore:\n\n";
67 if (
m_sgs->retrieve(cib,cie).isSuccess()) {
86 return StatusCode::SUCCESS;
96 std::ostringstream
ost;
102 return StatusCode::SUCCESS;
126 ATH_MSG_DEBUG(
dh.fullKey() <<
" is a ReadHandle. No need to register.");
127 return StatusCode::SUCCESS;
130 const auto [itr, success] =
m_idMap.try_emplace(
dh.fullKey(),
alg);
132 const IAlgorithm *ia = itr->second;
133 if (ia->name() !=
alg->name()) {
135 <<
" is already registered against a different Algorithm "
137 <<
". This is not allowed.");
138 return StatusCode::FAILURE;
147 const CLID clid =
dh.fullKey().clid();
174 const bool valid =
it->second->valid (ctx.eventID());
175 ATH_MSG_VERBOSE(
"CondSvc::isValidID: now: " << ctx.eventID() <<
" id : "
176 <<
id << (
valid ?
": T" :
": F") );
203 if (
m_sgs->retrieve(cib,cie).isSuccess()) {
206 CLID clid = cib->id().clid();
210 m_condConts.try_emplace( DataObjID(clid, storePrefix + cib.
key()), &*cib );
215 m_condConts.try_emplace( DataObjID(clid2, storePrefix + cib.
key()), &*cib );
222 return StatusCode::SUCCESS;
virtual StatusCode initialize() override
ServiceHandle< StoreGateSvc > m_sgs
virtual bool isValidID(const EventContext &, const DataObjID &) const override
Hold mappings of ranges to condition objects.
std::unordered_map< DataObjID, const CondContBase *, DataObjID_Hasher > m_condConts
Map from DataObjID to CondContBase (populated in setupDone)
const std::string & key() const
Get the key string with which the current object was stored.
virtual StatusCode regHandle(IAlgorithm *alg, const Gaudi::DataHandle &id) override
virtual void dump(std::ostream &) const override
#define ATH_MSG_VERBOSE(x)
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
virtual StatusCode validRanges(std::vector< EventIDRange > &ranges, const DataObjID &id) const override
Provide an interface for finding inheritance information at run time.
::StatusCode StatusCode
StatusCode definition for legacy code.
CondSvc(const std::string &name, ISvcLocator *svc)
std::unordered_map< DataObjID, IAlgorithm *, DataObjID_Hasher > m_idMap
Map from DataObjID to Algorithm to avoid duplicates.
uint32_t CLID
The Class ID type.
virtual StatusCode stop() override
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
std::set< IAlgorithm * > m_condAlgs
StatusCode regHandle_i(IAlgorithm *alg, const Gaudi::DataHandle &id)
A property holding a SG store/key/clid from which a VarHandle is made.
The non-template portion of the BaseInfo implementation.
virtual StatusCode start() override
static const std::string & storeName(const StoreID::type &s)
virtual StatusCode setupDone() override
To be called after changes to the set of conditions containers in the conditions store.