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