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

#include <AthenaPoolTestDataReader.h>

Inheritance diagram for AthenaPoolTestDataReader:
Collaboration diagram for AthenaPoolTestDataReader:

Public Member Functions

 AthenaPoolTestDataReader (const std::string &name, ISvcLocator *pSvcLocator)
 Algorithm constructor. More...
 
 ~AthenaPoolTestDataReader ()
 Algorithm destructor. More...
 
virtual StatusCode initialize ()
 Algorithm initialize at begin of job. More...
 
virtual StatusCode execute ()
 Algorithm execute once per event. More...
 
virtual StatusCode finalize ()
 Algorithm finalize at end of job. More...
 
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

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 32 of file AthenaPoolTestDataReader.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

◆ AthenaPoolTestDataReader()

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

Algorithm constructor.

Definition at line 38 of file AthenaPoolTestDataReader.cxx.

39  :
40  AthAlgorithm(name, pSvcLocator)
41 {}

◆ ~AthenaPoolTestDataReader()

AthenaPoolTestDataReader::~AthenaPoolTestDataReader ( )

Algorithm destructor.

Definition at line 43 of file AthenaPoolTestDataReader.cxx.

44 {}

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 AthenaPoolTestDataReader::execute ( )
virtual

Algorithm execute once per event.

Definition at line 51 of file AthenaPoolTestDataReader.cxx.

