Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <TBXMLEventWriterTool.h>
|
| TBXMLEventWriterTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
| ~TBXMLEventWriterTool () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | writeOut (std::ostream &outStream, const std::string &entryTag=" ") |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | finalize (std::ostream &outStream) |
|
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 |
|
|
virtual StatusCode | writeRunFiles (const std::string &, unsigned int) |
|
virtual StatusCode | writeEvent (std::ostream &outFile, const std::string &entryTag) |
|
virtual void | openDictionary (std::ostream &outStream, const std::string &dictName, const std::vector< std::string > &listOfElements) |
|
virtual void | openDictionary (std::ostream &outStream, const std::string &dictName) |
|
virtual void | closeDictionary (std::ostream &outStream) |
|
virtual void | addDictElement (std::ostream &outStream, const std::string &theElement, const std::vector< std::string > &listOfElements) |
|
virtual void | addAttributes (std::ostream &outStream, const std::string &theElement, const std::vector< std::string > &listOfAttributes) |
|
virtual void | openElement (std::ostream &outStream, const std::string &theElement, const std::vector< std::string > &listOfAttr, const std::vector< std::string > &listOfValues) |
|
virtual void | closeElement (std::ostream &outStream, const std::string &theElement) |
|
virtual void | closeElement (std::ostream &outStream) |
|
virtual void | closeAllElements (std::ostream &outStream) |
|
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...
|
|
Definition at line 19 of file TBXMLEventWriterTool.h.
◆ StoreGateSvc_t
◆ TBXMLEventWriterTool()
TBXMLEventWriterTool::TBXMLEventWriterTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~TBXMLEventWriterTool()
TBXMLEventWriterTool::~TBXMLEventWriterTool |
( |
| ) |
|
◆ addAttributes()
void TBXMLWriterToolBase::addAttributes |
( |
std::ostream & |
outStream, |
|
|
const std::string & |
theElement, |
|
|
const std::vector< std::string > & |
listOfAttributes |
|
) |
| |
|
protectedvirtualinherited |
Definition at line 93 of file TBXMLWriterToolBase.cxx.
98 outStream <<
" <!ATTLIST " << theElement << std::endl;
99 for (
unsigned int i=0;
i<listOfAttr.size();
i++ )
101 outStream <<
" " << listOfAttr[
i] << std::endl;
103 outStream <<
">" << std::endl;
◆ addDictElement()
void TBXMLWriterToolBase::addDictElement |
( |
std::ostream & |
outStream, |
|
|
const std::string & |
theElement, |
|
|
const std::vector< std::string > & |
listOfElements |
|
) |
| |
|
protectedvirtualinherited |
Definition at line 59 of file TBXMLWriterToolBase.cxx.
64 outStream <<
"<!ELEMENT " << theElement;
66 if ( listOfElements.size() == 0 )
68 outStream <<
">" << std::endl;
73 if ( listOfElements[0] ==
"ANY" ||
74 listOfElements[0] ==
"EMPTY" ||
75 listOfElements[0] ==
"ALL" )
77 outStream <<
" " << listOfElements[0] <<
" >" << std::endl;
81 outStream <<
" (" << listOfElements[0];
82 for (
unsigned int i=1;
i<listOfElements.size();
i++ )
84 outStream <<
"," << listOfElements[
i];
86 outStream <<
") >" << std::endl;
◆ closeAllElements()
void TBXMLWriterToolBase::closeAllElements |
( |
std::ostream & |
outStream | ) |
|
|
protectedvirtualinherited |
◆ closeDictionary()
void TBXMLWriterToolBase::closeDictionary |
( |
std::ostream & |
outStream | ) |
|
|
protectedvirtualinherited |
◆ closeElement() [1/2]
void TBXMLWriterToolBase::closeElement |
( |
std::ostream & |
outStream | ) |
|
|
protectedvirtualinherited |
◆ closeElement() [2/2]
void TBXMLWriterToolBase::closeElement |
( |
std::ostream & |
outStream, |
|
|
const std::string & |
theElement |
|
) |
| |
|
protectedvirtualinherited |
Definition at line 141 of file TBXMLWriterToolBase.cxx.
148 outStream <<
"</" << (*inVec) <<
">" << std::endl;
153 outStream <<
"<!-- XML Structural Problem! \n\n"
154 <<
" cannot find an element " << theElement <<
"!\n\n"
155 <<
"-->" << std::endl;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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() [1/2]
virtual StatusCode TBXMLWriterToolBase::finalize |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ finalize() [2/2]
virtual StatusCode TBXMLWriterToolBase::finalize |
( |
std::ostream & |
outStream | ) |
|
|
inlinevirtualinherited |
◆ initialize()
virtual StatusCode TBXMLWriterToolBase::initialize |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ inputHandles()
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.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ openDictionary() [1/2]
void TBXMLWriterToolBase::openDictionary |
( |
std::ostream & |
outStream, |
|
|
const std::string & |
dictName |
|
) |
| |
|
protectedvirtualinherited |
◆ openDictionary() [2/2]
void TBXMLWriterToolBase::openDictionary |
( |
std::ostream & |
outStream, |
|
|
const std::string & |
dictName, |
|
|
const std::vector< std::string > & |
listOfElements |
|
) |
| |
|
protectedvirtualinherited |
◆ openElement()
void TBXMLWriterToolBase::openElement |
( |
std::ostream & |
outStream, |
|
|
const std::string & |
theElement, |
|
|
const std::vector< std::string > & |
listOfAttr, |
|
|
const std::vector< std::string > & |
listOfValues |
|
) |
| |
|
protectedvirtualinherited |
Definition at line 108 of file TBXMLWriterToolBase.cxx.
116 outStream <<
"<" << theElement;
117 if ( listOfAttr.size() > 0 && listOfValues.size() == listOfAttr.size() )
119 for (
unsigned int i=0;
i<listOfAttr.size();
i++ )
121 outStream <<
" " << listOfAttr[
i] <<
"="
127 outStream <<
">" << std::endl;
◆ outputHandles()
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()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ writeEvent()
StatusCode TBXMLEventWriterTool::writeEvent |
( |
std::ostream & |
outFile, |
|
|
const std::string & |
entryTag |
|
) |
| |
|
protectedvirtual |
Implements TBXMLWriterToolBase.
Definition at line 31 of file TBXMLEventWriterTool.cxx.
40 const EventContext& ctx = Gaudi::Hive::currentContext();
41 unsigned int theRun = ctx.eventID().run_number();
42 unsigned int theEvent = ctx.eventID().event_number();
43 unsigned int theType = 0;
50 std::vector<std::string> theEventElements;
51 theEventElements.push_back(
"EventHeader");
52 theEventElements.push_back(
"(CaloCellContainer*)?");
53 theEventElements.push_back(
"(BeamWireChambers*)?");
54 theEventElements.push_back(
"(BeamProfileChambers*)?");
55 theEventElements.push_back(
"(BeamScintillators*)?");
56 theEventElements.push_back(
"(TailCatcher*)?");
57 theEventElements.push_back(
"(PatternUnit*)?");
59 std::vector<std::string> theEventAttr;
60 theEventAttr.push_back(
"name CDATA #REQUIRED");
64 std::vector<std::string> theHeaderElements;
68 std::vector<std::string> theHeaderAttr;
69 theHeaderAttr.push_back(
"name CDATA #REQUIRED");
70 theHeaderAttr.push_back(
"run CDATA #REQUIRED");
71 theHeaderAttr.push_back(
"event CDATA #REQUIRED");
72 theHeaderAttr.push_back(
"type CDATA #REQUIRED");
82 std::vector<std::string> anyData;
83 anyData.push_back(
"ANY");
85 std::vector<std::string> theCaloAttr;
86 theCaloAttr.push_back(
"name CDATA #REQUIRED");
87 theCaloAttr.push_back(
"ncols CDATA #REQUIRED");
88 theCaloAttr.push_back(
"nrows CDATA #REQUIRED");
89 theCaloAttr.push_back(
"idtype ( uint | int | short | ushort ) #REQUIRED");
90 theCaloAttr.push_back(
"etype ( float | double ) #REQUIRED");
91 this->
addAttributes(outStream,
"CaloCellContainer",theCaloAttr);
95 std::vector<std::string> theBPCAttr;
96 theBPCAttr.push_back(
"name CDATA #REQUIRED");
97 theBPCAttr.push_back(
"cols CDATA #REQUIRED");
98 theBPCAttr.push_back(
"idtype ( uint | int | short | ushort ) #REQUIRED");
99 theBPCAttr.push_back(
"xtype ( float | double ) #REQUIRED");
100 theBPCAttr.push_back(
"ytype ( float | double ) #REQUIRED");
104 std::vector<std::string> theMWPCAttr;
105 theMWPCAttr.push_back(
"name CDATA #REQUIRED");
106 theMWPCAttr.push_back(
"cols CDATA #REQUIRED");
107 theMWPCAttr.push_back(
"idtype ( uint | int | short | ushort ) #REQUIRED");
108 theMWPCAttr.push_back(
"xtype ( float | double ) #REQUIRED");
109 theMWPCAttr.push_back(
"ytype ( float | double ) #REQUIRED");
113 std::vector<std::string> theScintAttr;
114 theScintAttr.push_back(
"name CDATA #REQUIRED");
115 theScintAttr.push_back(
"cols CDATA #REQUIRED");
116 theScintAttr.push_back(
"idtype ( uint | int | short | ushort ) #REQUIRED");
117 theScintAttr.push_back(
"signal ( float | double ) #REQUIRED");
126 std::vector<std::string> theEventValues(theEventAttr.size());
127 for (
unsigned int i=0;
i<theEventAttr.size();
i++ )
129 if ( (theEventAttr[
i]).
find(
"name") != std::string::npos )
131 theEventValues[
i] =
"EventInfo";
134 theEventAttr[
i].substr(0,theEventAttr[
i].find_first_of(
" "));
136 this->
openElement(outStream,
"EventInfo",theEventAttr,theEventValues);
142 std::vector<std::string> theHeaderValues(theHeaderAttr.size());
143 for (
unsigned int i=0;
i<theHeaderAttr.size();
i++ )
145 if ( (theHeaderAttr[
i]).
find(
"name") != std::string::npos )
147 theHeaderValues[
i] =
"EventInfo";
149 else if ( (theHeaderAttr[
i]).
find(
"run") != std::string::npos )
151 std::ostringstream theValue; theValue <<
theRun << std::ends;
152 theHeaderValues[
i] = theValue.str();
154 else if ( (theHeaderAttr[
i]).
find(
"event") != std::string::npos )
156 std::ostringstream theValue; theValue << theEvent << std::ends;
157 theHeaderValues[
i] = theValue.str();
159 else if ( (theHeaderAttr[
i]).
find(
"type") != std::string::npos )
161 std::ostringstream theValue; theValue << theType << std::ends;
162 theHeaderValues[
i] = theValue.str();
166 theHeaderValues[
i] =
"unknown";
169 theHeaderAttr[
i].substr(0,theHeaderAttr[
i].find_first_of(
" "));
173 theHeaderAttr,theHeaderValues);
197 outStream << std::endl;
201 return StatusCode::SUCCESS;
◆ writeOut()
virtual StatusCode TBXMLWriterToolBase::writeOut |
( |
std::ostream & |
outStream, |
|
|
const std::string & |
entryTag = " " |
|
) |
| |
|
inlinevirtualinherited |
◆ writeRunFiles()
StatusCode TBXMLEventWriterTool::writeRunFiles |
( |
const std::string & |
, |
|
|
unsigned int |
|
|
) |
| |
|
protectedvirtual |
◆ m_detStore
◆ m_dictionary
std::string TBXMLWriterToolBase::m_dictionary |
|
protectedinherited |
◆ m_doubleQuote
const std::string TBXMLWriterToolBase::m_doubleQuote = "\042" |
|
staticprotectedinherited |
◆ m_elementList
std::vector<std::string> TBXMLWriterToolBase::m_elementList |
|
protectedinherited |
◆ m_evtStore
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
virtual void setOwner(IDataHandleHolder *o)=0
msgSvc
Provide convenience handles for various services.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>