/[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.23 by mocchiut, Tue Jan 13 13:38:15 2009 UTC revision 1.26 by mocchiut, Wed Nov 25 09:39:50 2009 UTC
# Line 427  void PamelaDBOperations::SetOrbitNo(UInt Line 427  void PamelaDBOperations::SetOrbitNo(UInt
427        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());
428        return;        return;
429      };      };
430      TString dwo = 0;      TString dwo = "";
431      for (Int_t i = 0; i<5; i++){      for (Int_t i = 0; i<5; i++){
432        dwo.Append(name[i],1);        dwo.Append(name[i],1);
433      };      };
# Line 857  Int_t PamelaDBOperations::SetUpperLimits Line 857  Int_t PamelaDBOperations::SetUpperLimits
857    //  if ( nevent < jump ) jump = int(nevent/10);    //  if ( nevent < jump ) jump = int(nevent/10);
858    //  if ( !jump ) jump = 1;    //  if ( !jump ) jump = 1;
859    //    //
860    if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) && nevent > deltapkt ){  
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      //      //
863      if ( IsDebug() ) printf(" starting jump %i \n",jump);      if ( IsDebug() ) printf(" starting jump %i \n",jump);
864      //    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 4235  Int_t PamelaDBOperations::insertCALO_CAL Line 4236  Int_t PamelaDBOperations::insertCALO_CAL
4236    UInt_t totime = 0;    UInt_t totime = 0;
4237    UInt_t obt = 0;    UInt_t obt = 0;
4238    UInt_t pkt = 0;    UInt_t pkt = 0;
4239      Float_t totped = 0.;
4240    //    //
4241    tr = (TTree*)file->Get("CalibCalPed");    tr = (TTree*)file->Get("CalibCalPed");
4242    if ( !tr || tr->IsZombie() ) throw -21;    if ( !tr || tr->IsZombie() ) throw -21;
# Line 4252  Int_t PamelaDBOperations::insertCALO_CAL Line 4254  Int_t PamelaDBOperations::insertCALO_CAL
4254        if ( calibCalPed->cstwerr[section] ){        if ( calibCalPed->cstwerr[section] ){
4255          valid = 1;          valid = 1;
4256          if ( calibCalPed->cperror[section] ) valid = 0;          if ( calibCalPed->cperror[section] ) valid = 0;
4257            //
4258            // 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.]
4259            //
4260            totped = 0.;
4261            for (UInt_t ss=0; ss<96; ss++){
4262              totped += calibCalPed->calped[section][0][ss];
4263            }
4264            if ( totped < 1. ){
4265              if ( IsDebug() ) printf(" Section %i totped %f -  No calibration data! Calorimeter power problems? \n",section,totped);
4266              valid = 0;
4267            };
4268            //
4269          ph = eh->GetPscuHeader();          ph = eh->GetPscuHeader();
4270          obt = ph->GetOrbitalTime();            obt = ph->GetOrbitalTime();  
4271          pkt = ph->GetCounter();            pkt = ph->GetCounter();  
# Line 4419  Int_t PamelaDBOperations::insertCALOPULS Line 4433  Int_t PamelaDBOperations::insertCALOPULS
4433    tr->SetBranchAddress("Header", &eh);    tr->SetBranchAddress("Header", &eh);
4434    nevents = tr->GetEntries();    nevents = tr->GetEntries();
4435    //    //
4436      Float_t totpul = 0.;
4437      //
4438    if ( nevents > 0 ){    if ( nevents > 0 ){
4439      //      //
4440      for (UInt_t i=0; i < nevents; i++){      for (UInt_t i=0; i < nevents; i++){
# Line 4428  Int_t PamelaDBOperations::insertCALOPULS Line 4444  Int_t PamelaDBOperations::insertCALOPULS
4444          if ( cp1->pstwerr[section] && cp1->unpackError == 0 ){          if ( cp1->pstwerr[section] && cp1->unpackError == 0 ){
4445            valid = 1;            valid = 1;
4446            if ( cp1->pperror[section] ) valid = 0;            if ( cp1->pperror[section] ) valid = 0;
4447              //
4448              // 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.]
4449              //
4450              totpul = 0.;
4451              for (UInt_t ss=0; ss<96; ss++){
4452                totpul += cp1->calpuls[section][0][ss];
4453              }
4454              if ( totpul >= 3145632. ){
4455                if ( IsDebug() ) printf(" PULSE1 Section %i totpul %f -  No calibration data! Calorimeter power problems? \n",section,totpul);
4456                valid = 0;
4457              };
4458              //
4459            ph = eh->GetPscuHeader();            ph = eh->GetPscuHeader();
4460            obt = ph->GetOrbitalTime();              obt = ph->GetOrbitalTime();  
4461            pkt = ph->GetCounter();              pkt = ph->GetCounter();  
# Line 4585  Int_t PamelaDBOperations::insertCALOPULS Line 4613  Int_t PamelaDBOperations::insertCALOPULS
4613          if ( cp2->pstwerr[section] && cp2->unpackError == 0 ){          if ( cp2->pstwerr[section] && cp2->unpackError == 0 ){
4614            valid = 1;            valid = 1;
4615            if ( cp2->pperror[section] ) valid = 0;            if ( cp2->pperror[section] ) valid = 0;
4616              //
4617              // 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.]
4618              //
4619              totpul = 0.;
4620              for (UInt_t ss=0; ss<96; ss++){
4621                totpul += cp2->calpuls[section][0][ss];
4622              }
4623              if ( totpul >= 3145632. ){
4624                if ( IsDebug() ) printf(" PULSE2 Section %i totpul %f -  No calibration data! Calorimeter power problems? \n",section,totpul);
4625                valid = 0;
4626              };
4627              //
4628            ph = eh->GetPscuHeader();            ph = eh->GetPscuHeader();
4629            obt = ph->GetOrbitalTime();              obt = ph->GetOrbitalTime();  
4630            pkt = ph->GetCounter();              pkt = ph->GetCounter();  

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.23