/[PAMELA software]/YodaProfiler/src/PamelaDBOperations.cpp
ViewVC logotype

Diff of /YodaProfiler/src/PamelaDBOperations.cpp

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

revision 1.8 by pam-fi, Mon Sep 11 16:38:18 2006 UTC revision 1.9 by mocchiut, Tue Sep 12 07:28:46 2006 UTC
# Line 48  using namespace pamela; Line 48  using namespace pamela;
48   * @param tsync        file timesync.   * @param tsync        file timesync.
49   * @param debug        debug flag.   * @param debug        debug flag.
50   */   */
51  PamelaDBOperations::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){  PamelaDBOperations::PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug){
52    //    //
53    //    //
54    SetConnection(host,user,password);    SetConnection(host,user,password);
# Line 67  PamelaDBOperations::PamelaDBOperations(T Line 67  PamelaDBOperations::PamelaDBOperations(T
67    if(INSERT_RAW)SetRawName(filerawname);    if(INSERT_RAW)SetRawName(filerawname);
68    //    //
69    INSERT_ROOT = !filerootname.IsNull();    INSERT_ROOT = !filerootname.IsNull();
70    if(INSERT_ROOT){    if( INSERT_ROOT ){
71            file = TFile::Open(this->GetRootName().Data());      file = TFile::Open(this->GetRootName().Data());
72            if ( !file ) INSERT_ROOT = false;      //    if ( !file ) INSERT_ROOT = false;
73    };    };
74  //  this->OpenFile();    //  this->OpenFile();
75    //    //
76    this->SetID_RAW(0);    this->SetID_RAW(0);
77    this->SetID_ROOT(0);    this->SetID_ROOT(0);
78    
79    VALIDATE = false;    VALIDATE = false;
   clean_time = new TDatime();  
   if(olderthan >= 0){  
         VALIDATE = true;  
         UInt_t timelim = 0;  
         // timelim = now - olderthan  
         timelim =  (UInt_t)clean_time->Convert() - olderthan;  
         clean_time->Set(timelim,false);  
   };  
80        
81      //    //
82  };  };
83    
84  /**  /**
# Line 103  void PamelaDBOperations::Close(){ Line 95  void PamelaDBOperations::Close(){
95  // SETTERS  // SETTERS
96  //  //
97    
98    //
99    // must be out of the constructor in order to FORCE the validation of the latest runs in case you run the validation together with the latest file
100    //
101    void PamelaDBOperations::CheckValidate(Long64_t olderthan){
102      clean_time = new TDatime();
103      if(olderthan >= 0){
104        VALIDATE = true;
105        UInt_t timelim = 0;
106        timelim =  (UInt_t)clean_time->Convert() - olderthan;
107        clean_time->Set(timelim,false);
108      };
109    };
110    
111  /**  /**
112   * Open the DB connection   * Open the DB connection
113   * @param host         hostname for the SQL connection.   * @param host         hostname for the SQL connection.
# Line 651  const PacketType* PamelaDBOperations::Ge Line 656  const PacketType* PamelaDBOperations::Ge
656  // void PamelaDBOperations::OpenFile(){  // void PamelaDBOperations::OpenFile(){
657  //   file = TFile::Open(this->GetRootName().Data());  //   file = TFile::Open(this->GetRootName().Data());
658  //   //  //   //
659  //   if ( !file ) throw -12;  
660  // };  void PamelaDBOperations::CheckFile(){  
661      if ( !file ) throw -12;
662    };
663    
664    
665  /**  /**

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.23