| The Gaudi Framework v27r1

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

- File List
- File Members

RootCnvSvc.h
Go to the documentation of this file.
1 //====================================================================
2 // RootCnvSvc definition
3 //--------------------------------------------------------------------
4 //
5 // Author : M.Frank
6 //====================================================================
7 #ifndef GAUDIROOTCNV_GAUDIROOTCNVSVC_H
8 #define GAUDIROOTCNV_GAUDIROOTCNVSVC_H
9
10 // Framework include files
11 #include "GaudiKernel/ConversionSvc.h"
12 #include "GaudiKernel/DataObject.h"
13 #include "GaudiKernel/ClassID.h"
14
15 // C++ include files
16 #include <set>
17
18 // Forward declarations
19 class IDataManagerSvc;
20 class IIncidentSvc;
21 class TClass;
22
23 // ROOT include files
24 #include "TROOT.h"
25 #include "TClass.h"
26 #include "TTree.h"
27 #include "TBranch.h"
28
29 //#include "RootCnv/RootPerfMonSvc.h"
30
31 /*
32 * Gaudi namespace declaration
33 */
34 namespace Gaudi {
35
36 // Forward declarations
37 class IIODataManager;
38 class IDataConnection;
39 class RootDataConnection;
40 class RootConnectionSetup;
41
52 class GAUDI_API RootCnvSvc : public ConversionSvc {
53 protected:
54
56 SmartIF<Gaudi::IIODataManager> m_ioMgr;
58 SmartIF<IIncidentSvc> m_incidentSvc;
60 Gaudi::RootDataConnection* m_current = nullptr;
62 TClass* m_classRefs;
64 TClass* m_classDO;
66 std::shared_ptr<RootConnectionSetup> m_setup;
68 std::string m_currSection;
69
71 bool m_incidentEnabled;
73 std::string m_shareFiles;
75 std::string m_recordName;
77 std::string m_ioPerfStats;
79 std::string m_compression;
80
82 int m_autoFlush;
84 int m_basketSize;
86 int m_bufferSize;
88 int m_splitLevel;
89
91 std::set<std::string> m_badFiles;
92
94 std::unique_ptr<MsgStream> m_log;
95
97 TClass* getClass(DataObject* pObject);
99 MsgStream& log() const { return *m_log; }
100
101 public:
102
104 RootCnvSvc(const std::string& name, ISvcLocator* svc);
105
107 virtual ~RootCnvSvc();
108
110 virtual StatusCode updateServiceState(IOpaqueAddress* /* pAddress */)
111 { return StatusCode::SUCCESS; }
112
118 StatusCode error(const std::string& msg);
119
126 StatusCode connectDatabase(const std::string& dataset, int mode, RootDataConnection** con);
127
129 virtual StatusCode initialize();
130
132 virtual StatusCode finalize();
133
135 virtual IConverter* createConverter(long typ,
136 const CLID& wanted,
137 const ICnvFactory* fac);
138
140 virtual void loadConverter(DataObject* pObj);
141
148 virtual StatusCode connectOutput(const std::string& outputFile,
149 const std::string& openMode);
150
156 virtual StatusCode connectOutput(const std::string& outputFile);
157
168 virtual StatusCode commitOutput(const std::string& outputFile,
169 bool do_commit);
170
176 virtual StatusCode disconnect(const std::string& dbName);
177
189 virtual StatusCode createAddress( long svc_type,
190 const CLID& clid,
191 const std::string* par,
192 const unsigned long* ip,
193 IOpaqueAddress*& refpAddress);
194
204 virtual StatusCode createAddress( long svc_type,
205 const CLID& clid,
206 const std::string& refAddress,
207 IOpaqueAddress*& refpAddress) {
208 return this->ConversionSvc::createAddress(svc_type,clid,refAddress,refpAddress);
209 }
210
217 virtual StatusCode createNullRep(const std::string& path);
218
225 virtual StatusCode createNullRef(const std::string& path);
226
234 virtual StatusCode i__createRep(DataObject* pObj, IOpaqueAddress*& refpAddr);
235
236
244 virtual StatusCode i__fillRepRefs(IOpaqueAddress* pAddr,DataObject* pObj);
245
253 virtual StatusCode i__createObj(IOpaqueAddress* pAddr, DataObject*& refpObj);
254
262 virtual StatusCode i__fillObjRefs(IOpaqueAddress* pAddr, DataObject* pObj);
263 };
264 }
265
266 #endif // GAUDIROOTCNV_GAUDIROOTCNVSVC_H
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
std::shared_ptr
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
ClassID.h
AnalysisTest.initialize
def initialize()
Definition: AnalysisTest.py:12
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
IConverter
The data converters are responsible to translate data from one representation into another...
Definition: IConverter.h:57
Gaudi::RootCnvSvc::m_currSection
std::string m_currSection
Property: ROOT section name.
Definition: RootCnvSvc.h:68
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
Gaudi::RootCnvSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootCnvSvc.h:58
GaudiMP.FdsRegistry.msg
tuple msg
Definition: FdsRegistry.py:8
ConversionSvc.h
Gaudi::RootCnvSvc::m_basketSize
int m_basketSize
Property: Basket optimization parameter for ROOT TTree (total basket size)
Definition: RootCnvSvc.h:84
Gaudi::RootCnvSvc::m_setup
std::shared_ptr< RootConnectionSetup > m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:66
GaudiPython.Bindings.getClass
def getClass
Definition: Bindings.py:117
Gaudi::RootCnvSvc
Description:
Definition: RootCnvSvc.h:52
std::string
STL class.
Gaudi::RootCnvSvc::m_splitLevel
int m_splitLevel
Property: Split level optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:88
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:386
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::RootCnvSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
Gaudi::RootCnvSvc::m_classDO
TClass * m_classDO
TClass pointer to DataObject class.
Definition: RootCnvSvc.h:64
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
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
Gaudi::RootCnvSvc::m_incidentEnabled
bool m_incidentEnabled
Property: Flag to enable incidents on FILE_OPEN.
Definition: RootCnvSvc.h:71
Gaudi::RootCnvSvc::m_badFiles
std::set< std::string > m_badFiles
Set with bad files/tables.
Definition: RootCnvSvc.h:91
Gaudi::RootCnvSvc::m_shareFiles
std::string m_shareFiles
Property: Share files ? If set to YES, files will not be closed on finalize.
Definition: RootCnvSvc.h:73
std::set< std::string >
std::unique_ptr< MsgStream >
Gaudi::RootCnvSvc::m_ioMgr
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:56
IDataManagerSvc
Definition: IDataManagerSvc.h:45
Gaudi::RootCnvSvc::createAddress
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress)
IAddressCreator implementation: Creates an address in string form to object form. ...
Definition: RootCnvSvc.h:204
Gaudi::RootCnvSvc::m_compression
std::string m_compression
Property: Compression-algorithm:compression-level.
Definition: RootCnvSvc.h:79
Gaudi::RootCnvSvc::m_recordName
std::string m_recordName
Property: Records name to fire incident for file records.
Definition: RootCnvSvc.h:75
ConversionSvc::createAddress
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
Create a Generic address using explicit arguments to identify a single object.
Definition: ConversionSvc.cpp:351
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
ConversionSvc
Base class for all conversion services.
Definition: ConversionSvc.h:46
Gaudi::RootCnvSvc::m_ioPerfStats
std::string m_ioPerfStats
Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name.
Definition: RootCnvSvc.h:77
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:92
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21
Gaudi::RootCnvSvc::m_bufferSize
int m_bufferSize
Property: Buffer size optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:86
DataObject.h
Gaudi::RootCnvSvc::updateServiceState
virtual StatusCode updateServiceState(IOpaqueAddress *)
Update state of the service.
Definition: RootCnvSvc.h:110
Gaudi::RootCnvSvc::m_autoFlush
int m_autoFlush
Property: AutoFlush parameter for ROOT TTree (Number of events between auto flushes) ...
Definition: RootCnvSvc.h:82
Gaudi::RootCnvSvc::m_classRefs
TClass * m_classRefs
TClass pointer to reference class.
Definition: RootCnvSvc.h:62