ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ReadData Class Reference

#include <ReadData.h>

Inheritance diagram for ReadData:
Collaboration diagram for ReadData:

Public Member Functions

 ReadData (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::string m_DataProducer
 
SG::ReadHandle< MyDataObjm_dobj3
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfo {this, "EvtInfo", "EventInfo", "EventInfo name"}
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 20 of file Control/AthenaExamples/AthExStoreGateExample/src/ReadData.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ReadData()

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

Definition at line 26 of file Control/AthenaExamples/AthExStoreGateExample/src/ReadData.cxx.

26  :
27  AthAlgorithm(name, pSvcLocator)
28 {
29 
30  // Declare the properties
31  declareProperty("DataProducer", m_DataProducer);
32 
33 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode ReadData::execute ( )

Definition at line 59 of file Control/AthenaExamples/AthExStoreGateExample/src/ReadData.cxx.

59  {
60 
61  // An algorithm, like this one, retrieving an object from the StoreGate(SG)
62  // can either ask for:
63  // i) the most recent (default) object of a given type
64  // ii) a specific object of a given type
65  // iii) all objects of a given type
66  //This example will show how to perform these three tasks
67 
68 
69  ATH_MSG_INFO ("in execute()");
70 
72  // Part 1: retrieving individual objects from SG
73  //
74  // i)Get the most recent (default) object of type MyDataObj
75  // we start by creating a *const* pointer: we won't be able
76  // to modify the MyDataObj we retrieve.
77  //unless you know what you are doing, *always* use const pointers
78  //FIXME const MyDataObj* dobj;
79 
80  //We pass the pointer to the StoreGate that will set it to point to
81  //the default MyDataObj. More precisely the handle will now contain
82  //all infos necessary to access (or create) the default MyDataObj when
83  //we will use it
84  //FIXME new (tag StoreGate-02-12-08) keyless record scheme does not allow it!
85  //FIXME if (StatusCode::SUCCESS != p_SGevent->retrieve(dobj) ) {
86  //FIXME log << MSG::ERROR
87  //FIXME << "Could not find default MyDataObj"
88  //FIXME << endmsg;
89  //FIXME return( StatusCode::FAILURE);
90  //FIXME }
91  //FIXME log << MSG::INFO
92  //FIXME << "default MyDataObj Val: " << dobj->val()
93  //FIXME << endmsg;
94 
96  // ii) Get a specific MyDataObj by providing its key
97  // (in this case the name of the algo which recorded it)
98 
99  ATH_MSG_INFO ("Get the MyDataObj recorded by " << m_DataProducer);
100 
101  //this time we set a *non-const* pointer. *If* we get back a valid
102  //pointer we'll be able to modify the content of the underlying transient obj
103  MyDataObj* dobj3;
104  //Most objects recorded to the SG may not be retrieved
105  //using a non-const handle, unless the original producer of the object
106  //allowed for later modifications invoking StoreGateSvc::record with
107  //the last "allowMods" optional argument = true
108 
109  // We retrieve our MyDataObj, using m_DataProducer as our key
110  if (StatusCode::SUCCESS != evtStore()->retrieve(dobj3, m_DataProducer)) {
111  ATH_MSG_ERROR ("Could not find MyDataObj " << m_DataProducer);
112  return (StatusCode::FAILURE);
113  } else {
114  dobj3->val(4); // should be able to do this
115  }
116 
117  // Also check retrieving it as a const object via ReadHandle.
118  assert (m_dobj3->val() == 4);
119 
120  //not every type can be used as a key.
121  //These requirements are checked at compile time in the record method
122  //using StoreGate/constraints/KeyConcept.h
123  //uncomment to see how the key concept is checked by the compiler
124  // p_SGevent->retrieve(dobj3, 1.0);
125  //concept checking does not work using egcs 1.1 (gcc 2.91)
126  //(but you still get a compiler error message...)
127 
129  // iii) Get all recorded instances of MyDataObj, print out their contents
130 
131  // (a SG::ConstIterator is an iterator class that we also use to defer
132  // and control the access to the persistent object)
135 
136  if (StatusCode::SUCCESS != evtStore()->retrieve(iMyD, eMyD) ) {
137  ATH_MSG_ERROR ("Could not find MyDataObj list");
138  return( StatusCode::FAILURE);
139  }
140 
141  // while(iMyD != eMyD) {
142  // ATH_MSG_INFO ((*iMyD).val());
143  // ++iMyD;
144  // }
145  ATH_MSG_WARNING ("FIXME loop of ConstIterator bombs");
146 
147 
148 
150 // Get the default listof MyContObj, print out its contents
151 
152  //the CLID of list<MyContObj> must be defined using the CLASSDEF
153  //macros. See StoreGateExample_ClassDEF.h for a few examples
154  //If no CLID is defined StoreGate assumes the object is (convertible to a)
155  //DataObject. If this is not the case an error message is issued:
156  //uncomment below to see how your compiler catches an undefined CLID
157  //ERROR p_SGevent->retrieve(errorH);
158 
160 
161  //now let's try again with a const pointer
163 
164  if (StatusCode::SUCCESS != evtStore()->retrieve(list) ) {
165  ATH_MSG_ERROR ("Could not find list of MyContObj");
166  return( StatusCode::FAILURE);
167  } else {
168  ATH_MSG_INFO ("Retrieved DataVector of MyContObj using a const pointer");
169  }
170  for (const MyContObj* obj : *list) {
171  float time = obj->time();
172  int ID = obj->id();
173 
174  ATH_MSG_INFO ("Time: " << time << " ID: " << ID);
175  }
176 
178 
179 // Get the std::vector, print out its contents
180 
181  const std::vector<float>* pVec;
182 
183  if (StatusCode::SUCCESS != evtStore()->retrieve(pVec) ) {
184  ATH_MSG_ERROR ("Could not find vector<int>");
185  return( StatusCode::FAILURE);
186  }
187 
188  for (unsigned int it=0; it<pVec->size(); it++) {
189  ATH_MSG_INFO ("pVec [" << it << "] = " << (*pVec)[it]);
190  }
191 
193  // test if an object is in the store
194  //FIXME if (p_SGevent->contains<MyDataObj>(SG::DEFAULTKEY)) {
195  //FIXME log << MSG::INFO
196  //FIXME <<"event store contains default MyDataObj"
197  //FIXME <<endmsg;
198  //FIXME } else {
199  //FIXME log << MSG::ERROR
200  //FIXME <<"event store claims it does not contain default MyDataObj"
201  //FIXME <<endmsg;
202  //FIXME return( StatusCode::FAILURE);
203  //FIXME }
204 
205  // test if an object is not in the store
206  if (evtStore()->contains<MyDataObj>("FunnyNonExistingKey")) {
208  ("event store claims it contains MyDataObj with FunnyNonExistingKey");
209  return( StatusCode::FAILURE);
210  } else {
212  ("event store does not contain MyDataObj with FunnyNonExistingKey");
213  }
214 
215 
216 
218  // Part 2: retrieving DataLinks
219 
220  // Get the list of links, print out its contents
221 
222  typedef ElementLink<std::vector<float> > VecElemLink;
223  const std::list<VecElemLink>* pList = nullptr;
224 
225  if (!(evtStore()->retrieve(pList)).isSuccess() ) {
226  ATH_MSG_ERROR ("Could not find list of links");
227  return( StatusCode::FAILURE);
228  } else
229  ATH_MSG_INFO ("Retrieved list of links");
230 
231  std::list<VecElemLink>::const_iterator itL= pList->begin();
232  std::list<VecElemLink>::const_iterator endL= pList->end();
233 
234  while(itL != endL) {
235  ATH_MSG_INFO ("ListVecLinks::linked element " << **itL);
236  ++itL;
237  }
238 
239 // Get the vector of links, print out its contents
240 
241  typedef ElementLink<MapStringFloat> MapElemLink;
242  const std::vector<MapElemLink>* vectorHandle;
243 
244  if (StatusCode::SUCCESS != evtStore()->retrieve(vectorHandle) ) {
245  ATH_MSG_ERROR ("Could not find vector of links");
246  return( StatusCode::FAILURE);
247  } else
248  ATH_MSG_INFO ("Retrieved vector of links");
249 
250  std::vector<MapElemLink>::const_iterator itV= vectorHandle->begin();
251  std::vector<MapElemLink>::const_iterator endV= vectorHandle->end();
252  while(itV != endV) {
253  ATH_MSG_INFO
254  ("VectorMapLinks::linked element: key " << itV->index()
255  << " - value " << (**itV)
256  << " - stored as " << *itV);
257  ++itV;
258  }
259 
260  //try to "read back" a link
261  // istrstream istr("due 0");
262  // MapElemLink toBeRead;
263  // istr >> toBeRead;
264  // if (!toBeRead.isValid()) {
265  // log << MSG::ERROR
266  // << "Could not read back MapElement"
267  // << endmsg;
268  // return( StatusCode::FAILURE);
269  // } else {
270  // log << MSG::INFO << "MapElement read back: key " << toBeRead->first
271  // << " value " << toBeRead->second <<endmsg;
272  // }
273 
275  // Part 3: symbolic links and derived types
276  // Get all objects as its base class
277 
280 
281  if (StatusCode::SUCCESS != evtStore()->retrieve(it2, iEnd2) ) {
282 
283  ATH_MSG_ERROR ("Could not find base class list");
284  return( StatusCode::FAILURE);
285  }
286 
287  // not much we can do with an empty base class,
288  // so print the path of its persistable companion (the DataBucket)
289  ATH_MSG_INFO (" retrieve as BaseClass, print its address: ");
290  while(it2 != iEnd2) {
291  ATH_MSG_INFO (&*it2);
292  ++it2;
293  }
294 
296  // Part 4: Get the event header, print out event and run number
297 
299  if(eventInfo.isValid()) {
300  int event = eventInfo->eventNumber();
301  int run = eventInfo->runNumber();
302  ATH_MSG_INFO (" EventInfo : "
303  << " event: " << event
304  << " run: " << run);
305  }
306  else
307  {
308  ATH_MSG_ERROR (" Unable to retrieve EventInfo from StoreGate ");
309  return StatusCode::SUCCESS;
310  }
311 
312  return StatusCode::SUCCESS;
313 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode ReadData::finalize ( )

Definition at line 317 of file Control/AthenaExamples/AthExStoreGateExample/src/ReadData.cxx.

317  {
318 
319  ATH_MSG_INFO ("in finalize()");
320  return StatusCode::SUCCESS;
321 }

◆ initialize()

StatusCode ReadData::initialize ( )

Definition at line 37 of file Control/AthenaExamples/AthExStoreGateExample/src/ReadData.cxx.

37  {
38 
39 
40  ATH_MSG_INFO ("in initialize()");
41 
42  // Print out the location of the data objects
43  ATH_MSG_INFO ("Data Object producer: " << m_DataProducer);
44 
45  //locate the StoreGateSvc and initialize our local ptr
46  StatusCode sc = evtStore().retrieve();
47  if (!sc.isSuccess())
48  ATH_MSG_ERROR ("Could not find StoreGateSvc");
49 
52 
54  return sc;
55 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< 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.

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< 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< 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< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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< 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_DataProducer

std::string ReadData::m_DataProducer
private

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dobj3

SG::ReadHandle<MyDataObj> ReadData::m_dobj3
private

◆ m_eventInfo

SG::ReadHandleKey<xAOD::EventInfo> ReadData::m_eventInfo {this, "EvtInfo", "EventInfo", "EventInfo name"}
private

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SG::VarHandleBase::assign
StatusCode assign(const std::string &sgkey)
Update the underlying key from a string.
Definition: StoreGate/src/VarHandleBase.cxx:642
MyDataObj::val
void val(int i)
Definition: AthExStoreGateExample/MyDataObj.h:24
skel.it
it
Definition: skel.GENtoEVGEN.py:396
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ReadData::m_DataProducer
std::string m_DataProducer
Definition: Control/AthenaExamples/AthExStoreGateExample/src/ReadData.h:29
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
ReadData::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Definition: Control/AthenaExamples/AthExStoreGateExample/src/ReadData.h:31
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
MyContObj
Definition: MyContObj.h:11
MyDataObj
Definition: AthExStoreGateExample/MyDataObj.h:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
run
Definition: run.py:1
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ReadData::m_dobj3
SG::ReadHandle< MyDataObj > m_dobj3
Definition: Control/AthenaExamples/AthExStoreGateExample/src/ReadData.h:30
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::VarHandleBase::initialize
StatusCode initialize(bool used=true)
Verify that the handle has been configured properly.
Definition: StoreGate/src/VarHandleBase.cxx:452
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
python.PyAthena.obj
obj
Definition: PyAthena.py:132
SG::ConstIterator
Definition: SGIterator.h:163
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >