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

#include <AANTupleStream.h>

Inheritance diagram for AANTupleStream:
Collaboration diagram for AANTupleStream:

Public Member Functions

 AANTupleStream (const std::string &name, ISvcLocator *pSvcLocator)
 Standard AANTupleStream Constructor. More...
 
virtual ~AANTupleStream ()
 Standard Destructor. More...
 
virtual StatusCode initialize ()
 Initialize AANTupleStream. More...
 
virtual StatusCode finalize ()
 Terminate AANTupleStream. More...
 
virtual StatusCode execute ()
 Working entry point. More...
 
const EventContext & getContext () const
 
virtual const DataObjIDColl & extraOutputDeps () const override
 
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
 

Protected Member Functions

bool isReEntrant () const override final
 
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

StatusCode initCollection ()
 Initialize the output collection. More...
 
StatusCode getRef (CLID id, const std::string &key, std::string &ref)
 Get ref from a proxy. More...
 
StatusCode splitAddress (const std::string &address, const std::string &match, std::string &address_header, std::string &address_data) const
 Split the address to get pool token. More...
 
StatusCode initialize_subAlgos ()
 initialize sub-algos More...
 
StatusCode execute_subAlgos ()
 execute sub-algos More...
 
void writeAttributeListSpecification ()
 write schema of AttributeList More...
 
void setupTree ()
 setup Tree More...
 
bool writeTokenAttrList (const std::string &token, const coral::AttributeList &attributeList)
 write Token and AttributeList More...
 
StatusCode getFilters ()
 get filter alogs More...
 
bool isEventAccepted () const
 check filters passed More...
 
StatusCode initSchema ()
 
