BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
CalibTreeCnvSvc.h
Go to the documentation of this file.
1#ifndef CalibTreeCnvSvc_h
2#define CalibTreeCnvSvc_h
3
4#include <string>
5
6#include "CalibDataSvc/ICalibTreeSvc.h"
7#include "GaudiKernel/ConversionSvc.h"
8#include "GaudiKernel/Service.h"
9
10// The function of the CalibTreeCnvSvc is to read the trees' buffers from
11// CalibMYSQLCnvSvc and use the defined converters to intepret the buffers
12// than register the calibdata to TCDS.
13// It's a different way from the CalibRootCnv
14
15/// Forward and external declarations
16template <class TYPE> class SvcFactory;
17
18class IDetDataSvc;
19class IOpaqueAddress;
20
21namespace CalibData {
22 class CalibBase;
23 class CalibBase1;
24} // namespace CalibData
25
26///---------------------------------------------------------------------------
27/** @class CalibTreeCnvSvc
28
29 A conversion service for GLAST calibration bulk data in ROOT format.
30
31 @author J. Bogart
32 @date July 2004
33*///--------------------------------------------------------------------------
34
35class CalibTreeCnvSvc : public ConversionSvc, virtual public ICalibTreeSvc {
36 /// Only factories can access protected constructors
37 friend class SvcFactory<CalibTreeCnvSvc>;
38
39public:
40 CalibTreeCnvSvc( const std::string& name, ISvcLocator* svc );
41 virtual ~CalibTreeCnvSvc() {}
42
43public:
44 // Reimplemented from IInterface
45
46 // virtual StatusCode queryInterface( const InterfaceID& riid,
47 // void** ppvInterface);
48
49 // Reimplemented from ICalibTreeSvc
50 /*virtual StatusCode writeToRoot(const std::string& outputFile,
51 const std::string& tdsPath);
52 virtual StatusCode writeToRoot(const std::string& outputFile,
53 CalibData::CalibBase1 *calib);
54*/
55
56 virtual StatusCode updateObj( IOpaqueAddress* pAddress, DataObject* pObject );
57
58public:
59 // Overloaded from ConversionSvc
60
61 virtual StatusCode initialize();
62 virtual StatusCode finalize();
63
64 /**
65 * Create a ROOT address using explicit arguments to identify a single object
66 * @param svc_type the service type
67 * @param CLID the CLID of the ROOT Element for which an address is created
68 * @param par an array of three strings containing the format version,
69 * calibration type name and the flavor, in this order
70 * @param ip has a single element, the serial number of the MySQL row
71 * which corresponds to this element
72 * @param refpAddress the new address created
73 * @return a StatusCode giving the status of the address creation
74 */
75 // virtual StatusCode createAddress(unsigned char svc_type,
76 virtual StatusCode createAddress( long svc_type, const CLID& clid, const std::string* par,
77 const unsigned long* ip, IOpaqueAddress*& refpAddress );
78 std::string getrootfile() { return m_rootfile[0]; }
79
80 /*
81 There are a pile of functions implemented in the Gaudi
82 base class ConversionSvc which we can just let be, such
83 as createObj, fillObjRefs,...
84
85 The base implementation looks up the appropriate converter
86 and invokes it, usually just what we want to do.
87 */
88
89 // added in 2024-06-26: Now it seems we need to implement this function
90 IConverter* createConverter( long typ, const CLID& clid, const ICnvFactory* fac );
91
92private:
93 // With current functionality, there really is no need to keep
94 // this as a member. It's only used during initialize()
95 /// Handle to the IConversionSvc interface of the DetectorPersistencySvc
96 IConversionSvc* m_detPersSvc;
97
98 /// Handle to IDataProviderSvc interface of CalibDataSvc
99 IDataProviderSvc* m_detDataSvc;
100 std::string m_rootfile[4];
101};
102#endif
std::string getrootfile()
virtual StatusCode finalize()
IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
virtual StatusCode initialize()
CalibTreeCnvSvc(const std::string &name, ISvcLocator *svc)
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
virtual ~CalibTreeCnvSvc()
Forward and external declarations.