Changeset 3174


Ignore:
Timestamp:
02/16/04 00:31:25 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3173 r3174  
    99   * mcalib/Makefile
    1010   * mcalib/CalibLinkDef.h
     11
     12   * mcalib/MHCalibrationChargePix.[h,cc]
     13     - new base class for the calibration charges histogram pixel.
     14       Derives from MH and can be filled with the MH with the MH
     15       functions.
     16
    1117   * mcalib/MExtractPINDiode.[h,cc]
    1218     - new signal extractor for the PIN Diode
  • trunk/MagicSoft/Mars/mcalib/CalibLinkDef.h

    r3173 r3174  
    1717#pragma link C++ class MHCalibrationBlindPixel+;
    1818#pragma link C++ class MHCalibrationPixel+;
     19#pragma link C++ class MHCalibrationChargePix+;
    1920
    2021#pragma link C++ class MMcCalibrationCalc++;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc

    r3124 r3174  
    6060//                MalibrationCam::SkipBlindPixelFits()  (skip all blind
    6161//                pixel fits)
    62 //                MalibrationCam::SkipPinDiodeFits()  (skip all PIN Diode
    63 //                fits)
    6462//
    6563//                Hi-Gain vs. Lo-Gain Calibration (very memory-intensive)
     
    106104
    107105#include "MCalibrationBlindPix.h"
    108 #include "MCalibrationPINDiode.h"
    109106
    110107ClassImp(MCalibrationCalc);
     
    112109using namespace std;
    113110
    114 const UInt_t MCalibrationCalc::fBlindPixelId = 559;
    115 const UInt_t MCalibrationCalc::fPINDiodeId   = 9999;
     111const UInt_t MCalibrationCalc::fgBlindPixelId    = 559;
     112const UInt_t MCalibrationCalc::fgPINDiodeId      = 9999;
    116113const Byte_t MCalibrationCalc::fgSaturationLimit = 254;
    117114const Int_t  MCalibrationCalc::fgBlindPixelFirst = 3;
     
    149146    CLRBIT(fFlags, kHiGainOverFlow);
    150147    CLRBIT(fFlags, kLoGainOverFlow);
    151     // As long as we don't have the PIN Diode:
    152     CLRBIT(fFlags, kUsePinDiodeFit);
    153148
    154149    fBlindPixelFirst   = 0;
     
    178173{
    179174    return fCalibrations->GetBlindPixel();
    180 }
    181 
    182 MCalibrationPINDiode *MCalibrationCalc::GetPINDiode() const
    183 {
    184     return fCalibrations->GetPINDiode();
    185175}
    186176
     
    313303
    314304        // Exclude the blind pixel and the PIN Diode from normal pixel calibration:
    315         if (i == fBlindPixelId)
     305        if (i == fgBlindPixelId)
    316306          pix.SetExcluded();
    317307
    318         if (i == fPINDiodeId)
     308        if (i == fgPINDiodeId)
    319309          pix.SetExcluded();
    320310
     
    395385  //
    396386  MCalibrationBlindPix &blindpixel = *(fCalibrations->GetBlindPixel());
    397   MCalibrationPINDiode &pindiode   = *(fCalibrations->GetPINDiode());
    398387 
    399388  MRawEvtPixelIter pixel(fRawEvt);
     
    457446        {
    458447         
    459         case fBlindPixelId:
     448        case fgBlindPixelId:
    460449
    461450          if (TESTBIT(fFlags,kUseBlindPixelFit))
     
    556545         
    557546          break;
    558         case fPINDiodeId:
    559 
    560           if (TESTBIT(fFlags,kUsePinDiodeFit))
    561             {
    562          
    563               if (!pindiode.FillCharge(sumhi))
    564                 *fLog << warn
    565                       << "Overflow or Underflow occurred filling PINDiode: sum = "
    566                       << sumhi << endl;
    567              
    568               if (!pindiode.FillAbsTime(abstime))
    569                  *fLog << warn
    570                        << "Overflow or Underflow occurred filling PINDiode abs. time = "
    571                        << abstime << endl;
    572 
    573               if (!pindiode.FillGraphs(sumhi,sumlo))
    574                 *fLog << warn
    575                       << "Overflow or Underflow occurred filling PINDiode: eventnr = " << endl;
    576              
    577             } /* if use PIN Diode */
    578          
    579           //          break;
    580              
    581547        default:
    582548             
     
    662628      const Int_t   nslices     = fBlindPixelLast-fBlindPixelFirst+1;
    663629      const Float_t sqrslice    = TMath::Sqrt((Float_t)nslices);
    664       //
    665       // retrieve the pedestal pix of the blind pixel
    666       //
    667       if (fPedestals->GetHistSize() > fBlindPixelId)
    668         {
    669           MHPedestalPixel &pedhist = (*fPedestals)(fBlindPixelId);
    670           pedestal    = pedhist.GetChargeMean()*nslices;
    671           pederr      = pedhist.GetChargeMeanErr()*nslices;
    672           //
    673           // Fitted sigma: 1. one sqrt(Nr. slices) for the division which is not
    674           //                  not appropriate: sigma(real)/slice = GetSigma*sqrt(nslices)
    675           //               2. another sqrt(Nr. slices) to calculate back to number
    676           //                  of slices
    677           //
    678           pedsigma    = pedhist.GetChargeSigma()*nslices;
    679           pedsigmaerr = pedhist.GetChargeSigmaErr()*nslices;
    680         }
    681       else
    682         {
    683           MPedestalPix    &pedpix  = (*fPedestals)[fBlindPixelId];
    684           pedestal    = pedpix.GetPedestal()*nslices;
    685           pederr      = pedpix.GetPedestalRms()*nslices/nentries;
    686           pedsigma    = pedpix.GetPedestalRms()*sqrslice;
    687           pedsigmaerr = pederr/2.;
    688         }
     630
     631      MPedestalPix    &pedpix  = (*fPedestals)[fgBlindPixelId];
     632      pedestal    = pedpix.GetPedestal()*nslices;
     633      pederr      = pedpix.GetPedestalRms()*nslices/nentries;
     634      pedsigma    = pedpix.GetPedestalRms()*sqrslice;
     635      pedsigmaerr = pederr/2.;
    689636      //
    690637      // retrieve the histogram containers
     
    779726
    780727
    781   if (TESTBIT(fFlags,kUsePinDiodeFit) && fCalibrations->IsPINDiodeMethodValid())
     728  if (fCalibrations->IsPINDiodeMethodValid())
    782729    {
    783730      if (!fCalibrations->CalcFluxOutsidePlexiglass())
    784731        {
    785732          *fLog << err
    786                 << "Could not calculate the number of photons from the blind pixel " << endl;
    787           *fLog << err
    788                 << "You can try to calibrate using the MCalibrationCalc::SkipPINDiodeFit()" << endl;
     733                << "Could not calculate the number of photons from the PIN Diode " << endl;
    789734          fCalibrations->SetPINDiodeMethodValid(kFALSE);
    790735        }
  • trunk/MagicSoft/Mars/mcalib/Makefile

    r3173 r3174  
    4747           MHCalibrationPINDiode.cc \
    4848           MHCalibrationPixel.cc \
     49           MHCalibrationChargePix.cc \
    4950           MMcCalibrationCalc.cc \
    5051           MExtractPINDiode.cc \
Note: See TracChangeset for help on using the changeset viewer.