|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "GaudiKernel/GaudiException.h"
12 #include "GaudiKernel/IAlgManager.h"
13 #include "GaudiKernel/IClassIDSvc.h"
14 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/IOpaqueAddress.h"
16 #include "GaudiKernel/IProperty.h"
17 #include "GaudiKernel/ClassID.h"
34 m_dataStore(
"StoreGateSvc",
name),
35 m_pCLIDSvc(
"ClassIDSvc",
name),
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.");
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;
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()) {
192 if (!
m_streamer->commitOutput().isSuccess()) {
196 if (!
m_streamer->finalizeOutput().isSuccess()) {
207 ? StatusCode::FAILURE
208 : StatusCode::SUCCESS;
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;
259 if (!
sc.isSuccess()) {
260 if (!
sc.isRecoverable()) {
268 if (!
sc.isSuccess()) {
280 ? StatusCode::FAILURE
281 : StatusCode::SUCCESS;
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()) {
JetConstituentVector::iterator iterator
ToolHandle< IAthenaOutputStreamTool > m_streamer
pointer to AthenaOutputStreamTool
algorithm that marks for write data objects in SG
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)
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:...
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.
void handle(const Incident &incident)
Incident service handle listening for MetaDataStop.
virtual StatusCode execute()
virtual StatusCode finalize()
StringArrayProperty m_itemList
Vector of item names.
bool m_forceRead
set to true to force read of data objects in item list
Some weak symbol referencing magic...
::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.
RootNtupleOutputStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm Constructor.
bool m_itemListFromTool
set to write out everything from input DataHeader
bool m_persToPers
set to true to allow data objects being copied persistent to persistent (without SG retrieve).
const std::string selection
virtual ~RootNtupleOutputStream()
Standard Destructor.
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
std::vector< SG::FolderItem > m_selection
list of selected proxies.
virtual StatusCode initialize()
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.
a Folder item (data object) is identified by the clid/key pair