--- YodaProfiler/inc/PamelaDBOperations.h 2006/09/11 16:38:18 1.4 +++ YodaProfiler/inc/PamelaDBOperations.h 2008/02/06 12:22:00 1.19 @@ -3,9 +3,9 @@ #include #include -// + +#include #include -// #include #include #include @@ -19,11 +19,12 @@ #include #include #include -// + #include -using namespace pamela; +#include +using namespace pamela; /** * Collections of Pamela specific operations over a database @@ -49,16 +50,19 @@ UInt_t tsync; UInt_t toffset; // -// Long64_t olderthan; + // Long64_t olderthan; + UInt_t dworbit; // UInt_t BOOTNO; UInt_t obt0; UInt_t id; UInt_t idroot; UInt_t pktfirst; - ULong64_t obtfirst; - ULong64_t upperobt; - UInt_t upperpkt; + UInt_t obtfirst; + UInt_t ppktfirst; + UInt_t pobtfirst; + Long64_t upperobt; + Long64_t upperpkt; UInt_t upperentry; Int_t rtev; Int_t rhev; @@ -77,14 +81,21 @@ // Bool_t NOBOOT; Bool_t debug; + + // Path to tle file + TString tlefilename; - // flag to control profiler actions - Bool_t INSERT_RAW; - Bool_t INSERT_ROOT; - Bool_t VALIDATE; - - TDatime *clean_time; - + // flag to control profiler actions + Bool_t STATIC; + Bool_t INSERT_RAW; + Bool_t INSERT_ROOT; + Bool_t VALIDATE; + Bool_t NOFRAG; + Bool_t AUTOBOOT; + Bool_t PEDANTIC; + + TDatime *clean_time; + // typedef std::list pcksList; static void getPacketsNames(pcksList &pcksNames){ @@ -146,20 +157,32 @@ void FillClass(Bool_t mishead, Bool_t mistrail, UInt_t firstev, UInt_t lastev); void HandleTRK_CALIB(Bool_t pk1, Bool_t pk2); // + void RemoveCALIBS(); + void ValidationOFF(); + void ReArrangeRUNS(); + void RemoveRUNS(); + void RemoveFILES(); + // Bool_t IsDebug(){return(debug);}; Bool_t IsRunAlreadyInserted(); Bool_t IsRunConsistent(Bool_t mishead, Bool_t mistrail, UInt_t &firstev, UInt_t &lastev); - // - Bool_t MissingTRK_CALIB(UInt_t t1,UInt_t t2); - // - UInt_t PKT(UInt_t pkt_num); + Bool_t AutoBoot(){return(AUTOBOOT);}; // - ULong64_t OBT(UInt_t obt); + Bool_t MissingTRK_CALIB(UInt_t t1,UInt_t t2); // + Long64_t PKT(UInt_t pkt_num); + // + Long64_t OBT(UInt_t obt); + // + UInt_t AssignRunID(); + + // GL_TLE related functions + int insertTle(cTle*); + bool isTlePresent(cTle*); public: // - PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug, Long64_t olderthan); // 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 // void Close(); // destructor // @@ -168,16 +191,23 @@ // void SetConnection(TString host, TString user, TString password); void SetBOOTnumber(UInt_t boot); + void SetBOOTnumber(UInt_t boot, Bool_t gpamela); void SetRawName(TString str); void SetRootName(TString str); void SetDebugFlag(Bool_t debug); void SetID_RAW(UInt_t idr); void SetID_ROOT(UInt_t idr); void SetTsync(UInt_t ts); + void SetTsync(UInt_t ts, Bool_t gpamela); void SetObt0(UInt_t ts); void SetCommonGLRUN(UInt_t absth, UInt_t abstt); void SetNOBOOT(Bool_t noboot); void SetOlderThan(Long64_t oldthan); + void SetTLEPath(TString str); + void SetOrbitNo(UInt_t dwinput); + void SetNoFrag(Bool_t nf); + void SetAutoBoot(Bool_t nf); + void SetPedantic(Bool_t pd); // Bool_t SetID_RAW(); // @@ -197,13 +227,13 @@ const PacketType* GetPacketType(const char* type); // TString GetRawFile(){return((TString)gSystem->BaseName(filerawname.Data()));}; - TString GetRawPath(){return((TString)gSystem->DirName(filerawname.Data())+'/');}; TString GetRootFile(){return((TString)gSystem->BaseName(filerootname.Data()));}; - TString GetRootPath(){return((TString)gSystem->DirName(filerootname.Data())+'/');}; TString GetRootName(){return(filerootname);}; TString GetRawName(){return(filerawname);}; + TString GetRawPath(); + TString GetRootPath(); - const char* GetCleanTime(){return clean_time->AsSQLString();}; + const char* GetCleanTime(){return clean_time->AsSQLString();}; // // Functions // @@ -213,19 +243,34 @@ Int_t insertPamelaGL_TIMESYNC(); Int_t insertPamelaRUN(); Int_t insertCALO_CALIB(); + Int_t insertCALOPULSE_CALIB(); Int_t insertTRK_CALIB(); Int_t insertS4_CALIB(); Int_t CleanGL_RUN_FRAGMENTS(); + Int_t CleanGL_RUN_FRAGMENTS(TString fcleanfile); Int_t ValidateRuns(); - Int_t assignVALIDATION(UInt_t ,Bool_t ); - // -// void OpenFile(); + Int_t ValidateRuns(TString valfile); + Int_t assignVALIDATION(UInt_t ,Bool_t ); + Int_t removeFile(TString rootfilename); + // + // void OpenFile(); + void CheckValidate(Long64_t olderthan); void CheckConnection(); + void CheckFile(); // - Bool_t InsertRoot(){return(INSERT_ROOT);}; - Bool_t InsertRaw(){return(INSERT_RAW);}; - Bool_t Validate(){return(VALIDATE);}; + Bool_t NoFrag(){return(NOFRAG);}; + Bool_t InsertRoot(){return(INSERT_ROOT);}; + Bool_t InsertRaw(){return(INSERT_RAW);}; + Bool_t Validate(){return(VALIDATE);}; + + // Functions for TLE + Int_t populateTLE(); + + UInt_t ValidateTrkCalib( CalibTrk1Event* calibtrk , EventHeader* h); + UInt_t ValidateTrkCalib( CalibTrk2Event* calibtrk , EventHeader* h){return ValidateTrkCalib((CalibTrk1Event*)calibtrk,h); }; + + UInt_t Check(); }; #endif /* PAMELA_DB_OPERATIONS_H */