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 GetID(){return(ID);}; |
113 |
UInt_t GetRUNHEADER_PKT(){return(RUNHEADER_PKT);}; |
114 |
UInt_t GetRUNTRAILER_PKT(){return(RUNTRAILER_PKT);}; |
115 |
UInt_t GetRUNHEADER_TIME(){return(RUNHEADER_TIME);}; |
116 |
UInt_t GetRUNTRAILER_TIME(){return(RUNTRAILER_TIME);}; |
117 |
UInt_t GetRUNHEADER_OBT(){return(RUNHEADER_OBT);}; |
118 |
UInt_t GetRUNTRAILER_OBT(){return(RUNTRAILER_OBT);}; |
119 |
UInt_t GetNEVENTS(){return(NEVENTS);}; |
120 |
UInt_t GetBOOT_NUMBER(){return(BOOT_NUMBER);}; |
121 |
UInt_t GetTRK_CALIB(){return(TRK_CALIB_USED);}; |
122 |
UInt_t GetPKT_COUNTER(){return(PKT_COUNTER);}; |
123 |
UInt_t GetLAST_TIMESYNC(){return(LAST_TIMESYNC);}; |
124 |
UInt_t GetOBT_TIMESYNC(){return(OBT_TIMESYNC);}; |
125 |
UInt_t GetPKT_READY_COUNTER(){return(PKT_READY_COUNTER);}; |
126 |
UInt_t GetCOMPILATIONTIMESTAMP(){return(COMPILATIONTIMESTAMP);}; |
127 |
UInt_t GetFAV_WRK_SCHEDULE(){return(FAV_WRK_SCHEDULE);}; |
128 |
UInt_t GetEFF_WRK_SCHEDULE(){return(EFF_WRK_SCHEDULE);}; |
129 |
UInt_t GetPRH_VAR_TRG_MODE_A(){return(PRH_VAR_TRG_MODE_A);}; |
130 |
UInt_t GetPRH_VAR_TRG_MODE_B(){return(PRH_VAR_TRG_MODE_B);}; |
131 |
UInt_t GetACQ_BUILD_INFO(){return(ACQ_BUILD_INFO);}; |
132 |
UInt_t GetACQ_VAR_INFO(){return(ACQ_VAR_INFO);}; |
133 |
UInt_t GetRM_ACQ_AFTER_CALIB(){return(RM_ACQ_AFTER_CALIB);}; |
134 |
UInt_t GetRM_ACQ_SETTING_MODE(){return(RM_ACQ_SETTING_MODE);}; |
135 |
UInt_t GetTRK_CALIB_USED(){return(TRK_CALIB_USED);}; |
136 |
UInt_t GetCAL_DSP_MASK(){return(CAL_DSP_MASK);}; |
137 |
|
138 |
// |
139 |
ClassDef(GL_RUN,1); |
140 |
}; |
141 |
|
142 |
// ================================================================== |
143 |
/** |
144 |
* \brief Class to store GL_ROOT |
145 |
*/ |
146 |
class GL_ROOT : public TObject{ |
147 |
private: |
148 |
|
149 |
public: |
150 |
// |
151 |
UInt_t ID; |
152 |
UInt_t ID_RAW; |
153 |
UInt_t ID_TIMESYNC; |
154 |
TString PATH; |
155 |
TString NAME; |
156 |
|
157 |
GL_ROOT(); |
158 |
|
159 |
Int_t Query_GL_ROOT(UInt_t id, TSQLServer *dbc); |
160 |
|
161 |
ClassDef(GL_ROOT,1); |
162 |
}; |
163 |
// ================================================================== |
164 |
/** |
165 |
* \brief Class to store GL_PARAM data |
166 |
*/ |
167 |
class GL_PARAM : public TObject{ |
168 |
private: |
169 |
|
170 |
public: |
171 |
// |
172 |
UInt_t ID; |
173 |
TString PATH; |
174 |
TString NAME; |
175 |
UInt_t FROM_TIME; |
176 |
UInt_t TO_TIME; |
177 |
UInt_t TYPE; |
178 |
TString DESCR; |
179 |
|
180 |
GL_PARAM(); |
181 |
|
182 |
Int_t Query_GL_PARAM(UInt_t time, UInt_t type, TSQLServer *dbc); |
183 |
|
184 |
ClassDef(GL_PARAM,1); |
185 |
}; |
186 |
// ================================================================== |
187 |
/** |
188 |
* \brief Class to store GL_TRK_CALIB data |
189 |
*/ |
190 |
class GL_TRK_CALIB : public TObject{ |
191 |
private: |
192 |
|
193 |
public: |
194 |
// |
195 |
UInt_t ID; |
196 |
UInt_t ID_ROOT_L0; |
197 |
UInt_t EV_ROOT_CALIBTRK1 ; |
198 |
UInt_t EV_ROOT_CALIBTRK2 ; |
199 |
UInt_t FROM_TIME; |
200 |
UInt_t TO_TIME; |
201 |
UInt_t OBT1; |
202 |
UInt_t OBT2; |
203 |
UInt_t PKT1; |
204 |
UInt_t PKT2; |
205 |
UInt_t BOOT_NUMBER; |
206 |
UInt_t VALIDATION; |
207 |
|
208 |
GL_TRK_CALIB(); |
209 |
|
210 |
Int_t Query_GL_TRK_CALIB(UInt_t time, TSQLServer *dbc); |
211 |
|
212 |
ClassDef(GL_TRK_CALIB,1); |
213 |
}; |
214 |
|
215 |
// ================================================================== |
216 |
/** |
217 |
* \brief Class to store GL_CALO_CALIB data |
218 |
*/ |
219 |
class GL_CALO_CALIB : public TObject{ |
220 |
private: |
221 |
|
222 |
public: |
223 |
// |
224 |
UInt_t ID; |
225 |
UInt_t ID_ROOT_L0; |
226 |
UInt_t EV_ROOT; |
227 |
UInt_t FROM_TIME; |
228 |
UInt_t TO_TIME; |
229 |
UInt_t SECTION; |
230 |
|
231 |
GL_CALO_CALIB(); |
232 |
|
233 |
Int_t Query_GL_CALO_CALIB(UInt_t time, UInt_t &uptime, UInt_t section, TSQLServer *dbc); |
234 |
|
235 |
ClassDef(GL_CALO_CALIB,1); |
236 |
}; |
237 |
// ================================================================== |
238 |
/** |
239 |
* \brief Class to store GL_S4_CALIB data |
240 |
*/ |
241 |
class GL_S4_CALIB : public TObject{ |
242 |
private: |
243 |
|
244 |
public: |
245 |
// |
246 |
UInt_t ID; |
247 |
UInt_t ID_ROOT_L0; |
248 |
UInt_t EV_ROOT; |
249 |
UInt_t FROM_TIME; |
250 |
UInt_t TO_TIME; |
251 |
Float_t PARAM_FIT0; |
252 |
Float_t PARAM_FIT1; |
253 |
|
254 |
GL_S4_CALIB(); |
255 |
|
256 |
Int_t Query_GL_S4_CALIB(UInt_t time, TSQLServer *dbc); |
257 |
|
258 |
ClassDef(GL_S4_CALIB,1); |
259 |
}; |
260 |
|
261 |
// ================================================================== |
262 |
/** |
263 |
* \brief Class to store TIMESYNC data |
264 |
*/ |
265 |
class GL_TIMESYNC : public TObject{ |
266 |
private: |
267 |
UInt_t obtfirst; |
268 |
UInt_t pktfirst; |
269 |
UInt_t toffset; |
270 |
// |
271 |
UInt_t ID; |
272 |
UInt_t ID_RAW; |
273 |
UInt_t OBT0; |
274 |
UInt_t TIMESYNC; |
275 |
UInt_t TYPE; |
276 |
|
277 |
public: |
278 |
// |
279 |
GL_TIMESYNC(); |
280 |
GL_TIMESYNC(UInt_t ID, TString TYPE, TSQLServer *dbc); |
281 |
// |
282 |
UInt_t DBabsTime(UInt_t OBT); |
283 |
// |
284 |
UInt_t DBpkt(UInt_t PKT); |
285 |
ULong64_t DBobt(UInt_t OBT); |
286 |
// |
287 |
TString ConvertTime(TString &tzone, UInt_t dbt); |
288 |
TString UnConvertTime(TString &tzone, UInt_t dbt); |
289 |
|
290 |
ClassDef(GL_TIMESYNC,1); |
291 |
}; |
292 |
|
293 |
/* Class to query a TLE from the db. |
294 |
* |
295 |
* Two methods are implemented. |
296 |
*/ |
297 |
class GL_TLE : public TObject{ |
298 |
private: |
299 |
cTle *Query_GL_TLE_go(TString, TSQLServer *); |
300 |
|
301 |
public: |
302 |
GL_TLE(); |
303 |
|
304 |
cTle* Query_GL_TLE(UInt_t unixtime, TSQLServer *dbc); |
305 |
cTle* Query_GL_TLE(TString date, TSQLServer *dbc); |
306 |
|
307 |
ClassDef(GL_TLE,1); |
308 |
}; |
309 |
|
310 |
#endif |
311 |
|