/[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.52 by mocchiut, Thu Oct 25 13:23:37 2007 UTC revision 1.54 by mocchiut, Wed Feb 6 12:22:02 2008 UTC
# Line 169  void PamelaDBOperations::SetAutoBoot(Boo Line 169  void PamelaDBOperations::SetAutoBoot(Boo
169  };  };
170    
171  /**  /**
172     * Set the pedantic flag
173     *
174     */
175    void PamelaDBOperations::SetPedantic(Bool_t dbg){
176      PEDANTIC = dbg;
177    };
178    
179    /**
180   * Set the nofrag flag   * Set the nofrag flag
181   *   *
182   */   */
# Line 382  Bool_t PamelaDBOperations::SetID_RAW(){ Line 390  Bool_t PamelaDBOperations::SetID_RAW(){
390    if ( result == NULL ) throw -4;    if ( result == NULL ) throw -4;
391    row = result->Next();    row = result->Next();
392    if ( !row ) return(false);    if ( !row ) return(false);
   delete result;  
393    id = (UInt_t)atoll(row->GetField(0));    id = (UInt_t)atoll(row->GetField(0));
394      delete result;
395    return(true);    return(true);
396  }  }
397    
# Line 490  Int_t PamelaDBOperations::SetUpperLimits Line 498  Int_t PamelaDBOperations::SetUpperLimits
498    if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) && nevent > deltapkt ){    if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) && nevent > deltapkt ){
499      //      //
500      if ( IsDebug() ) printf(" starting jump %i \n",jump);      if ( IsDebug() ) printf(" starting jump %i \n",jump);
501        if ( PEDANTIC ) throw -66;
502      // go back      // go back
503      zomp = nevent - 2;      zomp = nevent - 2;
504      //      //
# Line 629  Int_t PamelaDBOperations::SetUpperLimits Line 638  Int_t PamelaDBOperations::SetUpperLimits
638        //    if ( IsDebug() ) printf(" k %i rhev before %i ph %u upperp %u oh %u uppero %u \n",k,rhev,pkth,spkth,obth,sobth);        //    if ( IsDebug() ) printf(" k %i rhev before %i ph %u upperp %u oh %u uppero %u \n",k,rhev,pkth,spkth,obth,sobth);
639        //        //
640        if ( pkth < spkth && obth < sobth ){        if ( pkth < spkth && obth < sobth ){
641            if ( PEDANTIC ) throw -66;
642          if ( IsDebug() ) printf(" RH PROBLEMS determining the event repetition at the end of the file lasthead %i  \n",rhev);          if ( IsDebug() ) printf(" RH PROBLEMS determining the event repetition at the end of the file lasthead %i  \n",rhev);
643          //          //
644          rhev = k-1;          rhev = k-1;
# Line 688  Int_t PamelaDBOperations::SetUpperLimits Line 698  Int_t PamelaDBOperations::SetUpperLimits
698        //    if ( IsDebug() ) printf(" k %i rtev beforev %i  pt %i upperp %i ot %llu uppero %llu \n",k,rtev,pktt,spktt,obtt,sobtt);        //    if ( IsDebug() ) printf(" k %i rtev beforev %i  pt %i upperp %i ot %llu uppero %llu \n",k,rtev,pktt,spktt,obtt,sobtt);
699        //        //
700        if ( pktt < spktt && obtt < sobtt ){        if ( pktt < spktt && obtt < sobtt ){
701            if ( PEDANTIC ) throw -66;
702          if ( IsDebug() ) printf(" RT PROBLEMS determining the event repetition at the end of the file lasttrail %i \n",rtev);          if ( IsDebug() ) printf(" RT PROBLEMS determining the event repetition at the end of the file lasttrail %i \n",rtev);
703          //          //
704          rtev = k-1;          rtev = k-1;
# Line 1163  Int_t PamelaDBOperations::insertPamelaGL Line 1174  Int_t PamelaDBOperations::insertPamelaGL
1174      tsync = (UInt_t)atoll(row->GetField(2));      tsync = (UInt_t)atoll(row->GetField(2));
1175      obt0 = (UInt_t)atoll(row->GetField(1));      obt0 = (UInt_t)atoll(row->GetField(1));
1176      //      //
1177        if ( PEDANTIC ) throw -67;
1178      return(1);      return(1);
1179    };    };
1180    //    //
# Line 1332  Int_t PamelaDBOperations::insertPamelaGL Line 1344  Int_t PamelaDBOperations::insertPamelaGL
1344    //    //
1345    if ( !existsts && obt0 ){ // insert timesync by hand    if ( !existsts && obt0 ){ // insert timesync by hand
1346      //      //
1347        if ( PEDANTIC ) throw -68;
1348      if ( IsDebug() ) printf(" No incl mcmd \n");      if ( IsDebug() ) printf(" No incl mcmd \n");
1349      signal = 30;      signal = 30;
1350      //      //
# Line 2038  void PamelaDBOperations::HandleRunFragme Line 2051  void PamelaDBOperations::HandleRunFragme
2051      //      //
2052    } else {    } else {
2053      if ( IsDebug() ) printf(" The run is already present in the fragment table \n");      if ( IsDebug() ) printf(" The run is already present in the fragment table \n");
2054        if ( PEDANTIC ) throw -69;
2055      return;      return;
2056    };    };
2057    //    //
# Line 2188  void PamelaDBOperations::HandleRunFragme Line 2202  void PamelaDBOperations::HandleRunFragme
2202          bpkt = PKT(ph->GetCounter());          bpkt = PKT(ph->GetCounter());
2203          bobt = OBT(ph->GetOrbitalTime());                bobt = OBT(ph->GetOrbitalTime());      
2204          firstev++;          firstev++;
2205            if ( PEDANTIC ) throw -71;
2206        };        };
2207        if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu firstev is %i\n",apkt,bpkt,aobt,bobt,firstev);        if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu firstev is %i\n",apkt,bpkt,aobt,bobt,firstev);
2208        //        //
# Line 2385  void PamelaDBOperations::HandleRunFragme Line 2400  void PamelaDBOperations::HandleRunFragme
2400          apkt = PKT(ph->GetCounter());          apkt = PKT(ph->GetCounter());
2401          aobt = OBT(ph->GetOrbitalTime());                aobt = OBT(ph->GetOrbitalTime());      
2402          lastev--;          lastev--;
2403            if ( PEDANTIC ) throw -72;
2404        };        };
2405        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);
2406        //        //
# Line 2471  void PamelaDBOperations::HandleRunFragme Line 2487  void PamelaDBOperations::HandleRunFragme
2487      //      //
2488      if ( row ){      if ( row ){
2489        if ( IsDebug() ) printf(" The run is already present in the GL_RUN table \n");        if ( IsDebug() ) printf(" The run is already present in the GL_RUN table \n");
2490          if ( PEDANTIC ) throw -70;
2491      } else {      } else {
2492        if ( NoFrag() ){        if ( NoFrag() ){
2493          glrun->SetID_RUN_FRAG(glrun->GetID());          glrun->SetID_RUN_FRAG(glrun->GetID());
# Line 3014  Int_t PamelaDBOperations::insertCALO_CAL Line 3031  Int_t PamelaDBOperations::insertCALO_CAL
3031            if ( row ){            if ( row ){
3032              //              //
3033              if ( IsDebug() ) printf(" Calo calibration already inserted in the DB\n");              if ( IsDebug() ) printf(" Calo calibration already inserted in the DB\n");
3034                if ( PEDANTIC ) throw -73;
3035              //              //
3036            } else {            } else {
3037              //              //
# Line 3101  Int_t PamelaDBOperations::insertCALO_CAL Line 3119  Int_t PamelaDBOperations::insertCALO_CAL
3119          } else {          } else {
3120            //            //
3121            if ( IsDebug() ) printf(" Repeated calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt);            if ( IsDebug() ) printf(" Repeated calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt);
3122              if ( PEDANTIC ) throw -74;
3123            //            //
3124          };                };      
3125          //                //      
# Line 3189  Int_t PamelaDBOperations::insertCALOPULS Line 3208  Int_t PamelaDBOperations::insertCALOPULS
3208              if ( row ){              if ( row ){
3209                //                //
3210                if ( IsDebug() ) printf(" Calo pulse1 calibration already inserted in the DB\n");                if ( IsDebug() ) printf(" Calo pulse1 calibration already inserted in the DB\n");
3211                  if ( PEDANTIC ) throw -75;
3212                //                //
3213              } else {              } else {
3214                //                //
# Line 3279  Int_t PamelaDBOperations::insertCALOPULS Line 3299  Int_t PamelaDBOperations::insertCALOPULS
3299            } else {            } else {
3300              //              //
3301              if ( IsDebug() ) printf(" Repeated pulse1 calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt);              if ( IsDebug() ) printf(" Repeated pulse1 calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt);
3302                if ( PEDANTIC ) throw -76;
3303              //              //
3304            };                  };      
3305            //                  //      
# Line 3343  Int_t PamelaDBOperations::insertCALOPULS Line 3364  Int_t PamelaDBOperations::insertCALOPULS
3364              if ( row ){              if ( row ){
3365                //                //
3366                if ( IsDebug() ) printf(" Calo pulse2 calibration already inserted in the DB\n");                if ( IsDebug() ) printf(" Calo pulse2 calibration already inserted in the DB\n");
3367                  if ( PEDANTIC ) throw -77;
3368                //                //
3369              } else {              } else {
3370                //                //
# Line 3476  Int_t PamelaDBOperations::insertCALOPULS Line 3498  Int_t PamelaDBOperations::insertCALOPULS
3498            } else {            } else {
3499              //              //
3500              if ( IsDebug() ) printf(" Repeated pulse2 calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt);              if ( IsDebug() ) printf(" Repeated pulse2 calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt);
3501                if ( PEDANTIC ) throw -78;
3502              //              //
3503            };                  };      
3504            //                  //      
# Line 3536  void PamelaDBOperations::HandleTRK_CALIB Line 3559  void PamelaDBOperations::HandleTRK_CALIB
3559    if ( row ){    if ( row ){
3560      //      //
3561      if ( IsDebug() ) printf(" Trk calibration already inserted in the DB\n");      if ( IsDebug() ) printf(" Trk calibration already inserted in the DB\n");
3562        if ( PEDANTIC ) throw -80;
3563      //      //
3564    } else {    } else {
3565      //      //
# Line 3801  Int_t PamelaDBOperations::insertTRK_CALI Line 3825  Int_t PamelaDBOperations::insertTRK_CALI
3825      } else {      } else {
3826        //        //
3827        if ( IsDebug() ) printf(" Repetead trk calibration1 at time %u obt %u pkt %u \n",fromtime,obt1,pkt1);        if ( IsDebug() ) printf(" Repetead trk calibration1 at time %u obt %u pkt %u \n",fromtime,obt1,pkt1);
3828          if ( PEDANTIC ) throw -79;
3829        //        //
3830      };      };
3831      //          //    
# Line 3899  Int_t PamelaDBOperations::insertS4_CALIB Line 3924  Int_t PamelaDBOperations::insertS4_CALIB
3924        if ( row ){        if ( row ){
3925          //          //
3926          if ( IsDebug() ) printf(" S4 calibration already inserted in the DB\n");          if ( IsDebug() ) printf(" S4 calibration already inserted in the DB\n");
3927            if ( PEDANTIC ) throw -81;
3928          //          //
3929        } else {        } else {
3930          //          //
# Line 3982  Int_t PamelaDBOperations::insertS4_CALIB Line 4008  Int_t PamelaDBOperations::insertS4_CALIB
4008      } else {      } else {
4009        //        //
4010        if ( IsDebug() ) printf(" Repeated S4 calibration at time %u obt %u pkt %u \n",fromtime,obt,pkt);        if ( IsDebug() ) printf(" Repeated S4 calibration at time %u obt %u pkt %u \n",fromtime,obt,pkt);
4011          if ( PEDANTIC ) throw -82;
4012        //        //
4013      };            };      
4014      //            //      
# Line 4118  Int_t PamelaDBOperations::CleanGL_RUN_FR Line 4145  Int_t PamelaDBOperations::CleanGL_RUN_FR
4145          //          //
4146        } else {        } else {
4147          if ( IsDebug() ) printf(" The already exist in the GL_RUN table! \n");          if ( IsDebug() ) printf(" The already exist in the GL_RUN table! \n");
4148            if ( PEDANTIC ) throw -83;
4149        };        };
4150        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));      
4151        //        //

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.54

  ViewVC Help
Powered by ViewVC 1.1.23