/[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.31 by mocchiut, Mon Apr 30 08:16:19 2007 UTC revision 1.34 by mocchiut, Mon Apr 30 08:52:19 2007 UTC
# Line 400  Int_t PamelaDBOperations::SetUpperLimits Line 400  Int_t PamelaDBOperations::SetUpperLimits
400    upperobt = OBT(obtlast);    upperobt = OBT(obtlast);
401    upperentry = nevent-1;    upperentry = nevent-1;
402    //    //
403    if ( IsDebug() ) printf(" First entries are: OBT %i pkt_num %i \n",obtfirst,pktfirst);    if ( IsDebug() ) printf(" First entries are: OBT %u pkt_num %u \n",obtfirst,pktfirst);
404    //    //
405    if ( IsDebug() ) printf(" Last entries are: OBT %lld pkt_num %lld entry %i\n",upperobt,upperpkt,upperentry);    if ( IsDebug() ) printf(" Last entries are: OBT %lld pkt_num %lld entry %i\n",upperobt,upperpkt,upperentry);
406    //    //
407    if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) > OBT(obtfirst)) || (PKT(pktlast) > PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) ) return(1);    if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) > OBT(obtfirst)) || (PKT(pktlast) > PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) ) return(32);
408    //    //
409    if ( !nevent ) return(2);    if ( !nevent ) return(64);
410    //    //
411    if ( nevent < 2 ) return(4);    if ( nevent < 2 ) return(128);
412    if ( nevent < jump ) jump = 1;    if ( nevent < jump ) jump = 1;
413    //  if ( nevent < jump ) jump = int(nevent/10);    //  if ( nevent < jump ) jump = int(nevent/10);
414    //  if ( !jump ) jump = 1;    //  if ( !jump ) jump = 1;
# Line 867  Long64_t PamelaDBOperations::PKT(UInt_t Line 867  Long64_t PamelaDBOperations::PKT(UInt_t
867      return((Long64_t)pkt_num+16777215LL);      return((Long64_t)pkt_num+16777215LL);
868    };    };
869    //    //
870    if ( pkt_num > ppktfirst*2 && pkt_num > (16777214/2) ){    if ( pkt_num > ((Long64_t)ppktfirst*2) && pkt_num > (16777214/2) ){
871      if ( IsDebug() ) printf(" rise down pktnum %lld \n",(Long64_t)pkt_num-16777215LL);      if ( IsDebug() ) printf(" rise down pktnum %lld \n",(Long64_t)pkt_num-16777215LL);
872      return((Long64_t)pkt_num-16777215LL);      return((Long64_t)pkt_num-16777215LL);
873    };    };
# Line 882  Long64_t PamelaDBOperations::PKT(UInt_t Line 882  Long64_t PamelaDBOperations::PKT(UInt_t
882   */   */
883  Long64_t PamelaDBOperations::OBT(UInt_t obt){    Long64_t PamelaDBOperations::OBT(UInt_t obt){  
884    //    //
885    if ( IsDebug() ) printf(" obt conversion: ob is %u obtfirst is %u  (numeric_limits<UInt_t>::max()/2) is %u  \n",obt,pobtfirst,(UInt_t)(numeric_limits<UInt_t>::max()/2));    if ( IsDebug() ) printf(" obt conversion: obt is %u obtfirst is %u  (numeric_limits<UInt_t>::max()/2) is %u  \n",obt,pobtfirst,(UInt_t)(numeric_limits<UInt_t>::max()/2));
886    //    //
887    if ( obt < (pobtfirst/2) && pobtfirst > (numeric_limits<UInt_t>::max()/2) ){    if ( obt < (pobtfirst/2) && pobtfirst > (numeric_limits<UInt_t>::max()/2) ){
888      if ( IsDebug() ) printf(" rise up obt %lld \n",(obt+numeric_limits<UInt_t>::max()));      if ( IsDebug() ) printf(" rise up obt %lld \n",(Long64_t)(obt+numeric_limits<UInt_t>::max()));
889      return((Long64_t)(obt+numeric_limits<UInt_t>::max()));      return((Long64_t)(obt+numeric_limits<UInt_t>::max()));
890    };    };
891    //    //
892    if ( obt > (pobtfirst*2) && obt > (numeric_limits<UInt_t>::max()/2) ){    if ( obt > ((Long64_t)pobtfirst*2) && obt > (numeric_limits<UInt_t>::max()/2) ){
893        if ( IsDebug() ) printf(" pobtfirst*2 %lld \n",((Long64_t)pobtfirst*2));
894      if ( IsDebug() ) printf(" rise down pktnum %lld \n", (Long64_t)obt-(Long64_t)numeric_limits<UInt_t>::max());      if ( IsDebug() ) printf(" rise down pktnum %lld \n", (Long64_t)obt-(Long64_t)numeric_limits<UInt_t>::max());
895      return((Long64_t)obt-(Long64_t)numeric_limits<UInt_t>::max());      return((Long64_t)obt-(Long64_t)numeric_limits<UInt_t>::max());
896    };    };
# Line 1034  Int_t PamelaDBOperations::insertPamelaGL Line 1035  Int_t PamelaDBOperations::insertPamelaGL
1035    TSQLResult *result = 0;    TSQLResult *result = 0;
1036    TSQLRow *row = 0;    TSQLRow *row = 0;
1037    UInt_t t0 = 0;    UInt_t t0 = 0;
1038      Int_t signal = 0;
1039      //
1040      signal = this->SetUpperLimits();
1041    //    //
1042    stringstream   oss;    stringstream   oss;
1043    //      //  
# Line 1086  Int_t PamelaDBOperations::insertPamelaGL Line 1090  Int_t PamelaDBOperations::insertPamelaGL
1090    };    };
1091    //    //
1092    TTree *T = 0;    TTree *T = 0;
   Int_t signal = 0;  
