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

This is the implementation of IAthenaOutputStreamTool. More...

#include <AthenaOutputStreamTool.h>

Inheritance diagram for AthenaOutputStreamTool:
Collaboration diagram for AthenaOutputStreamTool:

Public Types

typedef std::pair< std::string, std::string > TypeKeyPair
 Stream out objects. More...
 
typedef std::vector< TypeKeyPairTypeKeyPairs
 
typedef std::vector< DataObject * > DataObjectVec
 Stream out a vector of objects Must convert to DataObject, e.g. More...
 

Public Member Functions

 AthenaOutputStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard AlgTool Constructor. More...
 
virtual ~AthenaOutputStreamTool ()
 Destructor. More...
 
StatusCode initialize ()
 AthAlgTool Interface method implementations: More...
 
StatusCode finalize ()
 
StatusCode connectServices (const std::string &dataStore, const std::string &cnvSvc, bool extendProvenenceRecord)
 Specify which data store and conversion service to use and whether to extend provenance Only use if one wants to override jobOptions. More...
 
StatusCode connectOutput (const std::string &outputName="")
 Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wants to override jobOptions. More...
 
StatusCode commitOutput (bool doCommit=false)
 Commit the output stream after having streamed out objects Must commitOutput AFTER streaming. More...
 
StatusCode finalizeOutput ()
 Finalize the output stream after the last commit, e.g. More...
 
virtual StatusCode streamObjects (const TypeKeyPairs &typeKeys, const std::string &outputName="")
 
virtual StatusCode streamObjects (const DataObjectVec &dataObjects, const std::string &outputName="")
 
virtual StatusCode getInputItemList (SG::IFolder *m_p2BWrittenFromTool)
 Get ItemList from the OutputStreamTool (e.g. all input objects) 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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Gaudi boilerplate. More...
 

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

virtual StatusCode connectServices ()
 Do the real connection to services. More...
 
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

StringProperty m_outputName { this, "OutputFile", "", "name of the output db name"}
 
StringProperty m_dataHeaderKey { this, "DataHeaderKey", "", "name of the data header key: defaults to tool name"}
 
StringProperty m_processTag { this, "ProcessingTag", "", "tag of processing stage: defaults to SG key of DataHeader (Stream name)"}
 
StringProperty m_outputCollection { this, "OutputCollection", "", "custom container name prefix for DataHeader: default = "" (will result in \"POOLContainer_\")"}
 
StringProperty m_containerPrefix { this, "PoolContainerPrefix", "", "prefix for top level POOL container: default = \"CollectionTree\""}
 
StringProperty m_containerNameHint { this, "TopLevelContainerName", "0", "naming hint policy for top level POOL container: default = \"0\""}
 
StringProperty m_metaDataOutputCollection { this, "MetaDataOutputCollection", "", "custom container name prefix for MetaDataHeader: default = "" (will result in \"MetaDataHdr\")"}
 
StringProperty m_metaDataContainerPrefix { this, "MetaDataPoolContainerPrefix", "", "prefix for top level MetaData container: default = "" (will result in \"MetaData\")"}
 
StringProperty m_branchNameHint { this, "SubLevelBranchName", "0", "naming hint policy for POOL branching: default = \"0\"" }
 
std::string m_outputAttributes {""}
 
std::string m_metaDataOutputAttributes {""}
 
SG::ReadHandleKey< AthenaAttributeListm_attrListKey {this, "AttributeListKey", "", "optional key for AttributeList to be written as part of the DataHeader: default = \"\""}
 
std::string m_attrListWrite {""}
 
ServiceHandle< StoreGateSvcm_store { this, "Store", "StoreGateSvc/DetectorStore", "Pointer to the data store"}
 
ServiceHandle< IConversionSvc > m_conversionSvc
 Keep reference to the data conversion service. More...
 
ServiceHandle< IClassIDSvc > m_clidSvc
 Ref to ClassIDSvc to convert type name to clid. More...
 
ServiceHandle< IDecisionSvcm_decSvc
 Ref to DecisionSvc. More...
 
DataHeaderm_dataHeader
 Current DataHeader for streamed objects. More...
 
bool m_connectionOpen
 Flag to tell whether connectOutput has been called. More...
 
bool m_extendProvenanceRecord
 Flag as to whether to extend provenance via the DataHeader. More...
 
bool m_extend
 Flag to extend attribute list with stream flags from DecisionSvc. More...
 
std::set< std::string > m_skippedItems
 set of skipped item keys, because of missing CLID More...
 
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

This is the implementation of IAthenaOutputStreamTool.

Definition at line 31 of file AthenaOutputStreamTool.h.

Member Typedef Documentation

◆ DataObjectVec

typedef std::vector<DataObject*> AthenaOutputStreamTool::DataObjectVec

Stream out a vector of objects Must convert to DataObject, e.g.

#include "AthenaKernel/StorableConversions.h" T* obj = xxx; DataObject* dataObject = SG::asStorable(obj);

Definition at line 76 of file AthenaOutputStreamTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TypeKeyPair

typedef std::pair<std::string, std::string> AthenaOutputStreamTool::TypeKeyPair

Stream out objects.

Provide vector of typeName/key pairs. If key is empty, assumes only one object and this will fail if there is more than one

Definition at line 67 of file AthenaOutputStreamTool.h.

◆ TypeKeyPairs

Definition at line 68 of file AthenaOutputStreamTool.h.

Constructor & Destructor Documentation

◆ AthenaOutputStreamTool()

AthenaOutputStreamTool::AthenaOutputStreamTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard AlgTool Constructor.

Constructor.

Definition at line 44 of file AthenaOutputStreamTool.cxx.

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),
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 }

◆ ~AthenaOutputStreamTool()

AthenaOutputStreamTool::~AthenaOutputStreamTool ( )
virtual

Destructor.

Definition at line 60 of file AthenaOutputStreamTool.cxx.

60  {
61 }

Member Function Documentation

◆ commitOutput()

StatusCode AthenaOutputStreamTool::commitOutput ( bool  doCommit = false)
virtual

Commit the output stream after having streamed out objects Must commitOutput AFTER streaming.

Implements IAthenaOutputStreamTool.

Definition at line 326 of file AthenaOutputStreamTool.cxx.

326  {
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 }

◆ connectOutput()

StatusCode AthenaOutputStreamTool::connectOutput ( const std::string &  outputName = "")
virtual

Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wants to override jobOptions.

Implements IAthenaOutputStreamTool.

Definition at line 173 of file AthenaOutputStreamTool.cxx.

173  {
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 }

◆ connectServices() [1/2]

StatusCode AthenaOutputStreamTool::connectServices ( )
privatevirtual

Do the real connection to services.

Definition at line 164 of file AthenaOutputStreamTool.cxx.

164  {
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 }

◆ connectServices() [2/2]

StatusCode AthenaOutputStreamTool::connectServices ( const std::string &  dataStore,
const std::string &  cnvSvc,
bool  extendProvenenceRecord 
)
virtual

Specify which data store and conversion service to use and whether to extend provenance Only use if one wants to override jobOptions.

Implements IAthenaOutputStreamTool.

Definition at line 140 of file AthenaOutputStreamTool.cxx.

142  {
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 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ finalize()

StatusCode AthenaOutputStreamTool::finalize ( )

Definition at line 129 of file AthenaOutputStreamTool.cxx.

129  {
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 }

◆ finalizeOutput()

StatusCode AthenaOutputStreamTool::finalizeOutput ( )
virtual

Finalize the output stream after the last commit, e.g.

in finalize

Implements IAthenaOutputStreamTool.

Definition at line 338 of file AthenaOutputStreamTool.cxx.

338  {
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 }

◆ getInputItemList()

StatusCode AthenaOutputStreamTool::getInputItemList ( SG::IFolder m_p2BWrittenFromTool)
virtual

Get ItemList from the OutputStreamTool (e.g. all input objects)

Implements IAthenaOutputStreamTool.

Definition at line 521 of file AthenaOutputStreamTool.cxx.

521  {
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 }

◆ initialize()

StatusCode AthenaOutputStreamTool::initialize ( )

AthAlgTool Interface method implementations:

Definition at line 63 of file AthenaOutputStreamTool.cxx.

63  {
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 }

◆ inputHandles()

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

◆ interfaceID()

const InterfaceID & IAthenaOutputStreamTool::interfaceID ( )
inlinestaticinherited

Gaudi boilerplate.

Definition at line 119 of file IAthenaOutputStreamTool.h.

119  {
120  static const InterfaceID IID("IAthenaOutputStreamTool", 1, 0);
121  return IID;
122 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::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< AlgTool >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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  }

◆ streamObjects() [1/2]

StatusCode AthenaOutputStreamTool::streamObjects ( const DataObjectVec dataObjects,
const std::string &  outputName = "" 
)
virtual

Implements IAthenaOutputStreamTool.

Definition at line 410 of file AthenaOutputStreamTool.cxx.

410  {
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 }

◆ streamObjects() [2/2]

StatusCode AthenaOutputStreamTool::streamObjects ( const TypeKeyPairs typeKeys,
const std::string &  outputName = "" 
)
virtual

Implements IAthenaOutputStreamTool.

Definition at line 349 of file AthenaOutputStreamTool.cxx.

349  {
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 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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_attrListKey

SG::ReadHandleKey<AthenaAttributeList> AthenaOutputStreamTool::m_attrListKey {this, "AttributeListKey", "", "optional key for AttributeList to be written as part of the DataHeader: default = \"\""}
private

Definition at line 97 of file AthenaOutputStreamTool.h.

◆ m_attrListWrite

std::string AthenaOutputStreamTool::m_attrListWrite {""}
private

Definition at line 99 of file AthenaOutputStreamTool.h.

◆ m_branchNameHint

StringProperty AthenaOutputStreamTool::m_branchNameHint { this, "SubLevelBranchName", "0", "naming hint policy for POOL branching: default = \"0\"" }
private

Definition at line 94 of file AthenaOutputStreamTool.h.

◆ m_clidSvc

ServiceHandle<IClassIDSvc> AthenaOutputStreamTool::m_clidSvc
private

Ref to ClassIDSvc to convert type name to clid.

Definition at line 105 of file AthenaOutputStreamTool.h.

◆ m_connectionOpen

bool AthenaOutputStreamTool::m_connectionOpen
private

Flag to tell whether connectOutput has been called.

Definition at line 111 of file AthenaOutputStreamTool.h.

◆ m_containerNameHint

StringProperty AthenaOutputStreamTool::m_containerNameHint { this, "TopLevelContainerName", "0", "naming hint policy for top level POOL container: default = \"0\""}
private

Definition at line 91 of file AthenaOutputStreamTool.h.

◆ m_containerPrefix

StringProperty AthenaOutputStreamTool::m_containerPrefix { this, "PoolContainerPrefix", "", "prefix for top level POOL container: default = \"CollectionTree\""}
private

Definition at line 90 of file AthenaOutputStreamTool.h.

◆ m_conversionSvc

ServiceHandle<IConversionSvc> AthenaOutputStreamTool::m_conversionSvc
private

Keep reference to the data conversion service.

Definition at line 103 of file AthenaOutputStreamTool.h.

◆ m_dataHeader

DataHeader* AthenaOutputStreamTool::m_dataHeader
private

Current DataHeader for streamed objects.

Definition at line 109 of file AthenaOutputStreamTool.h.

◆ m_dataHeaderKey

StringProperty AthenaOutputStreamTool::m_dataHeaderKey { this, "DataHeaderKey", "", "name of the data header key: defaults to tool name"}
private

Definition at line 87 of file AthenaOutputStreamTool.h.

◆ m_decSvc

ServiceHandle<IDecisionSvc> AthenaOutputStreamTool::m_decSvc
private

Ref to DecisionSvc.

Definition at line 107 of file AthenaOutputStreamTool.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extend

bool AthenaOutputStreamTool::m_extend
private

Flag to extend attribute list with stream flags from DecisionSvc.

Definition at line 115 of file AthenaOutputStreamTool.h.

◆ m_extendProvenanceRecord

bool AthenaOutputStreamTool::m_extendProvenanceRecord
private

Flag as to whether to extend provenance via the DataHeader.

Definition at line 113 of file AthenaOutputStreamTool.h.

◆ m_metaDataContainerPrefix

StringProperty AthenaOutputStreamTool::m_metaDataContainerPrefix { this, "MetaDataPoolContainerPrefix", "", "prefix for top level MetaData container: default = "" (will result in \"MetaData\")"}
private

Definition at line 93 of file AthenaOutputStreamTool.h.

◆ m_metaDataOutputAttributes

std::string AthenaOutputStreamTool::m_metaDataOutputAttributes {""}
private

Definition at line 96 of file AthenaOutputStreamTool.h.

◆ m_metaDataOutputCollection

StringProperty AthenaOutputStreamTool::m_metaDataOutputCollection { this, "MetaDataOutputCollection", "", "custom container name prefix for MetaDataHeader: default = "" (will result in \"MetaDataHdr\")"}
private

Definition at line 92 of file AthenaOutputStreamTool.h.

◆ m_outputAttributes

std::string AthenaOutputStreamTool::m_outputAttributes {""}
private

Definition at line 95 of file AthenaOutputStreamTool.h.

◆ m_outputCollection

StringProperty AthenaOutputStreamTool::m_outputCollection { this, "OutputCollection", "", "custom container name prefix for DataHeader: default = "" (will result in \"POOLContainer_\")"}
private

Definition at line 89 of file AthenaOutputStreamTool.h.

◆ m_outputName

StringProperty AthenaOutputStreamTool::m_outputName { this, "OutputFile", "", "name of the output db name"}
private

Definition at line 86 of file AthenaOutputStreamTool.h.

◆ m_processTag

StringProperty AthenaOutputStreamTool::m_processTag { this, "ProcessingTag", "", "tag of processing stage: defaults to SG key of DataHeader (Stream name)"}
private

Definition at line 88 of file AthenaOutputStreamTool.h.

◆ m_skippedItems

std::set<std::string> AthenaOutputStreamTool::m_skippedItems
private

set of skipped item keys, because of missing CLID

Definition at line 118 of file AthenaOutputStreamTool.h.

◆ m_store

ServiceHandle<StoreGateSvc> AthenaOutputStreamTool::m_store { this, "Store", "StoreGateSvc/DetectorStore", "Pointer to the data store"}
private

Definition at line 101 of file AthenaOutputStreamTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
DataHeader::setProcessTag
void setProcessTag(const std::string &processTag)
Set ProcessTag for DataHeader.
Definition: DataHeader.cxx:243
AthenaOutputStreamTool::streamObjects
virtual StatusCode streamObjects(const TypeKeyPairs &typeKeys, const std::string &outputName="")
Definition: AthenaOutputStreamTool.cxx:349
CxxUtils::starts_with
bool starts_with(const char *s, const char *prefix)
Test whether one null-terminated byte string starts with another.
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
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
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthenaOutputStreamTool::m_metaDataContainerPrefix
StringProperty m_metaDataContainerPrefix
Definition: AthenaOutputStreamTool.h:93
PyPoolBrowser.dh
dh
Definition: PyPoolBrowser.py:102
AthenaOutputStreamTool::m_processTag
StringProperty m_processTag
Definition: AthenaOutputStreamTool.h:88
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
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::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
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
AthCommonDataStore
Definition: AthCommonDataStore.h:52
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
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
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
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
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
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
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
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
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
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
AthenaOutputStreamTool::m_attrListKey
SG::ReadHandleKey< AthenaAttributeList > m_attrListKey
Definition: AthenaOutputStreamTool.h:97
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
a
TList * a
Definition: liststreamerinfos.cxx:10
h
AthenaOutputStreamTool::m_store
ServiceHandle< StoreGateSvc > m_store
Definition: AthenaOutputStreamTool.h:101
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
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthCnvSvc::disconnectOutput
virtual StatusCode disconnectOutput(const std::string &output)
Disconnect output files from the service.
Definition: AthCnvSvc.cxx:437
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
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
SG::DataProxy
Definition: DataProxy.h:44
LArParamsProperties::keyword
std::string keyword(const std::string &classname)
Definition: LArParamsProperties.cxx:160
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
AthCnvSvc
Definition: AthCnvSvc.h:67
AthenaOutputStreamTool::m_attrListWrite
std::string m_attrListWrite
Definition: AthenaOutputStreamTool.h:99
fitman.k
k
Definition: fitman.py:528
ServiceHandle< StoreGateSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
AthenaOutputStreamTool::m_outputName
StringProperty m_outputName
Definition: AthenaOutputStreamTool.h:86