12 |
#include <RunHeaderEvent.h> |
#include <RunHeaderEvent.h> |
13 |
#include <RunTrailerEvent.h> |
#include <RunTrailerEvent.h> |
14 |
#include <sgp4.h> |
#include <sgp4.h> |
15 |
|
// |
16 |
|
|
17 |
using namespace pamela; |
using namespace pamela; |
18 |
|
// |
19 |
|
|
20 |
|
static const TString *fHost; |
21 |
|
static const TString *fUser; |
22 |
|
static const TString *fPsw; |
23 |
|
static UInt_t fNquery; |
24 |
|
static Bool_t fSet; |
25 |
|
|
26 |
|
// ================================================================== |
27 |
|
/** |
28 |
|
* \brief Class to store GL_RUN data |
29 |
|
*/ |
30 |
|
class GL_TABLES : public TObject { |
31 |
|
private: |
32 |
|
|
33 |
|
public: |
34 |
|
// |
35 |
|
GL_TABLES(); |
36 |
|
GL_TABLES(TString, TString, TString); |
37 |
|
// |
38 |
|
void Set(TString, TString, TString); |
39 |
|
// |
40 |
|
Bool_t IsConnected(TSQLServer *); |
41 |
|
// |
42 |
|
void ResetCounters(); |
43 |
|
void AddQ(); |
44 |
|
// |
45 |
|
const TString* GetHost(){return(fHost);}; |
46 |
|
const TString* GetUser(){return(fUser);}; |
47 |
|
const TString* GetPsw(){return(fPsw);}; |
48 |
|
UInt_t GetfNquery(){return(fNquery);}; |
49 |
|
UInt_t GetNqueries(); |
50 |
|
Bool_t IsSet(){return(fSet);}; |
51 |
|
// |
52 |
|
GL_TABLES *GetGLTABLES(){return this;}; |
53 |
|
// |
54 |
|
ClassDef(GL_TABLES,1); |
55 |
|
}; |
56 |
|
|
57 |
// ================================================================== |
// ================================================================== |
58 |
/** |
/** |
59 |
* \brief Class to store GL_RUN data |
* \brief Class to store GL_RUN data |
60 |
*/ |
*/ |
61 |
class GL_RUN : public TObject { |
//class GL_RUN : public TObject { |
62 |
|
class GL_RUN : public GL_TABLES { |
63 |
private: |
private: |
64 |
|
|
65 |
public: |
public: |
186 |
/** |
/** |
187 |
* \brief Class to store GL_ROOT |
* \brief Class to store GL_ROOT |
188 |
*/ |
*/ |
189 |
class GL_ROOT : public TObject{ |
class GL_ROOT : public GL_TABLES { |
190 |
|
//class GL_ROOT : public TObject{ |
191 |
private: |
private: |
192 |
|
|
193 |
public: |
public: |
208 |
/** |
/** |
209 |
* \brief Class to store GL_PARAM data |
* \brief Class to store GL_PARAM data |
210 |
*/ |
*/ |
211 |
class GL_PARAM : public TObject{ |
class GL_PARAM : public GL_TABLES { |
212 |
|
//class GL_PARAM : public TObject{ |
213 |
private: |
private: |
214 |
|
|
215 |
public: |
public: |
232 |
/** |
/** |
233 |
* \brief Class to store GL_TRK_CALIB data |
* \brief Class to store GL_TRK_CALIB data |
234 |
*/ |
*/ |
235 |
class GL_TRK_CALIB : public TObject{ |
//class GL_TRK_CALIB : public TObject{ |
236 |
|
class GL_TRK_CALIB : public GL_TABLES { |
237 |
private: |
private: |
238 |
|
|
239 |
public: |
public: |
262 |
/** |
/** |
263 |
* \brief Class to store GL_CALO_CALIB data |
* \brief Class to store GL_CALO_CALIB data |
264 |
*/ |
*/ |
265 |
class GL_CALO_CALIB : public TObject{ |
class GL_CALO_CALIB : public GL_TABLES { |
266 |
|
//class GL_CALO_CALIB : public TObject{ |
267 |
private: |
private: |
268 |
|
|
269 |
public: |
public: |
285 |
/** |
/** |
286 |
* \brief Class to store GL_S4_CALIB data |
* \brief Class to store GL_S4_CALIB data |
287 |
*/ |
*/ |
288 |
class GL_S4_CALIB : public TObject{ |
class GL_S4_CALIB : public GL_TABLES { |
289 |
|
//class GL_S4_CALIB : public TObject{ |
290 |
private: |
private: |
291 |
|
|
292 |
public: |
public: |
310 |
/** |
/** |
311 |
* \brief Class to store TIMESYNC data |
* \brief Class to store TIMESYNC data |
312 |
*/ |
*/ |
313 |
class GL_TIMESYNC : public TObject{ |
class GL_TIMESYNC : public GL_TABLES { |
314 |
|
//class GL_TIMESYNC : public TObject{ |
315 |
private: |
private: |
316 |
UInt_t obtfirst; |
UInt_t obtfirst; |
317 |
UInt_t pktfirst; |
UInt_t pktfirst; |
318 |
UInt_t toffset; |
UInt_t toffset; |
319 |
// |
// |
320 |
UInt_t ID; |
// UInt_t ID; |
321 |
UInt_t ID_RAW; |
// UInt_t ID_RAW; |
322 |
UInt_t OBT0; |
UInt_t OBT0; |
323 |
UInt_t TIMESYNC; |
UInt_t TIMESYNC; |
324 |
UInt_t TYPE; |
UInt_t TYPE; |
325 |
|
UInt_t T0; |
326 |
|
|
327 |
public: |
public: |
328 |
// |
// |
330 |
GL_TIMESYNC(UInt_t ID, TString TYPE, TSQLServer *dbc); |
GL_TIMESYNC(UInt_t ID, TString TYPE, TSQLServer *dbc); |
331 |
// |
// |
332 |
UInt_t DBabsTime(UInt_t OBT); |
UInt_t DBabsTime(UInt_t OBT); |
333 |
|
UInt_t ResursTime(UInt_t OBT); |
334 |
// |
// |
335 |
UInt_t DBpkt(UInt_t PKT); |
Long64_t DBpkt(UInt_t PKT); |
336 |
ULong64_t DBobt(UInt_t OBT); |
Long64_t DBobt(UInt_t OBT); |
337 |
// |
// |
338 |
TString ConvertTime(TString &tzone, UInt_t dbt); |
TString ConvertTime(TString &tzone, UInt_t dbt); |
339 |
TString UnConvertTime(TString &tzone, UInt_t dbt); |
TString UnConvertTime(TString &tzone, UInt_t dbt); |
340 |
|
// |
341 |
ClassDef(GL_TIMESYNC,1); |
UInt_t GetTimesync() { return TIMESYNC; }; |
342 |
|
UInt_t GetObt0() { return OBT0; }; |
343 |
|
UInt_t GetT0() { return T0; }; |
344 |
|
UInt_t GetType() { return TYPE; }; |
345 |
|
// |
346 |
|
ClassDef(GL_TIMESYNC,2); |
347 |
}; |
}; |
348 |
|
|
349 |
/* Class to query a TLE from the db. |
|
350 |
|
/* |
351 |
|
* Class to query a TLE from the db. |
352 |
* |
* |
353 |
* Two methods are implemented. |
* Two non default constructor are avaiable. It is the same to call |
354 |
|
* the Query method. |
355 |
|
* |
356 |
|
* The class looks for a TLE in the GL_TLE table using the connection |
357 |
|
* dbc. You need to pass an UTC date in SQL datetime format or in |
358 |
|
* unix time (UTC) and it will look for the tle with the nearest and |
359 |
|
* previous date. Then it initialize tle to a cTle object, |
360 |
|
* tleFromTime to the UTC unix time of the tle and tleToTime to the |
361 |
|
* UTC unix time of the next avaible tle. |
362 |
*/ |
*/ |
363 |
class GL_TLE : public TObject{ |
class GL_TLE : public GL_TABLES { |
364 |
|
//class GL_TLE : public TObject{ |
365 |
private: |
private: |
366 |
cTle *Query_GL_TLE_go(TString, TSQLServer *); |
Int_t DoQuery(TString query, TSQLServer *dbc); |
367 |
|
cTle* GiveTle(TSQLRow*); |
368 |
|
|
369 |
public: |
cTle *tle; // the requested tle |
370 |
GL_TLE(); |
UInt_t tleFromTime; // unix time (UTC) of the tle |
371 |
|
UInt_t tleToTime; // unix time (UTC) of the next tle |
372 |
|
|
373 |
cTle* Query_GL_TLE(UInt_t unixtime, TSQLServer *dbc); |
public: |
374 |
cTle* Query_GL_TLE(TString date, TSQLServer *dbc); |
GL_TLE(){ |
375 |
|
tle = NULL; |
376 |
|
tleFromTime = 0; |
377 |
|
tleToTime = 0; |
378 |
|
}; |
379 |
|
|
380 |
|
GL_TLE(UInt_t unixtime, TSQLServer *dbc) { |
381 |
|
Query(unixtime, dbc); |
382 |
|
}; |
383 |
|
|
384 |
|
GL_TLE(TString date, TSQLServer *dbc) { |
385 |
|
Query(date, dbc); |
386 |
|
}; |
387 |
|
|
388 |
|
Int_t Query(UInt_t unixtime, TSQLServer *dbc); |
389 |
|
Int_t Query(TString date, TSQLServer *dbc); |
390 |
|
|
391 |
|
cTle* GetTle() const { return tle; } |
392 |
|
UInt_t GetFromTime() const { return tleFromTime; } |
393 |
|
UInt_t GetToTime() const { return tleToTime; } |
394 |
|
|
395 |
ClassDef(GL_TLE,1); |
ClassDef(GL_TLE,1); |
396 |
}; |
}; |