BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
CalibRootCnvSvc.h
Go to the documentation of this file.
1//$Header:
2/// bes/bes/BossCvs/Calibration/CalibSvc/CalibROOTCnv/CalibROOTCnv/CalibRootCnvSvc.h,v 1.19
3// 2022/03/04 03:49:16 maqm Exp $
4#ifndef CalibRootCnvSvc_h
5// #define CalibRootCnvSvc_h 1
6#define CalibRootCnvSvc_h
7
8#include <string>
9
10#include "CalibDataSvc/ICalibRootSvc.h"
11#include "GaudiKernel/ConversionSvc.h"
12
13// Hi Heather. For the XML conversion service I defined an
14// extra interface to do generic XML things that converters
15// might need. For now there really is just one thing there:
16// a function which reads in the XML file, so that the converters
17// deal with the DOM representation (in-memory, but otherwise
18// isomorphic to the XML description) rather than with the physical
19// file. Putting that kind of functionality in the conversion service
20// is probably a good idea, but it doesn't have to be defined in
21// an abstract interface.
22
23/// Forward and external declarations
24template <class TYPE> class SvcFactory;
25
26class IDetDataSvc;
27class IOpaqueAddress;
28
29namespace CalibData {
30 class CalibBase;
31 class CalibBase1;
32} // namespace CalibData
33
34///---------------------------------------------------------------------------
35/** @class CalibRootCnvSvc
36
37 A conversion service for GLAST calibration bulk data in ROOT format.
38
39 @author J. Bogart
40 @date July 2004
41 *///--------------------------------------------------------------------------
42class CalibRootCnvSvc : public ConversionSvc, virtual public ICalibRootSvc {
43 /// Only factories can access protected constructors
44 // friend class SvcFactory<CalibRootCnvSvc>;
45
46public:
47 CalibRootCnvSvc( const std::string& name, ISvcLocator* svc );
48 virtual ~CalibRootCnvSvc() {}
49
50public:
51 // Reimplemented from IInterface
52
53 /*virtual StatusCode queryInterface( const InterfaceID& riid,
54 void** ppvInterface);
55 */
56 // Reimplemented from ICalibRootSvc
57 virtual StatusCode writeToRoot( const std::string& outputFile, const std::string& tdsPath );
58 virtual StatusCode writeToRoot( const std::string& outputFile,
59 CalibData::CalibBase1* calib );
60 virtual StatusCode updateObj( IOpaqueAddress* pAddress, DataObject* pObject );
61
62public:
63 // Overloaded from ConversionSvc
64
65 virtual StatusCode initialize();
66 virtual StatusCode finalize();
67
68 /**
69 * Create a ROOT address using explicit arguments to identify a single object
70 * @param svc_type the service type
71 * @param CLID the CLID of the ROOT Element for which an address is created
72 * @param par an array of three strings containing the format version,
73 * calibration type name and the flavor, in this order
74 * @param ip has a single element, the serial number of the MySQL row
75 * which corresponds to this element
76 * @param refpAddress the new address created
77 * @return a StatusCode giving the status of the address creation
78 */
79 // virtual StatusCode createAddress(unsigned char svc_type,
80 virtual StatusCode createAddress( long svc_type, const CLID& clid, const std::string* par,
81 const unsigned long* ip, IOpaqueAddress*& refpAddress );
82 std::string getrootfile() { return m_rootfile[0]; }
83 StatusCode decodeDescription( const std::string& oldpath, std::string& realpath );
84
85 IConverter* createConverter( long typ, const CLID& wanted, const ICnvFactory* fac ) override;
86 /*
87 There are a pile of functions implemented in the Gaudi
88 base class ConversionSvc which we can just let be, such
89 as createObj, fillObjRefs,...
90
91 The base implementation looks up the appropriate converter
92 and invokes it, usually just what we want to do.
93 */
94private:
95 // With current functionality, there really is no need to keep
96 // this as a member. It's only used during initialize()
97 /// Handle to the IConversionSvc interface of the DetectorPersistencySvc
98 IConversionSvc* m_detPersSvc;
99
100 /// Handle to IDataProviderSvc interface of CalibDataSvc
101 IDataProviderSvc* m_detDataSvc;
102 std::string m_rootfile[14];
103};
104#endif
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *pObject)
virtual ~CalibRootCnvSvc()
virtual StatusCode finalize()
std::string getrootfile()
IConverter * createConverter(long typ, const CLID &wanted, const ICnvFactory *fac) override
virtual StatusCode initialize()
StatusCode decodeDescription(const std::string &oldpath, std::string &realpath)
virtual StatusCode writeToRoot(const std::string &outputFile, const std::string &tdsPath)
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
CalibRootCnvSvc(const std::string &name, ISvcLocator *svc)
Only factories can access protected constructors.
Forward and external declarations.