Changeset 3702 for trunk


Ignore:
Timestamp:
04/09/04 19:33:44 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r3700 r3702  
    499499// Retrieves pedestal and pedestal RMS from MPedestalPix
    500500// Retrieves total entries from MPedestalCam
    501 // Sums up pedestal and pedestalRMS for the average pixel
    502501// Sets pedestal*fNumHiGainSamples and pedestal*fNumLoGainSamples in MCalibrationChargePix
    503502// Sets pedRMS *fSqrtHiGainSamples and pedRMS *fSqrtLoGainSamples in MCalibrationChargePix
    504503//
    505 void MCalibrationChargeCalc::FinalizePedestals(const MPedestalPix &ped, MCalibrationChargePix &cal,
    506                                                Float_t &avped, Float_t &avrms)
     504void MCalibrationChargeCalc::FinalizePedestals(const MPedestalPix &ped, MCalibrationChargePix &cal)
    507505{
    508506 
     
    514512  const Float_t num    = TMath::Sqrt((Float_t)fPedestals->GetTotalEntries());
    515513
    516   //
    517   // Calculate the average pedestal
    518   //
    519   avped += pedes;
    520   avrms += prms;
    521  
    522514  //
    523515  // set them in the calibration camera
     
    537529    }
    538530 
    539 }
    540 
    541 void MCalibrationChargeCalc::FinalizeAvPedestals(MCalibrationChargePix &cal,
    542                                                  Float_t avped, Float_t avrms, Int_t avnum)
    543 {
    544  
    545   //
    546   // set the pedestans in the calibration camera
    547   //
    548   if (cal.IsHiGainSaturation())
    549     {
    550       cal.SetPedestal(avped/avnum * fNumLoGainSamples,
    551                       avrms/avnum * fSqrtLoGainSamples,
    552                       avrms/avnum * fSqrtLoGainSamples/avnum);
    553       cal.CalcLoGainPedestal((Float_t)fNumLoGainSamples);
    554     }
    555   else
    556     {
    557       cal.SetPedestal(avped/avnum * fNumHiGainSamples,
    558                       avrms/avnum * fSqrtHiGainSamples,
    559                       avrms/avnum * fSqrtHiGainSamples/avnum);
    560     }
    561531}
    562532
     
    626596      return kFALSE;
    627597    }
     598
    628599  return kTRUE;
    629600}
     
    11341105  //
    11351106  Int_t   nvalid      = 0;
    1136   Float_t avinnerped  = 0.;
    1137   Float_t avinnerprms = 0.;
    1138   Int_t   avinnernum  = 0;
    1139   Float_t avouterped  = 0.;
    1140   Float_t avouterprms = 0.;
    1141   Int_t   avouternum  = 0;
    11421107
    11431108  for (Int_t pixid=0; pixid<fPedestals->GetSize(); pixid++)
     
    11541119      MBadPixelsPix &bad = (*fBadPixels)[pixid];
    11551120
    1156       if (fGeom->GetPixRatio(pixid) == 1.)
    1157         {
    1158           FinalizePedestals(ped,pix,avinnerped,avinnerprms);
    1159           avinnernum++;
    1160         }
    1161       else
    1162         {
    1163           FinalizePedestals(ped,pix,avouterped,avouterprms);
    1164           avouternum++;
    1165         }
     1121      FinalizePedestals(ped,pix);
    11661122
    11671123      if (FinalizeCharges(pix,bad))
    1168           nvalid++;
     1124        nvalid++;
    11691125    }
    11701126 
     
    11851141    {
    11861142
    1187       FinalizeAvPedestals((MCalibrationChargePix&)fCam->GetAverageArea(aidx),
    1188                           avinnerped, avinnerprms,avinnernum);
    1189       FinalizeCharges((MCalibrationChargePix&)fCam->GetAverageArea(aidx),
    1190                       fCam->GetAverageBadArea(aidx));
     1143      const MPedestalPix     &ped = fPedestals->GetAverageArea(aidx);
     1144      MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageArea(aidx);
     1145
     1146      FinalizePedestals(ped,pix);
     1147      FinalizeCharges(pix, fCam->GetAverageBadArea(aidx));
    11911148    }
    11921149 
     
    11941151    {
    11951152
    1196       FinalizeAvPedestals((MCalibrationChargePix&)fCam->GetAverageSector(sector),
    1197                           avinnerped, avinnerprms,avinnernum);
    1198       FinalizeCharges((MCalibrationChargePix&)fCam->GetAverageSector(sector),
    1199                       fCam->GetAverageBadSector(sector));
     1153      const MPedestalPix     &ped = fPedestals->GetAverageSector(sector);
     1154      MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageSector(sector);
     1155
     1156      FinalizePedestals(ped,pix);
     1157      FinalizeCharges(pix, fCam->GetAverageBadSector(sector));
    12001158    }
    12011159 
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h

    r3697 r3702  
    7878
    7979  // functions
    80   void   FinalizePedestals      ( const MPedestalPix &ped, MCalibrationChargePix &cal,
    81                                   Float_t &avped, Float_t &avrms                      );
    82   void   FinalizeAvPedestals    ( MCalibrationChargePix &cal,
    83                                   Float_t avped, Float_t avrms, Int_t avnum);
     80  void   FinalizePedestals      ( const MPedestalPix &ped, MCalibrationChargePix &cal );
    8481  Bool_t FinalizeCharges        ( MCalibrationChargePix &cal, MBadPixelsPix &bad      );
    8582  Bool_t FinalizePINDiode       ();
Note: See TracChangeset for help on using the changeset viewer.