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; |
57 |
UInt_t id; |
UInt_t id; |
58 |
UInt_t idroot; |
UInt_t idroot; |
59 |
UInt_t pktfirst; |
UInt_t pktfirst; |
60 |
ULong64_t obtfirst; |
UInt_t obtfirst; |
61 |
ULong64_t upperobt; |
UInt_t ppktfirst; |
62 |
UInt_t upperpkt; |
UInt_t pobtfirst; |
63 |
|
Long64_t upperobt; |
64 |
|
Long64_t upperpkt; |
65 |
UInt_t upperentry; |
UInt_t upperentry; |
66 |
Int_t rtev; |
Int_t rtev; |
67 |
Int_t rhev; |
Int_t rhev; |
80 |
// |
// |
81 |
Bool_t NOBOOT; |
Bool_t NOBOOT; |
82 |
Bool_t debug; |
Bool_t debug; |
83 |
|
|
84 |
|
// Path to tle file |
85 |
|
TString tlefilename; |
86 |
|
|
87 |
// flag to control profiler actions |
// flag to control profiler actions |
88 |
Bool_t INSERT_RAW; |
Bool_t STATIC; |
89 |
Bool_t INSERT_ROOT; |
Bool_t INSERT_RAW; |
90 |
Bool_t VALIDATE; |
Bool_t INSERT_ROOT; |
91 |
|
Bool_t VALIDATE; |
92 |
TDatime *clean_time; |
Bool_t NOFRAG; |
93 |
|
Bool_t AUTOBOOT; |
94 |
|
|
95 |
|
TDatime *clean_time; |
96 |
|
|
97 |
// |
// |
98 |
typedef std::list<const char*> pcksList; |
typedef std::list<const char*> pcksList; |
99 |
static void getPacketsNames(pcksList &pcksNames){ |
static void getPacketsNames(pcksList &pcksNames){ |
155 |
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); |
156 |
void HandleTRK_CALIB(Bool_t pk1, Bool_t pk2); |
void HandleTRK_CALIB(Bool_t pk1, Bool_t pk2); |
157 |
// |
// |
158 |
|
void RemoveCALIBS(); |
159 |
|
void ValidationOFF(); |
160 |
|
void ReArrangeRUNS(); |
161 |
|
void RemoveRUNS(); |
162 |
|
void RemoveFILES(); |
163 |
|
// |
164 |
Bool_t IsDebug(){return(debug);}; |
Bool_t IsDebug(){return(debug);}; |
165 |
Bool_t IsRunAlreadyInserted(); |
Bool_t IsRunAlreadyInserted(); |
166 |
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); |
167 |
|
Bool_t AutoBoot(){return(AUTOBOOT);}; |
168 |
// |
// |
169 |
Bool_t MissingTRK_CALIB(UInt_t t1,UInt_t t2); |
Bool_t MissingTRK_CALIB(UInt_t t1,UInt_t t2); |
170 |
// |
// |
171 |
UInt_t PKT(UInt_t pkt_num); |
Long64_t PKT(UInt_t pkt_num); |
172 |
// |
// |
173 |
ULong64_t OBT(UInt_t obt); |
Long64_t OBT(UInt_t obt); |
174 |
// |
// |
175 |
|
UInt_t AssignRunID(); |
176 |
|
|
177 |
|
// GL_TLE related functions |
178 |
|
int insertTle(cTle*); |
179 |
|
bool isTlePresent(cTle*); |
180 |
|
|
181 |
public: |
public: |
182 |
// |
// |
183 |
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,UInt_t dwinput, Bool_t staticp, Bool_t gpamela); // constructor |
184 |
// |
// |
185 |
void Close(); // destructor |
void Close(); // destructor |
186 |
// |
// |
189 |
// |
// |
190 |
void SetConnection(TString host, TString user, TString password); |
void SetConnection(TString host, TString user, TString password); |
191 |
void SetBOOTnumber(UInt_t boot); |
void SetBOOTnumber(UInt_t boot); |
192 |
|
void SetBOOTnumber(UInt_t boot, Bool_t gpamela); |
193 |
void SetRawName(TString str); |
void SetRawName(TString str); |
194 |
void SetRootName(TString str); |
void SetRootName(TString str); |
195 |
void SetDebugFlag(Bool_t debug); |
void SetDebugFlag(Bool_t debug); |
196 |
void SetID_RAW(UInt_t idr); |
void SetID_RAW(UInt_t idr); |
197 |
void SetID_ROOT(UInt_t idr); |
void SetID_ROOT(UInt_t idr); |
198 |
void SetTsync(UInt_t ts); |
void SetTsync(UInt_t ts); |
199 |
|
void SetTsync(UInt_t ts, Bool_t gpamela); |
200 |
void SetObt0(UInt_t ts); |
void SetObt0(UInt_t ts); |
201 |
void SetCommonGLRUN(UInt_t absth, UInt_t abstt); |
void SetCommonGLRUN(UInt_t absth, UInt_t abstt); |
202 |
void SetNOBOOT(Bool_t noboot); |
void SetNOBOOT(Bool_t noboot); |
203 |
void SetOlderThan(Long64_t oldthan); |
void SetOlderThan(Long64_t oldthan); |
204 |
|
void SetTLEPath(TString str); |
205 |
|
void SetOrbitNo(UInt_t dwinput); |
206 |
|
void SetNoFrag(Bool_t nf); |
207 |
|
void SetAutoBoot(Bool_t nf); |
208 |
// |
// |
209 |
Bool_t SetID_RAW(); |
Bool_t SetID_RAW(); |
210 |
// |
// |
224 |
const PacketType* GetPacketType(const char* type); |
const PacketType* GetPacketType(const char* type); |
225 |
// |
// |
226 |
TString GetRawFile(){return((TString)gSystem->BaseName(filerawname.Data()));}; |
TString GetRawFile(){return((TString)gSystem->BaseName(filerawname.Data()));}; |
|
TString GetRawPath(){return((TString)gSystem->DirName(filerawname.Data())+'/');}; |
|
227 |
TString GetRootFile(){return((TString)gSystem->BaseName(filerootname.Data()));}; |
TString GetRootFile(){return((TString)gSystem->BaseName(filerootname.Data()));}; |
|
TString GetRootPath(){return((TString)gSystem->DirName(filerootname.Data())+'/');}; |
|
228 |
TString GetRootName(){return(filerootname);}; |
TString GetRootName(){return(filerootname);}; |
229 |
TString GetRawName(){return(filerawname);}; |
TString GetRawName(){return(filerawname);}; |
230 |
|
TString GetRawPath(); |
231 |
|
TString GetRootPath(); |
232 |
|
|
233 |
const char* GetCleanTime(){return clean_time->AsSQLString();}; |
const char* GetCleanTime(){return clean_time->AsSQLString();}; |
234 |
// |
// |
235 |
// Functions |
// Functions |
236 |
// |
// |
243 |
Int_t insertTRK_CALIB(); |
Int_t insertTRK_CALIB(); |
244 |
Int_t insertS4_CALIB(); |
Int_t insertS4_CALIB(); |
245 |
Int_t CleanGL_RUN_FRAGMENTS(); |
Int_t CleanGL_RUN_FRAGMENTS(); |
246 |
|
Int_t CleanGL_RUN_FRAGMENTS(TString fcleanfile); |
247 |
Int_t ValidateRuns(); |
Int_t ValidateRuns(); |
248 |
|
Int_t ValidateRuns(TString valfile); |
249 |
Int_t assignVALIDATION(UInt_t ,Bool_t ); |
Int_t assignVALIDATION(UInt_t ,Bool_t ); |
250 |
|
Int_t removeFile(TString rootfilename); |
251 |
// |
// |
252 |
// void OpenFile(); |
// void OpenFile(); |
253 |
void CheckValidate(Long64_t olderthan); |
void CheckValidate(Long64_t olderthan); |
255 |
void CheckFile(); |
void CheckFile(); |
256 |
// |
// |
257 |
|
|
258 |
Bool_t InsertRoot(){return(INSERT_ROOT);}; |
Bool_t NoFrag(){return(NOFRAG);}; |
259 |
Bool_t InsertRaw(){return(INSERT_RAW);}; |
Bool_t InsertRoot(){return(INSERT_ROOT);}; |
260 |
Bool_t Validate(){return(VALIDATE);}; |
Bool_t InsertRaw(){return(INSERT_RAW);}; |
261 |
|
Bool_t Validate(){return(VALIDATE);}; |
262 |
|
|
263 |
|
// Functions for TLE |
264 |
|
Int_t populateTLE(); |
265 |
|
|
266 |
|
UInt_t ValidateTrkCalib( CalibTrk1Event* calibtrk , EventHeader* h); |
267 |
|
UInt_t ValidateTrkCalib( CalibTrk2Event* calibtrk , EventHeader* h){return ValidateTrkCalib((CalibTrk1Event*)calibtrk,h); }; |
268 |
|
|
269 |
|
UInt_t Check(); |
270 |
|
|
271 |
}; |
}; |
272 |
#endif /* PAMELA_DB_OPERATIONS_H */ |
#endif /* PAMELA_DB_OPERATIONS_H */ |