11 |
#include <PscuHeader.h> |
#include <PscuHeader.h> |
12 |
#include <RunHeaderEvent.h> |
#include <RunHeaderEvent.h> |
13 |
#include <RunTrailerEvent.h> |
#include <RunTrailerEvent.h> |
14 |
|
#include <sgp4.h> |
15 |
|
|
16 |
using namespace pamela; |
using namespace pamela; |
17 |
// ================================================================== |
// ================================================================== |
64 |
Int_t Fill_GL_RUN(TSQLServer*); |
Int_t Fill_GL_RUN(TSQLServer*); |
65 |
Int_t Query_GL_RUN_FRAGMENTS(TString, TSQLServer*); |
Int_t Query_GL_RUN_FRAGMENTS(TString, TSQLServer*); |
66 |
Int_t Fill_GL_RUN_FRAGMENTS(TSQLServer*); |
Int_t Fill_GL_RUN_FRAGMENTS(TSQLServer*); |
67 |
|
Int_t DeleteRun(TSQLServer*, UInt_t, TString); |
68 |
|
Int_t RestoreRun(TSQLServer*, UInt_t, TString); |
69 |
void Clear(); |
void Clear(); |
70 |
// |
// |
71 |
// SETTERS |
// SETTERS |
74 |
void Set_GL_RUNH(RunHeaderEvent *runt, PscuHeader *pht); |
void Set_GL_RUNH(RunHeaderEvent *runt, PscuHeader *pht); |
75 |
void Set_GL_RUNT0(); |
void Set_GL_RUNT0(); |
76 |
void Set_GL_RUNH0(); |
void Set_GL_RUNH0(); |
77 |
|
// |
78 |
|
void Set_GL_RUN(TSQLRow *row); |
79 |
|
// |
80 |
void SetRUNHEADER_TIME(UInt_t abst); |
void SetRUNHEADER_TIME(UInt_t abst); |
81 |
void SetRUNTRAILER_TIME(UInt_t abst); |
void SetRUNTRAILER_TIME(UInt_t abst); |
82 |
void SetRUNHEADER_PKT(UInt_t abst); |
void SetRUNHEADER_PKT(UInt_t abst); |
111 |
// GETTERS |
// GETTERS |
112 |
// |
// |
113 |
void GetLevel2Struct(cGLRun *l2) const; |
void GetLevel2Struct(cGLRun *l2) const; |
114 |
|
UInt_t GetID(){return(ID);}; |
115 |
UInt_t GetRUNHEADER_PKT(){return(RUNHEADER_PKT);}; |
UInt_t GetRUNHEADER_PKT(){return(RUNHEADER_PKT);}; |
116 |
UInt_t GetRUNTRAILER_PKT(){return(RUNTRAILER_PKT);}; |
UInt_t GetRUNTRAILER_PKT(){return(RUNTRAILER_PKT);}; |
117 |
UInt_t GetRUNHEADER_TIME(){return(RUNHEADER_TIME);}; |
UInt_t GetRUNHEADER_TIME(){return(RUNHEADER_TIME);}; |
204 |
UInt_t OBT2; |
UInt_t OBT2; |
205 |
UInt_t PKT1; |
UInt_t PKT1; |
206 |
UInt_t PKT2; |
UInt_t PKT2; |
207 |
|
UInt_t BOOT_NUMBER; |
208 |
|
UInt_t VALIDATION; |
209 |
|
|
210 |
GL_TRK_CALIB(); |
GL_TRK_CALIB(); |
211 |
|
|
232 |
|
|
233 |
GL_CALO_CALIB(); |
GL_CALO_CALIB(); |
234 |
|
|
235 |
Int_t Query_GL_CALO_CALIB(UInt_t time, UInt_t section, TSQLServer *dbc); |
Int_t Query_GL_CALO_CALIB(UInt_t time, UInt_t &uptime, UInt_t section, TSQLServer *dbc); |
236 |
|
|
237 |
ClassDef(GL_CALO_CALIB,1); |
ClassDef(GL_CALO_CALIB,1); |
238 |
}; |
}; |
270 |
UInt_t pktfirst; |
UInt_t pktfirst; |
271 |
UInt_t toffset; |
UInt_t toffset; |
272 |
// |
// |
273 |
UInt_t ID; |
// UInt_t ID; |
274 |
UInt_t ID_RAW; |
// UInt_t ID_RAW; |
275 |
UInt_t OBT0; |
UInt_t OBT0; |
276 |
UInt_t TIMESYNC; |
UInt_t TIMESYNC; |
277 |
UInt_t TYPE; |
UInt_t TYPE; |
278 |
|
UInt_t T0; |
279 |
|
|
280 |
public: |
public: |
281 |
// |
// |
283 |
GL_TIMESYNC(UInt_t ID, TString TYPE, TSQLServer *dbc); |
GL_TIMESYNC(UInt_t ID, TString TYPE, TSQLServer *dbc); |
284 |
// |
// |
285 |
UInt_t DBabsTime(UInt_t OBT); |
UInt_t DBabsTime(UInt_t OBT); |
286 |
|
UInt_t ResursTime(UInt_t OBT); |
287 |
// |
// |
288 |
UInt_t DBpkt(UInt_t PKT); |
Long64_t DBpkt(UInt_t PKT); |
289 |
ULong64_t DBobt(UInt_t OBT); |
Long64_t DBobt(UInt_t OBT); |
290 |
// |
// |
291 |
TString ConvertTime(TString tzone, UInt_t dbt); |
TString ConvertTime(TString &tzone, UInt_t dbt); |
292 |
TString UnConvertTime(TString tzone, UInt_t dbt); |
TString UnConvertTime(TString &tzone, UInt_t dbt); |
293 |
|
// |
294 |
|
UInt_t GetTimesync() { return TIMESYNC; }; |
295 |
|
UInt_t GetObt0() { return OBT0; }; |
296 |
|
UInt_t GetT0() { return T0; }; |
297 |
|
UInt_t GetType() { return TYPE; }; |
298 |
|
// |
299 |
|
ClassDef(GL_TIMESYNC,2); |
300 |
|
}; |
301 |
|
|
302 |
|
|
303 |
ClassDef(GL_TIMESYNC,1); |
/* |
304 |
|
* Class to query a TLE from the db. |
305 |
|
* |
306 |
|
* Two non default constructor are avaiable. It is the same to call |
307 |
|
* the Query method. |
308 |
|
* |
309 |
|
* The class looks for a TLE in the GL_TLE table using the connection |
310 |
|
* dbc. You need to pass an UTC date in SQL datetime format or in |
311 |
|
* unix time (UTC) and it will look for the tle with the nearest and |
312 |
|
* previous date. Then it initialize tle to a cTle object, |
313 |
|
* tleFromTime to the UTC unix time of the tle and tleToTime to the |
314 |
|
* UTC unix time of the next avaible tle. |
315 |
|
*/ |
316 |
|
class GL_TLE : public TObject{ |
317 |
|
private: |
318 |
|
Int_t DoQuery(TString query, TSQLServer *dbc); |
319 |
|
cTle* GiveTle(TSQLRow*); |
320 |
|
|
321 |
|
cTle *tle; // the requested tle |
322 |
|
UInt_t tleFromTime; // unix time (UTC) of the tle |
323 |
|
UInt_t tleToTime; // unix time (UTC) of the next tle |
324 |
|
|
325 |
|
public: |
326 |
|
GL_TLE(){ |
327 |
|
tle = NULL; |
328 |
|
tleFromTime = 0; |
329 |
|
tleToTime = 0; |
330 |
|
}; |
331 |
|
|
332 |
|
GL_TLE(UInt_t unixtime, TSQLServer *dbc) { |
333 |
|
Query(unixtime, dbc); |
334 |
|
}; |
335 |
|
|
336 |
|
GL_TLE(TString date, TSQLServer *dbc) { |
337 |
|
Query(date, dbc); |
338 |
|
}; |
339 |
|
|
340 |
|
Int_t Query(UInt_t unixtime, TSQLServer *dbc); |
341 |
|
Int_t Query(TString date, TSQLServer *dbc); |
342 |
|
|
343 |
|
cTle* GetTle() const { return tle; } |
344 |
|
UInt_t GetFromTime() const { return tleFromTime; } |
345 |
|
UInt_t GetToTime() const { return tleToTime; } |
346 |
|
|
347 |
|
ClassDef(GL_TLE,1); |
348 |
}; |
}; |
349 |
|
|
350 |
#endif |
#endif |
351 |
|
|