6#include "GaudiKernel/EventIDBase.h"
14 base_class(name,svcLoc),
15 m_sgs(
"StoreGateSvc/ConditionStore", name)
26 StatusCode
sc =
m_sgs->retrieve( cib, cie );
27 if (
sc.isSuccess() ) {
28 while ( cib != cie ) {
29 if ( cib->id() ==
id ) {
30 ranges = cib->ranges();
46 return StatusCode::SUCCESS;
55 std::scoped_lock lock(
m_lock);
57 ost <<
"CondSvc::dump()";
59 ost <<
"\ndumping id->alg map\n";
60 for (
const auto& [
id, alg] :
m_idMap) {
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;
95 if (msgLvl(MSG::DEBUG)) {
96 std::ostringstream ost;
102 return StatusCode::SUCCESS;
111 std::scoped_lock lock(
m_lock);
125 if (dh.mode() != Gaudi::DataHandle::Writer) {
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;
145 StatusCode
sc{StatusCode::SUCCESS};
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") );
197 std::scoped_lock lock(
m_lock);
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;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Hold mappings of ranges to condition objects.
Provide an interface for finding inheritance information at run time.
uint32_t CLID
The Class ID type.
virtual void dump(std::ostream &) const override
ServiceHandle< StoreGateSvc > m_sgs
virtual StatusCode regHandle(IAlgorithm *alg, const Gaudi::DataHandle &id) override
CondSvc(const std::string &name, ISvcLocator *svc)
virtual StatusCode initialize() override
StatusCode regHandle_i(IAlgorithm *alg, const Gaudi::DataHandle &id)
std::unordered_map< DataObjID, IAlgorithm *, DataObjID_Hasher > m_idMap
Map from DataObjID to Algorithm to avoid duplicates.
std::unordered_map< DataObjID, const CondContBase *, DataObjID_Hasher > m_condConts
Map from DataObjID to CondContBase (populated in setupDone)
virtual StatusCode setupDone() override
To be called after changes to the set of conditions containers in the conditions store.
virtual StatusCode start() override
std::set< IAlgorithm * > m_condAlgs
virtual StatusCode validRanges(std::vector< EventIDRange > &ranges, const DataObjID &id) const override
virtual bool isValidID(const EventContext &, const DataObjID &) const override
virtual StatusCode stop() override
The non-template portion of the BaseInfo implementation.
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
a const_iterator facade to DataHandle.
A property holding a SG store/key/clid from which a VarHandle is made.
const std::string & key() const
Get the key string with which the current object was stored.
static const std::string & storeName(const StoreID::type &s)