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