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