/[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.18 by mocchiut, Thu Nov 9 12:02:55 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     */     */
# Line 2732  Int_t PamelaDBOperations::insertCALO_CAL Line 2747  Int_t PamelaDBOperations::insertCALO_CAL
2747                // no calibrations in the db contain our calibration                // no calibrations in the db contain our calibration
2748                //                //
2749                if ( IsDebug() ) printf(" Calibration with fromtime lower than others to be inserted in the DB for section %i \n",section);                if ( IsDebug() ) printf(" Calibration with fromtime lower than others to be inserted in the DB for section %i \n",section);
2750                if ( fromtime < 1150863400 ){                if ( fromtime < 1150867000 ){ //1150866904
2751                  if ( IsDebug() ) printf(" First PAMELA flight calibration at time %i \n",fromtime);                  if ( IsDebug() ) printf(" First PAMELA flight calibration at time %i \n",fromtime);
2752                  fromtime = 0;// the first flight calibration was taken at about  1156429100 s, this line allow to analyze first runs in raw mode                  fromtime = 0;// the first flight calibration was taken at about  1156429100 s, this line allow to analyze first runs in raw mode
2753                };                };
# Line 2877  void PamelaDBOperations::HandleTRK_CALIB Line 2892  void PamelaDBOperations::HandleTRK_CALIB
2892        // no calibrations in the db contain our calibration        // no calibrations in the db contain our calibration
2893        //        //
2894        if ( IsDebug() ) printf(" Calibration with fromtime lower than others to be inserted in the DB\n");        if ( IsDebug() ) printf(" Calibration with fromtime lower than others to be inserted in the DB\n");
2895        if ( fromtime < 1150863400 ) fromtime = 0; // the first flight calibration was taken at about 1150863300 s, this line allows to analyze first runs in raw mode        if ( fromtime < 1150867000 ) fromtime = 0; // the first flight calibration was taken at about 1150863300 s, this line allows to analyze first runs in raw mode
2896        //        //
2897        oss.str("");        oss.str("");
2898        oss << " SELECT FROM_TIME FROM GL_TRK_CALIB WHERE "        oss << " SELECT FROM_TIME FROM GL_TRK_CALIB WHERE "
# Line 3233  Int_t PamelaDBOperations::insertS4_CALIB Line 3248  Int_t PamelaDBOperations::insertS4_CALIB
3248            // no calibrations in the db contain our calibration            // no calibrations in the db contain our calibration
3249            //            //
3250            if ( IsDebug() ) printf(" Calibration with fromtime lower than others to be inserted in the DB \n");            if ( IsDebug() ) printf(" Calibration with fromtime lower than others to be inserted in the DB \n");
3251            if ( fromtime < 1150863400 ){            if ( fromtime < 1150867000 ){  
3252              if ( IsDebug() ) printf(" First PAMELA flight calibration at time %i \n",fromtime);              if ( IsDebug() ) printf(" First PAMELA flight calibration at time %i \n",fromtime);
3253              fromtime = 0;// the first flight calibration was taken at about  1156429100 s, this line allow to analyze first runs in raw mode              fromtime = 0;// the first flight calibration was taken at about  1156429100 s, this line allow to analyze first runs in raw mode
3254            };            };

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

  ViewVC Help
Powered by ViewVC 1.1.23