/[PAMELA software]/YodaProfiler/inc/PamelaDBOperations.h
ViewVC logotype

Diff of /YodaProfiler/inc/PamelaDBOperations.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by mocchiut, Tue Sep 12 07:28:45 2006 UTC revision 1.17 by mocchiut, Fri Oct 19 08:16:47 2007 UTC
# Line 3  Line 3 
3    
4  #include <iostream>  #include <iostream>
5  #include <list>  #include <list>
6  //  
7    #include <TFile.h>
8  #include <TSQLServer.h>  #include <TSQLServer.h>
 //  
9  #include <EventHeader.h>  #include <EventHeader.h>
10  #include <PscuHeader.h>  #include <PscuHeader.h>
11  #include <mcmd/McmdEvent.h>  #include <mcmd/McmdEvent.h>
# Line 19  Line 19 
19  #include <varDump/VarDumpEvent.h>  #include <varDump/VarDumpEvent.h>
20  #include <varDump/VarDumpRecord.h>  #include <varDump/VarDumpRecord.h>
21  #include <physics/S4/S4Event.h>  #include <physics/S4/S4Event.h>
22  //  
23  #include <GLTables.h>  #include <GLTables.h>
24    
25  using namespace pamela;  #include <sgp4.h>
26    
27    using namespace pamela;
28    
29  /**  /**
30   * Collections of Pamela specific operations over a database   * Collections of Pamela specific operations over a database
# Line 49  class PamelaDBOperations { Line 50  class PamelaDBOperations {
50      UInt_t tsync;      UInt_t tsync;
51      UInt_t toffset;      UInt_t toffset;
52      //      //
53  //    Long64_t olderthan;      //    Long64_t olderthan;
54        UInt_t dworbit;
55      //      //
56      UInt_t BOOTNO;      UInt_t BOOTNO;
57      UInt_t obt0;      UInt_t obt0;
58      UInt_t id;      UInt_t id;
59      UInt_t idroot;      UInt_t idroot;
60      UInt_t pktfirst;      UInt_t pktfirst;
61      ULong64_t obtfirst;      UInt_t obtfirst;
62      ULong64_t upperobt;      UInt_t ppktfirst;
63      UInt_t upperpkt;      UInt_t pobtfirst;
64        Long64_t upperobt;
65        Long64_t upperpkt;
66      UInt_t upperentry;      UInt_t upperentry;
67      Int_t rtev;      Int_t rtev;
68      Int_t rhev;      Int_t rhev;
# Line 77  class PamelaDBOperations { Line 81  class PamelaDBOperations {
81      //      //
82      Bool_t NOBOOT;      Bool_t NOBOOT;
83      Bool_t debug;      Bool_t debug;
84    
85        // Path to tle file
86        TString tlefilename;
87                    
88          // flag to control profiler actions      // flag to control profiler actions
89          Bool_t INSERT_RAW;      Bool_t STATIC;
90          Bool_t INSERT_ROOT;      Bool_t INSERT_RAW;
91          Bool_t VALIDATE;      Bool_t INSERT_ROOT;
92                Bool_t VALIDATE;
93          TDatime *clean_time;      Bool_t NOFRAG;
94                        Bool_t AUTOBOOT;
95        
96        TDatime *clean_time;
97        
98      //      //
99      typedef std::list<const char*> pcksList;      typedef std::list<const char*> pcksList;
100      static void getPacketsNames(pcksList &pcksNames){      static void getPacketsNames(pcksList &pcksNames){
# Line 146  class PamelaDBOperations { Line 156  class PamelaDBOperations {
156      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);
157      void HandleTRK_CALIB(Bool_t pk1, Bool_t pk2);      void HandleTRK_CALIB(Bool_t pk1, Bool_t pk2);
158      //      //
159        void RemoveCALIBS();
160        void ValidationOFF();
161        void ReArrangeRUNS();
162        void RemoveRUNS();
163        void RemoveFILES();
164        //
165      Bool_t IsDebug(){return(debug);};      Bool_t IsDebug(){return(debug);};
166      Bool_t IsRunAlreadyInserted();      Bool_t IsRunAlreadyInserted();
167      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);
168        Bool_t AutoBoot(){return(AUTOBOOT);};
169      //      //
170      Bool_t MissingTRK_CALIB(UInt_t t1,UInt_t t2);      Bool_t MissingTRK_CALIB(UInt_t t1,UInt_t t2);
171      //      //
172      UInt_t PKT(UInt_t pkt_num);      Long64_t PKT(UInt_t pkt_num);
173      //      //
174      ULong64_t OBT(UInt_t obt);      Long64_t OBT(UInt_t obt);
175      //      //
176        UInt_t AssignRunID();
177    
178        // GL_TLE related functions
179        int insertTle(cTle*);
180        bool isTlePresent(cTle*);
181    
182   public:   public:
183      //      //
184      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
185      //      //
186      void Close(); // destructor      void Close(); // destructor
187      //      //
# Line 168  class PamelaDBOperations { Line 190  class PamelaDBOperations {
190      //      //
191      void SetConnection(TString host, TString user, TString password);      void SetConnection(TString host, TString user, TString password);
192      void SetBOOTnumber(UInt_t boot);      void SetBOOTnumber(UInt_t boot);
193        void SetBOOTnumber(UInt_t boot, Bool_t gpamela);
194      void SetRawName(TString str);      void SetRawName(TString str);
195      void SetRootName(TString str);      void SetRootName(TString str);
196      void SetDebugFlag(Bool_t debug);      void SetDebugFlag(Bool_t debug);
197      void SetID_RAW(UInt_t idr);      void SetID_RAW(UInt_t idr);
198      void SetID_ROOT(UInt_t idr);      void SetID_ROOT(UInt_t idr);
199      void SetTsync(UInt_t ts);      void SetTsync(UInt_t ts);
200        void SetTsync(UInt_t ts, Bool_t gpamela);
201      void SetObt0(UInt_t ts);      void SetObt0(UInt_t ts);
202      void SetCommonGLRUN(UInt_t absth, UInt_t abstt);      void SetCommonGLRUN(UInt_t absth, UInt_t abstt);
203      void SetNOBOOT(Bool_t noboot);      void SetNOBOOT(Bool_t noboot);
204      void SetOlderThan(Long64_t oldthan);      void SetOlderThan(Long64_t oldthan);
205        void SetTLEPath(TString str);
206        void SetOrbitNo(UInt_t dwinput);
207        void SetNoFrag(Bool_t nf);
208        void SetAutoBoot(Bool_t nf);
209      //      //
210      Bool_t SetID_RAW();      Bool_t SetID_RAW();
211      //      //
# Line 197  class PamelaDBOperations { Line 225  class PamelaDBOperations {
225      const PacketType* GetPacketType(const char* type);      const PacketType* GetPacketType(const char* type);
226      //      //
227      TString GetRawFile(){return((TString)gSystem->BaseName(filerawname.Data()));};      TString GetRawFile(){return((TString)gSystem->BaseName(filerawname.Data()));};
     TString GetRawPath(){return((TString)gSystem->DirName(filerawname.Data())+'/');};  
228      TString GetRootFile(){return((TString)gSystem->BaseName(filerootname.Data()));};      TString GetRootFile(){return((TString)gSystem->BaseName(filerootname.Data()));};
     TString GetRootPath(){return((TString)gSystem->DirName(filerootname.Data())+'/');};  
229      TString GetRootName(){return(filerootname);};      TString GetRootName(){return(filerootname);};
230      TString GetRawName(){return(filerawname);};      TString GetRawName(){return(filerawname);};
231        TString GetRawPath();
232        TString GetRootPath();
233                    
234          const char*  GetCleanTime(){return clean_time->AsSQLString();};      const char*  GetCleanTime(){return clean_time->AsSQLString();};
235      //      //
236      // Functions      // Functions
237      //      //
# Line 216  class PamelaDBOperations { Line 244  class PamelaDBOperations {
244      Int_t insertTRK_CALIB();      Int_t insertTRK_CALIB();
245      Int_t insertS4_CALIB();      Int_t insertS4_CALIB();
246      Int_t CleanGL_RUN_FRAGMENTS();      Int_t CleanGL_RUN_FRAGMENTS();
247        Int_t CleanGL_RUN_FRAGMENTS(TString fcleanfile);
248      Int_t ValidateRuns();      Int_t ValidateRuns();
249        Int_t ValidateRuns(TString valfile);
250      Int_t assignVALIDATION(UInt_t ,Bool_t );      Int_t assignVALIDATION(UInt_t ,Bool_t );
251        Int_t removeFile(TString rootfilename);
252      //      //
253      //    void OpenFile();      //    void OpenFile();
254      void CheckValidate(Long64_t olderthan);      void CheckValidate(Long64_t olderthan);
# Line 225  class PamelaDBOperations { Line 256  class PamelaDBOperations {
256      void CheckFile();      void CheckFile();
257      //      //
258                    
259          Bool_t InsertRoot(){return(INSERT_ROOT);};      Bool_t NoFrag(){return(NOFRAG);};
260          Bool_t InsertRaw(){return(INSERT_RAW);};      Bool_t InsertRoot(){return(INSERT_ROOT);};
261          Bool_t Validate(){return(VALIDATE);};      Bool_t InsertRaw(){return(INSERT_RAW);};
262        Bool_t Validate(){return(VALIDATE);};
263    
264        // Functions for TLE
265        Int_t populateTLE();
266    
267        UInt_t ValidateTrkCalib( CalibTrk1Event* calibtrk , EventHeader* h);
268        UInt_t ValidateTrkCalib( CalibTrk2Event* calibtrk , EventHeader* h){return ValidateTrkCalib((CalibTrk1Event*)calibtrk,h); };
269    
270        UInt_t Check();
271                    
272  };  };
273  #endif /* PAMELA_DB_OPERATIONS_H */  #endif /* PAMELA_DB_OPERATIONS_H */

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.23