3 |
|
|
4 |
#include <iostream> |
#include <iostream> |
5 |
#include <list> |
#include <list> |
6 |
// |
|
7 |
#include <TSQLServer.h> |
#include <TSQLServer.h> |
|
// |
|
8 |
#include <EventHeader.h> |
#include <EventHeader.h> |
9 |
#include <PscuHeader.h> |
#include <PscuHeader.h> |
10 |
#include <mcmd/McmdEvent.h> |
#include <mcmd/McmdEvent.h> |
18 |
#include <varDump/VarDumpEvent.h> |
#include <varDump/VarDumpEvent.h> |
19 |
#include <varDump/VarDumpRecord.h> |
#include <varDump/VarDumpRecord.h> |
20 |
#include <physics/S4/S4Event.h> |
#include <physics/S4/S4Event.h> |
21 |
// |
|
22 |
#include <GLTables.h> |
#include <GLTables.h> |
23 |
|
|
24 |
using namespace pamela; |
#include <sgp4.h> |
25 |
|
|
26 |
|
using namespace pamela; |
27 |
|
|
28 |
/** |
/** |
29 |
* Collections of Pamela specific operations over a database |
* Collections of Pamela specific operations over a database |
49 |
UInt_t tsync; |
UInt_t tsync; |
50 |
UInt_t toffset; |
UInt_t toffset; |
51 |
// |
// |
52 |
Long64_t olderthan; |
// Long64_t olderthan; |
53 |
|
UInt_t dworbit; |
54 |
// |
// |
55 |
UInt_t BOOTNO; |
UInt_t BOOTNO; |
56 |
UInt_t obt0; |
UInt_t obt0; |
78 |
// |
// |
79 |
Bool_t NOBOOT; |
Bool_t NOBOOT; |
80 |
Bool_t debug; |
Bool_t debug; |
81 |
|
|
82 |
|
// Path to tle file |
83 |
|
TString tlefilename; |
84 |
|
|
85 |
|
// flag to control profiler actions |
86 |
|
Bool_t INSERT_RAW; |
87 |
|
Bool_t INSERT_ROOT; |
88 |
|
Bool_t VALIDATE; |
89 |
|
Bool_t NOFRAG; |
90 |
|
|
91 |
|
TDatime *clean_time; |
92 |
|
|
93 |
// |
// |
94 |
typedef std::list<const char*> pcksList; |
typedef std::list<const char*> pcksList; |
95 |
static void getPacketsNames(pcksList &pcksNames){ |
static void getPacketsNames(pcksList &pcksNames){ |
151 |
void FillClass(Bool_t mishead, Bool_t mistrail, UInt_t firstev, UInt_t lastev); |
void FillClass(Bool_t mishead, Bool_t mistrail, UInt_t firstev, UInt_t lastev); |
152 |
void HandleTRK_CALIB(Bool_t pk1, Bool_t pk2); |
void HandleTRK_CALIB(Bool_t pk1, Bool_t pk2); |
153 |
// |
// |
154 |
|
void RemoveCALIBS(); |
155 |
|
void ValidationOFF(); |
156 |
|
void ReArrangeRUNS(); |
157 |
|
void RemoveRUNS(); |
158 |
|
void RemoveFILES(); |
159 |
|
// |
160 |
Bool_t IsDebug(){return(debug);}; |
Bool_t IsDebug(){return(debug);}; |
161 |
Bool_t IsRunAlreadyInserted(); |
Bool_t IsRunAlreadyInserted(); |
162 |
Bool_t IsRunConsistent(Bool_t mishead, Bool_t mistrail, UInt_t &firstev, UInt_t &lastev); |
Bool_t IsRunConsistent(Bool_t mishead, Bool_t mistrail, UInt_t &firstev, UInt_t &lastev); |
163 |
// |
// |
164 |
|
Bool_t MissingTRK_CALIB(UInt_t t1,UInt_t t2); |
165 |
|
// |
166 |
UInt_t PKT(UInt_t pkt_num); |
UInt_t PKT(UInt_t pkt_num); |
167 |
// |
// |
168 |
ULong64_t OBT(UInt_t obt); |
ULong64_t OBT(UInt_t obt); |
169 |
// |
// |
170 |
|
UInt_t AssignRunID(); |
171 |
|
|
172 |
|
// GL_TLE related functions |
173 |
|
int insertTle(cTle*); |
174 |
|
bool isTlePresent(cTle*); |
175 |
|
|
176 |
public: |
public: |
177 |
// |
// |
178 |
PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug); // constructor |
PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug, TString tlefilename); // constructor |
179 |
// |
// |
180 |
void Close(); // destructor |
void Close(); // destructor |
181 |
// |
// |
194 |
void SetCommonGLRUN(UInt_t absth, UInt_t abstt); |
void SetCommonGLRUN(UInt_t absth, UInt_t abstt); |
195 |
void SetNOBOOT(Bool_t noboot); |
void SetNOBOOT(Bool_t noboot); |
196 |
void SetOlderThan(Long64_t oldthan); |
void SetOlderThan(Long64_t oldthan); |
197 |
|
void SetTLEPath(TString str); |
198 |
|
void SetOrbitNo(); |
199 |
|
void SetNoFrag(Bool_t nf); |
200 |
// |
// |
201 |
Bool_t SetID_RAW(); |
Bool_t SetID_RAW(); |
202 |
// |
// |
221 |
TString GetRootPath(){return((TString)gSystem->DirName(filerootname.Data())+'/');}; |
TString GetRootPath(){return((TString)gSystem->DirName(filerootname.Data())+'/');}; |
222 |
TString GetRootName(){return(filerootname);}; |
TString GetRootName(){return(filerootname);}; |
223 |
TString GetRawName(){return(filerawname);}; |
TString GetRawName(){return(filerawname);}; |
224 |
|
|
225 |
|
const char* GetCleanTime(){return clean_time->AsSQLString();}; |
226 |
// |
// |
227 |
// Functions |
// Functions |
228 |
// |
// |
235 |
Int_t insertTRK_CALIB(); |
Int_t insertTRK_CALIB(); |
236 |
Int_t insertS4_CALIB(); |
Int_t insertS4_CALIB(); |
237 |
Int_t CleanGL_RUN_FRAGMENTS(); |
Int_t CleanGL_RUN_FRAGMENTS(); |
238 |
|
Int_t CleanGL_RUN_FRAGMENTS(TString fcleanfile); |
239 |
Int_t ValidateRuns(); |
Int_t ValidateRuns(); |
240 |
// |
Int_t ValidateRuns(TString valfile); |
241 |
void OpenFile(); |
Int_t assignVALIDATION(UInt_t ,Bool_t ); |
242 |
|
Int_t removeFile(TString rootfilename); |
243 |
|
// |
244 |
|
// void OpenFile(); |
245 |
|
void CheckValidate(Long64_t olderthan); |
246 |
|
void CheckConnection(); |
247 |
void CheckFile(); |
void CheckFile(); |
248 |
// |
// |
249 |
|
|
250 |
|
Bool_t NoFrag(){return(NOFRAG);}; |
251 |
|
Bool_t InsertRoot(){return(INSERT_ROOT);}; |
252 |
|
Bool_t InsertRaw(){return(INSERT_RAW);}; |
253 |
|
Bool_t Validate(){return(VALIDATE);}; |
254 |
|
|
255 |
|
// Functions for TLE |
256 |
|
Int_t populateTLE(); |
257 |
|
|
258 |
}; |
}; |
259 |
#endif /* PAMELA_DB_OPERATIONS_H */ |
#endif /* PAMELA_DB_OPERATIONS_H */ |