52 {
53 
54  ATH_MSG_DEBUG("Executing AthenaPoolTestDataReader" );
55 
56 
57  // Retrieve collections
58 
59  // A's only
60 
61  std::string test1;
62  std::string test2;
63  bool error = false;
64 
66  ATH_CHECK( evtStore()->retrieve(col, "AthenaPoolTestCollection_1") );
67 
68 
69  ATH_MSG_DEBUG("Collection of A's" );
70  int i = 0;
71  for (const IAthenaPoolTestData* elt : *col) {
72  ATH_MSG_DEBUG( "Read: " << elt->printWhoYouAre() );
73  AthenaPoolTestA data(i+1, i+2);
74  ATH_MSG_DEBUG( "Should be: " << data.printWhoYouAre() );
75  test1 = elt->printWhoYouAre();
76  test2 = data.printWhoYouAre();
77  if (test1 != test2) {
78  ATH_MSG_ERROR( "Incorrect data: in/out " << test1 << " " << test2 );
79  error = true;
80  }
81  ++i;
82  }
83 
84 
85  // B's only
86 
87  ATH_CHECK( evtStore()->retrieve(col, "AthenaPoolTestCollection_2") );
88 
89  ATH_MSG_DEBUG("Collection of B's" );
90  i = 0;
91  for (const IAthenaPoolTestData* elt : *col) {
92  ATH_MSG_DEBUG( "Read: " << elt->printWhoYouAre() );
93  AthenaPoolTestB data(i+11, i+12);
94  ATH_MSG_DEBUG( "Should be: " << data.printWhoYouAre() );
95  test1 = elt->printWhoYouAre();
96  test2 = data.printWhoYouAre();
97  if (test1 != test2) {
98  ATH_MSG_ERROR( "Incorrect data: in/out " << test1 << " " << test2 );
99  error = true;
100  }
101  ++i;
102  }
103 
104 
105  // A's and B's
106 
107  ATH_CHECK( evtStore()->retrieve(col, "AthenaPoolTestCollection_3") );
108 
109  ATH_MSG_DEBUG("Collection of A's and B's" );
110  i = 0;
111  for (const IAthenaPoolTestData* elt : *col) {
112  ATH_MSG_DEBUG( "Read: " << elt->printWhoYouAre() );
113  if (i < 3) {
114  AthenaPoolTestA data(i+21, i+22);
115  ATH_MSG_DEBUG( "Should be: " << data.printWhoYouAre() );
116  test1 = elt->printWhoYouAre();
117  test2 = data.printWhoYouAre();
118  if (test1 != test2) {
119  ATH_MSG_ERROR( "Incorrect data: in/out " << test1 << " " << test2 );
120  error = true;
121  }
122  }
123  else {
124  AthenaPoolTestB data(i+21, i+22);
125  ATH_MSG_DEBUG( "Should be: " << data.printWhoYouAre() );
126  test1 = elt->printWhoYouAre();
127  test2 = data.printWhoYouAre();
128  if (test1 != test2) {
129  ATH_MSG_ERROR( "Incorrect data: in/out " << test1 << " " << test2 );
130  error = true;
131  }
132  }
133  ++i;
134  }
135 
136 
137  // C's only
138 
139  ATH_CHECK( evtStore()->retrieve(col, "AthenaPoolTestCollection_4") );
140 
141  ATH_MSG_DEBUG("Collection of C's" );
142  i = 0;
143  for (const IAthenaPoolTestData* elt : *col) {
144  ATH_MSG_DEBUG( "Read: " << elt->printWhoYouAre() );
145  AthenaPoolTestC data(0, 0, i+3, i+4);
146  ATH_MSG_DEBUG( "Should be: " << data.printWhoYouAre() );
147  test1 = elt->printWhoYouAre();
148  test2 = data.printWhoYouAre();
149  if (test1 != test2) {
150  ATH_MSG_ERROR( "Incorrect data: in/out " << test1 << " " << test2 );
151  error = true;
152  }
153  ++i;
154  }
155 
156 
157  // D's only
158 
159  ATH_CHECK( evtStore()->retrieve(col, "AthenaPoolTestCollection_5") );
160 
161  ATH_MSG_DEBUG("Collection of D's" );
162  i = 0;
163  for (const IAthenaPoolTestData* elt : *col) {
164  ATH_MSG_DEBUG( "Read: " << elt->printWhoYouAre() );
165  AthenaPoolTestD data(0, 0, i+13, i+14, i+15, i+16);
166  ATH_MSG_DEBUG( "Should be: " << data.printWhoYouAre() );
167  test1 = elt->printWhoYouAre();
168  test2 = data.printWhoYouAre();
169  if (test1 != test2) {
170  ATH_MSG_ERROR( "Incorrect data: in/out " << test1 << " " << test2 );
171  error = true;
172  }
173  ++i;
174  }
175 
176 
177  // Test for CLHEP matrix
178 
179  // Now create a write 10 Hit objects
180  //bool readMatrix = false;
181  bool readMatrix = true;
182  if (readMatrix) {
183  const AthenaPoolTestMatrix* matrix = nullptr;
184  for ( int i = 0; i < 3; ++i ) {
185  std::stringstream stream;
186  stream << "AthenaPoolTestMatrix_" << i;
187  std::string key(stream.str());
189  ATH_MSG_DEBUG("Retrieved matrix " << i + 1 << " " << key );
190 
191  const HepGeom::Point3D<double>& point = matrix->point();
192  const HepGeom::Point3D<double>& point1 = matrix->point1();
193  ATH_MSG_DEBUG(" Points (by value,by ptr) x,y,z : "
194  << point.x() << " "
195  << point.y() << " "
196  << point.z() << " "
197  << ", x,y,z "
198  << point1.x() << " "
199  << point1.y() << " "
200  << point1.z() << " ");
201  const CLHEP::HepMatrix& smallMatrix = matrix->smallMatrix();
202  ATH_MSG_DEBUG(" Small matrix : ( " << smallMatrix.num_row() << ", " << smallMatrix.num_col() << " ) " );
203  stream.clear();
204  stream << " values: ";
205  for (int i = 0; i < smallMatrix.num_row(); ++i) {
206  for (int j = 0; j < smallMatrix.num_col(); ++ j) {
207  stream << smallMatrix[i][j] << ", ";
208  }
209  }
210  ATH_MSG_VERBOSE(stream.str());
211 
212  const CLHEP::HepMatrix& bigMatrix = matrix->bigMatrix();
213  ATH_MSG_DEBUG(" Big matrix : ( " << bigMatrix.num_row() << ", " << bigMatrix.num_col() << " ) " );
214  stream.clear();
215  stream << " values: ";
216  for (int i = 0; i < bigMatrix.num_row(); ++i) {
217  for (int j = 0; j < bigMatrix.num_col(); ++ j) {
218  stream << bigMatrix[i][j] << ", ";
219  }
220  }
221  ATH_MSG_VERBOSE(stream.str());
222  ATH_MSG_DEBUG(" Other matrices : " );
223  for ( int ii = 0; ii < matrix->numberOfMatrices(); ++ii ) {
224  const CLHEP::HepMatrix& matrx = matrix->matrix( ii );
225  ATH_MSG_DEBUG(" ( " << matrx.num_row() << ", " << matrx.num_col() << " ) " );
226  stream.clear();
227  stream << " values: ";
228  for (int i = 0; i < matrx.num_row(); ++i) {
229  for (int j = 0; j < matrx.num_col(); ++ j) {
230  stream << matrx[i][j] << ", ";
231  }
232  }
233  ATH_MSG_VERBOSE(stream.str());
234  }
235 
236  // print out matrix maps
237  AthenaPoolTestMatrix::matrixMaps_t mats = matrix->matrixMaps();
238 
239  ATH_MSG_DEBUG(" Matrix maps : " << mats.size() );
240  std::map<unsigned int, CLHEP::HepMatrix>& mp0 = mats[0];
241  std::map<unsigned int, CLHEP::HepMatrix>& mp1 = mats[1];
242  std::map<unsigned int, CLHEP::HepMatrix>::const_iterator itmp = mp0.begin();
243  ATH_MSG_DEBUG(" Key, row, column " << (*itmp).first << " "
244  << (*itmp).second.num_row() << ", " << (*itmp).second.num_col() );
245  ++itmp;
246  ATH_MSG_DEBUG(" Key, row, column " << (*itmp).first << " "
247  << (*itmp).second.num_row() << ", " << (*itmp).second.num_col() );
248  itmp = mp1.begin();
249  ATH_MSG_DEBUG(" Key, row, column " << (*itmp).first << " "
250  << (*itmp).second.num_row() << ", " << (*itmp).second.num_col() );
251  ++itmp;
252  ATH_MSG_DEBUG(" Key, row, column " << (*itmp).first << " "
253  << (*itmp).second.num_row() << ", " << (*itmp).second.num_col() );
254 
255  // Print out the transform:
256  ATH_MSG_DEBUG(" Matrix transform: " );
257  const HepGeom::Transform3D& trans = matrix->trans();
258  ATH_MSG_DEBUG(" Matrix transform: " );
259  ATH_MSG_DEBUG(" xx " << trans(0,0) );
260  ATH_MSG_DEBUG(" xy " << trans(0,1) );
261  ATH_MSG_DEBUG(" xz " << trans(0,2) );
262  ATH_MSG_DEBUG(" yx " << trans(1,0) );
263  ATH_MSG_DEBUG(" yy " << trans(1,1) );
264  ATH_MSG_DEBUG(" yz " << trans(1,2) );
265  ATH_MSG_DEBUG(" zx " << trans(2,0) );
266  ATH_MSG_DEBUG(" zy " << trans(2,1) );
267  ATH_MSG_DEBUG(" zz " << trans(2,2) );
268  ATH_MSG_DEBUG(" dx " << trans(3,0) );
269  ATH_MSG_DEBUG(" dy " << trans(3,1) );
270  ATH_MSG_DEBUG(" dz " << trans(3,2) );
271 
272  }
273  }
274 
275 
276 
277  // Read in nested collections
278 
279  bool readMap = true;
280  const AthenaPoolTestMap* tmapPtr;
281  if (evtStore()->retrieve(tmapPtr, "AthenaPoolMap").isFailure()) {
282  ATH_MSG_ERROR("Unable to retrieve AthenaPoolMap object ");
283  readMap = false;
284  }
285  else {
286  ATH_MSG_DEBUG("Retrieved AthenaPoolMap" );
287  }
288 
289  if (readMap) {
290 
291  const AthenaPoolTestMap& tmap = *tmapPtr;
292 
293  typedef AthenaPoolTestMapData::Deposit deposit_t;
294  typedef std::vector<deposit_t> deposit_vec;
295 
296  deposit_vec deposits;
297 
298  //deposit_t deposit;
299 
300  // Printout data
301  AthenaPoolTestMap::const_iterator itm = tmap.begin();
302  AthenaPoolTestMap::const_iterator endm = tmap.end();
303  for (; itm != endm; ++itm) {
304 
305  std::stringstream stream;
306  stream << "AthenaPoolTestMap: key " << (*itm).first
307  << " word " << (*itm).second.word()
308  << " Deposits: (barCode, evtIndx, wgt) ";
309 
310  deposits.clear();
311  (*itm).second.deposits(deposits);
312  for (unsigned int i = 0; i < deposits.size(); ++i) {
313  AthenaPoolTestMapDataLink& link = deposits[i].first;
314  stream << link.barcode() << " "
315  << link.eventIndex() << " "
316  << deposits[i].second << " ";
317  }
318  ATH_MSG_DEBUG(stream.str());
319  }
320  }
321 
322 
323  // Read back dummy classes
324 
325  const dummy_A* dummyA;
326  if (evtStore()->retrieve(dummyA, "Dummy_A").isFailure() ) {
327  ATH_MSG_ERROR("Could not retrieve Dummy_A");
328  }
329  else {
330  ATH_MSG_DEBUG("Read back dummy_A class " );
331  }
332  const std::vector<dummy_B>& b = dummyA->dummy();
333  ATH_MSG_DEBUG("Dummy A: size B " << b.size() );
334  for (unsigned int i = 0; i < b.size(); ++i) {
335  const std::vector<dummy_C>& c = b[i].dummy();
336  ATH_MSG_DEBUG("Dummy B: size C " << c.size() );
337  for (unsigned int j = 0; j < c.size(); ++j) {
338  ATH_MSG_DEBUG("i,c: " << j << " " << c[j].value() );
339  }
340  }
341 
342  // dummy_E, D
343 
344  const dummy_E* dummyE;
345  ATH_CHECK( evtStore()->retrieve(dummyE, "Dummy_E") );
346  const std::vector<const dummy_D*>& d = dummyE->dummy();
347  ATH_MSG_DEBUG("Dummy E: size D " << d.size() );
348  for (unsigned int i = 0; i < d.size(); ++i) {
349  ATH_MSG_DEBUG("Dummy D: value " << d[i]->value() );
350  }
351 
352 
353  // Read PileupEventInfo
354 
355  // Normal EventInfo
356  const EventInfo * evt = nullptr;
357  ATH_CHECK( evtStore()->retrieve( evt, "McEventInfo" ) );
358  ATH_MSG_DEBUG( "Normal EventInfo" );
359  ATH_MSG_DEBUG( "Event ID: ["
360  << evt->event_ID()->event_number() << ":"
361  << evt->event_ID()->time_stamp() << "] " );
362  ATH_MSG_DEBUG( *(evt->event_ID()) );
363  {
364  std::stringstream stream;
365  stream << "Event type: user type "
366  << evt->event_type()->user_type();
367  for (unsigned int i = 0; i < evt->event_type()->n_mc_event_weights (); ++i)
368  stream<< " weight " << i << ": " << evt->event_type()->mc_event_weight(i);
369  ATH_MSG_DEBUG(stream.str());
370  }
371 
372  // Check interactions per crossing
373  ATH_MSG_DEBUG( "Actual interatctions per crossing: "
374  << evt->actualInteractionsPerCrossing() << " and ave: "
375  << evt->averageInteractionsPerCrossing() );
376 
377  // We only loop up to Lumi and not nDets since Lumi is set separately
378  for (unsigned int i = 0; i < EventInfo::Lumi; ++i) {
379  ATH_MSG_DEBUG( "Subdet: " << i << " flags "
380  << MSG::hex << evt->eventFlags(EventInfo::EventFlagSubDet(i)) << MSG::dec );
382  if (error == EventInfo::NotSet)
383  ATH_MSG_DEBUG( "Subdet: " << i << " error state: NotSet " );
384  else if (error == EventInfo::Warning)
385  ATH_MSG_DEBUG( "Subdet: " << i << " error state: Warning " );
386  else if (error == EventInfo::Error)
387  ATH_MSG_DEBUG( "Subdet: " << i << " error state: Error " );
388  }
389 
390 
391  // PileupEventInfo as itself
392  const PileUpEventInfo* pevt = nullptr;
393  ATH_CHECK( evtStore()->retrieve( pevt, "OverlayEvent" ) );
394  ATH_MSG_DEBUG( "PileUpEventInfo" );
395  ATH_MSG_DEBUG( "Event ID: ["
396  << pevt->event_ID()->run_number() << ","
397  << pevt->event_ID()->event_number() << ":"
398  << pevt->event_ID()->time_stamp() << "] " );
399  ATH_MSG_DEBUG( *(pevt->event_ID()) );
400  ATH_MSG_DEBUG( "Event type: user type "
401  << pevt->event_type()->user_type() );
402 
403  {
404  std::stringstream stream;
405  stream << "Trigger info: status " << pevt->trigger_info()->statusElement()
406  << " extLvl1ID " << pevt->trigger_info()->extendedLevel1ID()
407  << " lvl1Type " << pevt->trigger_info()->level1TriggerType()
408  << " lvl1Info ";
409  for (unsigned int i = 0; i < pevt->trigger_info()->level1TriggerInfo().size(); ++i) {
410  stream << pevt->trigger_info()->level1TriggerInfo()[i] << " ";
411  }
412  stream << "lvl2Info ";
413  for (unsigned int i = 0; i < pevt->trigger_info()->level2TriggerInfo().size(); ++i) {
414  stream << pevt->trigger_info()->level2TriggerInfo()[i] << " ";
415  }
416  stream << "EventFilterInfo ";
417  for (unsigned int i = 0; i < pevt->trigger_info()->eventFilterInfo().size(); ++i) {
418  stream << pevt->trigger_info()->eventFilterInfo()[i] << " ";
419  }
420  stream << "EventFilterInfo ";
421  for (unsigned int i = 0; i < pevt->trigger_info()->streamTags().size(); ++i) {
422  stream << " i " << i << " name " << pevt->trigger_info()->streamTags()[i].name();
423  stream << " type " << pevt->trigger_info()->streamTags()[i].type();
424  stream << " ObeyLumi " << pevt->trigger_info()->streamTags()[i].obeysLumiblock();
425  }
426  ATH_MSG_DEBUG(stream.str());
427  }
428 
429  // Get normal event info as a sub-event info
430  ATH_MSG_DEBUG( "SubEventInfos" );
433  if (it == end) {
434  ATH_MSG_DEBUG( "None found" );
435  }
436  for (; it != end; ++it) {
437  const EventInfo* sevt = (*it).pSubEvt;
438  ATH_MSG_DEBUG( "Time, index "
439  << (*it).time() << " " << (*it).index() );
440  if (sevt) {
441  ATH_MSG_DEBUG( "Event ID: ["
442  << sevt->event_ID()->run_number() << ","
443  << sevt->event_ID()->event_number() << ":"
444  << sevt->event_ID()->time_stamp() << "] " );
445  ATH_MSG_DEBUG( "Event type: user type "
446  << sevt->event_type()->user_type() );
447  ATH_MSG_DEBUG( "Pileup time, index type "
448  << it->time() << " " << it->index() );
449  }
450  else {
451  ATH_MSG_DEBUG( "Subevent is null ptr " );
452  }
453  }
454 
455  if (error) return (StatusCode::FAILURE);
456 
457  return StatusCode::SUCCESS;
458 }

