/[PAMELA software]/DarthVader/CalorimeterLevel2/src/CaloLevel0.cpp
ViewVC logotype

Diff of /DarthVader/CalorimeterLevel2/src/CaloLevel0.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by mocchiut, Mon Sep 28 17:06:47 2009 UTC revision 1.30 by mocchiut, Fri Jan 29 05:49:24 2010 UTC
# Line 741  Int_t CaloLevel0::CalcCrossTalkCorrDo(TS Line 741  Int_t CaloLevel0::CalcCrossTalkCorrDo(TS
741        //        //
742        if ( !ncalibs ) return(-110);        if ( !ncalibs ) return(-110);
743        //        //
744        calo->GetEntry(calibno);        if ( calo->GetEntry(calibno) <= 0) throw -36;
745        if ( verbose ) printf(" PULSE2 using entry %u from file %s",calibno,fcalname.Data());        if ( verbose ) printf(" PULSE2 using entry %u from file %s",calibno,fcalname.Data());
746        //        //
747        // retrieve calibration table        // retrieve calibration table
# Line 822  Int_t CaloLevel0::CalcCrossTalkCorrDo(TS Line 822  Int_t CaloLevel0::CalcCrossTalkCorrDo(TS
822        //        //
823        if ( !ncalibs ) return(-110);        if ( !ncalibs ) return(-110);
824        //        //
825        calo1->GetEntry(calibno);        if ( calo1->GetEntry(calibno) <= 0 ) throw -36;
826        if ( verbose ) printf(" PULSE1 using entry %u from file %s",calibno,fcalname.Data());        if ( verbose ) printf(" PULSE1 using entry %u from file %s",calibno,fcalname.Data());
827        //        //
828        // retrieve calibration table        // retrieve calibration table
# Line 1184  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1184  Int_t CaloLevel0::Calibrate(Int_t ei){
1184    //    //
1185    // get entry ei    // get entry ei
1186    //    //
1187    l0calo->GetEntry(ei);    if ( l0calo->GetEntry(ei) <= 0 ) throw -36;
1188    //    //
1189    // if it was not a selftrigger event, could it ever been a selftrigger event? if so trigty = 3.    // if it was not a selftrigger event, could it ever been a selftrigger event? if so trigty = 3.
1190    //    //
# Line 1253  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1253  Int_t CaloLevel0::Calibrate(Int_t ei){
1253    //    //
1254    Float_t ener0 = 0.;    Float_t ener0 = 0.;
1255    Float_t cbase0 = 0.;    Float_t cbase0 = 0.;
1256      Float_t totbase = 0.;
1257      Float_t totped = 0.;
1258    Bool_t pproblem = false;    Bool_t pproblem = false;
1259    Bool_t negbase = false;    Bool_t negbase = false;
1260    //    //
# Line 1367  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1369  Int_t CaloLevel0::Calibrate(Int_t ei){
1369          //          //
1370          pre = -1;          pre = -1;
1371          ener0 = 0.;          ener0 = 0.;
1372            totbase = 0.;
1373            totped = 0.;
1374          for (Int_t i = 0 ; i < 3 ; i++){          for (Int_t i = 0 ; i < 3 ; i++){
1375            ip[i] = 0;            ip[i] = 0;
1376            for (Int_t n = i*32 ; n < (i+1)*32 ; n++){                            for (Int_t n = i*32 ; n < (i+1)*32 ; n++){                
# Line 1434  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1438  Int_t CaloLevel0::Calibrate(Int_t ei){
1438              ener = dexyc[l][m][n];              ener = dexyc[l][m][n];
1439              ener0 += ener;              ener0 += ener;
1440              clevel1->estrip[n][m][l] = 0.;              clevel1->estrip[n][m][l] = 0.;
1441                totbase += de->base[l][m][pre]/96.;
1442                totped += fabs(calped[l][m][n]);
1443              if ( de->base[l][m][pre] < 0 ) negbase = true;              if ( de->base[l][m][pre] < 0 ) negbase = true;
1444              if ( base0>0 && base0 < 30000. ){              if ( base0>0 && base0 < 30000. ){
1445                //                //
# Line 1457  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1463  Int_t CaloLevel0::Calibrate(Int_t ei){
1463          };          };
1464          //          //
1465          // check if there were problems with 5.7 or glitches in the power supply          // check if there were problems with 5.7 or glitches in the power supply
1466          //          //
1467          if ( ((ener0 == 0. && cbase0 == 0.) || negbase ) && !pproblem && clevel2->perr[se] == 0){          //      if ( ((ener0 == 0. && cbase0 == 0.) || negbase || totbase > 196600. || totped < 1. ) && !pproblem && clevel2->perr[se] == 0){   // check pedestal and baseline 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.]
1468            if ( verbose ) printf(" L0 entry %i : calorimeter power problems! event marked as bad perr %f swerr %X view %i plane %i \n",ei,de->perror[se],de->stwerr[se],l,m);          if ( ((ener0 == 0. && cbase0 == 0.) || negbase || totbase > 32700. || totped < 1. ) && !pproblem && clevel2->perr[se] == 0){    // check pedestal and baseline 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.]
1469              if ( verbose ) printf(" L0 entry %i : calorimeter power problems! event marked as bad perr %f swerr %X view %i plane %i negbase %i totbase %f totped %f\n",ei,de->perror[se],de->stwerr[se],l,m, negbase, totbase, totped);
1470            pproblem = true;            pproblem = true;
1471            pe++;            pe++;
1472          };          };
# Line 1752  Int_t CaloLevel0::Calibrate(Int_t ei){ Line 1759  Int_t CaloLevel0::Calibrate(Int_t ei){
1759              clevel1->estrip[j4][m][l] = 0.;              clevel1->estrip[j4][m][l] = 0.;
1760            };            };
1761            //            //
1762              if ( debug ) printf(" STRIP: view %i plane %i strip %i energy: %f \n",l,m,j4,clevel1->estrip[j4][m][l]);
1763              //
1764            // code and save the energy for each strip in svstrip                // code and save the energy for each strip in svstrip    
1765            //            //
1766            if ( clevel1->estrip[j4][m][l] > clevel1->emin ){            if ( clevel1->estrip[j4][m][l] > clevel1->emin ){
1767              //              //
1768              Float_t savel1 = clevel1->estrip[j4][m][l];              Float_t savel1 = clevel1->estrip[j4][m][l];
1769                //
1770                if ( m == 18 && l == 0 ){
1771                  if ( debug ) printf(" Resetting plane 18X for variable calculation: view %i plane %i strip %i \n",l,m,j4);
1772                  clevel1->estrip[j4][m][l] = 0.; // SAVE STRIPS VALUE FOR PLANE 18 X but DO NOT USE IT FOR VARIABLE CALCULATION
1773                };
1774                if ( debug ) printf(" HIT STRIP: view %i plane %i strip %i energy: %f \n",l,m,j4,clevel1->estrip[j4][m][l]);
1775              //      if ( dexyc[l][m][j4] == 32767. ){              //      if ( dexyc[l][m][j4] == 32767. ){
1776              if ( dexyc[l][m][j4] > 32000. ){              if ( dexyc[l][m][j4] > 32000. ){
1777                savel1 += 5000.;                savel1 += 5000.;
# Line 2181  Int_t CaloLevel0::LoadCalib(Int_t s){ Line 2196  Int_t CaloLevel0::LoadCalib(Int_t s){
2196    //    //
2197    if ( !ncalibs ) return(-110);    if ( !ncalibs ) return(-110);
2198    //    //
2199    calo->GetEntry(calibno[s]);    if ( calo->GetEntry(calibno[s]) <= 0 ) throw -36;
2200    //    //
2201    if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) {    if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) {
2202      for ( Int_t d=0 ; d<11 ;d++  ){      for ( Int_t d=0 ; d<11 ;d++  ){

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

  ViewVC Help
Powered by ViewVC 1.1.23