ATLAS Offline Software
AANTupleStream.h
Go to the documentation of this file.
1 // dear emacs, this is -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef ANALYSISTOOLS_AANTUPLESTREAM_H
8 #define ANALYSISTOOLS_AANTUPLESTREAM_H 1
9 
10 #include "GaudiKernel/IAddressCreator.h"
11 #include "GaudiKernel/ServiceHandle.h"
12 #include "GaudiKernel/IIoComponent.h"
15 
16 #include <map>
17 #include <vector>
18 
19 namespace coral
20 {
21  class AttributeList;
22  class AttributeListSpecification;
23 }
24 
25 class StoreGateSvc;
26 
27 class ITHistSvc;
28 
29 class TFile;
30 class TTree;
31 class TBranch;
32 
33 class ATLAS_NOT_THREAD_SAFE AANTupleStream : virtual public IIoComponent,
34  public AthLegacySequence
35 {
36 public:
37 
39  AANTupleStream(const std::string& name, ISvcLocator* pSvcLocator);
40 
42  virtual ~AANTupleStream();
43 
45  virtual StatusCode initialize();
46 
48  virtual StatusCode finalize();
49 
51  virtual StatusCode execute();
52 
53 private:
54 
56  StatusCode initCollection();
57 
59  StatusCode getRef(CLID id, const std::string& key,
60  std::string& ref);
61 
63  StatusCode splitAddress( const std::string& address,
64  const std::string& match,
65  std::string& address_header,
66  std::string& address_data ) const;
67 
69  StatusCode initialize_subAlgos ();
70 
72  StatusCode execute_subAlgos ();
73 
75  void writeAttributeListSpecification();
76 
78  void setupTree();
79 
81  bool writeTokenAttrList( const std::string& token, const coral::AttributeList& attributeList );
82 
84  StatusCode getFilters();
85 
87  bool isEventAccepted() const;
88 
89  StatusCode initSchema();
90 
94  StatusCode io_reinit ();
95 
98 
100  coral::AttributeListSpecification* m_attribSpec;
101 
103  std::string m_fileName;
104 
106  StringArrayProperty m_extraRefNames;
107 
109  BooleanProperty m_writeInputDH;
110 
112  BooleanProperty m_existDH;
113 
115  std::string m_streamName;
116 
118  BooleanProperty m_lateSchema;
119 
121  std::string m_macro;
122 
125 
127  std::string m_treeName;
128 
130  std::vector<std::string> m_acceptNames;
131 
133  std::vector<IAlgorithm*> m_acceptAlgs;
134 
136  TTree * m_tree;
137 
139  TBranch * m_tokenBranch;
140 
143 
144  // Sub-algorithms as given in jobOptions type/name
145  std::vector<std::string> m_membersNames;
146 
148  static const unsigned int s_maxLengthOfStrings = 5000;
149  char m_tokenCString[s_maxLengthOfStrings];
150 };
151 
152 #endif
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
initialize
void initialize()
Definition: run_EoverP.cxx:894
AthLegacySequence::execute
StatusCode execute() override=0
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
AANTupleStream::m_acceptAlgs
std::vector< IAlgorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
Definition: AANTupleStream.h:133
AANTupleStream::m_membersNames
std::vector< std::string > m_membersNames
Definition: AANTupleStream.h:145
AANTupleStream::m_persSvc
ServiceHandle< IAddressCreator > m_persSvc
Persistency service.
Definition: AANTupleStream.h:97
coral
Definition: ISecondaryEventSelector.h:19
AANTupleStream::m_tokenBranch
TBranch * m_tokenBranch
TBranch which contains Token info.
Definition: AANTupleStream.h:139
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
AthLegacySequence
Alias for backward compatibility.
Definition: AthLegacySequence.h:63
AANTupleStream::m_macro
std::string m_macro
macro
Definition: AANTupleStream.h:121
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AANTupleStream::m_tree
TTree * m_tree
TTree.
Definition: AANTupleStream.h:136
AANTupleStream::m_schemaDone
bool m_schemaDone
first event
Definition: AANTupleStream.h:124
AANTupleStream
Definition: AANTupleStream.h:35
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
AANTupleStream::m_streamName
std::string m_streamName
Name of Stream.
Definition: AANTupleStream.h:115
AANTupleStream::m_attribSpec
coral::AttributeListSpecification * m_attribSpec
Collection attribute specification.
Definition: AANTupleStream.h:100
AthLegacySequence.h
AANTupleStream::m_extraRefNames
StringArrayProperty m_extraRefNames
Vector of extra parent ref names to register in collection.
Definition: AANTupleStream.h:106
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
AANTupleStream::m_lateSchema
BooleanProperty m_lateSchema
write schema in execute()
Definition: AANTupleStream.h:118
ref
const boost::regex ref(r_ef)
AANTupleStream::m_tHistSvc
ServiceHandle< ITHistSvc > m_tHistSvc
THistSvc.
Definition: AANTupleStream.h:142
AANTupleStream::m_acceptNames
std::vector< std::string > m_acceptNames
Vector of names of Algorithms that this stream accepts.
Definition: AANTupleStream.h:130
checker_macros.h
Define macros for attributes used to control the static checker.
AANTupleStream::m_writeInputDH
BooleanProperty m_writeInputDH
Flag to signal whether or not to write input data header.
Definition: AANTupleStream.h:109
Lb2Lll.AANTupleStream
AANTupleStream
Definition: Lb2Lll.py:219
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< IAddressCreator >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
AANTupleStream::m_fileName
std::string m_fileName
Name of the output collection.
Definition: AANTupleStream.h:103