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

Diff of /chewbacca/YodaProfiler/src/PamelaDBOperations.cpp

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

revision 1.36 by mocchiut, Wed Apr 10 11:29:38 2013 UTC revision 1.39 by mocchiut, Tue Oct 14 12:59:14 2014 UTC
# Line 1366  void PamelaDBOperations::CheckConnection Line 1366  void PamelaDBOperations::CheckConnection
1366    stringstream oss;    stringstream oss;
1367    //      //  
1368    oss.str("");    oss.str("");
1369    oss << "SET time_zone='+0:00';";    oss << "SET time_zone='+0:00'; SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';";
1370    TSQLResult *result = 0;    TSQLResult *result = 0;
1371    result = conn->Query(oss.str().c_str());    result = conn->Query(oss.str().c_str());
1372    if ( !result ) throw -10;    if ( !result ) throw -10;
# Line 1658  Int_t PamelaDBOperations::insertPamelaRa Line 1658  Int_t PamelaDBOperations::insertPamelaRa
1658  Int_t PamelaDBOperations::insertPamelaGL_TIMESYNC(){  Int_t PamelaDBOperations::insertPamelaGL_TIMESYNC(){
1659    //    //
1660    Int_t signal = 0;    Int_t signal = 0;
1661    UInt_t idresof = 0;    //  UInt_t idresof = 0;
1662      idresof = 0;
1663    stringstream   oss;    stringstream   oss;
1664    TSQLResult *result = 0;    TSQLResult *result = 0;
1665    TSQLRow *row = 0;    TSQLRow *row = 0;
# Line 1972  Int_t PamelaDBOperations::insertPamelaRo Line 1973  Int_t PamelaDBOperations::insertPamelaRo
1973      //      //
1974      if ( chewbacca ){      if ( chewbacca ){
1975          oss.str("");          oss.str("");
1976          oss << " SELECT ID FROM GL_TIMESYNC where TIMESYNC="<<chlastts<<" AND OBT0="<<chobtts*1000<<" limit 1;";          oss << " SELECT ID FROM GL_TIMESYNC where TIMESYNC="<<chlastts<<" AND OBT0="<<chobtts*1000<<" and ID_RESURS_OFFSET="<< idresof <<" limit 1;"; // 10RED BUG!!!! without 'and ID_RESURS_OFFSET="<< idresof ' this query is not enough to ensure finding the correct line in GL_TIMSYNC...
1977          if ( debug ) printf(" %s \n",oss.str().c_str());          if ( debug ) printf(" %s \n",oss.str().c_str());
1978          result = conn->Query(oss.str().c_str());          result = conn->Query(oss.str().c_str());
1979          //          //
# Line 2976  void PamelaDBOperations::HandleRunFragme Line 2977  void PamelaDBOperations::HandleRunFragme
2977          if ( IsDebug() ) printf(" here firstev is %i lastev is %i \n",firstev,lastev);          if ( IsDebug() ) printf(" here firstev is %i lastev is %i \n",firstev,lastev);
2978          //          //
2979          glrun->SetEV_FROM(firstev);          glrun->SetEV_FROM(firstev);
2980            glrun->SetEV_TO(lastev); // EM 10 RED ghost run bug
2981          glrun->SetNEVENTS(lastev-firstev+1);          glrun->SetNEVENTS(lastev-firstev+1);
2982          //          //
2983          glrun->SetRUNHEADER_TIME(glrun1->GetRUNHEADER_TIME());          glrun->SetRUNHEADER_TIME(glrun1->GetRUNHEADER_TIME());
# Line 3171  void PamelaDBOperations::HandleRunFragme Line 3173  void PamelaDBOperations::HandleRunFragme
3173          };          };
3174          if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu lastev is %i\n",apkt,bpkt,aobt,bobt,lastev);          if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu lastev is %i\n",apkt,bpkt,aobt,bobt,lastev);
3175          //          //
3176            glrun->SetEV_FROM(firstev); // EM 10RED ghost run bug
3177          glrun->SetEV_TO(lastev);          glrun->SetEV_TO(lastev);
3178          glrun->SetNEVENTS(lastev-firstev+1);          glrun->SetNEVENTS(lastev-firstev+1);
3179          glrun->SetPKT_COUNTER(glrun1->GetPKT_COUNTER());          glrun->SetPKT_COUNTER(glrun1->GetPKT_COUNTER());
# Line 4013  Bool_t PamelaDBOperations::IsRunConsiste Line 4016  Bool_t PamelaDBOperations::IsRunConsiste
4016                  glrun1->SetRUNTRAILER_PKT(glrun->GetRUNTRAILER_PKT());                  glrun1->SetRUNTRAILER_PKT(glrun->GetRUNTRAILER_PKT());
4017                  //                  //
4018                  glrun->SetEV_FROM(firstev);                  glrun->SetEV_FROM(firstev);
4019                    glrun->SetEV_TO(lastev); // 10 RED ghost run bug
4020                  glrun->SetNEVENTS(lastev-firstev+1);                  glrun->SetNEVENTS(lastev-firstev+1);
4021                  //                  //
4022                  glrun->SetRUNHEADER_TIME(glrun1->GetRUNHEADER_TIME());                  glrun->SetRUNHEADER_TIME(glrun1->GetRUNHEADER_TIME());
# Line 5742  Int_t PamelaDBOperations::insertTRK_CALI Line 5746  Int_t PamelaDBOperations::insertTRK_CALI
5746                // ---------------------------------------------------------------------                // ---------------------------------------------------------------------
5747                UInt_t idtimesync = 0;                UInt_t idtimesync = 0;
5748                oss.str("");                oss.str("");
5749                oss << " SELECT ID FROM GL_TIMESYNC where TIMESYNC="<<chlastts<<" AND OBT0="<<chobtts*1000<<" limit 1;";                oss << " SELECT ID FROM GL_TIMESYNC where TIMESYNC="<<chlastts<<" AND OBT0="<<chobtts*1000<<" and ID_RESURS_OFFSET="<< idresof <<" limit 1;"; // 10RED BUG!!!! without 'and ID_RESURS_OFFSET="<< idresof ' this query is not enough to ensure finding the correct line in GL_TIMSYNC...
5750                if ( debug ) printf(" %s \n",oss.str().c_str());                if ( debug ) printf(" %s \n",oss.str().c_str());
5751                result = conn->Query(oss.str().c_str());                result = conn->Query(oss.str().c_str());
5752                if ( !result ) throw -3;                if ( !result ) throw -3;

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.39

  ViewVC Help
Powered by ViewVC 1.1.23