The Gaudi Framework  v30r3 (a5ef0a68)
RNTupleCnv.h
Go to the documentation of this file.
1 #ifndef ROOTHISTCNV_RNTUPLECNV_H
2 #define ROOTHISTCNV_RNTUPLECNV_H 1
3 
4 // Include files
5 #include "RConverter.h"
6 
7 // Forward declarations
8 class ISvcLocator;
9 class INTupleItem;
10 class INTupleSvc;
11 class INTuple;
12 class TTree;
13 
14 namespace RootHistCnv
15 {
16 
24  class RNTupleCnv : public RConverter
25  {
26  public:
28  StatusCode initialize() override;
30  StatusCode finalize() override;
31 
33  StatusCode createObj( IOpaqueAddress* pAddr, DataObject*& refpObj ) override;
35  StatusCode updateObj( IOpaqueAddress* pAddr, DataObject* refpObj ) override;
37  StatusCode createRep( DataObject* pObj, IOpaqueAddress*& refpAddr ) override;
39  StatusCode updateRep( IOpaqueAddress* pAddr, DataObject* pObj ) override;
40 
41  protected:
43  RNTupleCnv( ISvcLocator* svc, const CLID& clid );
44 
46  virtual StatusCode load( TTree* tree, INTuple*& refpObj ) = 0;
48  virtual StatusCode book( const std::string& desc, INTuple* pObj, TTree*& tree ) = 0;
50  virtual StatusCode writeData( TTree* rtree, INTuple* pObj ) = 0;
52  virtual StatusCode readData( TTree* rtree, INTuple* pObj, long ievt ) = 0;
53 
54  protected:
57 
58  virtual std::string rootVarType( int );
59  };
60 
62  template <class TYP>
63  INTupleItem* createNTupleItem( std::string itemName, std::string blockName, std::string indexName, int indexRange,
64  int arraySize, TYP minimum, TYP maximum, INTuple* tuple );
65 
66  bool parseName( const std::string& full, std::string& blk, std::string& var );
67 
68 } // namespace RootHistCnv
69 
70 #endif // RootHistCnv_RNTupleCnv_H
NTuple converter class definition.
Definition: RNTupleCnv.h:24
Root Converter.
Definition: RConverter.h:33
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
RNTupleCnv(ISvcLocator *svc, const CLID &clid)
Standard constructor.
Definition: RNTupleCnv.cpp:34
virtual StatusCode book(const std::string &desc, INTuple *pObj, TTree *&tree)=0
Book a new N tuple.
StatusCode updateRep(IOpaqueAddress *pAddr, DataObject *pObj) override
Update the converted representation of a transient object.
Definition: RNTupleCnv.cpp:180
bool parseName(const std::string &full, std::string &blk, std::string &var)
Definition: RNTupleCnv.cpp:245
StatusCode initialize() override
Initialize the converter.
Definition: RNTupleCnv.cpp:39
StatusCode finalize() override
Finalize the converter.
Definition: RNTupleCnv.cpp:52
STL class.
NTuple interface class definition.
Definition: INTuple.h:82
NTuple interface class definition.
Definition: INTuple.h:27
StatusCode updateObj(IOpaqueAddress *pAddr, DataObject *refpObj) override
Update the transient object from the other representation.
Definition: RNTupleCnv.cpp:61
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
virtual StatusCode load(TTree *tree, INTuple *&refpObj)=0
Create the transient representation of an object.
virtual StatusCode writeData(TTree *rtree, INTuple *pObj)=0
Write N tuple data.
INTupleItem * createNTupleItem(std::string itemName, std::string blockName, std::string indexName, int indexRange, int arraySize, TYP min, TYP max, INTuple *ntup)
Add an item of a given type to the N tuple.
Definition: RNTupleCnv.cpp:272
Opaque address interface definition.
SmartIF< INTupleSvc > m_ntupleSvc
Reference to N tuple service.
Definition: RNTupleCnv.h:56
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr) override
Convert the transient object to the requested representation.
Definition: RNTupleCnv.cpp:123
virtual StatusCode readData(TTree *rtree, INTuple *pObj, long ievt)=0
Read N tuple data.
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&refpObj) override
Create the transient representation of an object.
Definition: RNTupleCnv.cpp:88
virtual std::string rootVarType(int)
Return ROOT type info:
Definition: RNTupleCnv.cpp:208