1 |
#ifndef gltables_h |
2 |
#define gltables_h |
3 |
|
4 |
#include <TString.h> |
5 |
#include <TObject.h> |
6 |
#include <TSQLServer.h> |
7 |
#include <TSQLRow.h> |
8 |
#include <TSQLResult.h> |
9 |
#include <GLTablesStruct.h> |
10 |
#include <EventHeader.h> |
11 |
#include <PscuHeader.h> |
12 |
#include <RunHeaderEvent.h> |
13 |
#include <RunTrailerEvent.h> |
14 |
#include <cTle.h> |
15 |
|
16 |
using namespace pamela; |
17 |
// ================================================================== |
18 |
/** |
19 |
* \brief Class to store GL_RUN data |
20 |
*/ |
21 |
class GL_RUN : public TObject { |
22 |
private: |
23 |
|
24 |
public: |
25 |
// |
26 |
UInt_t ID; |
27 |
UInt_t ID_RUN_FRAG; |
28 |
UInt_t ID_ROOT_L0; |
29 |
UInt_t ID_ROOT_L2; |
30 |
UInt_t RUNHEADER_TIME; |
31 |
UInt_t RUNTRAILER_TIME; |
32 |
UInt_t RUNHEADER_OBT; |
33 |
UInt_t RUNTRAILER_OBT; |
34 |
UInt_t RUNHEADER_PKT; |
35 |
UInt_t RUNTRAILER_PKT; |
36 |
UInt_t BOOT_NUMBER; |
37 |
UInt_t EV_FROM; |
38 |
UInt_t EV_TO; |
39 |
UInt_t NEVENTS; |
40 |
UInt_t PKT_COUNTER; |
41 |
UInt_t PKT_READY_COUNTER; |
42 |
UInt_t COMPILATIONTIMESTAMP; |
43 |
UInt_t FAV_WRK_SCHEDULE; |
44 |
UInt_t EFF_WRK_SCHEDULE; |
45 |
UInt_t PRH_VAR_TRG_MODE_A; |
46 |
UInt_t PRH_VAR_TRG_MODE_B; |
47 |
UInt_t ACQ_BUILD_INFO; |
48 |
UInt_t ACQ_VAR_INFO; |
49 |
UInt_t RM_ACQ_AFTER_CALIB; |
50 |
UInt_t RM_ACQ_SETTING_MODE; |
51 |
UInt_t TRK_CALIB_USED; |
52 |
UInt_t CAL_DSP_MASK; |
53 |
UInt_t LAST_TIMESYNC; |
54 |
UInt_t OBT_TIMESYNC; |
55 |
UInt_t VALIDATION; |
56 |
// |
57 |
// |
58 |
// |
59 |
GL_RUN(); |
60 |
// |
61 |
// functions |
62 |
// |
63 |
Int_t Query_GL_RUN(UInt_t, TSQLServer*); |
64 |
Int_t Fill_GL_RUN(TSQLServer*); |
65 |
Int_t Query_GL_RUN_FRAGMENTS(TString, TSQLServer*); |
66 |
Int_t Fill_GL_RUN_FRAGMENTS(TSQLServer*); |
67 |
void Clear(); |
68 |
// |
69 |
// SETTERS |
70 |
// |
71 |
void Set_GL_RUNT(RunTrailerEvent *runt, PscuHeader *pht); |
72 |
void Set_GL_RUNH(RunHeaderEvent *runt, PscuHeader *pht); |
73 |
void Set_GL_RUNT0(); |
74 |
void Set_GL_RUNH0(); |
75 |
// |
76 |
void Set_GL_RUN(TSQLRow *row); |
77 |
// |
78 |
void SetRUNHEADER_TIME(UInt_t abst); |
79 |
void SetRUNTRAILER_TIME(UInt_t abst); |
80 |
void SetRUNHEADER_PKT(UInt_t abst); |
81 |
void SetRUNTRAILER_PKT(UInt_t abst); |
82 |
void SetRUNHEADER_OBT(UInt_t abst); |
83 |
void SetRUNTRAILER_OBT(UInt_t abst); |
84 |
void SetBOOTNUMBER(UInt_t abst); |
85 |
void SetID(UInt_t); |
86 |
void SetID_ROOT_L2(UInt_t L2); |
87 |
void SetID_ROOT_L0(UInt_t L0); |
88 |
void SetID_RUN_FRAG(UInt_t RUN); |
89 |
void SetVALIDATION(UInt_t valid); |
90 |
void SetEV_FROM(UInt_t evfrom); |
91 |
void SetEV_TO(UInt_t evto); |
92 |
void SetNEVENTS(UInt_t nev); |
93 |
void SetLAST_TIMESYNC(UInt_t ts); |
94 |
void SetOBT_TIMESYNC(UInt_t ts); |
95 |
void SetPKT_COUNTER(UInt_t); |
96 |
void SetPKT_READY_COUNTER(UInt_t); |
97 |
void SetCOMPILATIONTIMESTAMP(UInt_t); |
98 |
void SetFAV_WRK_SCHEDULE(UInt_t); |
99 |
void SetEFF_WRK_SCHEDULE(UInt_t); |
100 |
void SetPRH_VAR_TRG_MODE_A(UInt_t); |
101 |
void SetPRH_VAR_TRG_MODE_B(UInt_t); |
102 |
void SetACQ_BUILD_INFO(UInt_t); |
103 |
void SetACQ_VAR_INFO(UInt_t); |
104 |
void SetRM_ACQ_AFTER_CALIB(UInt_t); |
105 |
void SetRM_ACQ_SETTING_MODE(UInt_t); |
106 |
void SetTRK_CALIB_USED(UInt_t); |
107 |
void SetCAL_DSP_MASK(UInt_t); |
108 |
// |
109 |
// GETTERS |
110 |
// |
111 |
void GetLevel2Struct(cGLRun *l2) const; |
112 |
UInt_t GetRUNHEADER_PKT(){return(RUNHEADER_PKT);}; |
113 |
UInt_t GetRUNTRAILER_PKT(){return(RUNTRAILER_PKT);}; |
114 |
UInt_t GetRUNHEADER_TIME(){return(RUNHEADER_TIME);}; |
115 |
UInt_t GetRUNTRAILER_TIME(){return(RUNTRAILER_TIME);}; |
116 |
UInt_t GetRUNHEADER_OBT(){return(RUNHEADER_OBT);}; |
117 |
UInt_t GetRUNTRAILER_OBT(){return(RUNTRAILER_OBT);}; |
118 |
UInt_t GetNEVENTS(){return(NEVENTS);}; |
119 |
UInt_t GetBOOT_NUMBER(){return(BOOT_NUMBER);}; |
120 |
UInt_t GetTRK_CALIB(){return(TRK_CALIB_USED);}; |
121 |
UInt_t GetPKT_COUNTER(){return(PKT_COUNTER);}; |
122 |
UInt_t GetLAST_TIMESYNC(){return(LAST_TIMESYNC);}; |
123 |
UInt_t GetOBT_TIMESYNC(){return(OBT_TIMESYNC);}; |
124 |
UInt_t GetPKT_READY_COUNTER(){return(PKT_READY_COUNTER);}; |
125 |
UInt_t GetCOMPILATIONTIMESTAMP(){return(COMPILATIONTIMESTAMP);}; |
126 |
UInt_t GetFAV_WRK_SCHEDULE(){return(FAV_WRK_SCHEDULE);}; |
127 |
UInt_t GetEFF_WRK_SCHEDULE(){return(EFF_WRK_SCHEDULE);}; |
128 |
UInt_t GetPRH_VAR_TRG_MODE_A(){return(PRH_VAR_TRG_MODE_A);}; |
129 |
UInt_t GetPRH_VAR_TRG_MODE_B(){return(PRH_VAR_TRG_MODE_B);}; |
130 |
UInt_t GetACQ_BUILD_INFO(){return(ACQ_BUILD_INFO);}; |
131 |
UInt_t GetACQ_VAR_INFO(){return(ACQ_VAR_INFO);}; |
132 |
UInt_t GetRM_ACQ_AFTER_CALIB(){return(RM_ACQ_AFTER_CALIB);}; |
133 |
UInt_t GetRM_ACQ_SETTING_MODE(){return(RM_ACQ_SETTING_MODE);}; |
134 |
UInt_t GetTRK_CALIB_USED(){return(TRK_CALIB_USED);}; |
135 |
UInt_t GetCAL_DSP_MASK(){return(CAL_DSP_MASK);}; |
136 |
|
137 |
// |
138 |
ClassDef(GL_RUN,1); |
139 |
}; |
140 |
|
141 |
// ================================================================== |
142 |
/** |
143 |
* \brief Class to store GL_ROOT |
144 |
*/ |
145 |
class GL_ROOT : public TObject{ |
146 |
private: |
147 |
|
148 |
public: |
149 |
// |
150 |
UInt_t ID; |
151 |
UInt_t ID_RAW; |
152 |
UInt_t ID_TIMESYNC; |
153 |
TString PATH; |
154 |
TString NAME; |
155 |
|
156 |
GL_ROOT(); |
157 |
|
158 |
Int_t Query_GL_ROOT(UInt_t id, TSQLServer *dbc); |
159 |
|
160 |
ClassDef(GL_ROOT,1); |
161 |
}; |
162 |
// ================================================================== |
163 |
/** |
164 |
* \brief Class to store GL_PARAM data |
165 |
*/ |
166 |
class GL_PARAM : public TObject{ |
167 |
private: |
168 |
|
169 |
public: |
170 |
// |
171 |
UInt_t ID; |
172 |
TString PATH; |
173 |
TString NAME; |
174 |
UInt_t FROM_TIME; |
175 |
UInt_t TO_TIME; |
176 |
UInt_t TYPE; |
177 |
TString DESCR; |
178 |
|
179 |
GL_PARAM(); |
180 |
|
181 |
Int_t Query_GL_PARAM(UInt_t time, UInt_t type, TSQLServer *dbc); |
182 |
|
183 |
ClassDef(GL_PARAM,1); |
184 |
}; |
185 |
// ================================================================== |
186 |
/** |
187 |
* \brief Class to store GL_TRK_CALIB data |
188 |
*/ |
189 |
class GL_TRK_CALIB : public TObject{ |
190 |
private: |
191 |
|
192 |
public: |
193 |
// |
194 |
UInt_t ID; |
195 |
UInt_t ID_ROOT_L0; |
196 |
UInt_t EV_ROOT_CALIBTRK1 ; |
197 |
UInt_t EV_ROOT_CALIBTRK2 ; |
198 |
UInt_t FROM_TIME; |
199 |
UInt_t TO_TIME; |
200 |
UInt_t OBT1; |
201 |
UInt_t OBT2; |
202 |
UInt_t PKT1; |
203 |
UInt_t PKT2; |
204 |
UInt_t BOOT_NUMBER; |
205 |
UInt_t VALIDATION; |
206 |
|
207 |
GL_TRK_CALIB(); |
208 |
|
209 |
Int_t Query_GL_TRK_CALIB(UInt_t time, TSQLServer *dbc); |
210 |
|
211 |
ClassDef(GL_TRK_CALIB,1); |
212 |
}; |
213 |
|
214 |
// ================================================================== |
215 |
/** |
216 |
* \brief Class to store GL_CALO_CALIB data |
217 |
*/ |
218 |
class GL_CALO_CALIB : public TObject{ |
219 |
private: |
220 |
|
221 |
public: |
222 |
// |
223 |
UInt_t ID; |
224 |
UInt_t ID_ROOT_L0; |
225 |
UInt_t EV_ROOT; |
226 |
UInt_t FROM_TIME; |
227 |
UInt_t TO_TIME; |
228 |
UInt_t SECTION; |
229 |
|
230 |
GL_CALO_CALIB(); |
231 |
|
232 |
Int_t Query_GL_CALO_CALIB(UInt_t time, UInt_t &uptime, UInt_t section, TSQLServer *dbc); |
233 |
|
234 |
ClassDef(GL_CALO_CALIB,1); |
235 |
}; |
236 |
// ================================================================== |
237 |
/** |
238 |
* \brief Class to store GL_S4_CALIB data |
239 |
*/ |
240 |
class GL_S4_CALIB : public TObject{ |
241 |
private: |
242 |
|
243 |
public: |
244 |
// |
245 |
UInt_t ID; |
246 |
UInt_t ID_ROOT_L0; |
247 |
UInt_t EV_ROOT; |
248 |
UInt_t FROM_TIME; |
249 |
UInt_t TO_TIME; |
250 |
Float_t PARAM_FIT0; |
251 |
Float_t PARAM_FIT1; |
252 |
|
253 |
GL_S4_CALIB(); |
254 |
|
255 |
Int_t Query_GL_S4_CALIB(UInt_t time, TSQLServer *dbc); |
256 |
|
257 |
ClassDef(GL_S4_CALIB,1); |
258 |
}; |
259 |
|
260 |
// ================================================================== |
261 |
/** |
262 |
* \brief Class to store TIMESYNC data |
263 |
*/ |
264 |
class GL_TIMESYNC : public TObject{ |
265 |
private: |
266 |
UInt_t obtfirst; |
267 |
UInt_t pktfirst; |
268 |
UInt_t toffset; |
269 |
// |
270 |
UInt_t ID; |
271 |
UInt_t ID_RAW; |
272 |
UInt_t OBT0; |
273 |
UInt_t TIMESYNC; |
274 |
UInt_t TYPE; |
275 |
|
276 |
public: |
277 |
// |
278 |
GL_TIMESYNC(); |
279 |
GL_TIMESYNC(UInt_t ID, TString TYPE, TSQLServer *dbc); |
280 |
// |
281 |
UInt_t DBabsTime(UInt_t OBT); |
282 |
// |
283 |
UInt_t DBpkt(UInt_t PKT); |
284 |
ULong64_t DBobt(UInt_t OBT); |
285 |
// |
286 |
TString ConvertTime(TString &tzone, UInt_t dbt); |
287 |
TString UnConvertTime(TString &tzone, UInt_t dbt); |
288 |
|
289 |
ClassDef(GL_TIMESYNC,1); |
290 |
}; |
291 |
|
292 |
/* Class to query a TLE from the db. |
293 |
* |
294 |
* Two methods are implemented. |
295 |
*/ |
296 |
class GL_TLE : public TObject{ |
297 |
private: |
298 |
cTle *Query_GL_TLE_go(TString, TSQLServer *); |
299 |
|
300 |
public: |
301 |
GL_TLE(); |
302 |
|
303 |
cTle* Query_GL_TLE(UInt_t unixtime, TSQLServer *dbc); |
304 |
cTle* Query_GL_TLE(TString date, TSQLServer *dbc); |
305 |
|
306 |
ClassDef(GL_TLE,1); |
307 |
}; |
308 |
|
309 |
#endif |
310 |
|