/[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.16 by mocchiut, Tue Oct 31 15:36:04 2006 UTC revision 1.17 by mocchiut, Tue Nov 7 12:17:45 2006 UTC
# Line 15  Line 15 
15  #include <TTree.h>  #include <TTree.h>
16  #include <TGraph.h>  #include <TGraph.h>
17  #include <TDatime.h>  #include <TDatime.h>
18    #include <TTimeStamp.h>
19  #include <TF1.h>  #include <TF1.h>
20  //  //
21  #include <EventHeader.h>  #include <EventHeader.h>
# Line 112  void PamelaDBOperations::Close(){ Line 113  void PamelaDBOperations::Close(){
113  //  //
114  void PamelaDBOperations::CheckValidate(Long64_t olderthan){  void PamelaDBOperations::CheckValidate(Long64_t olderthan){
115    clean_time = new TDatime();    clean_time = new TDatime();
116      //
117    if(olderthan >= 0){    if(olderthan >= 0){
118      VALIDATE = true;      VALIDATE = true;
119      UInt_t timelim = 0;      UInt_t timelim = 0;
120      timelim =  (UInt_t)clean_time->Convert() - olderthan;      timelim =  (UInt_t)clean_time->Convert(true) - olderthan;
121      clean_time->Set(timelim,false);      clean_time->Set(timelim,false);
122    };    };
123  };  };
# Line 764  void PamelaDBOperations::CheckConnection Line 766  void PamelaDBOperations::CheckConnection
766    bool connect = conn->IsConnected();    bool connect = conn->IsConnected();
767    if( !connect ) throw -1;    if( !connect ) throw -1;
768    if ( !dworbit && strcmp(this->GetRootName().Data(),"") ) throw -27;    if ( !dworbit && strcmp(this->GetRootName().Data(),"") ) throw -27;
769      //
770      // set DB timezone to UTC
771      //
772      stringstream   oss;
773      //  
774      oss.str("");
775      oss << "SET time_zone='+0:00';";
776      conn->Query(oss.str().c_str());
777      //
778  };  };
779    
780  /**  /**
# Line 961  Int_t PamelaDBOperations::insertPamelaGL Line 972  Int_t PamelaDBOperations::insertPamelaGL
972      if ( !row ) throw -10;      if ( !row ) throw -10;
973    };    };
974    //    //
975    t0 = (UInt_t)TDatime(row->GetField(0)).Convert();    TDatime ti = TDatime(row->GetField(0));
976      TTimeStamp tu = TTimeStamp((UInt_t)ti.GetYear(),(UInt_t)ti.GetMonth(),(UInt_t)ti.GetDay(),(UInt_t)ti.GetHour(),(UInt_t)ti.GetMinute(),(UInt_t)ti.GetSecond(),0,true,0);
977      t0 = (UInt_t)tu.GetSec();
978      //
979      //  t0 = (UInt_t)TDatime(row->GetField(0)).Convert();
980    /*    /*
981     * Verify that the TIMESYNC have been not already processed     * Verify that the TIMESYNC have been not already processed
982     */     */

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

  ViewVC Help
Powered by ViewVC 1.1.23