StatusCode io_reinit ()
 callback method to reinitialize the internal state of the component for I/O purposes (e.g. 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

ServiceHandle< IAddressCreator > m_persSvc
 Persistency service. More...
 
coral::AttributeListSpecification * m_attribSpec
 Collection attribute specification. More...
 
std::string m_fileName
 Name of the output collection. More...
 
StringArrayProperty m_extraRefNames
 Vector of extra parent ref names to register in collection. More...
 
BooleanProperty m_writeInputDH
 Flag to signal whether or not to write input data header. More...
 
BooleanProperty m_existDH
 Flag to signal whether data header exists. More...
 
std::string m_streamName
 Name of Stream. More...
 
BooleanProperty m_lateSchema
 write schema in execute() More...
 
std::string m_macro
 macro More...
 
bool m_schemaDone
 first event More...
 
std::string m_treeName
 Name of the output tree. More...
 
std::vector< std::string > m_acceptNames
 Vector of names of Algorithms that this stream accepts. More...
 
std::vector< Algorithm * > m_acceptAlgs
 Vector of Algorithms that this stream accepts. More...
 
TTree * m_tree
 TTree. More...
 
TBranch * m_tokenBranch
 TBranch which contains Token info. More...
 
ServiceHandle< ITHistSvc > m_tHistSvc
 THistSvc. More...
 
std::vector< std::string > m_membersNames
 
char m_tokenCString [s_maxLengthOfStrings]
 
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
 

Static Private Attributes

static const unsigned int s_maxLengthOfStrings = 5000
 for string branches More...
 

Detailed Description

Definition at line 33 of file AANTupleStream.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ AANTupleStream()

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

Standard AANTupleStream Constructor.

Definition at line 48 of file AANTupleStream.cxx.

49  : AthLegacySequence(name, pSvcLocator),
50  m_persSvc ("EventPersistencySvc", name),
51  m_attribSpec(0),
52  m_schemaDone(false),
53  m_tree(0),
54  m_tokenBranch(0),
55  m_tHistSvc ("THistSvc", name)
56 {
57  declareProperty("OutputName", m_fileName="AANTuple.root");
58  declareProperty("ExtraRefNames", m_extraRefNames);
59  declareProperty("WriteInputDataHeader", m_writeInputDH=false);
60  declareProperty("ExistDataHeader", m_existDH=true);
61  declareProperty("StreamName", m_streamName=c_streamName);
62  declareProperty("LateSchemaWriting", m_lateSchema=false);
63  declareProperty("TreeName", m_treeName=c_treeName);
64  declareProperty("Macro", m_macro="");
65  declareProperty("Members", m_membersNames);
66  declareProperty("FilterAlgs", m_acceptNames);
67 
68  m_tokenCString[0] = '\0';
69 }

◆ ~AANTupleStream()

AANTupleStream::~AANTupleStream ( )
virtual

Standard Destructor.

Definition at line 73 of file AANTupleStream.cxx.

74 {
75 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::detStore
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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::evtStore
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 AANTupleStream::execute ( )
virtual

Working entry point.

Implements AthLegacySequence.

Definition at line 202 of file AANTupleStream.cxx.

203 {
204  StatusCode sc;
205 
206  if (!m_schemaDone) {
207  sc = initSchema();
208  if (sc.isFailure())
209  return sc;
210  }
211 
212  // execute sub-algos
213  sc = execute_subAlgos();
214  if ( sc.isFailure() )
215  {
216  ATH_MSG_ERROR ("Could not execute sub-algos");
217  return sc;
218  }
219 
220  std::map<std::string,std::string> inputRefs;
221  std::string ref;
222 
223  // Get tokens specified by item list
224  if (m_existDH)
225  {
226  // get token
229  StatusCode status = evtStore()->retrieve(beg,ending);
230  if (status.isFailure() || beg==ending)
231  {
232  ATH_MSG_WARNING ("No DataHeaders present in StoreGate");
233  return StatusCode::FAILURE;
234  }
235 
236  // look for header
237  for (; beg != ending; ++beg)
238  if (m_writeInputDH == beg->isInput()) break;
239 
240  if (beg==ending)
241  {
242  ATH_MSG_WARNING ("No appropriate DataHeader present in StoreGate");
243  return StatusCode::FAILURE;
244  }
245 
246  // get the ref
247  while (getRef(ClassID_traits<DataHeader>::ID(), beg.key(), ref) == StatusCode::FAILURE)
248  {
249  ++beg;
250  if (beg==ending)
251  {
252  ATH_MSG_ERROR ("No refs found");
253  return StatusCode::FAILURE;
254  }
255  }
256 
257  ATH_MSG_DEBUG ("Found token: Key=" << beg.key() << ", Ref=" << ref);
258 
259  // Get a single input header ref if requested
260  const DataHeader* hdr = &(*beg);
261  if (hdr->sizeProvenance())
262  {
263  std::vector<DataHeaderElement>::const_iterator it =
264  (const_cast<DataHeader*>(hdr)->beginProvenance());
265  std::vector<DataHeaderElement>::const_iterator itE =
266  (const_cast<DataHeader*>(hdr)->endProvenance());
267  // grab refs for those
268  for (; it!=itE; ++it)
269  {
270  std::string tmpRef = (*it).getToken() != NULL
271  ? (*it).getToken()->toString()
272  : "";
273  inputRefs.insert(std::make_pair(it->getKey(),tmpRef));
274  ATH_MSG_DEBUG ("Found ref for input header: Key=" << it->getKey()
275  << ", Ref=" << tmpRef);
276  }
277  }
278  }
279 
280  // create Attrlist, add attributes and if extra ref is requested, append to the end
281 
282  ATH_MSG_DEBUG ("create AttributeList");
283  // AthenaAttributeList newAttr(*m_attribSpec);
285 
286  unsigned int runNumber = 0;
287  unsigned int eventNumber = 0;
288 
289  // retrieve event info
290  const EventInfo* eventInfo;
291  eventInfo = evtStore()->tryConstRetrieve<EventInfo>();
292  if ( !eventInfo )
293  {
294  // Try to get the xAOD::EventInfo
295  const xAOD::EventInfo* eventInfoX{nullptr};
296  sc = evtStore()->retrieve(eventInfoX);
297  if (sc.isFailure())
298  {
299  ATH_MSG_ERROR ("Cannot get event info.");
300  return sc;
301  }
302  else
303  {
304  runNumber = eventInfoX->runNumber();
305  eventNumber = eventInfoX->eventNumber();
306  }
307  }
308  else
309  {
310  runNumber = eventInfo->event_ID()->run_number();
311  eventNumber = eventInfo->event_ID()->event_number();
312  }
313 
314  // add global event tag data
315  newAttr[ name_RunNumber ].setValue( runNumber );
316  newAttr[ name_EventNumber ].setValue( eventNumber );
317 
318  // add back nav ref's
319  ATH_MSG_DEBUG ("Append extra ref");
320  std::vector<std::string> extraRefs = m_extraRefNames.value();
321  std::map<std::string,std::string>::iterator itRef = inputRefs.begin();
322  std::map<std::string,std::string>::iterator itRefE = inputRefs.end();
323  for (; itRef != itRefE; ++itRef)
324  {
325  std::string name = itRef->first + "_ref";
326  if (extraRefs.end() != std::find(extraRefs.begin(),extraRefs.end(),itRef->first))
327  {
328  newAttr[name].setValue(std::string(itRef->second));
329  ATH_MSG_DEBUG (" Added extra ref to new attribute list - name: "
330  << name << " " << itRef->second);
331  }
332  }
333 
334  // write if filters passed
335  if (isEventAccepted())
336  {
337  ATH_MSG_DEBUG ("write attributes to collection");
338 
339  // write token plus attributes
340  try
341  {
342  writeTokenAttrList(ref, newAttr);
343  }
344  catch (std::exception &e)
345  {
347  ("Caught exception from collection add of Pool attributes. "
348  "Message: " << e.what());
349  return StatusCode::FAILURE;
350  }
351  }
352 
353  ATH_MSG_DEBUG ("done successfully");
354 
355  return StatusCode::SUCCESS;
356 }

◆ execute_subAlgos()

StatusCode AANTupleStream::execute_subAlgos ( )
private

execute sub-algos

Definition at line 600 of file AANTupleStream.cxx.

601 {
602  StatusCode sc = StatusCode::SUCCESS;
603 
604  ATH_MSG_DEBUG ("in execute_subAlgos() ...");
605 
606  const EventContext& ctx = Gaudi::Hive::currentContext();
607 
608  // -- run subalgorithms
609  for ( unsigned int i=0; i < m_membersNames.size(); ++i )
610  {
611  ATH_MSG_DEBUG (" -> calling sub-algorithm " << m_membersNames[i]);
612  // skip disabled algo
613  if (! (*(this->subAlgorithms()))[i]->isEnabled()) continue ;
614 
615  sc = (*(this->subAlgorithms()))[i]->execute(ctx);
616  if ( sc.isFailure())
617  {
619  (" ERROR executing sub-algorithm:" << m_membersNames[i]);
620  return StatusCode::FAILURE;
621  }
622  }
623  return sc;
624 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::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 & Athena::details::AthLegacySequenceAdapter::extraOutputDeps ( ) const
overridevirtualinherited

Definition at line 30 of file AthLegacySequence.cxx.

30  {
31  if (!m_extendedExtraObjects.empty()) {
33  }
34  return Gaudi::Sequence::extraOutputDeps();
35  }

◆ finalize()

StatusCode AANTupleStream::finalize ( )
virtual

Terminate AANTupleStream.

Definition at line 178 of file AANTupleStream.cxx.

179 {
180  ATH_MSG_INFO ("finalize");
181 
182  // exec macro
183  if (m_macro != "")
184  {
185  // save current dir
186  std::string curDir = gDirectory->GetPath();
187  // go to the root dir of output file
188  gDirectory->cd((m_fileName+":/").c_str());
189  // exec
190  // G__exec_tempfile(m_macro.c_str());
191  // MN: that should be the equivalent new call:
192  gInterpreter->ExecuteMacro(m_macro.c_str());
193  // back to the current dir
194  gDirectory->cd(curDir.c_str());
195  }
196 
198 }

◆ getContext()

const EventContext& Athena::details::AthLegacySequenceAdapter::getContext ( ) const
inlineinherited

Definition at line 36 of file AthLegacySequence.h.

36 { return Gaudi::Hive::currentContext(); }

◆ getFilters()

StatusCode AANTupleStream::getFilters ( )
private

get filter alogs

Definition at line 628 of file AANTupleStream.cxx.

629 {
630  ATH_MSG_DEBUG ("in getFilters()");
631 
632  // no filter
633  if (m_acceptNames.empty())
634  return StatusCode::SUCCESS;
635 
636 
637 
638  // old way to get ApplicationMgr crash with gaudi 21 (dynamic_cast fails)
639  // IAlgManager* theAlgMgr;
640 // IInterface* ptmp;
641 // StatusCode sc = serviceLocator()->getService("ApplicationMgr",
642 // IAlgManager::interfaceID(),
643 // ptmp);
644 
645 // if (sc.isFailure())
646 // {
647 // ATH_MSG_FATAL ("Can't locate ApplicationMgr!!!");
648 // return sc;
649 // }
650 // theAlgMgr = dynamic_cast<IAlgManager*> (ptmp);
651 
652  // new safe way to get ApplicationMgr (gaudi 21 and backward compatible)
653  ServiceHandle<IAlgManager> theAlgMgr("ApplicationMgr", this->name());
654  if (theAlgMgr==0){
655  ATH_MSG_FATAL ("Can't locate ApplicationMgr!!!");
656  return StatusCode::FAILURE;
657  }
658 
659 
660  // loop over all alg names
661  std::vector<std::string>::const_iterator it;
662  std::vector<std::string>::const_iterator itend = m_acceptNames.end();
663  for (it = m_acceptNames.begin(); it != itend; ++it)
664  {
665  IAlgorithm* ialg;
666  // get Alg
667  StatusCode sc = theAlgMgr->getAlgorithm(*it, ialg);
668 
669  if (sc.isFailure() )
670  {
671  ATH_MSG_ERROR ("Can't get Filter Alg : " << *it);
672  return StatusCode::FAILURE;
673  }
674  Algorithm *theAlg = dynamic_cast<Algorithm*>(ialg);
675  if (theAlg==0 )
676  {
677  ATH_MSG_ERROR ("Can't cast Filter Alg : " << *it);
678  return StatusCode::FAILURE;
679  }
680  ATH_MSG_DEBUG (" -> getting Filter Alg success " << *it);
681  // push back
682  m_acceptAlgs.push_back(theAlg);
683  }
684  return StatusCode::SUCCESS;
685 }

◆ getRef()

StatusCode AANTupleStream::getRef ( CLID  id,
const std::string &  key,
std::string &  ref 
)
private

Get ref from a proxy.

Definition at line 422 of file AANTupleStream.cxx.

423 {
424  // Must access the SG proxy to get the IOpaqueAddress
425  SG::DataProxy* itemProxy = 0;
426  ATH_MSG_DEBUG ("Retrieving proxy for " << id << " " << key);
427  itemProxy = evtStore()->proxy(id, key);
428  if (!itemProxy)
429  {
430  ATH_MSG_ERROR ("Could not get proxy ");
431  return(StatusCode::FAILURE);
432  }
433  else
434  {
435  ATH_MSG_DEBUG (" found proxy for ("<< id << ",\"" << key << "\") ");
436  }
437 
438  if (!itemProxy)
439  {
440  ATH_MSG_ERROR ("Empty proxy ");
441  return(StatusCode::FAILURE);
442  }
443 
444  // Get IOpaqueAddress from the proxy
445  IOpaqueAddress* addr = itemProxy->address();
446  if (!addr)
447  {
448  ATH_MSG_DEBUG ("Could not get address for clid "
449  << itemProxy->clID() << " " << itemProxy->name());
450  return( StatusCode::FAILURE);
451  }
452 
453  // Convert IOpaqueAddress to string via the persistency
454  // service. And then remove header to extract the token.
455  std::string saddr;
456 
457  StatusCode sc = m_persSvc->convertAddress(addr, saddr);
458  if (sc.isFailure())
459  {
461  ("Could not get string from IOpaqueAddress for clid " << id
462  << " " << key
463  << " is BAD_STORAGE_TYPE: "<< (sc == IConversionSvc::Status::BAD_STORAGE_TYPE));
464  return( StatusCode::FAILURE);
465  }
466 
467 
468  // We assume here some knowledge of the form of the AthenaPool
469  // string address
470  std::string hdr;
471  sc = splitAddress(saddr, " /> ", hdr, ref);
472  if (sc.isFailure())
473  {
474  ATH_MSG_ERROR ("Could not get split off token. string address " << saddr);
475  return( StatusCode::FAILURE);
476  }
477 
478  ATH_MSG_DEBUG ("String address " << ref);
479 
480  return StatusCode::SUCCESS;
481 }

◆ initCollection()

StatusCode AANTupleStream::initCollection ( )
private

Initialize the output collection.

Definition at line 161 of file AANTupleStream.cxx.

162 {
163  // write schema
165 
166  // setup TTree
167  setupTree();
168 
169  // setup Token
170  m_tokenBranch = m_tree->GetBranch(c_tokenBranchName);
171  m_tokenBranch->SetAddress(m_tokenCString);
172 
173  return StatusCode::SUCCESS;
174 }

◆ initialize()

StatusCode AANTupleStream::initialize ( )
virtual

Initialize AANTupleStream.

Definition at line 79 of file AANTupleStream.cxx.

80 {
81  ATH_MSG_DEBUG ("In initialize ");
82  // register with the I/O component manager
83  {
84  ServiceHandle<IIoComponentMgr> iomgr ("IoComponentMgr", this->name());
85  if ( !iomgr.retrieve().isSuccess() ) {
86  ATH_MSG_ERROR ("Could not retrieve IIoComponentMgr/IoComponentMgr !");
87  return StatusCode::FAILURE;
88  }
89  if ( !iomgr->io_register (this).isSuccess() ) {
90  ATH_MSG_ERROR ("Could not register with the I/O component mgr !");
91  return StatusCode::FAILURE;
92  }
93  if ( !iomgr->io_register (this,
95  m_fileName).isSuccess() ) {
96  ATH_MSG_ERROR ("Could not register [" << this->name() << "]["
97  << m_fileName << "] with the I/O component manager !");
98  return StatusCode::FAILURE;
99  }
100  }
101 
102  // StoreGateSvc
103  StatusCode sc = evtStore().retrieve();
104  if ( !sc.isSuccess() )
105  {
106  ATH_MSG_ERROR ("Could not locate default store");
107  return sc;
108  }
109 
110  // set up the persistency service:
111  sc = m_persSvc.retrieve();
112  if ( !sc.isSuccess() )
113  {
114  ATH_MSG_ERROR ("Could not locate persistency service");
115  return sc;
116  }
117 
118  // instantiate AttrListSpec and add attributes for Run# and Event#
119  m_attribSpec = new coral::AttributeListSpecification;
120  m_attribSpec->extend( name_RunNumber, "unsigned int" );
121  m_attribSpec->extend( name_EventNumber, "unsigned int" );
122 
123  // Add on specification for extra refs
124  std::vector<std::string> extraRefs = m_extraRefNames.value();
125  for (unsigned int i = 0; i < extraRefs.size(); ++i)
126  {
127  // Append _ref to name of attribute
128  std::string name = extraRefs[i] + "_ref";
129  m_attribSpec->extend(name, "string");
130  }
131 
132  if (!m_lateSchema) {
133  sc = initSchema();
134  if (sc.isFailure())
135  return sc;
136  }
137 
138  // initialize sub-algos
140  if ( sc.isFailure() )
141  {
142  ATH_MSG_ERROR ("Could not initialize sub-algos");
143  return sc;
144  }
145 
146  // get filters
147  sc = getFilters();
148  if ( sc.isFailure() )
149  {
150  ATH_MSG_ERROR ("Could not get filters");
151  return sc;
152  }
153 
154  ATH_MSG_DEBUG ("End initialize ");
155 
157 }

◆ initialize_subAlgos()

StatusCode AANTupleStream::initialize_subAlgos ( )
private

initialize sub-algos

Definition at line 566 of file AANTupleStream.cxx.

567 {
568  StatusCode sc = StatusCode::SUCCESS;
569 
570  Algorithm* algo;
571  std::vector<std::string>::const_iterator it;
572  std::vector<std::string>::const_iterator itend = m_membersNames.end( );
573  for (it = m_membersNames.begin(); it != itend; ++it)
574  {
575  // Parse the name for a syntax of the form:
576  //
577  // <type>/<name>
578  //
579  // Where <name> is the algorithm instance name, and <type> is the
580  // algorithm class type (being a subclass of Algorithm).
581  ListItem foo(*it);
582  std::string theType = foo.type();
583  std::string theName = foo.name();
584 
585  // create sub-algorithm
586  ATH_MSG_INFO (" -> creating sub-algorithm " << (*it));
587  sc = createSubAlgorithm( theType,theName, algo );
588  if (sc.isFailure())
589  {
590  ATH_MSG_FATAL (" ERROR creating sub-alg." << (*it));
591  return StatusCode::FAILURE;
592  }
593  }
594 
595  return sc;
596 }

◆ initSchema()

StatusCode AANTupleStream::initSchema ( )
private

dump

Definition at line 715 of file AANTupleStream.cxx.

716 {
717  m_schemaDone = true;
718 
719  StatusCode sc = m_tHistSvc.retrieve();
720  if (sc.isFailure())
721  {
722  ATH_MSG_ERROR ("Unable to retrieve pointer to THistSvc");
723  return sc;
724  }
725 
726  // initialize output collection
727  sc = initCollection();
728  if ( sc.isFailure() )
729  {
730  ATH_MSG_ERROR ("Could not init collection");
731  return sc;
732  }
733 
734  // register TTree to THistSvc
735  sc = m_tHistSvc->regTree("/"+m_streamName+"/"+m_treeName, m_tree);
736  if ( sc.isFailure() )
737  {
738  ATH_MSG_ERROR ("Could not register TTree");
739  return sc;
740  }
741 
743  m_tree->Print();
744 
745  return sc;
746 }

◆ inputHandles()

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

◆ io_reinit()

StatusCode AANTupleStream::io_reinit ( )
private

callback method to reinitialize the internal state of the component for I/O purposes (e.g.

upon fork(2))

Definition at line 749 of file AANTupleStream.cxx.

750 {
751  ServiceHandle<IIoComponentMgr> iomgr ("IoComponentMgr", this->name());
752  if ( !iomgr.retrieve().isSuccess() ) {
753  ATH_MSG_ERROR ("Could not retrieve IIoComponentMgr/IoComponentMgr !");
754  return StatusCode::FAILURE;
755  }
756 
757  ServiceHandle<Gaudi::Interfaces::IOptionsSvc> josvc ("JobOptionsSvc", this->name());
758  if ( !josvc.retrieve().isSuccess() ) {
759  ATH_MSG_ERROR ("Could not retrieve IOptionsSvc/JobOptionsSvc !");
760  return StatusCode::FAILURE;
761  }
762 
763  // check the I/O manager knows about me
764  if ( !iomgr->io_hasitem (this) ) {
765  ATH_MSG_ERROR ("I/O component mgr does not know about ourselves !");
766  return StatusCode::FAILURE;
767  }
768 
769  // check there is actually something to do...
770  if ( !iomgr->io_contains (this, m_fileName) ) {
772  ("I/O component mgr does not have any entry about ["<< m_fileName<<"]");
773  return StatusCode::SUCCESS;
774  }
775 
776  if ( !iomgr->io_retrieve (this, m_fileName).isSuccess() ) {
777  ATH_MSG_ERROR ("Could not retrieve new name for [" << m_fileName << "] !");
778  return StatusCode::FAILURE;
779  }
780 
781  // recreate the proper property value...
782  std::vector<std::string> outvec = {"AANT DATAFILE='" + m_fileName + "' OPT='RECREATE'"};
783  josvc->set("THistSvc.Output", Gaudi::Utils::toString(outvec));
784 
785  // handle schema...
786  if (!m_schemaDone) {
787  if ( !initSchema().isSuccess() ) {
788  ATH_MSG_ERROR ("Could not initialize schema !");
789  }
790  }
791 
792  return StatusCode::SUCCESS;
793 }

◆ isEventAccepted()

bool AANTupleStream::isEventAccepted ( ) const
private

check filters passed

Definition at line 692 of file AANTupleStream.cxx.

693 {
694  // no filter
695  if (m_acceptAlgs.empty())
696  return true;
697 
698  const EventContext& ctx = Gaudi::Hive::currentContext();
699 
700  // loop over all algs
701  std::vector<Algorithm*>::const_iterator it;
702  std::vector<Algorithm*>::const_iterator itend = m_acceptAlgs.end();
703  for (it = m_acceptAlgs.begin(); it != itend; ++it)
704  {
705  const Algorithm* theAlgorithm = (*it);
706  if ( theAlgorithm->execState(ctx).state() == AlgExecState::State::Done &&
707  ( ! theAlgorithm->execState(ctx).filterPassed() ) )
708  return false;
709  }
710 
711  return true;
712 }

◆ isReEntrant()

bool Athena::details::AthLegacySequenceAdapter::isReEntrant ( ) const
inlinefinaloverrideprotectedinherited

Definition at line 41 of file AthLegacySequence.h.

41 { return false; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Sequence >::msg
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Sequence >::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< Gaudi::Sequence >::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< Gaudi::Sequence > >::outputHandles
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< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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  }

◆ setupTree()

void AANTupleStream::setupTree ( )
private

setup Tree

Definition at line 376 of file AANTupleStream.cxx.

377 {
378  static const std::map<std::string,char> typeDict = {
379  {"double", 'D'},
380  {"long double", 'D'}, // only 64 bit doubles are supported
381  {"float", 'F'},
382  {"int", 'i'},
383  {"unsigned int", 'I'},
384  {"long", 'i'}, // support for 64 bit integers introduced with ROOT 4.00/08
385  {"unsigned long", 'I'}, // support for 64 bit integers introduced with ROOT 4.00/08
386  {"short", 's'},
387  {"unsigned short", 'S'},
388  {"char", 'b'}, // AttributeLists's "get_root_type_char(...)" returned 'C' ???
389  {"unsigned char", 'B'}, // AttributeLists's "get_root_type_char(...)" returned 's' ???
390  {"bool", 'B'}, // AttributeLists's "get_root_type_char(...)" returned 'i' ???
391  {"string", 'C'},
392  {"Token", 'C'}
393  };
394 
395  // go to the root dir of output file
396  TDirectory::TContext save;
397  gDirectory->cd((m_fileName+":/").c_str());
398 
399  // instantiate TTree
400  m_tree = new TTree(m_treeName.c_str(), m_treeName.c_str());
401 
402  // add branches for attributes
403  for(coral::AttributeListSpecification::const_iterator iter=m_attribSpec->begin(); iter!=m_attribSpec->end(); ++iter)
404  {
405  std::string type = "/?";
406  type[1] = typeDict.at(iter->typeName());
407  std::string leaflist = iter->name() + type;
408  m_tree->Branch(iter->name().c_str(),0,leaflist.c_str());
409  }
410 
411  // add Token branch
412  std::string leaflist = c_tokenBranchName;
413  leaflist += "/C";
414  m_tree->Branch(c_tokenBranchName,0,leaflist.c_str());
415 
416  // set TTree
418 }

◆ splitAddress()

StatusCode AANTupleStream::splitAddress ( const std::string &  address,
const std::string &  match,
std::string &  address_header,
std::string &  address_data 
) const
private

Split the address to get pool token.

Definition at line 486 of file AANTupleStream.cxx.

490 {
491  ATH_MSG_DEBUG ("splitAddress " << endmsg
492  << " address : " << address
493  << " match : " << match);
494 
495  std::string::size_type p1;
496 
497  p1 = address.find( match );
498  if (p1 != std::string::npos)
499  {
500  address_header = address.substr( 0, p1+match.size());
501 
502  address_data = address.substr( p1+match.size() );
503  }
504  else
505  {
506  return StatusCode::FAILURE;
507  }
508 
509  ATH_MSG_DEBUG (" address_header : " << address_header
510  << endmsg
511  << " address_data : " << address_data);
512 
513  return StatusCode::SUCCESS;
514 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::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.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::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< Gaudi::Sequence > >::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  }

◆ writeAttributeListSpecification()

void AANTupleStream::writeAttributeListSpecification ( )
private

write schema of AttributeList

Definition at line 359 of file AANTupleStream.cxx.

360 {
361  // go to the root dir of output file
362  TDirectory::TContext save;
363  gDirectory->cd((m_fileName+":/").c_str());
364 
366  // store schema in the schema object
367  for( coral::AttributeListSpecification::const_iterator iter = m_attribSpec->begin();
368  iter != m_attribSpec->end(); ++iter) {
369  all.m_layout.push_back( make_pair( iter->name(), iter->typeName() ) );
370  }
371  // write schema object
372  all.Write(c_attributeListLayoutName);
373 }

◆ writeTokenAttrList()

bool AANTupleStream::writeTokenAttrList ( const std::string &  token,
const coral::AttributeList &  attributeList 
)
private

write Token and AttributeList

Definition at line 518 of file AANTupleStream.cxx.

519 {
520  // set addresses for attributes
521  coral::AttributeList::const_iterator attIter = attributeList.begin();
522  const TObjArray* branches = m_tree->GetListOfBranches();
523  std::vector<std::string> tokenStringDump;
524  // loop over all attributes
525  for (unsigned int i=0; i<attributeList.size(); ++i)
526  {
527  TBranch* branch = (TBranch*)branches->UncheckedAt(i);
528  // string attributes
529  if (attIter->specification().type() == typeid(std::string))
530  {
531  const std::string& str = attIter->data<std::string>();
532  if( str.length()+1 >= s_maxLengthOfStrings )
533  {
534  throw std::runtime_error("String is too long : RootCollection::pool2Root<std::string>");
535  }
536  branch->SetAddress( (void*)str.c_str() );
537  }
538  // Token
539  else if(attIter->specification().typeName() == "Token")
540  {
541  tokenStringDump.push_back( attIter->data<std::string>() );
542  branch->SetAddress( (void*) tokenStringDump.back().c_str() );
543  }
544  // else
545  else
546  {
547  branch->SetAddress( (void*)attIter->addressOfData() );
548  }
549  ++attIter;
550  }
551 
552  // set address for Token
553  m_tokenBranch->SetAddress((void*)token.c_str());
554 
555  // fill TTree
556  m_tree->Fill();
557 
558  // releases Token
559  m_tokenBranch->SetAddress(m_tokenCString);
560 
561  return true;
562 }

Member Data Documentation

◆ m_acceptAlgs

std::vector<Algorithm*> AANTupleStream::m_acceptAlgs
private

Vector of Algorithms that this stream accepts.

Definition at line 133 of file AANTupleStream.h.

◆ m_acceptNames

std::vector<std::string> AANTupleStream::m_acceptNames
private

Vector of names of Algorithms that this stream accepts.

Definition at line 130 of file AANTupleStream.h.

◆ m_attribSpec

coral::AttributeListSpecification* AANTupleStream::m_attribSpec
private

Collection attribute specification.

Definition at line 100 of file AANTupleStream.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_existDH

BooleanProperty AANTupleStream::m_existDH
private

Flag to signal whether data header exists.

Definition at line 112 of file AANTupleStream.h.

◆ m_extendedExtraObjects

DataObjIDColl Athena::details::AthLegacySequenceAdapter::m_extendedExtraObjects
privateinherited

Definition at line 51 of file AthLegacySequence.h.

◆ m_extraRefNames

StringArrayProperty AANTupleStream::m_extraRefNames
private

Vector of extra parent ref names to register in collection.

Definition at line 106 of file AANTupleStream.h.

◆ m_fileName

std::string AANTupleStream::m_fileName
private

Name of the output collection.

Definition at line 103 of file AANTupleStream.h.

◆ m_lateSchema

BooleanProperty AANTupleStream::m_lateSchema
private

write schema in execute()

Definition at line 118 of file AANTupleStream.h.

◆ m_macro

std::string AANTupleStream::m_macro
private

macro

Definition at line 121 of file AANTupleStream.h.

◆ m_membersNames

std::vector<std::string> AANTupleStream::m_membersNames
private

Definition at line 145 of file AANTupleStream.h.

◆ m_persSvc

ServiceHandle<IAddressCreator> AANTupleStream::m_persSvc
private

Persistency service.

Definition at line 97 of file AANTupleStream.h.

◆ m_schemaDone

bool AANTupleStream::m_schemaDone
private

first event

Definition at line 124 of file AANTupleStream.h.

◆ m_streamName

std::string AANTupleStream::m_streamName
private

Name of Stream.

Definition at line 115 of file AANTupleStream.h.

◆ m_tHistSvc

ServiceHandle<ITHistSvc> AANTupleStream::m_tHistSvc
private

THistSvc.

Definition at line 142 of file AANTupleStream.h.

◆ m_tokenBranch

TBranch* AANTupleStream::m_tokenBranch
private

TBranch which contains Token info.

Definition at line 139 of file AANTupleStream.h.

◆ m_tokenCString

char AANTupleStream::m_tokenCString[s_maxLengthOfStrings]
private

Definition at line 149 of file AANTupleStream.h.

◆ m_tree

TTree* AANTupleStream::m_tree
private

TTree.

Definition at line 136 of file AANTupleStream.h.

◆ m_treeName

std::string AANTupleStream::m_treeName
private

Name of the output tree.

Definition at line 127 of file AANTupleStream.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeInputDH

BooleanProperty AANTupleStream::m_writeInputDH
private

Flag to signal whether or not to write input data header.

Definition at line 109 of file AANTupleStream.h.

◆ s_maxLengthOfStrings

const unsigned int AANTupleStream::s_maxLengthOfStrings = 5000
staticprivate

for string branches

Definition at line 148 of file AANTupleStream.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AANTupleStream::m_acceptAlgs
std::vector< Algorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
Definition: AANTupleStream.h:133
initialize
void initialize()
Definition: run_EoverP.cxx:894
AANTupleStream::writeTokenAttrList
bool writeTokenAttrList(const std::string &token, const coral::AttributeList &attributeList)
write Token and AttributeList
Definition: AANTupleStream.cxx:518
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
python.FakeAthena.Algorithm
def Algorithm(name)
Definition: FakeAthena.py:41
skel.it
it
Definition: skel.GENtoEVGEN.py:423
pool::WRITE
@ WRITE
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:72
AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AANTupleStream::setupTree
void setupTree()
setup Tree
Definition: AANTupleStream.cxx:376
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
AANTupleStream::getRef
StatusCode getRef(CLID id, const std::string &key, std::string &ref)
Get ref from a proxy.
Definition: AANTupleStream.cxx:422
Athena::details::AthLegacySequenceAdapter::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthLegacySequence.h:51
TruthTest.itE
itE
Definition: TruthTest.py:25
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AANTupleStream::m_membersNames
std::vector< std::string > m_membersNames
Definition: AANTupleStream.h:145
AANTupleStream::splitAddress
StatusCode splitAddress(const std::string &address, const std::string &match, std::string &address_header, std::string &address_data) const
Split the address to get pool token.
Definition: AANTupleStream.cxx:486
AANTupleStream::m_persSvc
ServiceHandle< IAddressCreator > m_persSvc
Persistency service.
Definition: AANTupleStream.h:97
AANTupleStream::writeAttributeListSpecification
void writeAttributeListSpecification()
write schema of AttributeList
Definition: AANTupleStream.cxx:359
runLayerRecalibration.branches
list branches
Definition: runLayerRecalibration.py:98
AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
AANTupleStream::m_tokenBranch
TBranch * m_tokenBranch
TBranch which contains Token info.
Definition: AANTupleStream.h:139
checkTP.save
def save(self, fileName="./columbo.out")
Definition: checkTP.py:178
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
SG::DataProxy::address
virtual IOpaqueAddress * address() const override final
Retrieve IOpaqueAddress.
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AANTupleStream::isEventAccepted
bool isEventAccepted() const
check filters passed
Definition: AANTupleStream.cxx:692
AthLegacySequence
Alias for backward compatibility.
Definition: AthLegacySequence.h:63
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
AANTupleStream::m_macro
std::string m_macro
macro
Definition: AANTupleStream.h:121
DataHeader
This class provides the layout for summary information stored for data written to POOL.
Definition: DataHeader.h:124
lumiFormat.i
int i
Definition: lumiFormat.py:92
AANTupleStream::initSchema
StatusCode initSchema()
Definition: AANTupleStream.cxx:715
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
DataHeader::sizeProvenance
int sizeProvenance() const
Definition: DataHeader.cxx:281
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
calibdata.exception
exception
Definition: calibdata.py:496
AANTupleStream::getFilters
StatusCode getFilters()
get filter alogs
Definition: AANTupleStream.cxx:628
AANTupleStream::m_tree
TTree * m_tree
TTree.
Definition: AANTupleStream.h:136
AANTupleStream::m_schemaDone
bool m_schemaDone
first event
Definition: AANTupleStream.h:124
AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
AANTupleStream::m_treeName
std::string m_treeName
Name of the output tree.
Definition: AANTupleStream.h:127
SG::DataProxy::clID
CLID clID() const
Retrieve clid.
AANTupleStream::m_streamName
std::string m_streamName
Name of Stream.
Definition: AANTupleStream.h:115
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
AANTupleStream::m_tokenCString
char m_tokenCString[s_maxLengthOfStrings]
Definition: AANTupleStream.h:149
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
AANTupleStream::m_attribSpec
coral::AttributeListSpecification * m_attribSpec
Collection attribute specification.
Definition: AANTupleStream.h:100
AANTupleStream::s_maxLengthOfStrings
static const unsigned int s_maxLengthOfStrings
for string branches
Definition: AANTupleStream.h:148
AANTupleStream::initCollection
StatusCode initCollection()
Initialize the output collection.
Definition: AANTupleStream.cxx:161
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
AANTupleStream::m_extraRefNames
StringArrayProperty m_extraRefNames
Vector of extra parent ref names to register in collection.
Definition: AANTupleStream.h:106
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:42
SG::DataProxy::name
virtual const name_type & name() const override final
Retrieve data object key == string.
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
AANTupleStream::m_lateSchema
BooleanProperty m_lateSchema
write schema in execute()
Definition: AANTupleStream.h:118
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:64
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
RTTAlgmain.branch
branch
Definition: RTTAlgmain.py:61
AttributeListLayout
Definition: AttributeListLayout.h:19
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ref
const boost::regex ref(r_ef)
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AANTupleStream::execute_subAlgos
StatusCode execute_subAlgos()
execute sub-algos
Definition: AANTupleStream.cxx:600
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
AANTupleStream::m_tHistSvc
ServiceHandle< ITHistSvc > m_tHistSvc
THistSvc.
Definition: AANTupleStream.h:142
merge.status
status
Definition: merge.py:17
AANTupleStream::m_acceptNames
std::vector< std::string > m_acceptNames
Vector of names of Algorithms that this stream accepts.
Definition: AANTupleStream.h:130
SG::DataProxy
Definition: DataProxy.h:44
AANTTreeMap::setTree
static void setTree(const std::string &stream, TTree *tree)
Definition: AANTTreeMap.h:18
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
AANTupleStream::m_writeInputDH
BooleanProperty m_writeInputDH
Flag to signal whether or not to write input data header.
Definition: AANTupleStream.h:109
AANTupleStream::initialize_subAlgos
StatusCode initialize_subAlgos()
initialize sub-algos
Definition: AANTupleStream.cxx:566
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356
fitman.k
k
Definition: fitman.py:528
AANTupleStream::m_existDH
BooleanProperty m_existDH
Flag to signal whether data header exists.
Definition: AANTupleStream.h:112
ServiceHandle< IIoComponentMgr >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
AANTupleStream::m_fileName
std::string m_fileName
Name of the output collection.
Definition: AANTupleStream.h:103