/[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.48 by mocchiut, Fri Aug 31 08:58:08 2007 UTC revision 1.49 by mocchiut, Mon Sep 3 08:49:20 2007 UTC
# Line 4704  UInt_t PamelaDBOperations::Check(){ Line 4704  UInt_t PamelaDBOperations::Check(){
4704    if ( !result ) throw -4;;    if ( !result ) throw -4;;
4705    //    //
4706    row = result->Next();    row = result->Next();
4707      UInt_t nid = 0;
4708    //    //
4709    while ( row ){    while ( row ){
4710        nid++;
4711        if ( !(nid%1000) && nid ) printf(" %iK run scanned \n",nid/1000);
4712      thisid = (UInt_t)atoll(row->GetField(0));      thisid = (UInt_t)atoll(row->GetField(0));
4713      thisl0id = (UInt_t)atoll(row->GetField(1));      thisl0id = (UInt_t)atoll(row->GetField(1));
4714      thisrht = (UInt_t)atoll(row->GetField(2));      thisrht = (UInt_t)atoll(row->GetField(2));
# Line 4717  UInt_t PamelaDBOperations::Check(){ Line 4720  UInt_t PamelaDBOperations::Check(){
4720        //        //
4721        oss.str("");        oss.str("");
4722        oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!="        oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!="
4723            << thisid << " AND RUNHEADER_TIME="            << thisid << " AND ( RUNHEADER_TIME="
4724            << thisrht << " AND RUNTRAILER_TIME!="            << thisrht << " OR RUNTRAILER_TIME="
4725            << thisrtt << " AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;";            << thisrtt << " ) AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;";
4726        result3 = conn->Query(oss.str().c_str());        result3 = conn->Query(oss.str().c_str());
4727        if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str());        if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str());
4728        if ( result3 ){        if ( result3 ){
         row3 = result3->Next();  
4729          //          //
4730          while ( row3 ){          oss.str("");
4731            //          oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!="
4732            // 2 runs with same runheader              << thisid << " AND RUNHEADER_TIME="
4733            //              << thisrht << " AND RUNTRAILER_TIME!="
4734            printf(" CHECK n.4 RUNs %u and %u HAVE SAME RUNHEADER \n",thisid,(UInt_t)atoll(row3->GetField(0)));                  << thisrtt << " AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;";
4735            result3 = conn->Query(oss.str().c_str());
4736            if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str());
4737            if ( result3 ){
4738            row3 = result3->Next();            row3 = result3->Next();
4739              //
4740              while ( row3 ){
4741                //
4742                // 2 runs with same runheader
4743                //
4744                printf(" CHECK n.4 RUNs %u and %u HAVE SAME RUNHEADER \n",thisid,(UInt_t)atoll(row3->GetField(0)));  
4745                row3 = result3->Next();
4746              };
4747          };          };
       };  
       //  
       oss.str("");  
       oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!="  
           << thisid << " AND RUNHEADER_TIME!="  
           << thisrht << " AND RUNTRAILER_TIME="  
           << thisrtt << " AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;";  
       result3 = conn->Query(oss.str().c_str());  
       if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str());  
       if ( result3 ){  
         row3 = result3->Next();  
4748          //          //
4749          while ( row3 ){          oss.str("");
4750            //          oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!="
4751            // 2 runs with same runtrailer              << thisid << " AND RUNHEADER_TIME!="
4752                << thisrht << " AND RUNTRAILER_TIME="
4753                << thisrtt << " AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;";
4754            result3 = conn->Query(oss.str().c_str());
4755            if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str());
4756            if ( result3 ){
4757              row3 = result3->Next();
4758            //            //
4759            printf(" CHECK n.5 RUNs %u and %u HAVE SAME RUNTRAILER \n",thisid,(UInt_t)atoll(row3->GetField(0)));            while ( row3 ){
4760                //
4761                // 2 runs with same runtrailer
4762                //
4763                printf(" CHECK n.5 RUNs %u and %u HAVE SAME RUNTRAILER \n",thisid,(UInt_t)atoll(row3->GetField(0)));
4764                row3 = result3->Next();
4765              };
4766            };
4767            //
4768            oss.str("");
4769            oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!="
4770                << thisid << " AND RUNHEADER_TIME="
4771                << thisrht << " AND RUNTRAILER_TIME="
4772                << thisrtt << " AND ID_RUN_FRAG!="
4773                << thisid << " order by RUNHEADER_TIME asc;";
4774            result3 = conn->Query(oss.str().c_str());
4775            if ( result3 ){
4776            row3 = result3->Next();            row3 = result3->Next();
4777              //
4778              while ( row3 ){
4779                //
4780                // duplicated run
4781                //
4782                printf(" CHECK n.7 RUNs %u and %u HAVE SAME RUNTRAILER AND RUNHEADER (ARE THE SAME?) \n",thisid,(UInt_t)atoll(row3->GetField(0)));
4783                row3 = result3->Next();
4784              };
4785          };          };
4786        };        };
4787        //        //
# Line 4771  UInt_t PamelaDBOperations::Check(){ Line 4803  UInt_t PamelaDBOperations::Check(){
4803          };          };
4804        };        };
4805        //        //
       oss.str("");  
       oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!="  
           << thisid << " AND RUNHEADER_TIME="  
           << thisrht << " AND RUNTRAILER_TIME="  
           << thisrtt << " AND ID_RUN_FRAG!="  
           << thisid << " order by RUNHEADER_TIME asc;";  
       result3 = conn->Query(oss.str().c_str());  
       if ( result3 ){  
         row3 = result3->Next();  
         //  
         while ( row3 ){  
           //  
           // duplicated run  
           //  
           printf(" CHECK n.7 RUNs %u and %u HAVE SAME RUNTRAILER AND RUNHEADER (ARE THE SAME?) \n",thisid,(UInt_t)atoll(row3->GetField(0)));  
           row3 = result3->Next();  
         };  
       };  
4806      };      };
4807      //      //
4808      //    if ( thisrht < prevrtt || thisrtt < prevrht || thisrht > thisrtt && !(!prevrht && !prevrtt &&!previd) ){      //    if ( thisrht < prevrtt || thisrtt < prevrht || thisrht > thisrtt && !(!prevrht && !prevrtt &&!previd) ){

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49

  ViewVC Help
Powered by ViewVC 1.1.23