1093    //    //
1094    UInt_t nevent = 0;    UInt_t nevent = 0;
1095    UInt_t recEntries = 0;    UInt_t recEntries = 0;
# Line 1495  Int_t PamelaDBOperations::insertPamelaRU Line 1498  Int_t PamelaDBOperations::insertPamelaRU
1498    stringstream oss;    stringstream oss;
1499    oss.str("");    oss.str("");
1500    //    //
1501    signal = this->SetUpperLimits();    //  signal = this->SetUpperLimits();
1502    //    //
1503    // loop on runheader and runtrailer events    // loop on runheader and runtrailer events
1504    //    //
# Line 2869  Int_t PamelaDBOperations::insertCALO_CAL Line 2872  Int_t PamelaDBOperations::insertCALO_CAL
2872          fromtime = this->GetAbsTime(ph->GetOrbitalTime());            fromtime = this->GetAbsTime(ph->GetOrbitalTime());  
2873          if ( this->PKT(pkt) >= this->PKT(pktfirst) && this->OBT(obt) >= this->OBT(obtfirst) ){          if ( this->PKT(pkt) >= this->PKT(pktfirst) && this->OBT(obt) >= this->OBT(obtfirst) ){
2874            //            //
2875            if ( IsDebug() ) printf(" Calo calibration for section %i at time %i obt %i pkt %i \n",section,fromtime,obt,pkt);            if ( IsDebug() ) printf(" Calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt);
2876            //            //
2877            // check if the calibration has already been inserted            // check if the calibration has already been inserted
2878            //            //
# Line 2976  Int_t PamelaDBOperations::insertCALO_CAL Line 2979  Int_t PamelaDBOperations::insertCALO_CAL
2979            //            //
2980          } else {          } else {
2981            //            //
2982            if ( IsDebug() ) printf(" Repeated calo calibration for section %i at time %i obt %i pkt %i \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);
2983            //            //
2984          };                };      
2985          //                //      
# Line 3194  Int_t PamelaDBOperations::insertTRK_CALI Line 3197  Int_t PamelaDBOperations::insertTRK_CALI
3197      //      //
3198      if ( this->PKT(pkt1) >= this->PKT(pktfirst) && this->OBT(obt1) >= this->OBT(obtfirst) ){      if ( this->PKT(pkt1) >= this->PKT(pktfirst) && this->OBT(obt1) >= this->OBT(obtfirst) ){
3199        //        //
3200        if ( IsDebug() ) printf(" Trk calibration1 at time %i obt %i pkt %i \n",fromtime,obt1,pkt1);        if ( IsDebug() ) printf(" Trk calibration1 at time %u obt %u pkt %u \n",fromtime,obt1,pkt1);
3201        //              //      
3202        valid = ValidateTrkCalib( caltrk1, eh1 );        valid = ValidateTrkCalib( caltrk1, eh1 );
3203        if ( IsDebug() ) cout << " pkt1 validation --> "<<valid<<endl;        if ( IsDebug() ) cout << " pkt1 validation --> "<<valid<<endl;
# Line 3237  Int_t PamelaDBOperations::insertTRK_CALI Line 3240  Int_t PamelaDBOperations::insertTRK_CALI
3240          //          //
3241        };        };
3242        //        //
3243        if ( IsDebug() ) printf(" Found trk calibration2 at obt %i pkt %i t2 is %i \n",obt2,pkt2,t2);        if ( IsDebug() ) printf(" Found trk calibration2 at obt %u pkt %u t2 is %u \n",obt2,pkt2,t2);
3244        //        //
3245        // The calibration is good        // The calibration is good
3246        //        //
3247        if ( this->PKT(pkt2) == this->PKT(pkt1)+1 ){        if ( this->PKT(pkt2) == this->PKT(pkt1)+1 ){
3248          //          //
3249          if ( IsDebug() ) printf(" The trk calibration2 at obt %i pkt %i t2 is %i is good \n",obt2,pkt2,t2);          if ( IsDebug() ) printf(" The trk calibration2 at obt %u pkt %u t2 is %u is good \n",obt2,pkt2,t2);
3250          //          //
3251          UInt_t valid2 = ValidateTrkCalib( caltrk2, eh2 );          UInt_t valid2 = ValidateTrkCalib( caltrk2, eh2 );
3252          if ( IsDebug() ) cout << " pkt2 validation --> "<<valid2<<endl;          if ( IsDebug() ) cout << " pkt2 validation --> "<<valid2<<endl;
# Line 3257  Int_t PamelaDBOperations::insertTRK_CALI Line 3260  Int_t PamelaDBOperations::insertTRK_CALI
3260          //          //
3261          if ( t2 != pret2+1 ){          if ( t2 != pret2+1 ){
3262            //            //
3263            if ( IsDebug() ) printf(" Missing the trk calibration1! Next one at obt %i pkt %i t2 is %i pret2 is %i \n",obt2,pkt2,t2,pret2);            if ( IsDebug() ) printf(" Missing the trk calibration1! Next one at obt %u pkt %u t2 is %u pret2 is %u \n",obt2,pkt2,t2,pret2);
3264            //            //
3265            while ( t2 > pret2+1 ){            while ( t2 > pret2+1 ){
3266              //              //
# Line 3286  Int_t PamelaDBOperations::insertTRK_CALI Line 3289  Int_t PamelaDBOperations::insertTRK_CALI
3289          //          //
3290          // Check for missing calibtrk2          // Check for missing calibtrk2
3291          //          //
3292          if ( IsDebug() ) printf(" Missing the trk calibration2! Next one at obt %i pkt %i t2 is %i\n",obt2,pkt2,t2);          if ( IsDebug() ) printf(" Missing the trk calibration2! Next one at obt %u pkt %u t2 is %u\n",obt2,pkt2,t2);
3293          t2 = pret2;          t2 = pret2;
3294          //          //
3295          // handle missing calib2          // handle missing calib2
# Line 3300  Int_t PamelaDBOperations::insertTRK_CALI Line 3303  Int_t PamelaDBOperations::insertTRK_CALI
3303        //        //
3304      } else {      } else {
3305        //        //
3306        if ( IsDebug() ) printf(" Repetead trk calibration1 at time %i obt %i pkt %i \n",fromtime,obt1,pkt1);        if ( IsDebug() ) printf(" Repetead trk calibration1 at time %u obt %u pkt %u \n",fromtime,obt1,pkt1);
3307        //        //
3308      };      };
3309      //          //    
# Line 3325  Int_t PamelaDBOperations::insertTRK_CALI Line 3328  Int_t PamelaDBOperations::insertTRK_CALI
3328      valid = 0;      valid = 0;
3329      if ( this->PKT(pkt2) > this->PKT(pktfirst) || this->OBT(obt2) > this->OBT(obtfirst) ){      if ( this->PKT(pkt2) > this->PKT(pktfirst) || this->OBT(obt2) > this->OBT(obtfirst) ){
3330        //        //
3331        if ( IsDebug() ) printf(" Missing the trk calibration1! Next one at obt %i pkt %i t2 is %i\n",obt2,pkt2,t2);        if ( IsDebug() ) printf(" Missing the trk calibration1! Next one at obt %u pkt %u t2 is %u\n",obt2,pkt2,t2);
3332        //        //
3333        this->HandleTRK_CALIB(false,true);        this->HandleTRK_CALIB(false,true);
3334        //        //
# Line 3379  Int_t PamelaDBOperations::insertS4_CALIB Line 3382  Int_t PamelaDBOperations::insertS4_CALIB
3382      fromtime = this->GetAbsTime(ph->GetOrbitalTime());        fromtime = this->GetAbsTime(ph->GetOrbitalTime());  
3383      if ( this->PKT(pkt) >= this->PKT(pktfirst) && this->OBT(obt) >= this->OBT(obtfirst) ){      if ( this->PKT(pkt) >= this->PKT(pktfirst) && this->OBT(obt) >= this->OBT(obtfirst) ){
3384        //        //
3385        if ( IsDebug() ) printf(" S4 calibration at time %i obt %i pkt %i \n",fromtime,obt,pkt);        if ( IsDebug() ) printf(" S4 calibration at time %u obt %u pkt %u \n",fromtime,obt,pkt);
3386        //        //
3387        // check if the calibration has already been inserted        // check if the calibration has already been inserted
3388        //        //
# Line 3481  Int_t PamelaDBOperations::insertS4_CALIB Line 3484  Int_t PamelaDBOperations::insertS4_CALIB
3484        //        //
3485      } else {      } else {
3486        //        //
3487        if ( IsDebug() ) printf(" Repetead S4 calibration at time %i obt %i pkt %i \n",fromtime,obt,pkt);        if ( IsDebug() ) printf(" Repeated S4 calibration at time %u obt %u pkt %u \n",fromtime,obt,pkt);
3488        //        //
3489      };            };      
3490      //            //      

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.23