ATLAS Offline Software
Loading...
Searching...
No Matches
RootNtupleOutputStream.h
Go to the documentation of this file.
1// Dear emacs, this is -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef ATHENAROOTCOMPS_ROOTNTUPLEOUTPUTSTREAM_H
8#define ATHENAROOTCOMPS_ROOTNTUPLEOUTPUTSTREAM_H
9
10// STL include files
11#include <memory>
12#include <map>
13#include <set>
14#include <vector>
15#include <string>
16
17// fwk includes
18#include "GaudiKernel/IDataSelector.h"
19#include "GaudiKernel/ClassID.h"
20#include "GaudiKernel/ServiceHandle.h"
21#include "GaudiKernel/ToolHandle.h"
22#include "GaudiKernel/IIncidentListener.h"
24
25// forward declarations
26template <class ConcreteAlgorithm> class AlgFactory;
27class IClassIDSvc;
28class StoreGateSvc;
31
32namespace SG {
33 class DataProxy;
34 class IFolder;
35 class FolderItem;
36}
37
38namespace Athena {
39
47 : virtual public IIncidentListener,
49{
51
52public:
53 typedef std::vector<SG::DataProxy*> Items;
54
55protected:
59
61 std::string m_persName;
63 StringProperty m_writingTool;
65 std::string m_outputName;
67 StringProperty m_processTag;
68
69 typedef ServiceHandle<IClassIDSvc> IClassIDSvc_t;
71
73 StringArrayProperty m_itemList;
75 IDataSelector m_objects;
82 std::vector<unsigned int> m_exemptPersToPers;
91
96
98 std::vector<SG::FolderItem> m_selection;
99
101 ToolHandle<IAthenaOutputStreamTool> m_streamer;
103 ToolHandleArray<IAthenaOutputTool> m_helperTools;
104
105public:
106 typedef std::vector<std::pair<std::string, std::string> > TypeKeyPairs;
107
109 RootNtupleOutputStream(const std::string& name, ISvcLocator* pSvcLocator);
111 virtual ~RootNtupleOutputStream();
112
114
115 virtual StatusCode initialize();
116 virtual StatusCode finalize();
117 virtual StatusCode execute();
119
120 virtual StatusCode write();
121
122private:
124 void clearSelection();
126 void collectAllObjects();
128 IDataSelector* selectedObjects() {
129 return &m_objects;
130 }
131
132 void handle(const Incident& incident);
133};
134
135} //> ns Athena
136
137#endif // ATHENAROOTCOMPS_ROOTNTUPLEOUTPUTSTREAM_H
std::vector< SG::FolderItem > m_selection
list of selected proxies.
StringProperty m_writingTool
Name of the OutputStreamTool used for writing.
void clearSelection()
Clear list of selected objects.
IDataSelector * selectedObjects()
Return the list of selected objects.
bool m_dynamicItemList
dynamic output itemlist: if enabled rediscover object list to be written out at each event otherwise:...
std::vector< SG::DataProxy * > Items
virtual StatusCode write()
Stream the data.
bool m_provideDef
set to true to allow defaults being provided for non-existent data objects.
bool m_itemListFromTool
set to write out everything from input DataHeader
ServiceHandle< StoreGateSvc > m_dataStore
handle to the StoreGateSvc store where the data we want to write out resides
void collectAllObjects()
Collect data objects for output streamer list.
void handle(const Incident &incident)
Incident service handle listening for MetaDataStop.
IDataSelector m_objects
Collection of objects beeing selected.
bool m_persToPers
set to true to allow data objects being copied persistent to persistent (without SG retrieve).
StringArrayProperty m_itemList
Vector of item names.
RootNtupleOutputStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm Constructor.
bool m_forceRead
set to true to force read of data objects in item list
bool m_writeOnExecute
set to true to trigger streaming of data on execute()
std::string m_persName
Name of the persistency service capable to write data from the store.
StringProperty m_processTag
tag of processing stage:
ToolHandle< IAthenaOutputStreamTool > m_streamer
pointer to AthenaOutputStreamTool
ToolHandleArray< IAthenaOutputTool > m_helperTools
vector of AlgTools that that are executed by this stream
ServiceHandle< IClassIDSvc > IClassIDSvc_t
bool m_writeOnFinalize
set to true to trigger streaming of data on finalize()
std::string m_outputName
Name of the output file.
int m_events
Number of events written to this output stream.
std::vector< unsigned int > m_exemptPersToPers
std::vector< std::pair< std::string, std::string > > TypeKeyPairs
DataProxy provides the registry services for StoreGate.
FilteredAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm Constructor.
This is a tool that allows streaming out of DataObjects.
This class provides the interface for AthenaOutputTool classes used by AthenaOutputStream.
The Athena Transient Store API.
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
Forward declaration.