BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Calibration/CalibSvc/CalibDataSvc/CalibDataSvc-00-01-04/CalibDataSvc/CalibDataSvc.h
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/CalibSvc/CalibDataSvc/CalibDataSvc/CalibDataSvc.h,v 1.15 2014/04/18 05:01:11 maqm Exp $
2#ifndef CalibDataSvc_h
3#define CalibDataSvc_h
4
5// Base classes
6#include "GaudiKernel/DataSvc.h"
7#include "GaudiKernel/IDetDataSvc.h"
8#include "GaudiKernel/IIncidentListener.h"
9#include "CalibData/CalibBase1.h"
10#include "CalibDataSvc/IInstrumentName.h"
11//#include "CalibData/CalibTime.h"
12using namespace CalibData;
13// Forward declarations
14//class ITime;
15class StatusCode;
16class IDataProviderSvc;
17
18/** @class CalibDataSvc
19
20 A DataSvc specialized for calibration data.
21 This Service borrows heavily from DetDataSvc. In particular it
22 implements the IDetDataSvc interface. The only significant
23 difference is in initialize() and in the elimination of members
24 concerned with detector (geometry) description.
25
26 Maybe will also need to implement another abstract service
27 which gets (and sets?) instrument.
28
29 @author J. Bogart
30 @date 15 Oct. 2002
31*/
32class IAddressCreator;
33class MsgStream;
34
35template <class TYPE> class SvcFactory; //maqm add
36class CalibDataSvc : public DataSvc,
37// virtual public IDetDataSvc,
38 virtual public IIncidentListener
39 // virtual public IInstrumentName
40{
41
42 friend class SvcFactory<CalibDataSvc>;
43
44public:
45
46 // Overloaded DataSvc methods
47
48 virtual StatusCode initialize();
49
50 virtual StatusCode finalize();
51
52 /// Remove all data objects in the data store.
53 virtual StatusCode clearStore();
54
55 /// Update object
56 virtual StatusCode updateObject( DataObject* toUpdate );
57
58 /// Load object. Override DataSvc implementation to get current
59 /// event time first if necessary
60 virtual StatusCode loadObject(IConversionSvc* pLoader, IRegistry* pRegistry);
61
62 virtual StatusCode retrieveObject(const std::string& fullPath,DataObject*& pObject);
63
64 virtual StatusCode registerObject(const std::string& parentPath,
65 const std::string& objPath,
66 DataObject* pObject);
67
68
69//maqm protected:
70public:
71 CalibDataSvc(const std::string& name, ISvcLocator* svc);
72 virtual ~CalibDataSvc();
73
74public:
75
76 // Reimplemented from IInterface
77
78 /// Query the interface of the service
79 virtual StatusCode queryInterface( const InterfaceID& riid,
80 void** ppvInterface );
81
82
83public:
84 //get the CalibType from CalibDataSvc, either MYSQL_StorageType or CALIBROOT_StorageType;
85// int getsvctype(){return m_calibStorageType;}
86
87public:
88
89 // Implementation of the IIncidentListener interface
90
91 /// Inform that a new incident has occured
92 virtual void handle( const Incident& );
93
94 /// For use of CalibMySQLCnvSvc, to set "use event time mode"
95 private:
96 StatusCode updateRun(int &runfrm,int &runto,std::string& fullPath);
97 //properties
98 /// Calibration Data Persistency Storage type
99 // int m_calibStorageType;
100
101 // classfy the Data Persistency Storage type by each calib type
102 int m_calibType[12];
103
104 /// Name of the root node of the calib store
105 std::string m_calibRootName;
106
107 /// calibration types
108 StringArrayProperty m_calibList;
109
110 // StringArrayProperty m_flavorList;
111 std::vector<std::string> m_flavorList;
112
113
114 /// Set to true by handle( ) at BeginEvent; cleared after timestamp acquired
115 // bool m_newEvent;
116
117 /// Dumping place for various time-fetching methods to save the timestamp
118 // CalibData::CalibTime m_time;
119
120 IDataProviderSvc* m_eventSvc;
121 /** Redundant job option to indicate whether or not to check for valid
122 event time when fetching calibrations. There already is a similar thing
123 for CalibMySQLCnvSvc, but no easy way for one service to tell the
124 other about it.
125 */
126// bool m_useEventTime;
127
128
129 /// Private utility, called from initialize()
130 StatusCode makeFlavorNodes(IAddressCreator* calibCreator,
131 MsgStream* log );
132
133 /// Private utility to check if internal timestamp has been updated for
134 /// the event; if not do it.
135 // StatusCode updateTime();
136
137
138/*
139 enum TIMESOURCE {
140 TIMESOURCEnone = 0,
141 TIMESOURCEdata,
142 TIMESOURCEmc,
143 TIMESOURCEclock,
144 TIMESOURCEdigi
145 };
146
147 TIMESOURCE m_timeSourceEnum;
148
149 std::string m_startTimeAsc;
150
151 /// Absolute time of first event (seconds)
152 long m_startTime;
153
154 /// Absolute time spacing between events (milliseconds)
155 long m_delayTime;*/
156
157};
158
159#endif // CalibDataSvc_h
160
161
162
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
Query the interface of the service.
virtual StatusCode loadObject(IConversionSvc *pLoader, IRegistry *pRegistry)
virtual StatusCode registerObject(const std::string &parentPath, const std::string &objPath, DataObject *pObject)
virtual StatusCode initialize()
virtual StatusCode updateObject(DataObject *toUpdate)
Update object.
virtual void handle(const Incident &)
Inform that a new incident has occured.
virtual StatusCode retrieveObject(const std::string &fullPath, DataObject *&pObject)
virtual StatusCode finalize()
Finalize the service.
virtual ~CalibDataSvc()
Standard Destructor.
virtual StatusCode clearStore()
Remove all data objects in the data store.