ATLAS Offline Software
StoreGateSvc.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 
3 /*
4  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef STOREGATE_STOREGATESVC_H
8 #define STOREGATE_STOREGATESVC_H
9 
10 //FIXME the CLASS_DEF header is not needed here but was added to work around
11 //bad include statements in client code: when using CLASS_DEF put the
12 //include below in your header file!
13 #include "AthenaKernel/CLASS_DEF.h"
14 
15 #include "GaudiKernel/Service.h"
16 #include "GaudiKernel/SmartIF.h"
18 
23 
24 #include <GaudiKernel/ClassID.h> // for CLID
25 #include <GaudiKernel/IMessageSvc.h> // for Level
26 #include "Gaudi/Property.h"
27 #include "GaudiKernel/ServiceHandle.h"
28 #include "GaudiKernel/StatusCode.h"
29 #include "GaudiKernel/DataObjID.h"
30 #include "GaudiKernel/IAlgContextSvc.h"
31 
32 #include <cstddef> // for size_t
33 #include <list>
34 #include <memory>
35 #include <mutex>
36 #include <string>
37 #include <sys/types.h> // for off_t
38 #include <vector>
39 #include <type_traits>
40 
41 #include "AthenaKernel/StoreID.h"
44 #include "AthAllocators/Arena.h"
45 
46 #include <SGTools/StringPool.h>
47 #include "SGTools/ProxyMap.h" /* for SG::ConstProxyIterator */
48 
49 // includes used in StoreGateSvc.icc
50 #include "GaudiKernel/IClassIDSvc.h"
52 #include "AthenaKernel/IIOVSvc.h"
53 #include "StoreGate/SGIterator.h"
54 #include "StoreGate/DataHandle.h"
55 #include "StoreGate/SGWPtr.h"
58 
59 #include "GaudiKernel/IIncidentListener.h"
60 
61 
62 //forward declarations
63 namespace SG {
64  class DataProxy;
65  class TransientAddress;
66  struct RemapImpl;
67  class TestHiveStoreSvc;
68  class HiveMgrSvc;
69 }
70 namespace xAODMaker {
71  class AuxStoreWrapper;
72 }
73 
74 class DataObject;
75 class IConversionSvc;
76 class IIncidentSvc;
77 class IProxyProviderSvc;
78 class IHistorySvc;
79 
80 // python forward
81 struct _object; typedef _object PyObject;
82 class StoreGateSvc;
83 namespace AthenaInternal {
86 }
87 namespace SG {
88  class NoAuxStore;
89 }
90 
91 //friends...
92 class AthenaOutputStream;
93 class IOVDbSvc;
94 class IOVSvcTool;
95 class PileUpMergeSvc;
96 namespace SG {
97  class VarHandleBase;
98 }
99 
115 class StoreGateSvc : public extends<Service,
116  IProxyDict,
117  IHiveStore,
118  IHiveStoreMgr,
119  IIncidentListener>
120 {
121 
122 public:
123 #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES
124 #ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
125 
128 
147  template <typename T, typename TKEY, typename... ARGS>
148  SG::WPtr<T> create(const TKEY& key, ARGS... constructorArgs);
150 #endif /* needs C++11 variadic templates to call arbitrary constructors */
151 #endif /* needs "templated typedef" to define SG::WPtr (for now) */
152 
155 
156 
158  template <typename T, typename TKEY>
159  StatusCode record(T* p2BRegistered, const TKEY& key);
160 
162  template <typename T, typename TKEY>
163  StatusCode record(const T* p2BRegistered, const TKEY& key);
164 
165 
168  template <typename T, typename TKEY>
169  StatusCode record(T* p2BRegistered, const TKEY& key,
170  bool allowMods, bool resetOnly=true, bool noHist=false);
171 
173  template <typename T, typename TKEY>
174  StatusCode record(std::unique_ptr<T> pUnique, const TKEY& key);
175 
177  template <typename T, typename TKEY>
178  StatusCode record(std::unique_ptr<const T> pUnique, const TKEY& key);
179 
182  template <typename T, typename TKEY>
183  StatusCode record(std::unique_ptr<T> pUnique, const TKEY& key,
184  bool allowMods, bool resetOnly=true, bool noHist=false);
185 
187 
190 
191 
193  template <typename T>
194  StatusCode retrieve(const T*& ptr) const;
195 
197  template <typename T>
199 
202  template <typename T>
203  T* retrieve () const;
204 
207  template <typename T>
208  T* tryRetrieve () const;
209  template <typename T>
210  const T* tryConstRetrieve() const;
211 
213  template <typename T, typename TKEY>
214  StatusCode retrieve(const T*& ptr, const TKEY& key) const;
215 
218  template <typename T>
219  StatusCode retrieve(const T*& ptr, const std::string& key) const;
220 
221 
223  template <typename T, typename TKEY>
224  StatusCode retrieve(T*& ptr, const TKEY& key) const;
225 
228  template <typename T>
229  StatusCode retrieve(T*& ptr, const std::string& key) const;
230 
231 
234  template <typename T, class TKEY>
235  T* retrieve (const TKEY& key) const;
236 
239  template <typename T, class TKEY>
240  T* tryRetrieve (const TKEY& key) const;
241  template <typename T, class TKEY>
242  const T* tryConstRetrieve(const TKEY& key) const;
243 
244 
245 
247  template <typename T>
249  SG::ConstIterator<T>& end) const;
250 
254  template <typename T, typename TKEY>
256  bool contains(const TKEY& key) const;
257 
271  template <typename T, typename TKEY>
273 
275 
278 
279 
281  template <typename T, typename TKEY>
282  StatusCode overwrite(T* p2BRegistered, const TKEY& key);
283 
285  template <typename T, typename TKEY>
286  StatusCode overwrite(T* p2BRegistered, const TKEY& key,
287  bool allowMods, bool noHist=false);
288 
289 
291  template <typename T, typename TKEY>
292  StatusCode overwrite(std::unique_ptr<T> pUnique, const TKEY& key,
293  bool allowMods, bool noHist=false);
294 
296  template <typename T, typename TKEY>
297  StatusCode overwrite(std::unique_ptr<T> pUnique, const TKEY& key);
298 
300  StatusCode recordAddress(const std::string& skey,
301  IOpaqueAddress* pAddress, bool clearAddressFlag=true);
303  StatusCode recordAddress(IOpaqueAddress* pAddress, bool clearAddressFlag=true);
304 
306  template <typename T, typename TLINK>
307  StatusCode symLink (const T* p2BRegistered, TLINK* p2BLinked );
308 
310  template <typename T, typename TLINK>
311  StatusCode symLink (const T* p2BRegistered, const TLINK* p2BLinked );
312 
314  template <typename TKEY>
315  StatusCode symLink (const CLID id, const TKEY& key, const CLID linkid);
316 
318  template <typename T, typename TKEY, typename AKEY>
319  StatusCode setAlias(const T* p2BAliased, const TKEY& key, const AKEY& aliasKey);
320 
322  template <typename T, typename AKEY>
323  StatusCode setAlias(const T* p2BAliased, const AKEY& aliasKey);
324 
326  StatusCode setAlias(SG::DataProxy* proxy, const std::string& aliasKey);
327 
329  StatusCode setConst(const void* pointer);
330 
332  template <typename T>
333  StatusCode remove(const T* pObject);
334 
336  template <typename T>
337  StatusCode removeDataAndProxy(const T* pObject);
338 
344  bool transientSwap( const CLID& id,
345  const std::string& keyA, const std::string& keyB );
346 
348 
351 
352 
361  template <typename T, class TKEY>
363  const TKEY& requestedKey) const;
364 
370  //FIXME using a vector exposes ObjectWithVersion definition and hence
371  //FIXME VersionedKey.h. Should try an iface like
372  //FIXME retrieveAllVersions(const TKEY& requestedKey,
373  //FIXME ObjectWithVersion<T>& begin,
374  //FIXME ObjectWithVersion<T>& end)
375  template <typename T, class TKEY>
376  StatusCode
378  const TKEY& requestedKey) const;
379 
380 
381 
393  template <typename T>
394  std::unique_ptr<T> retrieveUniquePrivateCopy (const std::string& key);
395 
399  template<typename TKEY>
400  CLID clid( const TKEY& key ) const;
401 
405  template<typename TKEY>
406  std::vector<CLID> clids( const TKEY& key ) const;
407 
412  template <typename T>
413  int typeCount() const;
414 
416  int typeCount(const CLID& id) const;
417 
421  template <typename TKEY>
422  bool contains(const CLID& id, const TKEY& key) const;
423 
424 
428  template <typename T, typename TKEY>
430  bool transientContains(const TKEY& key) const;
431 
434  template <typename TKEY>
435  bool transientContains(const CLID& id, const TKEY& key) const;
436 
439  std::string dump() const;
440 
442  void setStoreID(StoreID::type id);
445 
446 
453  template <typename T>
454  void
455  keys(std::vector<std::string>& vkeys,
456  bool includeAlias = false, bool onlyValid = true) const;
457 
465  void
466  keys(const CLID& id, std::vector<std::string>& vkeys,
467  bool includeAlias = false, bool onlyValid = true) const;
468 
470 
471 
473  // FIXME pointer to unsafe impl exposed
474  virtual ::IProxyDict* hiveProxyDict() override final {
476  }
477 
479  static StoreGateSvc* currentStoreGate();
480 
481 
484 
485  virtual StatusCode clearStore(bool forceRemove=false) override final;
488 
491  virtual void commitNewDataObjects() override final;
493 
495  static void setSlot(SG::HiveEventSlot* pSlot);
496 
497 
499  void setDefaultStore(SGImplSvc* pStore);
500 
501 
504 
505 
506  template <typename H, typename TKEY>
508 
510  template <typename H, typename TKEY>
512 
517  const TKEY& key, bool trigger=false);
518 
522  const T* obj, DataHandle<H>& handle,
523  const TKEY& key, bool trigger=false);
524 
526  template <typename T1, typename T2>
528  const T1* obj1,
529  StatusCode (T2::*fcn2)(IOVSVC_CALLBACK_ARGS),
530  const T2* obj2, bool trigger=false);
531 
533  template <typename T2>
534  StatusCode regFcn ATLAS_NOT_THREAD_SAFE (const std::string& toolName,
535  StatusCode (T2::*fcn2)(IOVSVC_CALLBACK_ARGS),
536  const T2* obj2, bool trigger=false);
537 
539 
542  virtual SG::DataProxy* proxy(const void* const pTransient) const override final;
543 
546 
548  virtual SG::DataProxy* proxy(const CLID& id, const std::string& key) const override final;
552 
554  virtual StatusCode addToStore (CLID id, SG::DataProxy* proxy) override final;
555 
576  virtual
577  SG::DataProxy* recordObject (SG::DataObjectSharedPtr<DataObject> obj,
578  const std::string& key,
579  bool allowMods,
580  bool returnExisting) override final;
581 
582 
587 
588 
590 
592 
593  virtual SG::DataProxy* proxy(const CLID& id, bool checkValid) const final;
598  virtual SG::DataProxy* proxy(const CLID& id, const std::string& key, bool checkValid) const final;
602  virtual SG::DataProxy* proxy(const CLID& id, const char* key, bool checkValid) const final
603  { return this->proxy(id, std::string(key), checkValid); }
604 
606  virtual std::vector<const SG::DataProxy*> proxies() const override final;
607 
609  std::vector<CLID> clids() const;
610 
613  SG::DataProxy* transientProxy(const CLID& id, const std::string& key) const;
614 
616  DataObject* accessData(const CLID& id) const;
618  DataObject* accessData(const CLID& id, const std::string& key) const;
619 
625 
626 
634  virtual SG::SourceID sourceID (const std::string& key = "EventSelector") const override;
635 
636 
639 
640 
642 
651  virtual
652  sgkey_t stringToKey (const std::string& str, CLID clid) override final;
653 
661  virtual
662  const std::string* keyToString (sgkey_t key) const override final;
663 
672  virtual
673  const std::string* keyToString (sgkey_t key, CLID& clid) const override final;
674 
687  virtual
688  void registerKey (sgkey_t key,
689  const std::string& str,
690  CLID clidid) override final;
691 
693 
696 
697 
698 
721  template <class TKEY>
722  void remap (CLID clid,
723  const TKEY& source,
724  const TKEY& target,
725  off_t index_offset);
726 
727 
735  void remap_impl (sgkey_t source,
736  sgkey_t target,
737  off_t index_offset);
738 
739 
748  virtual bool tryELRemap (sgkey_t sgkey_in, size_t index_in,
749  sgkey_t& sgkey_out, size_t& index_out) override final;
750 
752 
755 
756  StoreGateSvc(const std::string& name, ISvcLocator* svc);
757  virtual ~StoreGateSvc() override;
759 
762 
763  virtual StatusCode initialize() override;
764  virtual StatusCode stop() override;
765  virtual StatusCode finalize() override;
767 
770 
771  virtual void handle(const Incident&) override final;
775 
776 
787  virtual
788  StatusCode createObj (IConverter* cvt,
789  IOpaqueAddress* addr,
790  DataObject*& refpObject) override;
791 
795  void makeCurrent();
796 
797 
798 private:
800 
801  ServiceHandle<IProxyProviderSvc> m_pPPSHandle{this, "ProxyProviderSvc", "ProxyProviderSvc"};
802  ServiceHandle<IIncidentSvc> m_incSvc{this, "IncidentSvc", "IncidentSvc"};
803  ServiceHandle<IAlgContextSvc> m_algContextSvc{this, "AlgContextSvc", "AlgContextSvc"};
804  Gaudi::Property<bool> m_DumpStore{this, "Dump", false, "Dump contents at EndEvent"};
805  Gaudi::Property<bool> m_ActivateHistory{this, "ActivateHistory", false, "record DataObjects history"};
806  Gaudi::Property<bool> m_DumpArena{this, "DumpArena", false, "Dump Arena usage stats"};
808 
811 
812  SmartIF<SGImplSvc> m_defaultStore;
813 
814  friend class SG::TestHiveStoreSvc;
815  static SG::HiveEventSlot* currentSlot();
816 
817  friend class SG::HiveMgrSvc;
820 
821 
823  friend class AthenaOutputStream;
825  StatusCode proxyRange(const CLID& id,
827  SG::ConstProxyIterator& end) const;
828 
833  void releaseObject(const CLID& id, const std::string& key);
834 
835 
837  friend class PileUpMergeSvc;
839  friend class IOVDbSvc;
840  friend class IOVSvcTool;
841  friend
842  void
844 
848 
850  friend class SG::VarHandleBase;
851  friend
852  PyObject*
856  StatusCode typeless_record( DataObject* obj, const std::string& key,
857  const void* const raw_ptr,
858  bool allowMods, bool resetOnly=true,
859  bool noHist=false );
862  DataObject* obj, const std::string& key,
863  const void* const raw_ptr,
864  bool allowMods,
865  bool noHist=false,
866  const std::type_info* tinfo=0);
867 
868  // Helper for record.
869  template <typename T, typename TKEY>
870  StatusCode record1(DataObject* obj, T* pObject, const TKEY& key,
871  bool allowMods, bool resetOnly=true, bool noHist=false);
872 
873  // Helper for overwrite.
874  template <typename T, typename TKEY>
875  StatusCode overwrite1(DataObject* obj, T* pObject, const TKEY& key,
876  bool allowMods, bool noHist=false);
877 
878  bool isSymLinked(const CLID& linkID, SG::DataProxy* dp);
879 
881 
882  StatusCode addAlias(const std::string& aliasKey, SG::DataProxy* dp);
883 
885  std::string createKey(const CLID& dataID);
886 
888  SG::DataProxy* setupProxy(const CLID& dataID,
889  const std::string& gK,
890  DataObject* pDObj,
891  bool allowMods,
892  bool resetOnly);
893 
895  void recycle(DataObject* pBadDObj);
897  void emptyTrash();
898 
904  StatusCode removeProxy(SG::DataProxy* proxy, const void* pTrans,
905  bool forceRemove=false);
907  StatusCode t2pRegister(const void* const pTrans, SG::DataProxy* const pPers);
909  void t2pRemove(const void* const pTrans);
910 
912  void msg_update_handler(Gaudi::Details::PropertyBase& outputLevel);
913 
915  void addAutoSymLinks (const std::string& key, CLID clid, SG::DataProxy* dp,
916  const std::type_info* tinfo,
917  bool warn_nobib = true);
918 
919  struct BadListItem
920  : public DataObjID
921  {
922  public:
923  BadListItem (CLID clid, const std::string& key, const std::string& algo)
924  : DataObjID (clid, key), m_algo (algo)
925  {}
926  std::string m_algo;
927  };
928  typedef std::unordered_set<BadListItem, DataObjID_Hasher> BadItemList;
929 
932  // Thread-safe, since they're protected by m_badMutex.
933  mutable BadItemList m_badRetrieves ATLAS_THREAD_SAFE;
934  mutable BadItemList m_badRecords ATLAS_THREAD_SAFE;
935 
938  typedef std::lock_guard<mutex_t> lock_t;
940 
941 
947  void rememberBadRetrieve (CLID clid, const std::string& key) const;
948 
949 
955  void rememberBadRecord (CLID clid, const std::string& key) const;
956 
957 
964  void rememberBad (BadItemList& bad,
965  CLID clid,
966  const std::string& key) const;
967 
968 
974  void printBadList (const BadItemList& bad,
975  const std::string& what) const;
976 
977 
983  template <class DOBJ>
984  bool associateAux (DOBJ*,
985  const std::string& key,
986  bool ignoreMissing=true) const;
987  template <class DOBJ>
988  bool associateAux (const DOBJ*,
989  const std::string& key,
990  bool ignoreMissing=true) const;
991 
992  template <class DOBJ, class AUXSTORE>
993  bool associateAux_impl(DOBJ* ptr,
994  const std::string& key,
995  const AUXSTORE*) const;
996  template <class DOBJ>
997  bool associateAux_impl(DOBJ* /*ptr*/,
998  const std::string& /*key*/,
999  const SG::NoAuxStore*) const;
1000 
1001 
1002 private:
1005 };
1006 
1007 
1009 void SG_dump (StoreGateSvc* sg);
1010 void SG_dump (StoreGateSvc* sg, const char* fname);
1011 
1012 
1013 #include "StoreGate/StoreGateSvc.icc"
1014 
1015 
1016 //- PyGate: StoreGate access from python -------------------------------------
1017 template< class T >
1018 struct PyGate {
1019  // default object retrieval
1020  static const T* retrieve( StoreGateSvc* psg ) {
1021  const T* obj = 0;
1022  if ( StatusCode::SUCCESS == psg->retrieve( obj ) )
1023  return obj;
1024  return 0;
1025  }
1026 
1027  // object retrieval with string key
1028  static const T* retrieve( StoreGateSvc* psg, const std::string& key ) {
1029  const T* obj = 0;
1030  if ( StatusCode::SUCCESS == psg->retrieve( obj, key ) )
1031  return obj;
1032  return 0;
1033  }
1034 };
1035 
1036 #endif // STOREGATE_STOREGATESVC_H
StoreGateSvc::transientSwap
bool transientSwap(const CLID &id, const std::string &keyA, const std::string &keyB)
swap the content of 2 keys payload A indexed by keyA will now be accessed via keyB and vice versa Not...
Definition: StoreGateSvc.cxx:305
IOVDbSvc
Athena service for Interval Of Validity database. The IOVDbSvc may be in one of three time states whi...
Definition: IOVDbSvc.h:82
StoreGateSvc::record
StatusCode record(T *p2BRegistered, const TKEY &key)
Record an object with a key.
bad
@ bad
Definition: SUSYToolsTester.cxx:95
SG::HiveEventSlot
Definition: SGHiveEventSlot.h:19
common.sgkey
def sgkey(tool)
Definition: common.py:1028
IStringPool
Abstract interface for looking up strings/CLIDs in a pool.
Definition: IStringPool.h:28
StoreGateSvc::typeCount
int typeCount() const
Return the number of instances of an object of type T int i = p_store->typeCount<T>(); Note that th...
TileDCSDataPlotter.dp
dp
Definition: TileDCSDataPlotter.py:843
StoreGateSvc::contains
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
StoreGateSvc::createKey
std::string createKey(const CLID &dataID)
creates a key internally if none specified by client
StoreGateSvc::addSymLink
StatusCode addSymLink(const CLID &linkid, SG::DataProxy *dp)
StoreGateSvc::tryRetrieve
T * tryRetrieve(const TKEY &key) const
Variant of the above which doesn't print a warning message.
StoreGateSvc::setSlot
static void setSlot(SG::HiveEventSlot *pSlot)
set the hive event slot pointer: used by the event loop mgrs
Definition: StoreGateSvc.cxx:44
StoreGateSvc::retrieve
T * retrieve() const
Variant of the above which doesn't return a status code.
StoreGateSvc::clearProxyPayload
void clearProxyPayload(SG::DataProxy *)
use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method corre...
Definition: StoreGateSvc.cxx:409
StoreGateSvc::associateAux_impl
bool associateAux_impl(DOBJ *, const std::string &, const SG::NoAuxStore *) const
IHiveStore.h
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
StoreGateSvc::retrieve
T * retrieve(const TKEY &key) const
Variant of the above which doesn't return a status code.
StoreGateSvc::stop
virtual StatusCode stop() override
Service start.
Definition: StoreGateSvc.cxx:159
StoreGateSvc::keys
void keys(const CLID &id, std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true) const
provide list of all StoreGate keys associated with an object.
StoreGateSvc::BadListItem::BadListItem
BadListItem(CLID clid, const std::string &key, const std::string &algo)
Definition: StoreGateSvc.h:923
StoreGateSvc::setProxyProviderSvc
void setProxyProviderSvc(IProxyProviderSvc *pPPSvc)
associate ProxyProviderSvc to this store
StoreGateSvc::setAlias
StatusCode setAlias(const T *p2BAliased, const TKEY &key, const AKEY &aliasKey)
make an alias to a DataObject (provide data type and old key)
EventInfoWrite.EventSelector
EventSelector
Definition: EventInfoWrite.py:49
StoreGateSvc::handle
virtual void handle(const Incident &) override final
Definition: StoreGateSvc.cxx:173
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
StoreGateSvc::retrieve
StatusCode retrieve(T *&ptr, const TKEY &key) const
Retrieve an object with "key", into a T*.
StoreGateSvc::msg_update_handler
void msg_update_handler(Gaudi::Details::PropertyBase &outputLevel)
callback for output level property
StoreGateSvc::m_storeID
StoreID::type m_storeID
Cache store type in the facade class.
Definition: StoreGateSvc.h:810
SGObjectWithVersion.h
associate a data object with its VersionedKey
SG::VarHandleBase
Base class for VarHandle types.
Definition: StoreGate/StoreGate/VarHandleBase.h:83
PyGate
Definition: StoreGateSvc.h:1018
StoreGateSvc::tryRetrieve
T * tryRetrieve() const
Variant of the above which doesn't print a warning message.
StoreGateSvc::overwrite
StatusCode overwrite(T *p2BRegistered, const TKEY &key)
Record an object with a key, overwriting any existing object with same key.
StoreGateSvc::StoreGateSvc
StoreGateSvc(const StoreGateSvc &)
StoreGateSvc::overwrite
StatusCode overwrite(std::unique_ptr< T > pUnique, const TKEY &key)
Record an object with a key, overwriting any existing object with same key, take ownership of the uni...
StoreGateSvc::makeCurrent
void makeCurrent()
The current store is becoming the active store.
Definition: StoreGateSvc.cxx:442
StoreGateSvc::setupProxy
SG::DataProxy * setupProxy(const CLID &dataID, const std::string &gK, DataObject *pDObj, bool allowMods, bool resetOnly)
try to locate a proxy or create it if needed
StoreGateSvc::m_DumpArena
Gaudi::Property< bool > m_DumpArena
Definition: StoreGateSvc.h:806
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
taskman.template
dictionary template
Definition: taskman.py:317
StoreGateSvc::ATLAS_THREAD_SAFE
BadItemList m_badRetrieves ATLAS_THREAD_SAFE
Remember calls to retrieve and record for a MT store, so we can warn about them during finalize().
Definition: StoreGateSvc.h:933
ReadCellNoiseFromCoolCompare.obj2
obj2
Definition: ReadCellNoiseFromCoolCompare.py:303
StoreGateSvc::printBadList
void printBadList(const BadItemList &bad, const std::string &what) const
Print out a list of bad calls during finalization.
Definition: StoreGateSvc.cxx:501
StoreGateSvc::typeless_overwrite
StatusCode typeless_overwrite(const CLID &id, DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool noHist=false, const std::type_info *tinfo=0)
same as typeless_record, allows to overwrite an object in memory or on disk
Definition: StoreGateSvc.cxx:321
StoreGateSvc::commitNewDataObjects
virtual void commitNewDataObjects() override final
Reset handles added since the last call to commit.
Definition: StoreGateSvc.cxx:76
StoreGateSvc::currentStore
SGImplSvc * currentStore() const
returns pointer to the current SGImplSvc
StoreGateSvc::clid
CLID clid(const TKEY &key) const
Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!
StoreGateSvc::associateAux
bool associateAux(const DOBJ *, const std::string &key, bool ignoreMissing=true) const
StoreGateSvc::typeCount
int typeCount(const CLID &id) const
Return the number of instances of type T (input CLID)
PyGate::retrieve
static const T * retrieve(StoreGateSvc *psg)
Definition: StoreGateSvc.h:1020
StoreGateSvc::m_pPPSHandle
ServiceHandle< IProxyProviderSvc > m_pPPSHandle
Properties.
Definition: StoreGateSvc.h:801
StoreGateSvc::clids
std::vector< CLID > clids(const TKEY &key) const
Retrieve all the CLID s (including symlinks) of the object recorded in StoreGate with the given "key"...
SGIterator.h
A standard conforming forward iterator over items in StoreGate.
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
StoreGateSvc.icc
StoreGateSvc::keys
void keys(std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true) const
provide list of all StoreGate keys associated with an object.
xAODMaker
Definition: StoreGateSvc.h:70
IOVSVC_CALLBACK_ARGS
#define IOVSVC_CALLBACK_ARGS
short hand for IOVSvc call back argument list, to be used when no access to formal arguments is neede...
Definition: IOVSvcDefs.h:24
StoreGateSvc::rememberBadRetrieve
void rememberBadRetrieve(CLID clid, const std::string &key) const
Remember that retrieve() was called for a MT store.
DataHandle.h
SG::WPtr
T * WPtr
Definition: SGWPtr.h:17
HiveEventSlot
A structure created by HiveMgrSvc and used by SGHiveStoreSvc to forward the StoreGateSvc method to a ...
StoreGateSvc::removeProxy
StatusCode removeProxy(SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
remove proxy from store, unless it is reset only.
Definition: StoreGateSvc.cxx:447
StoreGateSvc::record
StatusCode record(std::unique_ptr< T > pUnique, const TKEY &key)
Record an object with a key, take ownership of the unique_ptr obj.
StoreGateSvc::record
StatusCode record(const T *p2BRegistered, const TKEY &key)
Record a const object with a key.
ProxyMap.h
StoreGateSvc::storeID
StoreID::type storeID() const
get store ID. request forwarded to DataStore:
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
StoreGateSvc::remap_impl
void remap_impl(sgkey_t source, sgkey_t target, off_t index_offset)
Declare a remapping.
Definition: StoreGateSvc.cxx:383
PileUpMergeSvc
the preferred mechanism to access information from the different event stores in a pileup job.
Definition: PileUpMergeSvc.h:56
StoreGateSvc::transientContains
bool transientContains(const CLID &id, const TKEY &key) const
Look up a transient data object in TDS only by CLID.
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
StoreGateSvc::retrieveAllVersions
StatusCode retrieveAllVersions(std::list< SG::ObjectWithVersion< T > > &allVersions, const TKEY &requestedKey) const
Retrieve all versions of a given T,KEY combination sets allVersions, a ref to a vector of ObjectWithV...
StoreGateSvc::proxyRange
StatusCode proxyRange(const CLID &id, SG::ConstProxyIterator &beg, SG::ConstProxyIterator &end) const
return a range to all proxies of a given CLID
Definition: StoreGateSvc.cxx:396
StoreGateSvc::mutex_t
std::mutex mutex_t
Protect access to m_bad* members.
Definition: StoreGateSvc.h:937
StoreGateSvc::TestHiveStoreSvc
friend class SG::TestHiveStoreSvc
Definition: StoreGateSvc.h:814
AthenaInternal
Definition: AthenaPythonDict.h:31
SG::NoAuxStore
Mark that there's no associated AuxStore class.
Definition: AuxStore_traits.h:53
StoreGateSvc::emptyTrash
void emptyTrash()
throw away bad objects
Definition: StoreGateSvc.cxx:435
StoreGateSvc::setAlias
StatusCode setAlias(const T *p2BAliased, const AKEY &aliasKey)
make an alias to a DataObject (provide only valid pointer)
StoreGateSvc::finalize
virtual StatusCode finalize() override
Definition: StoreGateSvc.cxx:180
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr, const TKEY &key) const
Retrieve an object with "key", into a const T*.
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:120
H
#define H(x, y, z)
Definition: MD5.cxx:114
StoreGateSvc::releaseObject
void releaseObject(const CLID &id, const std::string &key)
release object held by proxy, if any.
Definition: StoreGateSvc.cxx:404
StoreGateSvc::record1
StatusCode record1(DataObject *obj, T *pObject, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
StoreGateSvc::operator=
StoreGateSvc & operator=(const StoreGateSvc &)
StoreGateSvc::tryConstRetrieve
const T * tryConstRetrieve(const TKEY &key) const
StoreGateSvc::initialize
virtual StatusCode initialize() override
Service initialization.
Definition: StoreGateSvc.cxx:101
SG::HiveMgrSvc
Definition: SGHiveMgrSvc.h:30
StoreGateSvc::dump
std::string dump() const
dump objects in store.
Definition: StoreGateSvc.cxx:349
StoreGateSvc::regHandle
StatusCode regHandle(DataHandle< H > &handle, const TKEY &key)
non-const method - will return an error
StoreGateSvc::BadItemList
std::unordered_set< BadListItem, DataObjID_Hasher > BadItemList
Definition: StoreGateSvc.h:928
StoreGateSvc::overwrite
StatusCode overwrite(std::unique_ptr< T > pUnique, const TKEY &key, bool allowMods, bool noHist=false)
Record an object with a key, overwriting any existing object with same key.
StoreGateSvc::sgkey_t
IStringPool::sgkey_t sgkey_t
Definition: StoreGateSvc.h:641
StoreGateSvc::m_incSvc
ServiceHandle< IIncidentSvc > m_incSvc
Definition: StoreGateSvc.h:802
StoreGateSvc::BadListItem::m_algo
std::string m_algo
Definition: StoreGateSvc.h:926
StoreGateSvc::record
StatusCode record(std::unique_ptr< T > pUnique, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
Record an object with a key, allow possibility of specifying const-access.
StoreGateSvc::addAutoSymLinks
void addAutoSymLinks(const std::string &key, CLID clid, SG::DataProxy *dp, const std::type_info *tinfo, bool warn_nobib=true)
Add automatically-made symlinks for DP.
PyObject
_object PyObject
Definition: StoreGateSvc.h:81
IResetable.h
StoreGateSvc::overwrite1
StatusCode overwrite1(DataObject *obj, T *pObject, const TKEY &key, bool allowMods, bool noHist=false)
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
SGImplSvc.h
StoreGateSvc::retrieve
StatusCode retrieve(T *&ptr) const
Retrieve the default object into a T*.
StoreGateSvc::retrieve
StatusCode retrieve(SG::ConstIterator< T > &begin, SG::ConstIterator< T > &end) const
Retrieve all objects of type T: returns an SG::ConstIterator range.
StoreGateSvc::currentStoreGate
static StoreGateSvc * currentStoreGate()
get current StoreGate
Definition: StoreGateSvc.cxx:51
StoreGateSvc::setDefaultStore
void setDefaultStore(SGImplSvc *pStore)
set pointer to default event store: used by ActiveStoreSvc
Definition: StoreGateSvc.cxx:39
DataProxy
DataProxy provides the registry services for StoreGate.
Definition: DataProxy.h:32
StringPool.h
Maintain a mapping of strings to 64-bit ints.
HiveMgrSvc
A service that manages a multi-event collection of StoreGateSvc It implements the IHiveWhiteBoard int...
Definition: SGHiveMgrSvc.h:22
StoreGateSvc::keyToString
virtual const std::string * keyToString(sgkey_t key) const override final
Find the string corresponding to a given key.
StoreGateSvc::loadEventProxies
StatusCode loadEventProxies()
load proxies at begin event
Definition: StoreGateSvc.cxx:415
StoreGateSvc::m_DumpStore
Gaudi::Property< bool > m_DumpStore
Definition: StoreGateSvc.h:804
StoreGateSvc::setAlias
StatusCode setAlias(SG::DataProxy *proxy, const std::string &aliasKey)
make an alias to a DataObject (provide valid proxy)
SGImplSvc
The Athena Transient Store API.
Definition: SGImplSvc.h:109
StoreGateSvc::rememberBadRecord
void rememberBadRecord(CLID clid, const std::string &key) const
Remember that retrieve() was called for a MT store.
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
StoreGateSvc::clearStore
virtual StatusCode clearStore(bool forceRemove=false) override final
clear DataStore contents: called by the event loop mgrs
Definition: StoreGateSvc.cxx:423
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
StoreGateSvc::proxy_exact
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override final
Get proxy given a hashed key+clid.
StoreGateSvc::registerKey
virtual void registerKey(sgkey_t key, const std::string &str, CLID clidid) override final
Remember an additional mapping from key to string/CLID.
Definition: StoreGateSvc.cxx:377
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
StoreGateSvc::ATLAS_NOT_THREAD_SAFE
StatusCode bind ATLAS_NOT_THREAD_SAFE(const DataHandle< T > &handle, const TKEY &key)
A "once-per-job" retrieve that binds a data object to a DataHandle, typically a data member of an Alg...
StoreGateSvc::overwrite
StatusCode overwrite(T *p2BRegistered, const TKEY &key, bool allowMods, bool noHist=false)
Record an object with a key, overwriting any existing object with same key.
columnar::final
CM final
Definition: ColumnAccessor.h:106
StoreGateSvc::transientContains
bool transientContains(const TKEY &key) const
Look up a transient data object in TDS only (no Proxy lookup) returns false if object not available i...
StoreGateSvc::typeless_record
StatusCode typeless_record(DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool resetOnly=true, bool noHist=false)
type-less recording of an object with a key, allow possibility of specifying const-access and history...
Definition: StoreGateSvc.cxx:313
StoreGateSvc::stringToKey
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override final
Find the key for a string/CLID pair.
Definition: StoreGateSvc.cxx:362
StoreGateSvc::clids
std::vector< CLID > clids() const
Return all CLIDs in the store.
Definition: StoreGateSvc.cxx:278
StoreID.h
IOVSvcTool
Definition: IOVSvcTool.h:70
IProxyDict.h
StoreGateSvc::createObj
virtual StatusCode createObj(IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) override
Call converter to create an object, with locking.
Definition: StoreGateSvc.cxx:464
StoreGateSvc::rememberBad
void rememberBad(BadItemList &bad, CLID clid, const std::string &key) const
Remember that retrieve or record was called for a MT store.
Definition: StoreGateSvc.cxx:478
python.ExitCodes.what
def what(code)
Definition: ExitCodes.py:73
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
StoreGateSvc::proxy
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
IProxyProviderSvc
Definition: IProxyProviderSvc.h:34
StoreGateSvc::lock_t
std::lock_guard< mutex_t > lock_t
Definition: StoreGateSvc.h:938
StoreGateSvc::symLink
StatusCode symLink(const T *p2BRegistered, TLINK *p2BLinked)
make a soft link to the object T* already registered (non-const)
StoreGateSvc::t2pRemove
void t2pRemove(const void *const pTrans)
forwarded to DataStore
StoreGateSvc::setConst
StatusCode setConst(const void *pointer)
prevent downstream clients from modifying the pointed-at dobj
Definition: StoreGateSvc.cxx:94
StoreGateSvc::t2pRegister
StatusCode t2pRegister(const void *const pTrans, SG::DataProxy *const pPers)
forwarded to DataStore
StoreGateSvc::symLink
StatusCode symLink(const T *p2BRegistered, const TLINK *p2BLinked)
make a soft link to the object T* already registered (const link)
xAODMaker::AuxStoreWrapper
Algorithm preparing auxiliary store objects for slimming.
Definition: AuxStoreWrapper.h:41
StoreGateSvc::symLink
StatusCode symLink(const CLID id, const TKEY &key, const CLID linkid)
make a soft link to the object pointed by id/key
DataHandle
an iterator over instances of a given type in StoreGateSvc. It d-casts and caches locally the pointed...
Definition: DataHandle.h:43
StoreGateSvc::ATLAS_THREAD_SAFE
BadItemList m_badRecords ATLAS_THREAD_SAFE
Definition: StoreGateSvc.h:934
StoreGateSvc::recordAddress
StatusCode recordAddress(const std::string &skey, IOpaqueAddress *pAddress, bool clearAddressFlag=true)
Create a proxy object using an IOpaqueAddress and a transient key.
python.Dumpers.typename
def typename(t)
Definition: Dumpers.py:194
AthenaInternal::py_sg_clearProxyPayload
void py_sg_clearProxyPayload(StoreGateSvc *self, SG::DataProxy *)
Definition: StoreGatePyExt.cxx:458
StoreGateSvc::accessData
DataObject * accessData(const CLID &id) const
find proxy and access its data. Returns 0 to flag failure
Definition: StoreGateSvc.cxx:294
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr, const std::string &key) const
Retrieve an object with "key", into a const T*.
StoreGateSvc::tryConstRetrieve
const T * tryConstRetrieve() const
IIOVSvc.h
python.TrigPSCPythonDbSetup.outputLevel
outputLevel
Definition: TrigPSCPythonDbSetup.py:30
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
StoreGateSvc::retrieveUniquePrivateCopy
std::unique_ptr< T > retrieveUniquePrivateCopy(const std::string &key)
EXPERTS ONLY: like readPrivateCopy this method returns your own private copy of a data object of type...
StoreGateSvc::recordObject
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override final
Record an object in the store.
Definition: StoreGateSvc.cxx:260
StoreGateSvc::proxies
virtual std::vector< const SG::DataProxy * > proxies() const override final
return the list of all current proxies in store
Definition: StoreGateSvc.cxx:271
Arena.h
Collection of memory allocators with a common lifetime, plus subsystem summary.
StoreGateSvc::tryELRemap
virtual bool tryELRemap(sgkey_t sgkey_in, size_t index_in, sgkey_t &sgkey_out, size_t &index_out) override final
Test to see if the target of an ElementLink has moved.
Definition: StoreGateSvc.cxx:390
StoreGateSvc::remap
void remap(CLID clid, const TKEY &source, const TKEY &target, off_t index_offset)
Declare a remapping.
PyGate::retrieve
static const T * retrieve(StoreGateSvc *psg, const std::string &key)
Definition: StoreGateSvc.h:1028
StoreGateSvc::m_defaultStore
SmartIF< SGImplSvc > m_defaultStore
Definition: StoreGateSvc.h:812
StoreGateSvc::sourceID
virtual SG::SourceID sourceID(const std::string &key="EventSelector") const override
Return the metadata source ID for the current event slot.
StoreGateSvc::removeDataAndProxy
StatusCode removeDataAndProxy(const T *pObject)
Remove pObject and its proxy no matter what.
StoreGateSvc::record
StatusCode record(std::unique_ptr< const T > pUnique, const TKEY &key)
Record a const object with a key.
SG_dump
void SG_dump(StoreGateSvc *sg)
These are intended to be easy to call from the debugger.
Definition: StoreGateSvc.cxx:517
StoreID::type
type
Definition: StoreID.h:24
StoreGateSvc::associateAux_impl
bool associateAux_impl(DOBJ *ptr, const std::string &key, const AUXSTORE *) const
AthenaOutputStream
algorithm that marks for write data objects in SG
Definition: AthenaOutputStream.h:55
StoreGateSvc::m_algContextSvc
ServiceHandle< IAlgContextSvc > m_algContextSvc
Definition: StoreGateSvc.h:803
copySelective.target
string target
Definition: copySelective.py:37
StoreGateSvc::recordAddress
StatusCode recordAddress(IOpaqueAddress *pAddress, bool clearAddressFlag=true)
Create a proxy object using an IOpaqueAddress.
StoreGateSvc::setStoreID
void setStoreID(StoreID::type id)
set store ID. request forwarded to DataStore:
Definition: StoreGateSvc.cxx:332
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:25
IHiveStoreMgr.h
SGWPtr.h
StoreGateSvc::retrieveHighestVersion
StatusCode retrieveHighestVersion(SG::ObjectWithVersion< T > &dobjWithVersion, const TKEY &requestedKey) const
Retrieve version with highest cycle number for a given T,KEY combination If there is only one availab...
StoreGateSvc::remove
StatusCode remove(const T *pObject)
Remove pObject, will remove its proxy if not reset only.
StoreGateSvc::m_ActivateHistory
Gaudi::Property< bool > m_ActivateHistory
Definition: StoreGateSvc.h:805
StoreGateSvc::associateAux
bool associateAux(DOBJ *, const std::string &key, bool ignoreMissing=true) const
try to associate a data object to its auxiliary store if ignoreMissing=false
StoreGateSvc::retrieve
StatusCode retrieve(T *&ptr, const std::string &key) const
Retrieve an object with "key", into a T*.
copySelective.source
string source
Definition: copySelective.py:32
str
Definition: BTagTrackIpAccessor.cxx:11
IOVSvcDefs.h
defines and typedefs for IOVSvc
StoreGateSvc::hiveProxyDict
virtual ::IProxyDict * hiveProxyDict() override final
implements IHiveStore interface
Definition: StoreGateSvc.h:474
StoreGateSvc::transientProxy
SG::DataProxy * transientProxy(const CLID &id, const std::string &key) const
get proxy with given id and key.
Definition: StoreGateSvc.cxx:287
StoreGateSvc::proxyProviderSvc
IProxyProviderSvc * proxyProviderSvc()
Return current ProxyProviderSvc.
StoreGateSvc::addToStore
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy) override final
Raw addition of a proxy to the store.
Definition: StoreGateSvc.cxx:233
SG::ObjectWithVersion
associate a data object with its VersionedKey The object is held by a ReadHandle to delay its retriev...
Definition: SGVersionedKey.h:17
DefaultKey.h
checker_macros.h
Define macros for attributes used to control the static checker.
python.PyAthena.obj
obj
Definition: PyAthena.py:132
SG::DataProxy
Definition: DataProxy.h:45
PyObject
_object PyObject
Definition: IPyComponent.h:26
StoreGateSvc::addAlias
StatusCode addAlias(const std::string &aliasKey, SG::DataProxy *dp)
SGHiveEventSlot.h
StoreGateSvc::m_badMutex
mutex_t m_badMutex
Definition: StoreGateSvc.h:939
StoreGateSvc::create
SG::WPtr< T > create(const TKEY &key, ARGS... constructorArgs)
Create an object with one of its constructors and record it with a key.
StoreGateSvc::isSymLinked
bool isSymLinked(const CLID &linkID, SG::DataProxy *dp)
StoreGateSvc::BadListItem
Definition: StoreGateSvc.h:921
StoreGateSvc::recycle
void recycle(DataObject *pBadDObj)
put a bad (unrecordable) dobj away
SG::ConstIterator
Definition: SGIterator.h:164
CLASS_DEF.h
macros to associate a CLID to a type
StoreGateSvc::currentSlot
static SG::HiveEventSlot * currentSlot()
Definition: StoreGateSvc.cxx:68
AthenaInternal::recordObjectToStore
PyObject * recordObjectToStore(StoreGateSvc *, PyObject *, PyObject *, bool, bool, bool)
record object to storegate
Definition: StoreGatePyExt.cxx:476
SG::ConstProxyIterator
ProxyMap::const_iterator ConstProxyIterator
Definition: ProxyMap.h:28
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
StoreGateSvc::record
StatusCode record(T *p2BRegistered, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
Record an object with a key, allow possibility of specifying const-access.
ServiceHandle
Definition: ClusterMakerTool.h:37
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
StoreGateSvc::contains
bool contains(const CLID &id, const TKEY &key) const
Look up a keyed object in TDS by CLID.