BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
CalibMySQLCnvSvc.h
Go to the documentation of this file.
1//$Header: /bes/bes/BossCvs/Calibration/CalibSvc/CalibMySQLCnv/CalibMySQLCnv/CalibMySQLCnvSvc.h,v 1.25 2022/02/21 06:01:56 maqm Exp $
2#ifndef CalibMySQLCnvSvc_h
3#define CalibMySQLCnvSvc_h 1
4
5/// Include files
8#include "GaudiKernel/ConversionSvc.h"
10#include "GaudiKernel/IDetDataSvc.h"
12#include "calibUtil/Metadata.h"
13
14class Metadata;
15/// Forward and external declarations
16// class ConditionsDBGate;
17template <class TYPE> class SvcFactory;
18class IDetDataSvc;
19class IOpaqueAddress;
20using namespace std;
21///---------------------------------------------------------------------------
22/** @class CalibMySQLCnvSvc
23
24 A conversion service for GLAST calibration metadata database persistency.
25 Allows to create and update condition data objects (i.e. DataObjects
26 implementing IValidity).
27
28 Adapted from LHCb class DetCond/ConditionsDBCnvSvc by Andrea Valassi
29 @author J. Bogart
30 @date November 2002
31*///--------------------------------------------------------------------------
32class CalibMySQLCnvSvc : public ConversionSvc,
33 virtual public ICalibMetaCnvSvc
34{
35 /// Only factories can access protected constructors
36 friend class SvcFactory<CalibMySQLCnvSvc>;
37
38// protected:
39 public:
40 CalibMySQLCnvSvc(const std::string& name, ISvcLocator* svc );
41 virtual ~CalibMySQLCnvSvc();
42
43 public:
44
45 // Reimplemented from IInterface
46
47 //virtual StatusCode queryInterface( const InterfaceID& riid,
48 // void** ppvInterface );
49
50 public:
51
52 // Overloaded from ConversionSvc
53
54 virtual StatusCode initialize();
55 virtual StatusCode finalize();
56
57 /// Create a transient representation from another rep of this object.
58 virtual StatusCode createObj ( IOpaqueAddress* pAddress,
59 DataObject*& refpObject );
60
61 /// Resolve the references of the created transient object.
62 virtual StatusCode fillObjRefs ( IOpaqueAddress* pAddress,
63 DataObject* pObject );
64
65 /// Update a transient representation from another rep of this object.
66 virtual StatusCode updateObj ( IOpaqueAddress* pAddress,
67 DataObject* pObject );
68
69 /// Update the references of an updated transient object.
70 virtual StatusCode updateObjRefs ( IOpaqueAddress* pAddress,
71 DataObject* pObject );
72
73 /// Convert a transient object to a requested representation.
74 virtual StatusCode createRep ( DataObject* pObject,
75 IOpaqueAddress*& refpAddress );
76
77 /// Resolve the references of a converted object.
78 virtual StatusCode fillRepRefs ( IOpaqueAddress* pAddress,
79 DataObject* pObject );
80
81 /// Update a converted representation of a transient object.
82 virtual StatusCode updateRep ( IOpaqueAddress* pAddress,
83 DataObject* pObject );
84
85 /// Update the references of an already converted object.
86 virtual StatusCode updateRepRefs ( IOpaqueAddress* pAddress,
87 DataObject* pObject );
88
89 /// Create an address using explicit arguments to identify a single object.
90 virtual StatusCode createAddress ( long svc_type,
91 const CLID& clid,
92 const std::string* par,
93 const unsigned long* ip,
94 IOpaqueAddress*& refpAddress );
95
96 public:
97 // Implementation of ICalibMetaCnvSvc.
98 // Create/update calib DataObject not necessarily registered in the TDS.
99
100 /// Create a calib DataObject by calib type name, flavor and time.
101 /// This method does not register DataObject in the transient data store.
102 /// The string storage type is discovered at runtime in the Metadata dbs.
103 virtual StatusCode createCalib(DataObject*& refpObject,
104 const std::string& fullpath,
105 const CLID& classID,
106 IRegistry* entry=0);
107
108 /// Update a condition DataObject by
109 /// This method does not register DataObject in the transient data store.
110 /// The string storage type is discovered at runtime in the metadata dbs.
111 // maqm change
112 virtual StatusCode updateCalib(DataObject* pObject,
113 const std::string& fullpath,
114 const CLID& classID,
115 IRegistry* entry=0);
116 /// Decode the string storage type to enumerated storage type
117 virtual StatusCode decodeDescription(const std::string& description,
118 unsigned char& type);
119
120 virtual calibUtil::Metadata* getMeta();
121//maqm add
122 //std::string getCalPar()
123 // { return m_calVer[0];}
124StatusCode getSftParVer(std::string& SftVer,
125 std::string& CalParVer, int &runfrm,
126 int &runto,int RunNo, std::string BossRelease,
127 std::string DataType);
128
129 //public:
130 //string flag="0";
131
132 private:
133
134 /// Handle for metadata access
135 calibUtil::Metadata* m_meta;
136
137 /// MySQL host, a job options parameter.
138 std::string m_host;
139
140 /// How official does a calibration have to be in order to be acceptable
141 /// Should default to calibUtil::Metadata::LEVELProd
142 unsigned int m_calibLevelMask;
143
144 /// Use event time to select calibration? Normal state is TRUE.
145 bool m_useEventTime;
146
147 /// Following only used if m_useEventTime is FALSE. In this case
148 /// search for calibration using enter-time instead
149 facilities::Timestamp* m_enterTimeStart;
150 facilities::Timestamp* m_enterTimeEnd;
151
152 std::string m_enterTimeStartString;
153 std::string m_enterTimeEndString;
154 IInstrumentName* m_instrSvc;
155 IDataProviderSvc* m_eventSvc;
156
157 std::string m_dbName;
158
159 std::string sft_ver;
160 std::string cal_ver;
161 std::string m_calPar[16];
162 std::string machine;
163 std::string m_bossver[16];
164 std::string m_bossRelease;
165 std::string m_flag[16];
166 /// Interval in seconds
167
168 /// Handle to the IConversionSvc interface of the DetectorPersistencySvc
169 IConversionSvc* m_detPersSvc;
170
171 /// Handle to the IDetDataSvc interface of the CalibDataSvc
172 IDetDataSvc* m_detDataSvc;
173
174 /// Job option parameter; individual items may take on values
175 /// "PROD", "DEV", "TEST", "SUPSED" (look only at first 3 characters)
176 std::vector<std::string> m_qualityList;
177 unsigned int m_qualityMask;
178 bool m_crash; // If true, failure is fatal
179 int m_MdcAlign_No;
180 std::string m_dbStatus;
181};
182#endif
183
char * SftVer
Definition DQA_TO_DB.cxx:18
virtual StatusCode finalize()
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject)
Update a converted representation of a transient object.
virtual StatusCode decodeDescription(const std::string &description, unsigned char &type)
Decode the string storage type to enumerated storage type.
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)
Resolve the references of the created transient object.
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)
Create a transient representation from another rep of this object.
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
Create an address using explicit arguments to identify a single object.
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert a transient object to a requested representation.
virtual StatusCode createCalib(DataObject *&refpObject, const std::string &fullpath, const CLID &classID, IRegistry *entry=0)
virtual StatusCode updateCalib(DataObject *pObject, const std::string &fullpath, const CLID &classID, IRegistry *entry=0)
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)
Resolve the references of a converted object.
StatusCode getSftParVer(std::string &SftVer, std::string &CalParVer, int &runfrm, int &runto, int RunNo, std::string BossRelease, std::string DataType)
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)
Update the references of an updated transient object.
CalibMySQLCnvSvc(const std::string &name, ISvcLocator *svc)
virtual calibUtil::Metadata * getMeta()
Handle to the MySQL metadata database.
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *pObject)
Update a transient representation from another rep of this object.
virtual StatusCode initialize()
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)
Update the references of an already converted object.
Simple interface to keep track of which instrument (LAT, EM, etc.) the process is concerned with....
Forward and external declarations.