ATLAS Offline Software
AthenaOutputStreamTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #include "AthenaOutputStreamTool.h"
11 
12 // Gaudi
13 #include "GaudiKernel/IConversionSvc.h"
14 #include "GaudiKernel/IOpaqueAddress.h"
15 #include "GaudiKernel/INamedInterface.h"
16 #include "GaudiKernel/IClassIDSvc.h"
17 #include "GaudiKernel/ThreadLocalContext.h"
18 
19 // Athena
22 #include "StoreGate/StoreGateSvc.h"
23 #include "SGTools/DataProxy.h"
24 #include "SGTools/SGIFolder.h"
28 #include "CxxUtils/starts_with.h"
29 
30 namespace {
31 
34 bool hasInputAlias (const SG::DataProxy& dp)
35 {
36  std::string inputName = dp.name() + "_Input";
37  return dp.hasAlias (inputName);
38 }
39 
40 
41 } // anonymous namespace
42 
45  const std::string& name,
46  const IInterface* parent) : ::AthAlgTool(type, name, parent),
47  m_store("DetectorStore", name),
48  m_conversionSvc("AthenaPoolCnvSvc", name),
49  m_clidSvc("ClassIDSvc", name),
50  m_decSvc("DecisionSvc/DecisionSvc", name),
51  m_dataHeader(nullptr),
52  m_connectionOpen(false),
53  m_extendProvenanceRecord(false) {
54  // Declare IAthenaOutputStreamTool interface
55  declareInterface<IAthenaOutputStreamTool>(this);
56 
57  declareProperty("SaveDecisions", m_extend = false, "Set to true to add streaming decisions to an attributeList");
58 }
59 //__________________________________________________________________________
61 }
62 //__________________________________________________________________________
64  ATH_MSG_INFO("Initializing " << name());
65 
66  ATH_CHECK( m_clidSvc.retrieve() );
67  ATH_CHECK( m_conversionSvc.retrieve() );
68 
69  // Autoconfigure
70  if (m_dataHeaderKey.empty()) {
71  m_dataHeaderKey.setValue(name());
72  // Remove "ToolSvc." from m_dataHeaderKey.
73  if (CxxUtils::starts_with (m_dataHeaderKey.value(), "ToolSvc.")) {
74  m_dataHeaderKey.setValue(m_dataHeaderKey.value().substr(8));
75  // Remove "Tool" from m_dataHeaderKey.
76  if (m_dataHeaderKey.value().find("Tool") == m_dataHeaderKey.size() - 4) {
77  m_dataHeaderKey.setValue(m_dataHeaderKey.value().substr(0, m_dataHeaderKey.size() - 4));
78  }
79  } else {
80  const INamedInterface* parentAlg = dynamic_cast<const INamedInterface*>(parent());
81  if (parentAlg != 0) {
82  m_dataHeaderKey.setValue(parentAlg->name());
83  }
84  }
85  }
86  if (m_processTag.empty()) {
87  m_processTag.setValue(m_dataHeaderKey);
88  }
89 
90  { // handle the AttrKey overwrite
91  const std::string keyword = "[AttributeListKey=";
92  std::string::size_type pos = m_outputName.value().find(keyword);
93  if( (pos != std::string::npos) ) {
94  ATH_MSG_INFO("The AttrListKey will be overwritten/set by the value from the OutputName: " << m_outputName);
95  const std::string attrListKey = m_outputName.value().substr(pos + keyword.size(),
96  m_outputName.value().find(']', pos + keyword.size()) - pos - keyword.size());
97  m_attrListKey = attrListKey;
98  }
99  }
100  if ( ! m_attrListKey.key().empty() ) {
102  m_attrListWrite = m_attrListKey.key() + "Decisions";
103  //ATH_CHECK(m_attrListWrite.initialize());
104  }
105 
106  if (!m_outputCollection.value().empty()) {
107  m_outputAttributes += "[OutputCollection=" + m_outputCollection.value() + "]";
108  }
109  if (!m_containerPrefix.value().empty()) {
110  m_outputAttributes += "[PoolContainerPrefix=" + m_containerPrefix.value() + "]";
111  }
112  if (m_containerNameHint.value() != "0") {
113  m_outputAttributes += "[TopLevelContainerName=" + m_containerNameHint.value() + "]";
114  }
115  if (m_branchNameHint.value() != "0") {
116  m_outputAttributes += "[SubLevelBranchName=" + m_branchNameHint.value() + "]";
117  }
118  if (!m_metaDataOutputCollection.value().empty()) {
119  m_metaDataOutputAttributes += "[OutputCollection=" + m_metaDataOutputCollection.value() + "]";
120  }
121  if (!m_metaDataContainerPrefix.value().empty()) {
122  m_metaDataOutputAttributes += "[PoolContainerPrefix=" + m_metaDataContainerPrefix.value() + "]";
123  }
124 
125  if (m_extend) ATH_CHECK(m_decSvc.retrieve());
126  return(StatusCode::SUCCESS);
127 }
128 //__________________________________________________________________________
130  m_decSvc.release().ignore();
131  if (m_conversionSvc.release().isFailure()) {
132  ATH_MSG_WARNING("Cannot release AthenaPoolCnvSvc");
133  }
134  if (m_clidSvc.release().isFailure()) {
135  ATH_MSG_WARNING("Cannot release the CLIDSvc");
136  }
137  return(StatusCode::SUCCESS);
138 }
139 //__________________________________________________________________________
141  const std::string& cnvSvc,
142  bool extendProvenenceRecord) {
143  // Release old data store
144  if (m_store.isValid()) {
145  if (m_store.release().isFailure()) {
146  ATH_MSG_ERROR("Could not release " << m_store.typeAndName() << " store");
147  }
148  }
149  m_store = ServiceHandle<StoreGateSvc>(dataStore, this->name());
150  if (cnvSvc != m_conversionSvc.type() && cnvSvc != "EventPersistencySvc") {
151  if (m_conversionSvc.release().isFailure()) {
152  ATH_MSG_ERROR("Could not release " << m_conversionSvc.type());
153  }
155  if (m_conversionSvc.retrieve().isFailure() || m_conversionSvc == 0) {
156  ATH_MSG_ERROR("Could not locate " << m_conversionSvc.type());
157  return(StatusCode::FAILURE);
158  }
159  }
160  m_extendProvenanceRecord = extendProvenenceRecord;
161  return(connectServices());
162 }
163 //__________________________________________________________________________
165  // Find the data store
166  if (m_store.retrieve().isFailure() || m_store == 0) {
167  ATH_MSG_ERROR("Could not locate " << m_store.typeAndName() << " store");
168  return(StatusCode::FAILURE);
169  }
170  return(StatusCode::SUCCESS);
171 }
172 //__________________________________________________________________________
174  ATH_MSG_DEBUG("In connectOutput " << outputName);
175 
176  // Use arg if not empty, save the output name
177  if (!outputName.empty()) {
178  m_outputName.setValue(outputName);
179  }
180  if (m_outputName.value().empty()) {
181  ATH_MSG_ERROR("No OutputName provided");
182  return(StatusCode::FAILURE);
183  }
184  // Connect services if not already available
185  if (m_store == 0 || m_conversionSvc == 0) {
186  if (connectServices().isFailure()) {
187  ATH_MSG_ERROR("Unable to connect services");
188  return(StatusCode::FAILURE);
189  }
190  }
191  // Connect the output file to the service
192  if (m_conversionSvc->connectOutput(m_outputName.value()).isFailure()) {
193  ATH_MSG_ERROR("Unable to connect output " << m_outputName.value());
194  return(StatusCode::FAILURE);
195  } else {
196  ATH_MSG_DEBUG("Connected to " << m_outputName.value());
197  }
198 
199  // Remove DataHeader with same key if it exists
200  if (m_store->contains<DataHeader>(m_dataHeaderKey)) {
201  const DataHeader* preDh = nullptr;
202  if (m_store->retrieve(preDh, m_dataHeaderKey).isSuccess()) {
203  if (m_store->removeDataAndProxy(preDh).isFailure()) {
204  ATH_MSG_ERROR("Unable to get proxy for the DataHeader with key " << m_dataHeaderKey);
205  return(StatusCode::FAILURE);
206  }
207  ATH_MSG_DEBUG("Released DataHeader with key " << m_dataHeaderKey);
208  }
209  }
210 
211  // Create new DataHeader
212  m_dataHeader = new DataHeader();
214 
215  // Retrieve all existing DataHeaders from StoreGate
216  const DataHeader* dh = nullptr;
217  std::vector<std::string> dhKeys;
218  m_store->keys<DataHeader>(dhKeys);
219  for (const std::string& dhKey : dhKeys) {
220  bool primaryDH = false;
221  if (!m_store->transientContains<DataHeader>(dhKey)) {
222  if (dhKey == "EventSelector") primaryDH = true;
223  ATH_MSG_DEBUG("No transientContains DataHeader with key " << dhKey);
224  }
225  if (m_store->retrieve(dh, dhKey).isFailure()) {
226  ATH_MSG_DEBUG("Unable to retrieve the DataHeader with key " << dhKey);
227  }
228  SG::DataProxy* dhProxy = m_store->proxy(dh);
229  if (dh->isInput() || hasInputAlias (*dhProxy) || primaryDH) {
230  // Add DataHeader token to new DataHeader
232  std::string pTag;
233  SG::TransientAddress* dhTransAddr = 0;
234  for (const DataHeaderElement& dhe : *dh) {
235  if (dhe.getPrimaryClassID() == ClassID_traits<DataHeader>::ID()) {
236  pTag = dhe.getKey();
237  delete dhTransAddr; dhTransAddr = dhe.getAddress(0);
238  }
239  }
240  // Update dhTransAddr to handle fast merged files.
241  if (dhProxy != 0 && dhProxy->address() != 0) {
242  delete dhTransAddr; dhTransAddr = 0;
244  dhProxy->address(),
245  pTag));
246  }
247  else if (dhTransAddr != nullptr) {
249  dhTransAddr->address(),
250  pTag));
251  delete dhTransAddr; dhTransAddr = 0;
252  }
253  }
254  for(auto iter=dh->beginProvenance(), iEnd=dh->endProvenance(); iter != iEnd; ++iter) {
256  }
257  }
258  }
259 
260  // Attach the attribute list to the DataHeader if requested
261  if (!m_attrListKey.key().empty() && m_store->storeID() == StoreID::EVENT_STORE) {
262  auto attrListHandle = SG::makeHandle(m_attrListKey);
263  if (!attrListHandle.isValid()) {
264  ATH_MSG_WARNING("Unable to retrieve AttributeList with key " << m_attrListKey);
265  } else {
266  m_dataHeader->setAttributeList(attrListHandle.cptr());
267  if (m_extend) { // Add streaming decisions
268  ATH_MSG_DEBUG("Adding stream decisions to " << m_attrListWrite);
269  // Look for attribute list created for mini-EventInfo
270  const AthenaAttributeList* attlist(attrListHandle.cptr());
271 
272  // Build new attribute list for modification
273  AthenaAttributeList* newone = new AthenaAttributeList(attlist->specification());
274  newone->copyData(*attlist);
275 
276  // Now loop over stream definitions and add decisions
277  auto streams = m_decSvc->getStreams();
278  for (auto it = streams.begin();
279  it != streams.end(); ++it) {
280  newone->extend(*it,"bool");
281  (*newone)[*it].data<bool>() = m_decSvc->isEventAccepted(*it,Gaudi::Hive::currentContext());
282  ATH_MSG_DEBUG("Added stream decision for " << *it << " to " << m_attrListKey);
283  }
284  // record new attribute list with old key + suffix
285  const AthenaAttributeList* attrList2 = nullptr;
286  if (!m_store->contains<AthenaAttributeList>(m_attrListWrite)) {
287  if (m_store->record(newone,m_attrListWrite).isFailure()) {
288  ATH_MSG_ERROR("Unable to record att list " << m_attrListWrite);
289  }
290  } else {
291  ATH_MSG_DEBUG("Decisions already added by a different stream");
292  }
293  if (m_store->retrieve(attrList2,m_attrListWrite).isFailure()) {
294  ATH_MSG_ERROR("Unable to record att list " << m_attrListWrite);
295  } else {
296  m_dataHeader->setAttributeList(attrList2);
297  }
298 /*
299  SG::WriteHandle<AthenaAttributeList> attrWrite(m_attrListWrite);
300  std::unique_ptr<AthenaAttributeList> uptr = std::make_unique<AthenaAttributeList>(*newone);
301  if ( attrWrite.record(std::move(uptr)).isFailure() ) {
302  ATH_MSG_ERROR("Unable to record att list " << m_attrListWrite);
303  } else {
304  ATH_MSG_DEBUG("Decisions already added by a different stream");
305  }
306 */
307  //m_dataHeader->setAttributeList(newone);
308  } // list extend check
309  } // list retrieve check
310  } // list property check
311 
312  // Record DataHeader in StoreGate
314  if (wh.record(std::unique_ptr<DataHeader>(m_dataHeader)).isFailure()) {
315  ATH_MSG_ERROR("Unable to record DataHeader with key " << m_dataHeaderKey);
316  return(StatusCode::FAILURE);
317  } else {
318  ATH_MSG_DEBUG("Recorded DataHeader with key " << m_dataHeaderKey);
319  }
321  // Set flag that connection is open
322  m_connectionOpen = true;
323  return(StatusCode::SUCCESS);
324 }
325 //__________________________________________________________________________
327  ATH_MSG_DEBUG("In commitOutput");
328  // Connect the output file to the service
329  if (m_conversionSvc->commitOutput(m_outputName.value(), doCommit).isFailure()) {
330  ATH_MSG_ERROR("Unable to commit output " << m_outputName.value());
331  return(StatusCode::FAILURE);
332  }
333  // Set flag that connection is closed
334  m_connectionOpen = false;
335  return(StatusCode::SUCCESS);
336 }
337 //__________________________________________________________________________
339  AthCnvSvc* athConversionSvc = dynamic_cast<AthCnvSvc*>(m_conversionSvc.get());
340  if (athConversionSvc != 0) {
341  if (athConversionSvc->disconnectOutput(m_outputName.value()).isFailure()) {
342  ATH_MSG_ERROR("Unable to finalize output " << m_outputName.value());
343  return(StatusCode::FAILURE);
344  }
345  }
346  return(StatusCode::SUCCESS);
347 }
348 //__________________________________________________________________________
350  ATH_MSG_DEBUG("In streamObjects");
351  // Check that a connection has been opened
352  if (!m_connectionOpen) {
353  ATH_MSG_ERROR("Connection NOT open. Please open a connection before streaming out objects.");
354  return(StatusCode::FAILURE);
355  }
356  // Use arg if not empty, save the output name
357  if (!outputName.empty()) {
358  m_outputName.setValue(outputName);
359  }
360  if (m_outputName.value().empty()) {
361  ATH_MSG_ERROR("No OutputName provided");
362  return(StatusCode::FAILURE);
363  }
364  // Now iterate over the type/key pairs and stream out each object
365  std::vector<DataObject*> dataObjects;
366  for (TypeKeyPairs::const_iterator first = typeKeys.begin(), last = typeKeys.end();
367  first != last; ++first) {
368  const std::string& type = (*first).first;
369  const std::string& key = (*first).second;
370  // Find the clid for type name from the CLIDSvc
371  CLID clid;
372  if (m_clidSvc->getIDOfTypeName(type, clid).isFailure()) {
373  ATH_MSG_ERROR("Could not get clid for typeName " << type);
374  return(StatusCode::FAILURE);
375  }
376  DataObject* dObj = 0;
377  // Two options: no key or explicit key
378  if (key.empty()) {
379  ATH_MSG_DEBUG("Get data object with no key");
380  // Get DataObject without key
381  dObj = m_store->accessData(clid);
382  } else {
383  ATH_MSG_DEBUG("Get data object with key");
384  // Get DataObjects with key
385  dObj = m_store->accessData(clid, key);
386  }
387  if (dObj == 0) {
388  // No object - print warning and return
389  ATH_MSG_DEBUG("No object found for type " << type << " key " << key);
390  return(StatusCode::SUCCESS);
391  } else {
392  ATH_MSG_DEBUG("Found object for type " << type << " key " << key);
393  }
394  // Save the dObj
395  dataObjects.push_back(dObj);
396  }
397  // Stream out objects
398  if (dataObjects.size() == 0) {
399  ATH_MSG_DEBUG("No data objects found");
400  return(StatusCode::SUCCESS);
401  }
402  StatusCode status = streamObjects(dataObjects, m_outputName.value());
403  if (!status.isSuccess()) {
404  ATH_MSG_ERROR("Could not stream out objects");
405  return(status);
406  }
407  return(StatusCode::SUCCESS);
408 }
409 //__________________________________________________________________________
411  // Check that a connection has been opened
412  if (!m_connectionOpen) {
413  ATH_MSG_ERROR("Connection NOT open. Please open a connection before streaming out objects.");
414  return(StatusCode::FAILURE);
415  }
416  // Connect the output file to the service
417  std::string outputConnectionString = outputName;
418  const std::string defaultMetaDataString = "[OutputCollection=MetaDataHdr][PoolContainerPrefix=MetaData]";
419  if (std::string::size_type mpos = outputConnectionString.find(defaultMetaDataString); mpos!=std::string::npos) {
420  // If we're in here we're writing MetaData
421  // Now let's see if we should be overwriting the MetaData attributes
422  // For the time-being this happens when we're writing MetaData in the augmentation mode
423  if (!m_metaDataOutputAttributes.empty()) {
424  // Note: This won't work quite right if only one attribute is set though!
425  outputConnectionString.replace(mpos, defaultMetaDataString.length(), m_metaDataOutputAttributes);
426  }
427  }
428  for (std::string::size_type pos = m_outputAttributes.find('['); pos != std::string::npos; pos = m_outputAttributes.find('[', ++pos)) {
429  if (outputConnectionString.find(m_outputAttributes.substr(pos, m_outputAttributes.find('=', pos) + 1 - pos)) == std::string::npos) {
430  outputConnectionString += m_outputAttributes.substr(pos, m_outputAttributes.find(']', pos) + 1 - pos);
431  }
432  }
433 
434  // Check that the DataHeader is still valid
435  DataObject* dataHeaderObj = m_store->accessData(ClassID_traits<DataHeader>::ID(), m_dataHeaderKey);
436  std::map<DataObject*, IOpaqueAddress*> written;
437  for (DataObject* dobj : dataObjects) {
438  // Do not write the DataHeader via the explicit list
439  if (dobj->clID() == ClassID_traits<DataHeader>::ID()) {
440  ATH_MSG_DEBUG("Explicit request to write DataHeader: " << dobj->name() << " - skipping it.");
441  // Do not stream out same object twice
442  } else if (written.find(dobj) != written.end()) {
443  // Print warning and skip
444  ATH_MSG_DEBUG("Trying to write DataObject twice (clid/key): " << dobj->clID() << " " << dobj->name());
445  ATH_MSG_DEBUG(" Skipping this one.");
446  } else {
447  // Write object
448  IOpaqueAddress* addr = new TokenAddress(0, dobj->clID(), outputConnectionString);
449  addr->addRef();
450  if (m_conversionSvc->createRep(dobj, addr).isSuccess()) {
451  written.insert(std::pair<DataObject*, IOpaqueAddress*>(dobj, addr));
452  } else {
453  ATH_MSG_ERROR("Could not create Rep for DataObject (clid/key):" << dobj->clID() << " " << dobj->name());
454  return(StatusCode::FAILURE);
455  }
456  }
457  }
458  // End of loop over DataObjects, write DataHeader
459  if (m_conversionSvc.type() == "AthenaPoolCnvSvc" && dataHeaderObj != nullptr) {
460  IOpaqueAddress* addr = new TokenAddress(0, dataHeaderObj->clID(), outputConnectionString);
461  addr->addRef();
462  if (m_conversionSvc->createRep(dataHeaderObj, addr).isSuccess()) {
463  written.insert(std::pair<DataObject*, IOpaqueAddress*>(dataHeaderObj, addr));
464  } else {
465  ATH_MSG_ERROR("Could not create Rep for DataHeader");
466  return(StatusCode::FAILURE);
467  }
468  }
469  for (DataObject* dobj : dataObjects) {
470  // call fillRepRefs of persistency service
471  SG::DataProxy* proxy = dynamic_cast<SG::DataProxy*>(dobj->registry());
472  if (proxy != nullptr && written.find(dobj) != written.end()) {
473  IOpaqueAddress* addr(written.find(dobj)->second);
474  if ((m_conversionSvc->fillRepRefs(addr, dobj)).isSuccess()) {
475  if (dobj->clID() != 1 || addr->par()[0] != "\n") {
476  if (dobj->clID() != ClassID_traits<DataHeader>::ID()) {
477  m_dataHeader->insert(proxy, addr);
478  } else {
480  }
481  if (proxy->address() == nullptr) {
482  proxy->setAddress(addr);
483  }
484  addr->release();
485  }
486  } else {
487  ATH_MSG_ERROR("Could not fill Object Refs for DataObject (clid/key):" << dobj->clID() << " " << dobj->name());
488  return(StatusCode::FAILURE);
489  }
490  } else {
491  ATH_MSG_WARNING("Could cast DataObject " << dobj->clID() << " " << dobj->name());
492  }
493  }
495  if (m_conversionSvc.type() == "AthenaPoolCnvSvc" && dataHeaderObj != nullptr) {
496  // End of DataObjects, fill refs for DataHeader
497  SG::DataProxy* proxy = dynamic_cast<SG::DataProxy*>(dataHeaderObj->registry());
498  if (proxy != nullptr && written.find(dataHeaderObj) != written.end()) {
499  IOpaqueAddress* addr(written.find(dataHeaderObj)->second);
500  if ((m_conversionSvc->fillRepRefs(addr, dataHeaderObj)).isSuccess()) {
501  if (dataHeaderObj->clID() != 1 || addr->par()[0] != "\n") {
502  if (dataHeaderObj->clID() != ClassID_traits<DataHeader>::ID()) {
503  m_dataHeader->insert(proxy, addr);
504  } else {
506  }
507  addr->release();
508  }
509  } else {
510  ATH_MSG_ERROR("Could not fill Object Refs for DataHeader");
511  return(StatusCode::FAILURE);
512  }
513  } else {
514  ATH_MSG_ERROR("Could not cast DataHeader");
515  return(StatusCode::FAILURE);
516  }
517  }
518  return(StatusCode::SUCCESS);
519 }
520 //__________________________________________________________________________
522  const std::string hltKey = "HLTAutoKey";
525  if (m_store->retrieve(beg, ending).isFailure() || beg == ending) {
526  ATH_MSG_DEBUG("No DataHeaders present in StoreGate");
527  } else {
528  for ( ; beg != ending; ++beg) {
529  if (m_store->transientContains<DataHeader>(beg.key()) && beg->isInput()) {
530  for (std::vector<DataHeaderElement>::const_iterator it = beg->begin(), itLast = beg->end();
531  it != itLast; ++it) {
532  // Only insert the primary clid, not the ones for the symlinks!
533  CLID clid = it->getPrimaryClassID();
534  if (clid != ClassID_traits<DataHeader>::ID()) {
535  //check the typename is known ... we make an exception if the key contains 'Aux.' ... aux containers may not have their keys known yet in some cases
536  //see https://its.cern.ch/jira/browse/ATLASG-59 for the solution
537  std::string typeName;
538  if (m_clidSvc->getTypeNameOfID(clid, typeName).isFailure() && it->getKey().find("Aux.") == std::string::npos) {
539  if (m_skippedItems.find(it->getKey()) == m_skippedItems.end()) {
540  ATH_MSG_WARNING("Skipping " << it->getKey() << " with unknown clid " << clid << " . Further warnings for this item are suppressed" );
541  m_skippedItems.insert(it->getKey());
542  }
543  continue;
544  }
545  ATH_MSG_DEBUG("Adding " << typeName << "#" << it->getKey() << " (clid " << clid << ") to itemlist");
546  const std::string keyName = it->getKey();
547  if (keyName.size() > 10 && keyName.compare(0, 10,hltKey)==0) {
548  p2BWrittenFromTool->add(clid, hltKey + "*").ignore();
549  } else if (keyName.size() > 10 && keyName.compare(keyName.size() - 10, 10, hltKey)==0) {
550  p2BWrittenFromTool->add(clid, "*" + hltKey).ignore();
551  } else {
552  p2BWrittenFromTool->add(clid, keyName).ignore();
553  }
554  }
555  }
556  }
557  }
558  }
559  ATH_MSG_DEBUG("Adding DataHeader for stream " << name());
560  return(StatusCode::SUCCESS);
561 }
AthenaOutputStreamTool::finalizeOutput
StatusCode finalizeOutput()
Finalize the output stream after the last commit, e.g.
Definition: AthenaOutputStreamTool.cxx:338
DataHeader::setProcessTag
void setProcessTag(const std::string &processTag)
Set ProcessTag for DataHeader.
Definition: DataHeader.cxx:243
TileDCSDataPlotter.dp
dp
Definition: TileDCSDataPlotter.py:840
AthenaOutputStreamTool::streamObjects
virtual StatusCode streamObjects(const TypeKeyPairs &typeKeys, const std::string &outputName="")
Definition: AthenaOutputStreamTool.cxx:349
SGIFolder.h
CxxUtils::starts_with
bool starts_with(const char *s, const char *prefix)
Test whether one null-terminated byte string starts with another.
IAthenaOutputStreamTool::TypeKeyPairs
std::vector< TypeKeyPair > TypeKeyPairs
Definition: IAthenaOutputStreamTool.h:99
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
python.outputTest_v2.streams
streams
Definition: outputTest_v2.py:55
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
DataHeader::setAttributeList
void setAttributeList(const coral::AttributeList *attrList)
Definition: DataHeader.cxx:308
AthenaOutputStreamTool::m_extend
bool m_extend
Flag to extend attribute list with stream flags from DecisionSvc.
Definition: AthenaOutputStreamTool.h:115
DataHeader::addHash
void addHash(IStringPool *pool)
Add new entry to hash map.
Definition: DataHeader.cxx:297
skel.it
it
Definition: skel.GENtoEVGEN.py:423
SG::TransientAddress
Definition: TransientAddress.h:32
AthCnvSvc.h
AthenaOutputStreamTool::m_dataHeader
DataHeader * m_dataHeader
Current DataHeader for streamed objects.
Definition: AthenaOutputStreamTool.h:109
AthenaOutputStreamTool::m_skippedItems
std::set< std::string > m_skippedItems
set of skipped item keys, because of missing CLID
Definition: AthenaOutputStreamTool.h:118
AthenaOutputStreamTool::m_metaDataContainerPrefix
StringProperty m_metaDataContainerPrefix
Definition: AthenaOutputStreamTool.h:93
AthenaOutputStreamTool::finalize
StatusCode finalize()
Definition: AthenaOutputStreamTool.cxx:129
PyPoolBrowser.dh
dh
Definition: PyPoolBrowser.py:102
AthenaOutputStreamTool::m_processTag
StringProperty m_processTag
Definition: AthenaOutputStreamTool.h:88
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
AthenaOutputStreamTool::connectServices
virtual StatusCode connectServices()
Do the real connection to services.
Definition: AthenaOutputStreamTool.cxx:164
DataHeader::insertProvenance
void insertProvenance(const DataHeaderElement &dhe)
Insert a new element into the "Provenance" vector.
Definition: DataHeader.cxx:293
SG::IFolder
a run-time configurable list of data objects
Definition: SGIFolder.h:25
TokenAddress
This class provides a Generic Transient Address for POOL tokens.
Definition: TokenAddress.h:21
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
AthenaOutputStreamTool::m_containerNameHint
StringProperty m_containerNameHint
Definition: AthenaOutputStreamTool.h:91
DataHeaderElement
This class provides a persistent form for the TransientAddress.
Definition: DataHeader.h:36
SG::DataProxy::address
virtual IOpaqueAddress * address() const override final
Retrieve IOpaqueAddress.
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
DataHeader
This class provides the layout for summary information stored for data written to POOL.
Definition: DataHeader.h:124
DataHeader::Output
@ Output
Definition: DataHeader.h:126
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
AthenaOutputStreamTool::m_dataHeaderKey
StringProperty m_dataHeaderKey
Definition: AthenaOutputStreamTool.h:87
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
AthenaOutputStreamTool::getInputItemList
virtual StatusCode getInputItemList(SG::IFolder *m_p2BWrittenFromTool)
Get ItemList from the OutputStreamTool (e.g. all input objects)
Definition: AthenaOutputStreamTool.cxx:521
test_pyathena.parent
parent
Definition: test_pyathena.py:15
parseDir.wh
wh
Definition: parseDir.py:46
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
plotmaker.keyName
keyName
Definition: plotmaker.py:145
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
jobOptions.pTag
string pTag
Definition: jobOptions.py:28
DataHeader.h
This file contains the class definition for the DataHeader and DataHeaderElement classes.
AthenaOutputStreamTool::AthenaOutputStreamTool
AthenaOutputStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard AlgTool Constructor.
Definition: AthenaOutputStreamTool.cxx:44
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
AthenaOutputStreamTool::m_containerPrefix
StringProperty m_containerPrefix
Definition: AthenaOutputStreamTool.h:90
IDecisionSvc.h
starts_with.h
C++20-like starts_with/ends_with for strings.
DataHeader::insert
void insert(const SG::TransientAddress *sgAddress, IOpaqueAddress *tokAddress=0, const std::string &pTag="")
Insert a new element into the "DataObject" vector.
Definition: DataHeader.cxx:267
AthenaOutputStreamTool::m_branchNameHint
StringProperty m_branchNameHint
Definition: AthenaOutputStreamTool.h:94
AthenaOutputStreamTool::m_outputCollection
StringProperty m_outputCollection
Definition: AthenaOutputStreamTool.h:89
DataHeader::setStatus
void setStatus(statusFlag status)
Set StatusFlag enum for DataHeader.
Definition: DataHeader.cxx:235
AthenaOutputStreamTool::m_conversionSvc
ServiceHandle< IConversionSvc > m_conversionSvc
Keep reference to the data conversion service.
Definition: AthenaOutputStreamTool.h:103
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
AthenaOutputStreamTool::m_metaDataOutputCollection
StringProperty m_metaDataOutputCollection
Definition: AthenaOutputStreamTool.h:92
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
AthenaOutputStreamTool::m_metaDataOutputAttributes
std::string m_metaDataOutputAttributes
Definition: AthenaOutputStreamTool.h:96
lumiFormat.outputName
string outputName
Definition: lumiFormat.py:71
AthenaOutputStreamTool::m_outputAttributes
std::string m_outputAttributes
Definition: AthenaOutputStreamTool.h:95
AthenaAttributeList.h
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
AthenaOutputStreamTool::initialize
StatusCode initialize()
AthAlgTool Interface method implementations:
Definition: AthenaOutputStreamTool.cxx:63
AthenaOutputStreamTool::m_attrListKey
SG::ReadHandleKey< AthenaAttributeList > m_attrListKey
Definition: AthenaOutputStreamTool.h:97
TokenAddress.h
This file contains the class definition for the TokenAddress class.
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AthenaOutputStreamTool::m_extendProvenanceRecord
bool m_extendProvenanceRecord
Flag as to whether to extend provenance via the DataHeader.
Definition: AthenaOutputStreamTool.h:113
AthenaOutputStreamTool::connectOutput
StatusCode connectOutput(const std::string &outputName="")
Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wan...
Definition: AthenaOutputStreamTool.cxx:173
IAthenaOutputStreamTool::DataObjectVec
std::vector< DataObject * > DataObjectVec
Stream out a vector of objects Must convert to DataObject, e.g.
Definition: IAthenaOutputStreamTool.h:107
AthenaOutputStreamTool::m_store
ServiceHandle< StoreGateSvc > m_store
Definition: AthenaOutputStreamTool.h:101
SG::IFolder::add
virtual StatusCode add(const std::string &typeName, const std::string &skey)=0
add a data object identifier to the list
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthenaOutputStreamTool::m_connectionOpen
bool m_connectionOpen
Flag to tell whether connectOutput has been called.
Definition: AthenaOutputStreamTool.h:111
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:534
AthenaOutputStreamTool.h
This is the implementation of IAthenaOutputStreamTool.
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
AthCnvSvc::disconnectOutput
virtual StatusCode disconnectOutput(const std::string &output)
Disconnect output files from the service.
Definition: AthCnvSvc.cxx:437
merge.status
status
Definition: merge.py:17
StoreID::EVENT_STORE
@ EVENT_STORE
Definition: StoreID.h:26
AthenaOutputStreamTool::m_clidSvc
ServiceHandle< IClassIDSvc > m_clidSvc
Ref to ClassIDSvc to convert type name to clid.
Definition: AthenaOutputStreamTool.h:105
AthenaOutputStreamTool::m_decSvc
ServiceHandle< IDecisionSvc > m_decSvc
Ref to DecisionSvc.
Definition: AthenaOutputStreamTool.h:107
AthAlgTool
Definition: AthAlgTool.h:26
SG::DataProxy
Definition: DataProxy.h:44
LArParamsProperties::keyword
std::string keyword(const std::string &classname)
Definition: LArParamsProperties.cxx:160
StoreGateSvc.h
SG::ConstIterator
Definition: SGIterator.h:163
AthCnvSvc
Definition: AthCnvSvc.h:67
AthenaOutputStreamTool::m_attrListWrite
std::string m_attrListWrite
Definition: AthenaOutputStreamTool.h:99
AthenaOutputStreamTool::commitOutput
StatusCode commitOutput(bool doCommit=false)
Commit the output stream after having streamed out objects Must commitOutput AFTER streaming.
Definition: AthenaOutputStreamTool.cxx:326
AthenaOutputStreamTool::~AthenaOutputStreamTool
virtual ~AthenaOutputStreamTool()
Destructor.
Definition: AthenaOutputStreamTool.cxx:60
ServiceHandle< StoreGateSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
DataProxy.h
AthenaOutputStreamTool::m_outputName
StringProperty m_outputName
Definition: AthenaOutputStreamTool.h:86