| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

OutputStream.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_PERSISTENCYSVC_OUTPUTSTREAM_H
2 #define GAUDISVC_PERSISTENCYSVC_OUTPUTSTREAM_H
3
4 // Required for inheritance
5 #include "GaudiKernel/IDataSelector.h"
6 #include "GaudiKernel/IIncidentSvc.h"
7 #include "GaudiKernel/Algorithm.h"
8 #include "GaudiKernel/Property.h"
9 #include "OutputStreamAgent.h"
10
11 // STL include files
12 #include <memory>
13 #include <vector>
14 #include <string>
15
16 // forward declarations
17 class IIncidentSvc;
18 class IRegistry;
19 class IConversionSvc;
20 class IDataManagerSvc;
21 class OutputStreamAgent;
22 class DataStoreItem;
23
29 class OutputStream : public Algorithm {
30 public:
31 typedef std::vector<DataStoreItem*> Items;
32 typedef std::vector<std::string> ItemNames;
33 typedef std::map< Algorithm*, Items > AlgDependentItems;
34 typedef std::map< std::string, ItemNames > AlgDependentItemNames;
35 protected:
37 SmartIF<IIncidentSvc> m_incidentSvc;
39 bool m_doPreLoad;
41 bool m_doPreLoadOpt;
43 bool m_verifyItems;
45 std::string m_storeName;
47 std::string m_persName;
49 std::string m_output;
51 std::string m_outputName;
53 std::string m_outputType;
55 std::unique_ptr<OutputStreamAgent> m_agent;
57 SmartIF<IDataProviderSvc> m_pDataProvider;
59 SmartIF<IDataManagerSvc> m_pDataManager;
61 SmartIF<IConversionSvc> m_pConversionSvc;
63 DataStoreItem* m_currentItem;
65 ItemNames m_itemNames;
67 Items m_itemList;
69 ItemNames m_optItemNames;
71 Items m_optItemList;
74 AlgDependentItemNames m_algDependentItemList;
76 AlgDependentItems m_algDependentItems;
78 IDataSelector m_objects;
80 int m_events;
82 StringArrayProperty m_acceptNames;
84 StringArrayProperty m_requireNames;
86 StringArrayProperty m_vetoNames;
88 std::vector<Algorithm*> m_acceptAlgs;
90 std::vector<Algorithm*> m_requireAlgs;
92 std::vector<Algorithm*> m_vetoAlgs;
93
94 public:
96 OutputStream(const std::string& name, ISvcLocator* pSvcLocator);
98 virtual ~OutputStream() = default;
99 protected:
101 StatusCode decodeAcceptAlgs();
103 void acceptAlgsHandler( Property& theProp );
105 StatusCode decodeRequireAlgs();
107 void requireAlgsHandler( Property& theProp );
109 StatusCode decodeVetoAlgs();
111 void vetoAlgsHandler( Property& theProp );
113 Algorithm* decodeAlgorithm( const std::string& theName );
115 StatusCode decodeAlgorithms( StringArrayProperty& theNames,
116 std::vector<Algorithm*>& theAlgs );
118 bool isEventAccepted() const;
120 DataStoreItem* findItem(const std::string& path);
122 virtual StatusCode writeObjects();
123
125 bool m_fireIncidents;
126
128 virtual bool hasInput() const;
129
130 public:
132 StatusCode initialize() override;
134 StatusCode finalize() override;
136 StatusCode execute() override;
137 // Connect to proper conversion service
138 virtual StatusCode connectConversionSvc();
140 virtual bool collect(IRegistry* dir, int level);
142 virtual StatusCode collectObjects();
144 void clearSelection();
145
146 private:
148 void clearItems(Items& itms);
150 void addItem(Items& itms, const std::string& descriptor);
152 IDataSelector* selectedObjects() { return &m_objects; }
153 };
154
155 #endif // GAUDISVC_PERSISTENCYSVC_OUTPUTSTREAM_H
OutputStream::m_acceptNames
StringArrayProperty m_acceptNames
Vector of names of Algorithms that this stream accepts.
Definition: OutputStream.h:82
IDataSelector.h
OutputStream::isEventAccepted
bool isEventAccepted() const
Test whether this event should be output.
Definition: OutputStream.cpp:609
OutputStream::clearItems
void clearItems(Items &itms)
Clear item list.
Definition: OutputStream.cpp:380
OutputStream::hasInput
virtual bool hasInput() const
Tell if the instance has been configured with input items or not.
Definition: OutputStream.cpp:638
Algorithm.h
SmartIF< IIncidentSvc >
OutputStream::decodeRequireAlgs
StatusCode decodeRequireAlgs()
Decode list of Algorithms that this stream requires.
Definition: OutputStream.cpp:514
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
OutputStream::m_objects
IDataSelector m_objects
Collection of objects being selected.
Definition: OutputStream.h:78
OutputStream::finalize
StatusCode finalize() override
Terminate OutputStream.
Definition: OutputStream.cpp:159
OutputStream::~OutputStream
virtual ~OutputStream()=default
Standard Destructor.
OutputStream::m_storeName
std::string m_storeName
Name of the service managing the data store.
Definition: OutputStream.h:45
IConversionSvc
Definition: IConversionSvc.h:37
OutputStream::m_events
int m_events
Number of events written to this output stream.
Definition: OutputStream.h:80
OutputStream::m_outputType
std::string m_outputType
Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE)
Definition: OutputStream.h:53
OutputStream::m_currentItem
DataStoreItem * m_currentItem
Keep track of the current item.
Definition: OutputStream.h:63
OutputStream::m_vetoNames
StringArrayProperty m_vetoNames
Vector of names of Algorithms that this stream is vetoed by.
Definition: OutputStream.h:86
OutputStream::AlgDependentItems
std::map< Algorithm *, Items > AlgDependentItems
Definition: OutputStream.h:33
OutputStream::m_outputName
std::string m_outputName
Name of the output file.
Definition: OutputStream.h:51
OutputStream::requireAlgsHandler
void requireAlgsHandler(Property &theProp)
Handler for RequireAlgs Property.
Definition: OutputStream.cpp:520
OutputStream::m_persName
std::string m_persName
Name of the persistency service capable to write data from the store.
Definition: OutputStream.h:47
OutputStreamAgent
Definition: OutputStreamAgent.h:30
OutputStream::m_requireAlgs
std::vector< Algorithm * > m_requireAlgs
Vector of Algorithms that this stream requires.
Definition: OutputStream.h:90
OutputStream::selectedObjects
IDataSelector * selectedObjects()
Return the list of selected objects.
Definition: OutputStream.h:152
OutputStreamAgent.h
OutputStream::m_pDataProvider
SmartIF< IDataProviderSvc > m_pDataProvider
Keep reference to the data provider service.
Definition: OutputStream.h:57
OutputStream::m_algDependentItemList
AlgDependentItemNames m_algDependentItemList
Mapping between algorithm names, and a list of items for which, if the algorithm in question accepted...
Definition: OutputStream.h:74
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
std::map
STL class.
OutputStream::m_agent
std::unique_ptr< OutputStreamAgent > m_agent
Keep reference of agent.
Definition: OutputStream.h:55
OutputStream
A small to stream Data I/O.
Definition: OutputStream.h:29
OutputStream::m_acceptAlgs
std::vector< Algorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
Definition: OutputStream.h:88
std::string
STL class.
Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:820
SimpleProperty< std::vector< std::string > >
OutputStream::collect
virtual bool collect(IRegistry *dir, int level)
Store agent's classback.
Definition: OutputStream.cpp:274
OutputStream::findItem
DataStoreItem * findItem(const std::string &path)
Find single item identified by its path (exact match)
Definition: OutputStream.cpp:387
OutputStream::writeObjects
virtual StatusCode writeObjects()
Select the different objects and write them to file.
Definition: OutputStream.cpp:199
OutputStream::m_pConversionSvc
SmartIF< IConversionSvc > m_pConversionSvc
Keep reference to the data conversion service.
Definition: OutputStream.h:61
OutputStream::initialize
StatusCode initialize() override
Initialize OutputStream.
Definition: OutputStream.cpp:70
OutputStream::connectConversionSvc
virtual StatusCode connectConversionSvc()
Definition: OutputStream.cpp:423
OutputStream::m_algDependentItems
AlgDependentItems m_algDependentItems
Items to be saved for specific algorithms.
Definition: OutputStream.h:76
OutputStream::m_verifyItems
bool m_verifyItems
Flag to indicate that item consistency should be checked.
Definition: OutputStream.h:43
OutputStream::Items
std::vector< DataStoreItem * > Items
Definition: OutputStream.h:31
IIncidentSvc.h
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
OutputStream::m_itemList
Items m_itemList
Vector of items to be saved to this stream.
Definition: OutputStream.h:67
OutputStream::m_doPreLoad
bool m_doPreLoad
Flag indicating whether data pre-loading should be performed.
Definition: OutputStream.h:39
OutputStream::addItem
void addItem(Items &itms, const std::string &descriptor)
Add item to output streamer list.
Definition: OutputStream.cpp:398
OutputStream::m_doPreLoadOpt
bool m_doPreLoadOpt
Flag indicating whether optional items should be preloaded.
Definition: OutputStream.h:41
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
OutputStream::m_pDataManager
SmartIF< IDataManagerSvc > m_pDataManager
Keep reference to the data manager service.
Definition: OutputStream.h:59
OutputStream::clearSelection
void clearSelection()
Clear list of selected objects.
Definition: OutputStream.cpp:375
OutputStream::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: OutputStream.h:37
OutputStream::decodeVetoAlgs
StatusCode decodeVetoAlgs()
Decode list of Algorithms that this stream is vetoed by.
Definition: OutputStream.cpp:528
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
OutputStream::execute
StatusCode execute() override
Working entry point.
Definition: OutputStream.cpp:173
Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:74
OutputStream::m_itemNames
ItemNames m_itemNames
Vector of item names.
Definition: OutputStream.h:65
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
std::vector< DataStoreItem * >
std::unique_ptr< OutputStreamAgent >
OutputStream::m_optItemNames
ItemNames m_optItemNames
Vector of item names.
Definition: OutputStream.h:69
OutputStream::decodeAlgorithms
StatusCode decodeAlgorithms(StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs)
Decode specified list of Algorithms.
Definition: OutputStream.cpp:577
IDataManagerSvc
Definition: IDataManagerSvc.h:45
OutputStream::ItemNames
std::vector< std::string > ItemNames
Definition: OutputStream.h:32
Property.h
OutputStream::acceptAlgsHandler
void acceptAlgsHandler(Property &theProp)
Handler for AcceptAlgs Property.
Definition: OutputStream.cpp:506
OutputStream::m_requireNames
StringArrayProperty m_requireNames
Vector of names of Algorithms that this stream requires.
Definition: OutputStream.h:84
OutputStream::decodeAlgorithm
Algorithm * decodeAlgorithm(const std::string &theName)
Decode a single algorithm name.
Definition: OutputStream.cpp:542
OutputStream::OutputStream
OutputStream(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm Constructor.
Definition: OutputStream.cpp:30
gaudirun.level
level
Definition: gaudirun.py:261
OutputStream::m_output
std::string m_output
Name of the output file specification.
Definition: OutputStream.h:49
ana.itms
list itms
Definition: ana.py:135
OutputStream::m_vetoAlgs
std::vector< Algorithm * > m_vetoAlgs
Vector of Algorithms that this stream is vetoed by.
Definition: OutputStream.h:92
OutputStream::AlgDependentItemNames
std::map< std::string, ItemNames > AlgDependentItemNames
Definition: OutputStream.h:34
OutputStream::collectObjects
virtual StatusCode collectObjects()
Collect all objects to be written to the output stream.
Definition: OutputStream.cpp:292
OutputStream::vetoAlgsHandler
void vetoAlgsHandler(Property &theProp)
Handler for VetoAlgs Property.
Definition: OutputStream.cpp:534
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21
OutputStream::decodeAcceptAlgs
StatusCode decodeAcceptAlgs()
Decode list of Algorithms that this stream accepts.
Definition: OutputStream.cpp:500
OutputStream::m_fireIncidents
bool m_fireIncidents
should I fire incidents for writing opening/closing etc?
Definition: OutputStream.h:125
OutputStream::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream.
Definition: OutputStream.h:71