|
ATLAS Offline Software
|
algorithm that marks for write data objects in SG
More...
#include <RootNtupleOutputStream.h>
|
| RootNtupleOutputStream (const std::string &name, ISvcLocator *pSvcLocator) |
| Standard algorithm Constructor. More...
|
|
virtual | ~RootNtupleOutputStream () |
| Standard Destructor. More...
|
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | 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 |
|
|
bool | isEventAccepted () const |
| Test whether this event should be output. More...
|
|
|
bool | isEventAccepted () const |
| Test whether this event should be output. More...
|
|
algorithm that marks for write data objects in SG
- Author
- binet.nosp@m.@cer.nosp@m.n.ch
- Id
- RootNtupleOutputStream.h 500674 2012-05-14 21:36:37Z gemmeren
Definition at line 46 of file RootNtupleOutputStream.h.
◆ IClassIDSvc_t
◆ Items
◆ StoreGateSvc_t
◆ TypeKeyPairs
◆ RootNtupleOutputStream()
Athena::RootNtupleOutputStream::RootNtupleOutputStream |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Standard algorithm Constructor.
Definition at line 32 of file RootNtupleOutputStream.cxx.
37 m_streamer(std::string(
"AthenaOutputStreamTool/") +
38 name + std::string(
"Tool"),
this),
59 "dynamic output itemlist:\n" \
60 " if enabled rediscover object list to be written out at each event\n" \
61 " otherwise: reuse the one from the first event.");
◆ ~RootNtupleOutputStream()
Athena::RootNtupleOutputStream::~RootNtupleOutputStream |
( |
| ) |
|
|
virtual |
◆ clearSelection()
void Athena::RootNtupleOutputStream::clearSelection |
( |
| ) |
|
|
inlineprivate |
◆ collectAllObjects()
void Athena::RootNtupleOutputStream::collectAllObjects |
( |
| ) |
|
|
private |
Collect data objects for output streamer list.
Definition at line 296 of file RootNtupleOutputStream.cxx.
298 typedef std::vector<SG::FolderItem> Items_t;
311 static const std::string s_plus =
"+";
312 static const std::string s_dash =
"-";
313 typedef std::vector<const SG::DataProxy*> Proxies_t;
317 std::vector<std::string> toremove;
318 toremove.reserve(
items.size());
323 for (Proxies_t::const_iterator
324 iproxy = proxies.begin(),
325 iend = proxies.end();
332 for (std::vector<std::string>::const_iterator
333 jkey =
items.begin(),
337 if (!jkey->empty()) {
338 if ((*jkey)[0] == s_dash[0]) {
339 toremove.push_back(jkey->substr(1, std::string::npos));
342 std::string
key = *jkey;
343 if ((*jkey)[0] == s_plus[0]) {
344 key = jkey->substr(1, std::string::npos);
346 int o = fnmatch(
key.c_str(),
347 proxy->name().c_str(),
359 if (toremove.empty()) {
362 for(Items_t::const_iterator
367 const std::string &
name = isel->key();
369 for (std::vector<std::string>::const_iterator
370 jkey = toremove.begin(),
371 jend = toremove.end();
374 const std::string&
key = *jkey;
375 int o = fnmatch(
key.c_str(),
391 for (Items_t::const_iterator
396 const std::string &
name = itr->key();
403 if (NULL ==
proxy->accessData()) {
408 if (NULL ==
proxy->accessData()) {
◆ 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]
◆ execute()
StatusCode Athena::RootNtupleOutputStream::execute |
( |
| ) |
|
|
virtual |
Reimplemented from FilteredAlgorithm.
Definition at line 212 of file RootNtupleOutputStream.cxx.
215 for (std::vector<ToolHandle<IAthenaOutputTool> >::
iterator
220 if (!(*iter)->preExecute().isSuccess()) {
225 if (!
write().isSuccess()) {
229 for (std::vector<ToolHandle<IAthenaOutputTool> >::
iterator
234 if(!(*iter)->postExecute().isSuccess()) {
240 ? StatusCode::FAILURE
241 : StatusCode::SUCCESS;
◆ 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
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode Athena::RootNtupleOutputStream::finalize |
( |
| ) |
|
|
virtual |
◆ handle()
void Athena::RootNtupleOutputStream::handle |
( |
const Incident & |
incident | ) |
|
|
private |
Incident service handle listening for MetaDataStop.
Definition at line 152 of file RootNtupleOutputStream.cxx.
155 static const std::string s_METADATASTOP =
"MetaDataStop";
156 if (inc.type() == s_METADATASTOP) {
159 for (std::vector<ToolHandle<IAthenaOutputTool> >::
iterator
164 if (!(*iter)->preFinalize().isSuccess()) {
170 if (!
write().isSuccess()) {
◆ initialize()
StatusCode Athena::RootNtupleOutputStream::initialize |
( |
| ) |
|
|
virtual |
Reimplemented from FilteredAlgorithm.
Definition at line 70 of file RootNtupleOutputStream.cxx.
75 return StatusCode::FAILURE;
84 return StatusCode::FAILURE;
93 return StatusCode::FAILURE;
100 return StatusCode::FAILURE;
103 const bool extendProvenanceRecord =
true;
106 extendProvenanceRecord).isSuccess()) {
108 return StatusCode::FAILURE;
113 return StatusCode::FAILURE;
118 for (std::vector<ToolHandle<IAthenaOutputTool> >::
iterator
123 if (!(*iter)->postInitialize().isSuccess()) {
129 return StatusCode::FAILURE;
138 if (!incSvc.retrieve().isSuccess()) {
140 return StatusCode::FAILURE;
144 incSvc->addListener(
this,
"MetaDataStop", 50);
148 return StatusCode::SUCCESS;
◆ 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.
◆ isEventAccepted()
bool FilteredAlgorithm::isEventAccepted |
( |
| ) |
const |
|
inherited |
Test whether this event should be output.
Definition at line 128 of file FilteredAlgorithm.cxx.
131 const EventContext& ctx = this->getContext();
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ 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()
◆ selectedObjects()
IDataSelector* Athena::RootNtupleOutputStream::selectedObjects |
( |
| ) |
|
|
inlineprivate |
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ 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()
◆ write()
StatusCode Athena::RootNtupleOutputStream::write |
( |
| ) |
|
|
virtual |
Stream the data.
Definition at line 246 of file RootNtupleOutputStream.cxx.
259 if (!
sc.isSuccess()) {
260 if (!
sc.isRecoverable()) {
268 if (!
sc.isSuccess()) {
280 ? StatusCode::FAILURE
281 : StatusCode::SUCCESS;
◆ AlgFactory< Athena::RootNtupleOutputStream >
◆ m_acceptNames
StringArrayProperty FilteredAlgorithm::m_acceptNames |
|
protectedinherited |
Vector of names of Algorithms that this stream accepts.
Definition at line 38 of file FilteredAlgorithm.h.
◆ m_dataStore
◆ m_decSvc
◆ m_detStore
◆ m_dynamicItemList
bool Athena::RootNtupleOutputStream::m_dynamicItemList |
|
protected |
dynamic output itemlist: if enabled rediscover object list to be written out at each event otherwise: reuse the one from the first event.
Definition at line 95 of file RootNtupleOutputStream.h.
◆ m_events
int Athena::RootNtupleOutputStream::m_events |
|
protected |
◆ m_evtStore
◆ m_exemptPersToPers
std::vector<unsigned int> Athena::RootNtupleOutputStream::m_exemptPersToPers |
|
protected |
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_forceRead
bool Athena::RootNtupleOutputStream::m_forceRead |
|
protected |
◆ m_helperTools
◆ m_itemList
StringArrayProperty Athena::RootNtupleOutputStream::m_itemList |
|
protected |
◆ m_itemListFromTool
bool Athena::RootNtupleOutputStream::m_itemListFromTool |
|
protected |
◆ m_objects
IDataSelector Athena::RootNtupleOutputStream::m_objects |
|
protected |
◆ m_outputName
std::string Athena::RootNtupleOutputStream::m_outputName |
|
protected |
◆ m_pCLIDSvc
◆ m_persName
std::string Athena::RootNtupleOutputStream::m_persName |
|
protected |
◆ m_persToPers
bool Athena::RootNtupleOutputStream::m_persToPers |
|
protected |
set to true to allow data objects being copied persistent to persistent (without SG retrieve).
Definition at line 81 of file RootNtupleOutputStream.h.
◆ m_processTag
StringProperty Athena::RootNtupleOutputStream::m_processTag |
|
protected |
◆ m_provideDef
bool Athena::RootNtupleOutputStream::m_provideDef |
|
protected |
set to true to allow defaults being provided for non-existent data objects.
Definition at line 84 of file RootNtupleOutputStream.h.
◆ m_requireNames
StringArrayProperty FilteredAlgorithm::m_requireNames |
|
protectedinherited |
Vector of names of Algorithms that this stream requires.
Definition at line 40 of file FilteredAlgorithm.h.
◆ m_selection
std::vector<SG::FolderItem> Athena::RootNtupleOutputStream::m_selection |
|
protected |
◆ m_streamer
◆ m_varHandleArraysDeclared
◆ m_vetoNames
StringArrayProperty FilteredAlgorithm::m_vetoNames |
|
protectedinherited |
Vector of names of Algorithms that this stream is vetoed by.
Definition at line 42 of file FilteredAlgorithm.h.
◆ m_vhka
◆ m_writeOnExecute
bool Athena::RootNtupleOutputStream::m_writeOnExecute |
|
protected |
◆ m_writeOnFinalize
bool Athena::RootNtupleOutputStream::m_writeOnFinalize |
|
protected |
◆ m_writingTool
StringProperty Athena::RootNtupleOutputStream::m_writingTool |
|
protected |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
ToolHandle< IAthenaOutputStreamTool > m_streamer
pointer to AthenaOutputStreamTool
bool m_writeOnFinalize
set to true to trigger streaming of data on finalize()
void collectAllObjects()
Collect data objects for output streamer list.
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
std::vector< unsigned int > m_exemptPersToPers
virtual StatusCode initialize()
bool m_writeOnExecute
set to true to trigger streaming of data on execute()
int m_events
Number of events written to this output stream.
bool m_dynamicItemList
dynamic output itemlist: if enabled rediscover object list to be written out at each event otherwise:...
virtual void setOwner(IDataHandleHolder *o)=0
void clearSelection()
Clear list of selected objects.
bool isEventAccepted() const
Test whether this event should be output.
IDataSelector m_objects
Collection of objects beeing selected.
StringArrayProperty m_itemList
Vector of item names.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
bool m_forceRead
set to true to force read of data objects in item list
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string m_persName
Name of the persistency service capable to write data from the store.
virtual StatusCode write()
Stream the data.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
bool m_itemListFromTool
set to write out everything from input DataHeader
virtual void renounce()=0
bool m_persToPers
set to true to allow data objects being copied persistent to persistent (without SG retrieve).
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
DataObjIDColl m_extendedExtraObjects
ServiceHandle< StoreGateSvc > m_dataStore
handle to the StoreGateSvc store where the data we want to write out resides
ToolHandleArray< IAthenaOutputTool > m_helperTools
vector of AlgTools that that are executed by this stream
#define ATH_MSG_WARNING(x)
std::vector< SG::FolderItem > m_selection
list of selected proxies.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
StringProperty m_processTag
tag of processing stage:
bool m_provideDef
set to true to allow defaults being provided for non-existent data objects.
std::string m_outputName
Name of the output file.
ServiceHandle< IDecisionSvc > m_decSvc
a Folder item (data object) is identified by the clid/key pair
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>