/[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.10 by mocchiut, Tue Sep 12 08:43:50 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());      this->SetRootName(filerootname);
72            if ( !file ) INSERT_ROOT = false;      file = TFile::Open(this->GetRootName().Data());
73    };    };
 //  this->OpenFile();  
74    //    //
75    this->SetID_RAW(0);    this->SetID_RAW(0);
76    this->SetID_ROOT(0);    this->SetID_ROOT(0);
77    
78    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);  
   };  
79        
80      //    //
81  };  };
82    
83  /**  /**
# Line 103  void PamelaDBOperations::Close(){ Line 94  void PamelaDBOperations::Close(){
94  // SETTERS  // SETTERS
95  //  //
96    
97    //
98    // 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
99    //
100    void PamelaDBOperations::CheckValidate(Long64_t olderthan){
101      clean_time = new TDatime();
102      if(olderthan >= 0){
103        VALIDATE = true;
104        UInt_t timelim = 0;
105        timelim =  (UInt_t)clean_time->Convert() - olderthan;
106        clean_time->Set(timelim,false);
107      };
108    };
109    
110  /**  /**
111   * Open the DB connection   * Open the DB connection
112   * @param host         hostname for the SQL connection.   * @param host         hostname for the SQL connection.
# Line 651  const PacketType* PamelaDBOperations::Ge Line 655  const PacketType* PamelaDBOperations::Ge
655  // void PamelaDBOperations::OpenFile(){  // void PamelaDBOperations::OpenFile(){
656  //   file = TFile::Open(this->GetRootName().Data());  //   file = TFile::Open(this->GetRootName().Data());
657  //   //  //   //
658  //   if ( !file ) throw -12;  
659  // };  void PamelaDBOperations::CheckFile(){  
660      if ( !file ) throw -12;
661    };
662    
663    
664  /**  /**

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

  ViewVC Help
Powered by ViewVC 1.1.23