|
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)
38 if (
sc.isSuccess() ) {
39 while ( cib != cie ) {
40 if ( cib->id() ==
id ) {
56 msg().setLevel( m_outputLevel.value() );
58 if (!
sc.isSuccess()) {
59 warning () <<
"Base class could not be initialized" <<
endmsg;
60 return StatusCode::FAILURE;
63 if (!
m_sgs.isValid()) {
64 error() <<
"could not get ConditionStore" <<
endmsg;
65 return StatusCode::FAILURE;
68 return StatusCode::SUCCESS;
89 std::lock_guard<mutex_t> lock(
m_lock);
91 ost <<
"CondSvc::dump()";
93 ost <<
"\ndumping id->alg map\n";
94 for (
const auto& ent :
m_idMap) {
95 ost << std::endl <<
" + " << ent.first <<
" : ";
96 for (
const auto&
a : ent.second) {
97 ost <<
" " <<
a->name();
101 ost <<
"\n\ndumping alg->id map\n";
103 ost << std::endl <<
" + " << ent.first->name() <<
" : ";
104 for (
const auto&
a : ent.second) {
108 ost <<
"\n\ndumping ConditionStore:\n\n";
111 if (
m_sgs->retrieve(cib,cie).isSuccess()) {
128 return StatusCode::SUCCESS;
137 return StatusCode::SUCCESS;
147 std::ostringstream
ost;
153 return StatusCode::SUCCESS;
162 std::lock_guard<mutex_t> lock(
m_lock);
177 info() <<
dh.fullKey() <<
" is a ReadHandle. no need to register"
179 return StatusCode::SUCCESS;
184 IAlgorithm *ia = *(itd2->second.begin());
185 if (ia->name() !=
alg->name()) {
186 error() <<
"WriteCondHandle " <<
dh.fullKey()
187 <<
" is already registered against a different Algorithm "
189 <<
". This is not allowed."
191 return StatusCode::FAILURE;
203 itd2->second.insert(
alg );
210 ita2->second.insert(
dh.fullKey() );
217 CLID clid =
dh.fullKey().clid();
225 sc = StatusCode::FAILURE;
241 std::lock_guard<mutex_t> lock(
m_lock);
243 EventIDBase
now(ctx.eventID());
245 std::ostringstream
ost;
246 ost <<
"getInvalidIDS " << ctx.eventID()
247 <<
": retrieving all ConstIterator<CondContBase>";
249 if (
m_sgs->retrieve(cib,cie).isSuccess()) {
251 ost << std::endl <<
" + " << cib.
key() <<
" " << cib->valid(
now)
252 <<
" id: " << cib->id();
254 if (! (cib->valid(
now)) ) {
255 invalidIDs.insert( cib->id() );
266 ost << std::endl <<
" -> found " << invalidIDs.size() <<
" invalid IDs";
277 DataObjIDColl& invalidIDs) {
278 std::lock_guard<mutex_t> lock(
m_lock);
280 EventIDBase
now(ctx.eventID());
282 std::ostringstream
ost;
283 ost <<
"getValidIDS " << ctx.eventID()
284 <<
": retrieving all ConstIterator<CondContBase>";
286 if (
m_sgs->retrieve(cib,cie).isSuccess()) {
288 ost << std::endl <<
" + " << cib.
key() <<
" v: " << cib->valid(
now)
289 <<
" id: " << cib->id();
291 if ( cib->valid(
now) ) {
292 validIDs.insert( cib->id() );
294 invalidIDs.insert( cib->id() );
305 ost << std::endl <<
" -> found " << validIDs.size() <<
" valid, "
306 << invalidIDs.size() <<
" invalid IDs";
317 std::lock_guard<mutex_t> lock(
m_lock);
319 EventIDBase
now(ctx.eventID());
321 std::ostringstream
ost;
322 ost <<
"getValidIDS " << ctx.eventID()
323 <<
": retrieving all ConstIterator<CondContBase>";
325 if (
m_sgs->retrieve(cib,cie).isSuccess()) {
327 ost << std::endl <<
" + " << cib.
key() <<
" v: " << cib->valid(
now)
328 <<
" id: " << cib->id();
330 if ( cib->valid(
now) ) {
331 validIDs.insert( cib->id() );
342 ost << std::endl <<
" -> found " << validIDs.size() <<
" valid IDs";
358 EventIDBase
now(ctx.eventID());
361 std::string sk =
id.key();
369 ATH_MSG_VERBOSE(
"CondSvc::isValidID: now: " << ctx.eventID() <<
" id : "
370 <<
id << (
valid ?
": T" :
": F") );
377 ATH_MSG_DEBUG(
"CondSvc::isValidID: now: " << ctx.eventID() <<
" id: "
417 std::lock_guard<mutex_t> lock(
m_lock);
420 if (
m_sgs->retrieve(cib,cie).isSuccess()) {
427 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
virtual StatusCode initialize() override
ServiceHandle< StoreGateSvc > m_sgs
virtual bool isValidID(const EventContext &, const DataObjID &) const override
Hold mappings of ranges to condition objects.
virtual StatusCode finalize() override
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
CondContMap_t m_condConts
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 bool isRegistered(const DataObjID &) const override
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)
virtual bool getInvalidIDs(const EventContext &, DataObjIDColl &ids)
uint32_t CLID
The Class ID type.
virtual const DataObjIDColl & conditionIDs() const override
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
std::set< IAlgorithm *, iAlgHasher > IAlgHashSet
static const std::string & storeName(const StoreID::type &s)
virtual bool getIDValidity(const EventContext &, DataObjIDColl &validIDs, DataObjIDColl &invalidIDs)
virtual bool getValidIDs(const EventContext &, DataObjIDColl &ids)
virtual StatusCode setupDone() override
To be called after changes to the set of conditions containers in the conditions store.