/[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.21 by mocchiut, Mon Jan 12 18:23:37 2009 UTC revision 1.28 by mocchiut, Mon Dec 14 13:20:37 2009 UTC
# Line 185  void PamelaDBOperations::OpenL0File(TStr Line 185  void PamelaDBOperations::OpenL0File(TStr
185            if ( !chboot ){            if ( !chboot ){
186              qu.str("");              qu.str("");
187              //      qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<10000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<7200 group by BOOT_NUMBER order by BOOT_NUMBER asc;";              //      qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<10000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<7200 group by BOOT_NUMBER order by BOOT_NUMBER asc;";
188              qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<20000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<40000 group by BOOT_NUMBER order by BOOT_NUMBER asc;"; // relax conditions... 090112 [8RED: error -29]              //      qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<40000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<40000 group by BOOT_NUMBER order by BOOT_NUMBER asc;"; // relax conditions... 090112 [8RED: error -29]
189                qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<50000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<50000 group by BOOT_NUMBER order by BOOT_NUMBER asc;"; // even more relaxed conditions... 091214 [9REDtest3: error -29]
190              if ( debug ) printf(" chewbacca: query is %s \n",qu.str().c_str());              if ( debug ) printf(" chewbacca: query is %s \n",qu.str().c_str());
191              result3 = conn->Query(qu.str().c_str());              result3 = conn->Query(qu.str().c_str());
192              if ( result3 ){              if ( result3 ){
# Line 427  void PamelaDBOperations::SetOrbitNo(UInt Line 428  void PamelaDBOperations::SetOrbitNo(UInt
428        if ( IsDebug() ) printf(" Agh problems determining the orbit number! name = %s \n",name.Data());        if ( IsDebug() ) printf(" Agh problems determining the orbit number! name = %s \n",name.Data());
429        return;        return;
430      };      };
431      TString dwo = 0;      TString dwo = "";
432      for (Int_t i = 0; i<5; i++){      for (Int_t i = 0; i<5; i++){
433        dwo.Append(name[i],1);        dwo.Append(name[i],1);
434      };      };
# Line 857  Int_t PamelaDBOperations::SetUpperLimits Line 858  Int_t PamelaDBOperations::SetUpperLimits
858    //  if ( nevent < jump ) jump = int(nevent/10);    //  if ( nevent < jump ) jump = int(nevent/10);
859    //  if ( !jump ) jump = 1;    //  if ( !jump ) jump = 1;
860    //    //
861    if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) && nevent > deltapkt ){  
862      if ( ((PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt)) && nevent > deltapkt ){
863      //      //
864      if ( IsDebug() ) printf(" starting jump %i \n",jump);      if ( IsDebug() ) printf(" starting jump %i \n",jump);
865      //    if ( IsDebug() ) printf(" (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) > OBT(obtfirst)) %llu < %llu && %llu > %llu \n     OR \n     (PKT(pktlast) > PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) %llu > %llu && %llu < %llu \n",PKT(pktlast),PKT(pktfirst),OBT(obtlast),OBT(obtfirst),PKT(pktlast),PKT(pktfirst),OBT(obtlast),OBT(obtfirst));      //    if ( IsDebug() ) printf(" (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) > OBT(obtfirst)) %llu < %llu && %llu > %llu \n     OR \n     (PKT(pktlast) > PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) %llu > %llu && %llu < %llu \n",PKT(pktlast),PKT(pktfirst),OBT(obtlast),OBT(obtfirst),PKT(pktlast),PKT(pktfirst),OBT(obtlast),OBT(obtfirst));
# Line 1504  void PamelaDBOperations::FillClass(Bool_ Line 1506  void PamelaDBOperations::FillClass(Bool_
1506      glrun->SetRUNTRAILER_PKT(lastPkt);      glrun->SetRUNTRAILER_PKT(lastPkt);
1507      //          //    
1508    };    };
1509      //
1510      // ad hoc solution for INF EV_TO [8RED] 090113
1511      //
1512      if ( !firstev && lastev == -1 ){
1513        if ( IsDebug() ) printf(" EE firstev %i lastev %i nevents %i \n",firstev,lastev,lastev-firstev+1);
1514        firstev = 1;
1515        lastev = 0;
1516      };
1517    glrun->SetEV_FROM((UInt_t)firstev);    glrun->SetEV_FROM((UInt_t)firstev);
1518    glrun->SetEV_TO((UInt_t)lastev);    glrun->SetEV_TO((UInt_t)lastev);
1519    glrun->SetNEVENTS((UInt_t)lastev-(UInt_t)firstev+1);    glrun->SetNEVENTS((UInt_t)lastev-(UInt_t)firstev+1);
# Line 3363  void PamelaDBOperations::HandleRunFragme Line 3373  void PamelaDBOperations::HandleRunFragme
3373            glrun->SetID_RUN_FRAG(IDRL2B);            glrun->SetID_RUN_FRAG(IDRL2B);
3374            glrun->Fill_GL_RUN(conn);                glrun->Fill_GL_RUN(conn);    
3375            glrun->DeleteRun(conn,0,"GL_RUN_FRAGMENTS");            glrun->DeleteRun(conn,0,"GL_RUN_FRAGMENTS");
3376              delete glA;
3377            //            //
3378          } else {          } else {
3379            //            //
# Line 4226  Int_t PamelaDBOperations::insertCALO_CAL Line 4237  Int_t PamelaDBOperations::insertCALO_CAL
4237    UInt_t totime = 0;    UInt_t totime = 0;
4238    UInt_t obt = 0;    UInt_t obt = 0;
4239    UInt_t pkt = 0;    UInt_t pkt = 0;
4240      Float_t totped = 0.;
4241    //    //
4242    tr = (TTree*)file->Get("CalibCalPed");    tr = (TTree*)file->Get("CalibCalPed");
4243    if ( !tr || tr->IsZombie() ) throw -21;    if ( !tr || tr->IsZombie() ) throw -21;
# Line 4243  Int_t PamelaDBOperations::insertCALO_CAL Line 4255  Int_t PamelaDBOperations::insertCALO_CAL
4255        if ( calibCalPed->cstwerr[section] ){        if ( calibCalPed->cstwerr[section] ){
4256          valid = 1;          valid = 1;
4257          if ( calibCalPed->cperror[section] ) valid = 0;          if ( calibCalPed->cperror[section] ) valid = 0;
4258            //
4259            // check pedestal values for one plane, if all zeros calibration is not valid (calorimeter power problems) [8th data reduction bug, fixed on 25/11/2009 by E.M.]
4260            //
4261            totped = 0.;
4262            Int_t ns = 0;
4263            if ( section == 2 ) ns = 3;
4264            if ( section == 3 ) ns = 1;
4265            if ( section == 1 ) ns = 2;
4266            for (UInt_t ss=0; ss<96; ss++){
4267              totped += fabs(calibCalPed->calped[ns][0][ss]);
4268            }
4269            if ( totped < 1. ){
4270              if ( IsDebug() ) printf(" Section %i totped %f -  No calibration data! Calorimeter power problems? \n",section,totped);
4271              valid = 0;
4272            };
4273            //
4274          ph = eh->GetPscuHeader();          ph = eh->GetPscuHeader();
4275          obt = ph->GetOrbitalTime();            obt = ph->GetOrbitalTime();  
4276          pkt = ph->GetCounter();            pkt = ph->GetCounter();  
# Line 4410  Int_t PamelaDBOperations::insertCALOPULS Line 4438  Int_t PamelaDBOperations::insertCALOPULS
4438    tr->SetBranchAddress("Header", &eh);    tr->SetBranchAddress("Header", &eh);
4439    nevents = tr->GetEntries();    nevents = tr->GetEntries();
4440    //    //
4441      Float_t totpul = 0.;
4442      //
4443    if ( nevents > 0 ){    if ( nevents > 0 ){
4444      //      //
4445      for (UInt_t i=0; i < nevents; i++){      for (UInt_t i=0; i < nevents; i++){
# Line 4419  Int_t PamelaDBOperations::insertCALOPULS Line 4449  Int_t PamelaDBOperations::insertCALOPULS
4449          if ( cp1->pstwerr[section] && cp1->unpackError == 0 ){          if ( cp1->pstwerr[section] && cp1->unpackError == 0 ){
4450            valid = 1;            valid = 1;
4451            if ( cp1->pperror[section] ) valid = 0;            if ( cp1->pperror[section] ) valid = 0;
4452              //
4453              // check pulse values for one plane, if all zeros calibration is not valid (calorimeter power problems) [8th data reduction bug, fixed on 25/11/2009 by E.M.]
4454              //
4455              totpul = 0.;
4456              Int_t ns = 0;
4457              if ( section == 2 ) ns = 3;
4458              if ( section == 3 ) ns = 1;
4459              if ( section == 1 ) ns = 2;
4460              for (UInt_t ss=0; ss<96; ss++){
4461                totpul += cp1->calpuls[ns][0][ss];
4462              }
4463              if ( totpul >= 3145632. ){
4464                if ( IsDebug() ) printf(" PULSE1 Section %i totpul %f -  No calibration data! Calorimeter power problems? \n",section,totpul);
4465                valid = 0;
4466              };
4467              //
4468            ph = eh->GetPscuHeader();            ph = eh->GetPscuHeader();
4469            obt = ph->GetOrbitalTime();              obt = ph->GetOrbitalTime();  
4470            pkt = ph->GetCounter();              pkt = ph->GetCounter();  
# Line 4576  Int_t PamelaDBOperations::insertCALOPULS Line 4622  Int_t PamelaDBOperations::insertCALOPULS
4622          if ( cp2->pstwerr[section] && cp2->unpackError == 0 ){          if ( cp2->pstwerr[section] && cp2->unpackError == 0 ){
4623            valid = 1;            valid = 1;
4624            if ( cp2->pperror[section] ) valid = 0;            if ( cp2->pperror[section] ) valid = 0;
4625              //
4626              // check pulse values for one plane, if all zeros calibration is not valid (calorimeter power problems) [8th data reduction bug, fixed on 25/11/2009 by E.M.]
4627              //
4628              totpul = 0.;
4629              Int_t ns = 0;
4630              if ( section == 2 ) ns = 3;
4631              if ( section == 3 ) ns = 1;
4632              if ( section == 1 ) ns = 2;
4633              for (UInt_t ss=0; ss<96; ss++){
4634                totpul += cp2->calpuls[ns][0][ss];
4635              }
4636              if ( totpul >= 3145632. ){
4637                if ( IsDebug() ) printf(" PULSE2 Section %i totpul %f -  No calibration data! Calorimeter power problems? \n",section,totpul);
4638                valid = 0;
4639              };
4640              //
4641            ph = eh->GetPscuHeader();            ph = eh->GetPscuHeader();
4642            obt = ph->GetOrbitalTime();              obt = ph->GetOrbitalTime();  
4643            pkt = ph->GetCounter();              pkt = ph->GetCounter();  
# Line 6121  Int_t PamelaDBOperations::CleanGL_RUN_FR Line 6183  Int_t PamelaDBOperations::CleanGL_RUN_FR
6183                row2 = result2->Next();                row2 = result2->Next();
6184                //                //
6185                if ( row2 ){                if ( row2 ){
6186                  if ( IsDebug() ) printf(" The already exist in the GL_RUN table! \n");                  if ( IsDebug() ) printf(" The run already exists in the GL_RUN table! \n");
6187                  if ( PEDANTIC ) throw -83;                  if ( PEDANTIC ) throw -83;
6188                  row2->Close();                  row2->Close();
6189                };                };
# Line 6198  Int_t PamelaDBOperations::CleanGL_RUN_FR Line 6260  Int_t PamelaDBOperations::CleanGL_RUN_FR
6260        glrun->Query_GL_RUN_FRAGMENTS(oss.str().c_str(),conn);          glrun->Query_GL_RUN_FRAGMENTS(oss.str().c_str(),conn);  
6261        //        //
6262        oss.str("");        oss.str("");
6263        oss << " SELECT ID,NEVENTS,TRK_CALIB_USED,PKT_COUNTER FROM GL_RUN WHERE "        oss << " SELECT ID,NEVENTS,TRK_CALIB_USED,PKT_COUNTER,ID_ROOT_L0 FROM GL_RUN WHERE "
6264            << " BOOT_NUMBER=" << glrun->GetBOOT_NUMBER() << " AND ("            << " BOOT_NUMBER=" << glrun->GetBOOT_NUMBER() << " AND ("
6265            << " (RUNHEADER_TIME>=" << (UInt_t)(glrun->GetRUNHEADER_TIME()-10) << " AND "            << " (RUNHEADER_TIME>=" << (UInt_t)(glrun->GetRUNHEADER_TIME()-10) << " AND "
6266            << " RUNTRAILER_TIME<=" << (UInt_t)(glrun->GetRUNTRAILER_TIME()+10) << " AND ("            << " RUNTRAILER_TIME<=" << (UInt_t)(glrun->GetRUNTRAILER_TIME()+10) << " AND ("
# Line 6256  Int_t PamelaDBOperations::CleanGL_RUN_FR Line 6318  Int_t PamelaDBOperations::CleanGL_RUN_FR
6318          moved++;          moved++;
6319          //          //
6320        } else {        } else {
6321          if ( IsDebug() ) printf(" The already exist in the GL_RUN table! \n");  
6322          if ( PEDANTIC ) throw -83;          // questa parte mah mah mah... da controllare
6323    
6324            //
6325            // we end up here if chewbacca and we have RH---| small gap |---RT, in this case the two pieces are attached and moved to GL_RUN. We are now processing the
6326            // "small gap" piece... we recognize this since: we have two entries from this query, the pkt number is consistent with our pkt number.
6327            //
6328            // 090112 [8RED (-70): RUN ALREADY INSERTED]
6329            //
6330            Bool_t OK = false;
6331            UInt_t IDRL2A = 0;
6332            UInt_t IDRL2B = 0;
6333              if ( result2->GetRowCount() == 2 ){
6334                IDRL2A = (UInt_t)atoll(row2->GetField(0));
6335                UInt_t IDRL0A = (UInt_t)atoll(row2->GetField(4));
6336                row2 = result2->Next();
6337                IDRL2B = (UInt_t)atoll(row2->GetField(0));
6338                UInt_t IDRL0B = (UInt_t)atoll(row2->GetField(4));
6339                if ( IsDebug() ) printf(" IDRL0A %u B %u IDRL2A %u B %u \n",IDRL0A,IDRL0B,IDRL2A,IDRL2B);
6340                //      if ( IDRL0A == IDRL0B ){
6341    //            TSQLResult *result2a = 0;
6342    //            TSQLRow    *row2a    = 0;
6343    //            oss.str("");
6344    //            oss << "select PKT_NUMBER_FINAL from ROOT_TABLE_MERGING where REAL_TIME_INIT<" << chrtinit << " order by REAL_TIME_INIT desc limit 1;";
6345    //            if ( IsDebug() ) printf(" Check if we are in the case RH---| small gap |---RT: query is \n %s \n",oss.str().c_str());
6346    //            result2a = conn->Query(oss.str().c_str());
6347    //            //
6348    //            if ( !result2a ) throw -4;
6349    //            //
6350    //            row2a = result2a->Next();
6351    //            //
6352    //            if ( row2a ){
6353    //              UInt_t PKA = (UInt_t)atoll(row2a->GetField(0));
6354    //              delete result2a;
6355    //              oss.str("");
6356    //              oss << "select PKT_NUMBER_INIT from ROOT_TABLE_MERGING where REAL_TIME_INIT>" << chrtinit << " order by REAL_TIME_INIT asc limit 1;";
6357    //              if ( IsDebug() ) printf(" Check if we are in the case RH---| small gap |---RT: query is \n %s \n",oss.str().c_str());
6358    //              result2a = conn->Query(oss.str().c_str());
6359    //              //
6360    //              if ( !result2a ) throw -4;
6361    //              //
6362    //              row2a = result2a->Next();
6363    //              //
6364    //              if ( row2a ){
6365    //                UInt_t PKB = (UInt_t)atoll(row2a->GetField(0));
6366    //                //
6367    //                if ( IsDebug() ) printf(" PKT(PKA) + 1 %llu == runheaderpkt %llu && PKB = runtrailer %llu + 1 %llu \n",PKT(PKA)+1LL, PKT(glrun->GetRUNHEADER_PKT()),PKT(PKB), PKT(glrun->GetRUNTRAILER_PKT())+1LL);
6368    //                if ( PKT(PKA)+1LL == PKT(glrun->GetRUNHEADER_PKT()) && PKT(PKB) == PKT(glrun->GetRUNTRAILER_PKT())+1LL ){
6369    //                  if ( IsDebug() ) printf(" Ok, we are in the case: RH---| small gap |---RT \n");
6370                        OK = true;
6371                        //            };
6372                        //          };
6373                        //        };                  
6374                        //    };
6375              };      
6376            if ( OK ){
6377              //
6378              // this is the case in which we must insert a piece of run between two fragments in the GL_RUN table
6379              //
6380              // we have to update with runheader/trailer infos our run and we have to change the ROOT_ID_FRAG of the header piece ( 1/2 2/1 must become 1/3 3/2 2/1 )
6381              //
6382              GL_RUN *glA = new GL_RUN();
6383              glA->Query_GL_RUN(IDRL2A,conn);
6384              //
6385              if ( glA->GetACQ_BUILD_INFO() != 0 ){
6386                //
6387                // the first piece contains a good runheader we can update all the other runs with correct infos!
6388                //
6389                oss.str("");
6390                oss << "UPDATE GL_RUN_FRAGMENTS SET "
6391                    << " RUNHEADER_TIME=" << glA->GetRUNHEADER_TIME()<< " , "
6392                    << " RUNHEADER_OBT=" << glA->GetRUNHEADER_OBT()<< " , "
6393                    << " RUNHEADER_PKT=" << glA->GetRUNHEADER_PKT()<< " , "
6394                    << " COMPILATIONTIMESTAMP=" << glA->GetCOMPILATIONTIMESTAMP()<< " , "
6395                    << " FAV_WRK_SCHEDULE=" << glA->GetFAV_WRK_SCHEDULE()<< " , "
6396                    << " EFF_WRK_SCHEDULE=" << glA->GetEFF_WRK_SCHEDULE()<< " , "
6397                    << " PRH_VAR_TRG_MODE_A=" << glA->GetPRH_VAR_TRG_MODE_A()<< " , "
6398                    << " PRH_VAR_TRG_MODE_B=" << glA->GetPRH_VAR_TRG_MODE_B()<< " , "
6399                    << " ACQ_BUILD_INFO=" << glA->GetACQ_BUILD_INFO()<< " , "
6400                    << " ACQ_VAR_INFO=" << glA->GetACQ_VAR_INFO()<< " , "
6401                    << " RM_ACQ_AFTER_CALIB=" << glA->GetRM_ACQ_AFTER_CALIB()<< " , "  
6402                    << " RM_ACQ_SETTING_MODE=" << glA->GetRM_ACQ_SETTING_MODE()<< " , "  
6403                    << " TRK_CALIB_USED=" << glA->GetTRK_CALIB_USED()<< " , "  
6404                    << " CAL_DSP_MASK=" << glA->GetCAL_DSP_MASK()<< " , "  
6405                    << " LAST_TIMESYNC=" << glA->GetLAST_TIMESYNC()<< " , ";
6406                //
6407                if ( glA->GetPHYSENDRUN_MASK_S3S2S12() )
6408                  oss << " PHYSENDRUN_MASK_S3S2S12=" << glA->GetPHYSENDRUN_MASK_S3S2S12() << " , ";
6409                if ( glA->GetPHYSENDRUN_MASK_S11CRC() )
6410                  oss << " PHYSENDRUN_MASK_S11CRC=" << glA->GetPHYSENDRUN_MASK_S11CRC() << " , ";
6411                //        
6412                oss << " OBT_TIMESYNC=" << glA->GetOBT_TIMESYNC();
6413                oss << " WHERE ID=" << glrun->GetID() << ";";
6414                if ( IsDebug() ) printf(" update with correct infos: %s\n",oss.str().c_str());
6415                conn->Query(oss.str().c_str());    
6416                //
6417              } else {
6418                //
6419                // sig no runheader, let set anyway what is possible...
6420                //
6421                oss.str("");
6422                oss << "UPDATE GL_RUN_FRAGMENTS SET "
6423                    << " RUNHEADER_TIME=" << glA->GetRUNHEADER_TIME()<< " , ";
6424                //
6425                if ( glA->GetPHYSENDRUN_MASK_S3S2S12() )
6426                  oss << " PHYSENDRUN_MASK_S3S2S12=" << glA->GetPHYSENDRUN_MASK_S3S2S12()<< " , ";
6427                if ( glA->GetPHYSENDRUN_MASK_S11CRC() )
6428                  oss << " PHYSENDRUN_MASK_S11CRC=" << glA->GetPHYSENDRUN_MASK_S11CRC()<< " , ";
6429                //        
6430                oss << " RUNHEADER_OBT=" << glA->GetRUNHEADER_OBT()<< " , "
6431                    << " RUNHEADER_PKT=" << glA->GetRUNHEADER_PKT();
6432                oss << " WHERE ID=" << glrun->GetID() << ";";
6433                if ( IsDebug() ) printf(" update with correct infos2: %s\n",oss.str().c_str());
6434                conn->Query(oss.str().c_str());    
6435              };
6436              //
6437              // update runheader ROOT_ID_FRAG
6438              //
6439              oss.str("");
6440              oss << "UPDATE GL_RUN SET ID_RUN_FRAG = " << glrun->GetID() << " where ID = " << IDRL2A << ";";
6441              if ( IsDebug() ) printf(" update gl_run to have cross indexing: %s\n",oss.str().c_str());
6442              conn->Query(oss.str().c_str());
6443              //
6444              // now let's look for runtrailer if any in the last run
6445              //
6446              glA->Query_GL_RUN(IDRL2B,conn);
6447              //
6448              if ( glA->GetPKT_READY_COUNTER() != 0 ){
6449                //
6450                // the first piece contains a good runtrailer we can update all the other runs with correct infos!
6451                //
6452                oss.str("");
6453                oss << "UPDATE GL_RUN_FRAGMENTS SET "
6454                    << " RUNTRAILER_TIME=" << glA->GetRUNTRAILER_TIME()<< " , "
6455                    << " RUNTRAILER_OBT=" << glA->GetRUNTRAILER_OBT()<< " , "
6456                    << " RUNTRAILER_PKT=" << glA->GetRUNTRAILER_PKT()<< " , "
6457                    << " PKT_COUNTER=" << glA->GetPKT_COUNTER()<< " , ";
6458                //
6459                if ( glA->GetPHYSENDRUN_MASK_S3S2S12() ){
6460                  oss << " PHYSENDRUN_MASK_S3S2S12=" << glA->GetPHYSENDRUN_MASK_S3S2S12()<< " , "; };
6461                if ( glA->GetPHYSENDRUN_MASK_S11CRC() ) {
6462                  oss << " PHYSENDRUN_MASK_S11CRC=" << glA->GetPHYSENDRUN_MASK_S11CRC()<< " , "; };
6463                //        
6464                oss << " PKT_READY_COUNTER=" << glA->GetPKT_READY_COUNTER()
6465                    << " WHERE ID=" << glrun->GetID() << ";";
6466                if ( IsDebug() ) printf(" update with correct trailer infos: %s\n",oss.str().c_str());
6467                conn->Query(oss.str().c_str());    
6468                //
6469              } else {
6470                //
6471                // sig no runtrailer, let set anyway what is possible...
6472                //
6473                oss.str("");
6474                oss << "UPDATE GL_RUN_FRAGMENTS SET "
6475                    << " RUNTRAILER_TIME=" << glA->GetRUNTRAILER_TIME()<< " , "
6476                    << " RUNTRAILER_OBT=" << glA->GetRUNTRAILER_OBT()<< " , ";
6477                  //
6478                if ( glA->GetPHYSENDRUN_MASK_S3S2S12() ){
6479                  oss << " PHYSENDRUN_MASK_S3S2S12=" << glA->GetPHYSENDRUN_MASK_S3S2S12()<< " , "; };
6480                if ( glA->GetPHYSENDRUN_MASK_S11CRC() ){
6481                  oss << " PHYSENDRUN_MASK_S11CRC=" << glA->GetPHYSENDRUN_MASK_S11CRC()<< " , "; };
6482                //        
6483                oss << " RUNTRAILER_PKT=" << glrun->GetRUNTRAILER_PKT()
6484                    << " WHERE ID=" << glrun->GetID() << ";";
6485                if ( IsDebug() ) printf(" update with correct trailer infos2: %s\n",oss.str().c_str());
6486                conn->Query(oss.str().c_str());    
6487              };
6488              //
6489              UInt_t myi = glrun->GetID();
6490              oss.str("");
6491              oss << " ID= "<< myi;
6492              //
6493              glrun->Query_GL_RUN_FRAGMENTS(oss.str().c_str(),conn);  
6494              //
6495              // fill the new run in GL_RUN
6496              //
6497              glrun->SetID_RUN_FRAG(IDRL2B);
6498              glrun->Fill_GL_RUN(conn);    
6499              glrun->DeleteRun(conn,0,"GL_RUN_FRAGMENTS");
6500              delete glA;
6501              moved++;
6502              //
6503            } else {
6504              //
6505              // is just a repetition
6506              //
6507              if ( IsDebug() ) printf(" The run %u is already present in the GL_RUN table...\n",glrun->GetID());    
6508              //      printf(" CCCCCCCCICCCCCCCCCCCCIOOOOOOOOOO si muove Ciccio! %u \n",glrun->GetID());
6509              //      if ( PEDANTIC && glrun->GetID() != 61563 ) throw -83;
6510              if ( PEDANTIC ) throw -83;
6511            };
6512            //      if ( IsDebug() ) printf(" The run already exists in the GL_RUN table! ...\n");
6513            //      if ( PEDANTIC ) throw -83;
6514        };        };
6515        if ( IsDebug() ) printf(" Delete run %s from the GL_RUN_FRAGMENTS table \n",row->GetField(0));              if ( IsDebug() ) printf(" Delete run %s from the GL_RUN_FRAGMENTS table \n",row->GetField(0));      
6516        //        //

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.23