◆ 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 AthenaPoolTestDataReader::finalize ( )
virtual

Algorithm finalize at end of job.

Definition at line 460 of file AthenaPoolTestDataReader.cxx.

461 {
462  return StatusCode::SUCCESS;
463 }

◆ initialize()

StatusCode AthenaPoolTestDataReader::initialize ( )
virtual

Algorithm initialize at begin of job.

Definition at line 46 of file AthenaPoolTestDataReader.cxx.

47 {
48  return StatusCode::SUCCESS;
49 }

◆ 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_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_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
EventInfo::Error
@ Error
Definition: EventInfo/EventInfo/EventInfo.h:60
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
EventType::user_type
std::string user_type(void) const
Access to user type.
Definition: EventType.cxx:94
TriggerInfo::streamTags
const std::vector< StreamTag > & streamTags() const
get stream tags
Definition: TriggerInfo.cxx:158
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
EventInfo::Warning
@ Warning
Definition: EventInfo/EventInfo/EventInfo.h:60
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
AthenaPoolTestMatrix::matrixMaps_t
std::vector< std::map< unsigned int, CLHEP::HepMatrix > > matrixMaps_t
Definition: AthenaPoolTestMatrix.h:42
skel.it
it
Definition: skel.GENtoEVGEN.py:423
python.TrigConfigSvcUtils.test2
def test2()
Definition: TrigConfigSvcUtils.py:983
AthenaPoolTestB
Simple class with int,int,float,double for testing pool i/o from Athena.
Definition: AthenaPoolTestB.h:39
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
athena.value
value
Definition: athena.py:122
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
IAthenaPoolTestCollection
Interface class for AthenaPoolTest i/o tests with DataVector.
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TriggerInfo::level1TriggerInfo
const std::vector< number_type > & level1TriggerInfo() const
get level1 trigger info
Definition: TriggerInfo.cxx:143
AthenaPoolTestD
Simple class with HepGeom::Point3D<double> for testing pool i/o from Athena.
Definition: AthenaPoolTestD.h:33
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
EventInfo::EventFlagErrorState
EventFlagErrorState
Definition: EventInfo/EventInfo/EventInfo.h:59
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
PileUpEventInfo::beginSubEvt
SubEvent::iterator beginSubEvt()
Definition: PileUpEventInfo.h:131
AthenaPoolTestA
Simple class with two int's for testing pool i/o from Athena.
Definition: AthenaPoolTestA.h:40
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:92
EventInfo::NotSet
@ NotSet
Definition: EventInfo/EventInfo/EventInfo.h:60
TriggerInfo::level2TriggerInfo
const std::vector< number_type > & level2TriggerInfo() const
get level2 trigger info
Definition: TriggerInfo.cxx:148
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
EventInfo::event_ID
EventID * event_ID()
the unique identification of the event.
Definition: EventInfo/EventInfo/EventInfo.h:210
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
AthenaPoolTestMapData::Deposit
std::pair< AthenaPoolTestMapDataLink, float > Deposit
Definition: AthenaPoolTestMapData.h:38
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IAthenaPoolTestData
Interface class for AthenaPoolTest i/o tests.
Definition: IAthenaPoolTestData.h:38
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthenaPoolTestC
Simple class with four int's divided among protected/private for testing pool i/o from Athena.
Definition: AthenaPoolTestC.h:40
TriggerInfo::level1TriggerType
number_type level1TriggerType() const
get level1 trigger type
Definition: TriggerInfo.cxx:138
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
dummy_A
test nested vectors - problem seen in root3/4 transition
Definition: dummy_A.h:51
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:42
AthenaPoolTestMap
Definition: AthenaPoolTestMap.h:30
query_example.col
col
Definition: query_example.py:7
dummy_E::dummy
const std::vector< const dummy_D * > & dummy() const
Definition: dummy_E.h:47
PileUpEventInfo
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
Definition: PileUpEventInfo.h:37
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
TriggerInfo::extendedLevel1ID
number_type extendedLevel1ID() const
get extended level1 ID
Definition: TriggerInfo.cxx:133
a
TList * a
Definition: liststreamerinfos.cxx:10
TriggerInfo::eventFilterInfo
const std::vector< number_type > & eventFilterInfo() const
get event filter trigger info
Definition: TriggerInfo.cxx:153
h
EventInfo::Lumi
@ Lumi
Definition: EventInfo/EventInfo/EventInfo.h:54
dummy_E
Test derived class that contains a list of parent classes.
Definition: dummy_E.h:42
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PileUpEventInfo::SubEvent::const_iterator
std::list< SubEvent >::const_iterator const_iterator
Definition: PileUpEventInfo.h:97
EventInfo::trigger_info
TriggerInfo * trigger_info()
trigger information (ptr may be NULL)
Definition: EventInfo/EventInfo/EventInfo.h:230
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
python.TrigConfigSvcUtils.test1
def test1()
Definition: TrigConfigSvcUtils.py:980
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
EventInfo::EventFlagSubDet
EventFlagSubDet
Definition: EventInfo/EventInfo/EventInfo.h:53
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
dummy_A::dummy
const std::vector< dummy_B > & dummy() const
Definition: dummy_A.h:55
error
Definition: IImpactPoint3dEstimator.h:70
AthenaPoolTestMatrix
Simple class with various CLHEP classes for testing pool i/o from Athena.
Definition: AthenaPoolTestMatrix.h:36
TriggerInfo::statusElement
number_type statusElement() const
get status element
Definition: TriggerInfo.cxx:128
python.compressB64.c
def c
Definition: compressB64.py:93
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
EventInfo::event_type
EventType * event_type()
the type of the event, e.g. simulation, testbeam, etc
Definition: EventInfo/EventInfo/EventInfo.h:220
PileUpEventInfo::endSubEvt
SubEvent::iterator endSubEvt()
Definition: PileUpEventInfo.h:132
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37