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
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 
53  protected:
54 
60  Gaudi::RootDataConnection* m_current = nullptr;
62  TClass* m_classRefs;
64  TClass* m_classDO;
69 
80 
89 
92 
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 
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
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
def initialize()
Definition: AnalysisTest.py:12
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
The data converters are responsible to translate data from one representation into another...
Definition: IConverter.h:57
std::string m_currSection
Property: ROOT section name.
Definition: RootCnvSvc.h:68
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootCnvSvc.h:58
int m_basketSize
Property: Basket optimization parameter for ROOT TTree (total basket size)
Definition: RootCnvSvc.h:84
std::shared_ptr< RootConnectionSetup > m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:66
Description:
Definition: RootCnvSvc.h:52
STL class.
int m_splitLevel
Property: Split level optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:88
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
TClass * m_classDO
TClass pointer to DataObject class.
Definition: RootCnvSvc.h:64
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
bool m_incidentEnabled
Property: Flag to enable incidents on FILE_OPEN.
Definition: RootCnvSvc.h:71
std::set< std::string > m_badFiles
Set with bad files/tables.
Definition: RootCnvSvc.h:91
std::string m_shareFiles
Property: Share files ? If set to YES, files will not be closed on finalize.
Definition: RootCnvSvc.h:73
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:56
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
std::string m_compression
Property: Compression-algorithm:compression-level.
Definition: RootCnvSvc.h:79
std::string m_recordName
Property: Records name to fire incident for file records.
Definition: RootCnvSvc.h:75
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.
Opaque address interface definition.
Base class for all conversion services.
Definition: ConversionSvc.h:46
std::string m_ioPerfStats
Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name.
Definition: RootCnvSvc.h:77
#define GAUDI_API
Definition: Kernel.h:107
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
Concrete implementation of the IDataConnection interface to access ROOT files.
Helper functions to set/get the application return code.
Definition: __init__.py:1
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21
int m_bufferSize
Property: Buffer size optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:86
virtual StatusCode updateServiceState(IOpaqueAddress *)
Update state of the service.
Definition: RootCnvSvc.h:110
int m_autoFlush
Property: AutoFlush parameter for ROOT TTree (Number of events between auto flushes) ...
Definition: RootCnvSvc.h:82
TClass * m_classRefs
TClass pointer to reference class.
Definition: RootCnvSvc.h:62