ATLAS Offline Software
AANTupleStream.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
9 
11 
12 #include "Gaudi/Interfaces/IOptionsSvc.h"
13 #include "GaudiKernel/IAlgManager.h"
14 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/IAddressCreator.h"
16 #include "GaudiKernel/IOpaqueAddress.h"
17 #include "GaudiKernel/MsgStream.h"
18 #include "GaudiKernel/ITHistSvc.h"
19 #include "GaudiKernel/TypeNameString.h"
20 #include "GaudiKernel/ServiceHandle.h"
21 #include "GaudiKernel/IIoComponentMgr.h"
22 
23 #include "StoreGate/StoreGateSvc.h"
24 #include "SGTools/DataProxy.h"
26 
28 #include "CoralBase/AttributeList.h"
29 #include "CoralBase/AttributeListSpecification.h"
30 
31 #include "EventInfo/EventInfo.h"
32 #include "EventInfo/EventID.h"
34 
35 #include "TFile.h"
36 #include "TTree.h"
37 #include "TText.h"
38 #include "TBranch.h"
39 #include "TInterpreter.h"
40 
41 #include <map>
42 #include <string>
43 #include <algorithm>
44 
45 using namespace AANTupleParams;
46 
47 // Standard Constructor
48 AANTupleStream::AANTupleStream(const std::string& name, ISvcLocator* pSvcLocator)
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 }
70 
71 
72 // Standard Destructor
74 {
75 }
76 
77 
78 // initialize data writer
80 {
81  ATH_MSG_DEBUG ("In initialize ");
82  // register with the I/O component manager
83  {
84  ServiceHandle<IIoComponentMgr> iomgr ("IoComponentMgr", this->name());
85  ATH_CHECK( iomgr.retrieve() );
86  ATH_CHECK( iomgr->io_register (this) );
87 
88  if ( !iomgr->io_register (this,
90  m_fileName).isSuccess() ) {
91  ATH_MSG_ERROR ("Could not register [" << this->name() << "]["
92  << m_fileName << "] with the I/O component manager !");
93  return StatusCode::FAILURE;
94  }
95  }
96 
97  // StoreGateSvc
99 
100  // set up the persistency service:
101  ATH_CHECK( m_persSvc.retrieve() );
102 
103  // instantiate AttrListSpec and add attributes for Run# and Event#
104  m_attribSpec = new coral::AttributeListSpecification;
105  m_attribSpec->extend( name_RunNumber, "unsigned int" );
106  m_attribSpec->extend( name_EventNumber, "unsigned int" );
107 
108  // Add on specification for extra refs
109  for (const std::string& ref : m_extraRefNames.value())
110  {
111  // Append _ref to name of attribute
112  m_attribSpec->extend(ref + "_ref", "string");
113  }
114 
115  if (!m_lateSchema) {
116  ATH_CHECK( initSchema() );
117  }
118 
119  // initialize sub-algos
121 
122  // get filters
123  ATH_CHECK( getFilters() );
124 
125  ATH_MSG_DEBUG ("End initialize ");
126 
128 }
129 
130 
131 // initialize output collection
133 {
134  // write schema
136 
137  // setup TTree
138  setupTree();
139 
140  // setup Token
141  m_tokenBranch = m_tree->GetBranch(c_tokenBranchName);
142  m_tokenBranch->SetAddress(m_tokenCString);
143 
144  return StatusCode::SUCCESS;
145 }
146 
147 
148 // terminate data writer
150 {
151  ATH_MSG_INFO ("finalize");
152 
153  // exec macro
154  if (m_macro != "")
155  {
156  // save current dir
157  std::string curDir = gDirectory->GetPath();
158  // go to the root dir of output file
159  gDirectory->cd((m_fileName+":/").c_str());
160  // exec
161  // G__exec_tempfile(m_macro.c_str());
162  // MN: that should be the equivalent new call:
163  gInterpreter->ExecuteMacro(m_macro.c_str());
164  // back to the current dir
165  gDirectory->cd(curDir.c_str());
166  }
167 
169 }
170 
171 
172 // Work entry point
174 {
175  StatusCode sc;
176 
177  if (!m_schemaDone) {
178  sc = initSchema();
179  if (sc.isFailure())
180  return sc;
181  }
182 
183  // execute sub-algos
184  sc = execute_subAlgos();
185  if ( sc.isFailure() )
186  {
187  ATH_MSG_ERROR ("Could not execute sub-algos");
188  return sc;
189  }
190 
191  std::map<std::string,std::string> inputRefs;
192  std::string ref;
193 
194  // Get tokens specified by item list
195  if (m_existDH)
196  {
197  // get token
200  StatusCode status = evtStore()->retrieve(beg,ending);
201  if (status.isFailure() || beg==ending)
202  {
203  ATH_MSG_WARNING ("No DataHeaders present in StoreGate");
204  return StatusCode::FAILURE;
205  }
206 
207  // look for header
208  for (; beg != ending; ++beg)
209  if (m_writeInputDH == beg->isInput()) break;
210 
211  if (beg==ending)
212  {
213  ATH_MSG_WARNING ("No appropriate DataHeader present in StoreGate");
214  return StatusCode::FAILURE;
215  }
216 
217  // get the ref
218  while (getRef(ClassID_traits<DataHeader>::ID(), beg.key(), ref) == StatusCode::FAILURE)
219  {
220  ++beg;
221  if (beg==ending)
222  {
223  ATH_MSG_ERROR ("No refs found");
224  return StatusCode::FAILURE;
225  }
226  }
227 
228  ATH_MSG_DEBUG ("Found token: Key=" << beg.key() << ", Ref=" << ref);
229 
230  // Get a single input header ref if requested
231  const DataHeader* hdr = &(*beg);
232  if (hdr->sizeProvenance())
233  {
234  std::vector<DataHeaderElement>::const_iterator it =
235  (const_cast<DataHeader*>(hdr)->beginProvenance());
236  std::vector<DataHeaderElement>::const_iterator itE =
237  (const_cast<DataHeader*>(hdr)->endProvenance());
238  // grab refs for those
239  for (; it!=itE; ++it)
240  {
241  std::string tmpRef = (*it).getToken() != NULL
242  ? (*it).getToken()->toString()
243  : "";
244  inputRefs.insert(std::make_pair(it->getKey(),tmpRef));
245  ATH_MSG_DEBUG ("Found ref for input header: Key=" << it->getKey()
246  << ", Ref=" << tmpRef);
247  }
248  }
249  }
250 
251  // create Attrlist, add attributes and if extra ref is requested, append to the end
252 
253  ATH_MSG_DEBUG ("create AttributeList");
254  // AthenaAttributeList newAttr(*m_attribSpec);
256 
257  unsigned int runNumber = 0;
258  unsigned int eventNumber = 0;
259 
260  // retrieve event info
261  const EventInfo* eventInfo;
262  eventInfo = evtStore()->tryConstRetrieve<EventInfo>();
263  if ( !eventInfo )
264  {
265  // Try to get the xAOD::EventInfo
266  const xAOD::EventInfo* eventInfoX{nullptr};
267  ATH_CHECK( evtStore()->retrieve(eventInfoX) );
268  runNumber = eventInfoX->runNumber();
269  eventNumber = eventInfoX->eventNumber();
270  }
271  else
272  {
273  runNumber = eventInfo->event_ID()->run_number();
274  eventNumber = eventInfo->event_ID()->event_number();
275  }
276 
277  // add global event tag data
278  newAttr[ name_RunNumber ].setValue( runNumber );
279  newAttr[ name_EventNumber ].setValue( eventNumber );
280 
281  // add back nav ref's
282  ATH_MSG_DEBUG ("Append extra ref");
283  std::vector<std::string> extraRefs = m_extraRefNames.value();
284  std::map<std::string,std::string>::iterator itRef = inputRefs.begin();
285  std::map<std::string,std::string>::iterator itRefE = inputRefs.end();
286  for (; itRef != itRefE; ++itRef)
287  {
288  std::string name = itRef->first + "_ref";
289  if (extraRefs.end() != std::find(extraRefs.begin(),extraRefs.end(),itRef->first))
290  {
291  newAttr[name].setValue(std::string(itRef->second));
292  ATH_MSG_DEBUG (" Added extra ref to new attribute list - name: "
293  << name << " " << itRef->second);
294  }
295  }
296 
297  // write if filters passed
298  if (isEventAccepted())
299  {
300  ATH_MSG_DEBUG ("write attributes to collection");
301 
302  // write token plus attributes
303  try
304  {
305  writeTokenAttrList(ref, newAttr);
306  }
307  catch (std::exception &e)
308  {
310  ("Caught exception from collection add of Pool attributes. "
311  "Message: " << e.what());
312  return StatusCode::FAILURE;
313  }
314  }
315 
316  ATH_MSG_DEBUG ("done successfully");
317 
318  return StatusCode::SUCCESS;
319 }
320 
321 
323 {
324  // go to the root dir of output file
325  TDirectory::TContext save;
326  gDirectory->cd((m_fileName+":/").c_str());
327 
329  // store schema in the schema object
330  for( coral::AttributeListSpecification::const_iterator iter = m_attribSpec->begin();
331  iter != m_attribSpec->end(); ++iter) {
332  all.m_layout.push_back( make_pair( iter->name(), iter->typeName() ) );
333  }
334  // write schema object
335  all.Write(c_attributeListLayoutName);
336 }
337 
338 
340 {
341  static const std::map<std::string,char> typeDict = {
342  {"double", 'D'},
343  {"long double", 'D'}, // only 64 bit doubles are supported
344  {"float", 'F'},
345  {"int", 'i'},
346  {"unsigned int", 'I'},
347  {"long", 'i'}, // support for 64 bit integers introduced with ROOT 4.00/08
348  {"unsigned long", 'I'}, // support for 64 bit integers introduced with ROOT 4.00/08
349  {"short", 's'},
350  {"unsigned short", 'S'},
351  {"char", 'b'}, // AttributeLists's "get_root_type_char(...)" returned 'C' ???
352  {"unsigned char", 'B'}, // AttributeLists's "get_root_type_char(...)" returned 's' ???
353  {"bool", 'B'}, // AttributeLists's "get_root_type_char(...)" returned 'i' ???
354  {"string", 'C'},
355  {"Token", 'C'}
356  };
357 
358  // go to the root dir of output file
359  TDirectory::TContext save;
360  gDirectory->cd((m_fileName+":/").c_str());
361 
362  // instantiate TTree
363  m_tree = new TTree(m_treeName.c_str(), m_treeName.c_str());
364 
365  // add branches for attributes
366  for(coral::AttributeListSpecification::const_iterator iter=m_attribSpec->begin(); iter!=m_attribSpec->end(); ++iter)
367  {
368  std::string type = "/?";
369  type[1] = typeDict.at(iter->typeName());
370  std::string leaflist = iter->name() + type;
371  m_tree->Branch(iter->name().c_str(),0,leaflist.c_str());
372  }
373 
374  // add Token branch
375  std::string leaflist = c_tokenBranchName;
376  leaflist += "/C";
377  m_tree->Branch(c_tokenBranchName,0,leaflist.c_str());
378 
379  // set TTree
381 }
382 
383 
384 // Get the string form of a ref for a given clid and key
385 StatusCode AANTupleStream::getRef(CLID id, const std::string& key, std::string& ref)
386 {
387  // Must access the SG proxy to get the IOpaqueAddress
388  SG::DataProxy* itemProxy = 0;
389  ATH_MSG_DEBUG ("Retrieving proxy for " << id << " " << key);
390  itemProxy = evtStore()->proxy(id, key);
391  if (!itemProxy)
392  {
393  ATH_MSG_ERROR ("Could not get proxy ");
394  return(StatusCode::FAILURE);
395  }
396  else
397  {
398  ATH_MSG_DEBUG (" found proxy for ("<< id << ",\"" << key << "\") ");
399  }
400 
401  if (!itemProxy)
402  {
403  ATH_MSG_ERROR ("Empty proxy ");
404  return(StatusCode::FAILURE);
405  }
406 
407  // Get IOpaqueAddress from the proxy
408  IOpaqueAddress* addr = itemProxy->address();
409  if (!addr)
410  {
411  ATH_MSG_DEBUG ("Could not get address for clid "
412  << itemProxy->clID() << " " << itemProxy->name());
413  return( StatusCode::FAILURE);
414  }
415 
416  // Convert IOpaqueAddress to string via the persistency
417  // service. And then remove header to extract the token.
418  std::string saddr;
419 
420  StatusCode sc = m_persSvc->convertAddress(addr, saddr);
421  if (sc.isFailure())
422  {
424  ("Could not get string from IOpaqueAddress for clid " << id
425  << " " << key
426  << " is BAD_STORAGE_TYPE: "<< (sc == IConversionSvc::Status::BAD_STORAGE_TYPE));
427  return( StatusCode::FAILURE);
428  }
429 
430 
431  // We assume here some knowledge of the form of the AthenaPool
432  // string address
433  std::string hdr;
434  sc = splitAddress(saddr, " /> ", hdr, ref);
435  if (sc.isFailure())
436  {
437  ATH_MSG_ERROR ("Could not get split off token. string address " << saddr);
438  return( StatusCode::FAILURE);
439  }
440 
441  ATH_MSG_DEBUG ("String address " << ref);
442 
443  return StatusCode::SUCCESS;
444 }
445 
446 
447 // Extract the address header and data from an IOpaqueAddress in
448 // string form
450  const std::string& match,
451  std::string& address_header,
452  std::string& address_data ) const
453 {
454  ATH_MSG_DEBUG ("splitAddress " << endmsg
455  << " address : " << address
456  << " match : " << match);
457 
458  std::string::size_type p1;
459 
460  p1 = address.find( match );
461  if (p1 != std::string::npos)
462  {
463  address_header = address.substr( 0, p1+match.size());
464 
465  address_data = address.substr( p1+match.size() );
466  }
467  else
468  {
469  return StatusCode::FAILURE;
470  }
471 
472  ATH_MSG_DEBUG (" address_header : " << address_header
473  << endmsg
474  << " address_data : " << address_data);
475 
476  return StatusCode::SUCCESS;
477 }
478 
479 
480 // write Token and Attributes to the output collection
481 bool AANTupleStream::writeTokenAttrList( const std::string& token, const coral::AttributeList& attributeList )
482 {
483  // set addresses for attributes
484  coral::AttributeList::const_iterator attIter = attributeList.begin();
485  const TObjArray* branches = m_tree->GetListOfBranches();
486  std::vector<std::string> tokenStringDump;
487  // loop over all attributes
488  for (unsigned int i=0; i<attributeList.size(); ++i)
489  {
490  TBranch* branch = (TBranch*)branches->UncheckedAt(i);
491  // string attributes
492  if (attIter->specification().type() == typeid(std::string))
493  {
494  const std::string& str = attIter->data<std::string>();
495  if( str.length()+1 >= s_maxLengthOfStrings )
496  {
497  throw std::runtime_error("String is too long : RootCollection::pool2Root<std::string>");
498  }
499  branch->SetAddress( (void*)str.c_str() );
500  }
501  // Token
502  else if(attIter->specification().typeName() == "Token")
503  {
504  tokenStringDump.push_back( attIter->data<std::string>() );
505  branch->SetAddress( (void*) tokenStringDump.back().c_str() );
506  }
507  // else
508  else
509  {
510  branch->SetAddress( (void*)attIter->addressOfData() );
511  }
512  ++attIter;
513  }
514 
515  // set address for Token
516  m_tokenBranch->SetAddress((void*)token.c_str());
517 
518  // fill TTree
519  m_tree->Fill();
520 
521  // releases Token
522  m_tokenBranch->SetAddress(m_tokenCString);
523 
524  return true;
525 }
526 
527 
528 // initialize sub-algos
530 {
531  StatusCode sc = StatusCode::SUCCESS;
532 
533  Algorithm* algo;
534  for (const std::string& name : m_membersNames)
535  {
536  // Parse the name for a syntax of the form:
537  //
538  // <type>/<name>
539  //
540  // Where <name> is the algorithm instance name, and <type> is the
541  // algorithm class type (being a subclass of Algorithm).
542  Gaudi::Utils::TypeNameString tn(name);
543 
544  // create sub-algorithm
545  ATH_MSG_INFO (" -> creating sub-algorithm " << name);
546  sc = createSubAlgorithm( tn.type(), tn.name(), algo );
547  if (sc.isFailure())
548  {
549  ATH_MSG_FATAL (" ERROR creating sub-alg." << name);
550  return StatusCode::FAILURE;
551  }
552  }
553 
554  return sc;
555 }
556 
557 
558 // execute sub-algos
560 {
561  StatusCode sc = StatusCode::SUCCESS;
562 
563  ATH_MSG_DEBUG ("in execute_subAlgos() ...");
564 
565  const EventContext& ctx = Gaudi::Hive::currentContext();
566 
567  // -- run subalgorithms
568  for ( unsigned int i=0; i < m_membersNames.size(); ++i )
569  {
570  ATH_MSG_DEBUG (" -> calling sub-algorithm " << m_membersNames[i]);
571  // skip disabled algo
572  if (! (*(this->subAlgorithms()))[i]->isEnabled()) continue ;
573 
574  sc = (*(this->subAlgorithms()))[i]->execute(ctx);
575  if ( sc.isFailure())
576  {
578  (" ERROR executing sub-algorithm:" << m_membersNames[i]);
579  return StatusCode::FAILURE;
580  }
581  }
582  return sc;
583 }
584 
585 
586 // get filters
588 {
589  ATH_MSG_DEBUG ("in getFilters()");
590 
591  // no filter
592  if (m_acceptNames.empty())
593  return StatusCode::SUCCESS;
594 
595  ServiceHandle<IAlgManager> theAlgMgr("ApplicationMgr", this->name());
596  ATH_CHECK( theAlgMgr.retrieve() );
597 
598  // loop over all alg names
599  for (const std::string& name : m_acceptNames)
600  {
601  SmartIF<IAlgorithm> ialg{theAlgMgr->algorithm(name)};
602  if (!ialg )
603  {
604  ATH_MSG_ERROR ("Can't get Filter Alg : " << name);
605  return StatusCode::FAILURE;
606  }
607  ATH_MSG_DEBUG (" -> getting Filter Alg success " << name);
608  // push back
609  m_acceptAlgs.push_back(ialg);
610  }
611  return StatusCode::SUCCESS;
612 }
613 
614 
615 // Loop over all Algorithms in the accept list to see
616 // whether any have been executed and have their filter
617 // passed flag set. Any match causes the event to be
618 // provisionally accepted.
620 {
621  // no filter
622  if (m_acceptAlgs.empty())
623  return true;
624 
625  const EventContext& ctx = Gaudi::Hive::currentContext();
626 
627  // loop over all algs
628  for (const IAlgorithm* alg : m_acceptAlgs)
629  {
630  if ( alg->execState(ctx).state() == AlgExecState::State::Done &&
631  ( ! alg->execState(ctx).filterPassed() ) )
632  return false;
633  }
634 
635  return true;
636 }
637 
640 {
641  m_schemaDone = true;
642 
643  ATH_CHECK( m_tHistSvc.retrieve() );
644 
645  // initialize output collection
647 
648  // register TTree to THistSvc
649  ATH_CHECK( m_tHistSvc->regTree("/"+m_streamName+"/"+m_treeName, m_tree) );
650 
652  m_tree->Print();
653 
654  return StatusCode::SUCCESS;
655 }
656 
659 {
660  ServiceHandle<IIoComponentMgr> iomgr ("IoComponentMgr", this->name());
661  ATH_CHECK( iomgr.retrieve() );
662 
663  ServiceHandle<Gaudi::Interfaces::IOptionsSvc> josvc ("JobOptionsSvc", this->name());
664  ATH_CHECK( josvc.retrieve() );
665 
666  // check the I/O manager knows about me
667  if ( !iomgr->io_hasitem (this) ) {
668  ATH_MSG_ERROR ("I/O component mgr does not know about ourselves !");
669  return StatusCode::FAILURE;
670  }
671 
672  // check there is actually something to do...
673  if ( !iomgr->io_contains (this, m_fileName) ) {
675  ("I/O component mgr does not have any entry about ["<< m_fileName<<"]");
676  return StatusCode::SUCCESS;
677  }
678 
679  if ( !iomgr->io_retrieve (this, m_fileName).isSuccess() ) {
680  ATH_MSG_ERROR ("Could not retrieve new name for [" << m_fileName << "] !");
681  return StatusCode::FAILURE;
682  }
683 
684  // recreate the proper property value...
685  std::vector<std::string> outvec = {"AANT DATAFILE='" + m_fileName + "' OPT='RECREATE'"};
686  josvc->set("THistSvc.Output", Gaudi::Utils::toString(outvec));
687 
688  // handle schema...
689  if (!m_schemaDone) {
690  if ( !initSchema().isSuccess() ) {
691  ATH_MSG_ERROR ("Could not initialize schema !");
692  }
693  }
694 
695  return StatusCode::SUCCESS;
696 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
createLinkingScheme.iter
iter
Definition: createLinkingScheme.py:62
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
AANTupleStream::AANTupleStream
AANTupleStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard AANTupleStream Constructor.
Definition: AANTupleStream.cxx:48
AANTupleStream::finalize
virtual StatusCode finalize()
Terminate AANTupleStream.
Definition: AANTupleStream.cxx:149
AANTupleStream::execute
virtual StatusCode execute()
Working entry point.
Definition: AANTupleStream.cxx:173
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
AANTTreeMap.h
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:481
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
skel.it
it
Definition: skel.GENtoEVGEN.py:407
pool::WRITE
@ WRITE
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:49
AANTupleStream::setupTree
void setupTree()
setup Tree
Definition: AANTupleStream.cxx:339
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
AthenaAttributeList.h
AANTupleStream::getRef
StatusCode getRef(CLID id, const std::string &key, std::string &ref)
Get ref from a proxy.
Definition: AANTupleStream.cxx:385
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
AANTupleStream::m_acceptAlgs
std::vector< IAlgorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
Definition: AANTupleStream.h:133
TruthTest.itE
itE
Definition: TruthTest.py:25
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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:449
AANTupleStream::m_persSvc
ServiceHandle< IAddressCreator > m_persSvc
Persistency service.
Definition: AANTupleStream.h:97
AANTupleStream::writeAttributeListSpecification
void writeAttributeListSpecification()
write schema of AttributeList
Definition: AANTupleStream.cxx:322
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
EventID.h
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
checkTP.save
def save(self, fileName="./columbo.out")
Definition: checkTP.py:176
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
AANTupleStream::initialize
virtual StatusCode initialize()
Initialize AANTupleStream.
Definition: AANTupleStream.cxx:79
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:619
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:126
lumiFormat.i
int i
Definition: lumiFormat.py:85
AANTupleStream::io_reinit
StatusCode io_reinit()
callback method to reinitialize the internal state of the component for I/O purposes (e....
Definition: AANTupleStream.cxx:658
AANTupleStream::initSchema
StatusCode initSchema()
Definition: AANTupleStream.cxx:639
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
AthCommonDataStore< AthCommonMsg< Gaudi::Sequence > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
EventInfo::event_ID
EventID * event_ID()
the unique identification of the event.
Definition: EventInfo/EventInfo/EventInfo.h:224
DataHeader::sizeProvenance
int sizeProvenance() const
Definition: DataHeader.cxx:280
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:37
calibdata.exception
exception
Definition: calibdata.py:495
AANTupleStream::getFilters
StatusCode getFilters()
get filter alogs
Definition: AANTupleStream.cxx:587
AANTupleParams
Definition: AANTupleParams.h:9
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AANTupleStream::m_tree
TTree * m_tree
TTree.
Definition: AANTupleStream.h:136
AANTupleParams.h
AANTupleStream::m_schemaDone
bool m_schemaDone
first event
Definition: AANTupleStream.h:124
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
DataHeader.h
This file contains the class definition for the DataHeader and DataHeaderElement classes.
AANTupleStream::m_treeName
std::string m_treeName
Name of the output tree.
Definition: AANTupleStream.h:127
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::DataProxy::clID
CLID clID() const
Retrieve clid.
AANTupleStream::m_streamName
std::string m_streamName
Name of Stream.
Definition: AANTupleStream.h:115
AANTupleStream.h
AANTupleStream::m_tokenCString
char m_tokenCString[s_maxLengthOfStrings]
Definition: AANTupleStream.h:149
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:132
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:240
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:43
RegSelToolConfig.alg
alg
Definition: RegSelToolConfig.py:332
SG::DataProxy::name
virtual const name_type & name() const override final
Retrieve data object key == string.
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
EventInfo.h
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
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
AttributeListLayout.h
RTTAlgmain.branch
branch
Definition: RTTAlgmain.py:61
AttributeListLayout
Definition: AttributeListLayout.h:19
AANTupleStream::~AANTupleStream
virtual ~AANTupleStream()
Standard Destructor.
Definition: AANTupleStream.cxx:73
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ref
const boost::regex ref(r_ef)
AANTupleStream::execute_subAlgos
StatusCode execute_subAlgos()
execute sub-algos
Definition: AANTupleStream.cxx:559
str
Definition: BTagTrackIpAccessor.cxx:11
AANTupleStream::m_tHistSvc
ServiceHandle< ITHistSvc > m_tHistSvc
THistSvc.
Definition: AANTupleStream.h:142
merge.status
status
Definition: merge.py:16
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:45
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
AANTTreeMap::setTree
static void setTree(const std::string &stream, TTree *tree)
Definition: AANTTreeMap.h:18
StoreGateSvc.h
SG::ConstIterator
Definition: SGIterator.h:164
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:529
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356
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
DataProxy.h