Ignore:
Timestamp:
02/23/04 22:17:10 (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/MExtractBlindPixel.cc

    r3201 r3268  
    4040#include "MRawEvtPixelIter.h"
    4141
     42#include "MPedestalCam.h"
     43#include "MPedestalPix.h"
     44
    4245#include "MExtractedSignalBlindPixel.h"
    4346
     
    4952const Byte_t MExtractBlindPixel::fgSaturationLimit = 254;
    5053const Byte_t MExtractBlindPixel::fgFirst =  3;
    51 const Byte_t MExtractBlindPixel::fgLast  = 14;
     54const Byte_t MExtractBlindPixel::fgLast  = 16;
    5255
    5356// --------------------------------------------------------------------------
     
    98101    }
    99102
     103    fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
     104    if (!fPedestals)
     105    {
     106        *fLog << err << AddSerialNumber("MPedestalCam") << " not found... aborting." << endl;
     107        return kFALSE;
     108    }
    100109
    101110    fBlindPixel = (MExtractedSignalBlindPixel*)pList->FindCreateObj(AddSerialNumber("MExtractedSignalBlindPixel"));
     
    177186      *fLog << warn << "WARNING - saturation occurred in the Blind Pixel " << endl;
    178187
     188    //
     189    // catch the pointer to the event, because MHCalibrationChargeBlindPix will need it later
     190    //
     191    fPixelIter = &pixel;
     192
    179193    fBlindPixel->SetReadyToSave();
    180194
    181195    return kTRUE;
     196}
     197
     198Int_t MExtractBlindPixel::PostProcess()
     199{
     200
     201    MPedestalPix &pedpix  = (*fPedestals)[fBlindPixelIdx];   
     202
     203    if (&pedpix)
     204    {
     205         fPed       = pedpix.GetPedestal()   * fNumSamples;
     206         fPedErr    = pedpix.GetPedestalRms()* fNumSamples / TMath::Sqrt((Float_t)fPedestals->GetTotalEntries());
     207         fPedRms    = pedpix.GetPedestalRms()* TMath::Sqrt((Float_t)fNumSamples);
     208         fPedRmsErr = fPedErr/2.;
     209    }
     210
     211    return kTRUE;
     212
    182213}
    183214
  • trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.h

    r3198 r3268  
    1717class MRawEvtData;
    1818class MRawRunHeader;
    19 
     19class MRawEvtPixelIter;
    2020class MPedestalCam;
    2121class MExtractedSignalBlindPixel;
     
    3333  MRawEvtData         *fRawEvt;       // raw event data (time slices)
    3434  MRawRunHeader       *fRunHeader;    // RunHeader information
     35  MRawEvtPixelIter    *fPixelIter;    // pointer to the MRawEvt information
     36  MPedestalCam        *fPedestals;    // pointer to the pedestal information
    3537 
    3638  Byte_t  fFirst;
     
    4244  UInt_t  fBlindPixelIdx;
    4345
     46  Float_t fPed;
     47  Float_t fPedErr;
     48  Float_t fPedRms;
     49  Float_t fPedRmsErr;
     50
    4451  Int_t  PreProcess(MParList *pList);
    4552  Int_t  Process();
     53  Int_t  PostProcess();
    4654  void   StreamPrimitive(ofstream &out) const;
    4755 
     
    5058  MExtractBlindPixel(const char *name=NULL, const char *title=NULL);
    5159
     60  const MRawEvtPixelIter *GetPixelIter()    const { return fPixelIter; }
     61
    5262  // Setters
    5363  void SetRange(const Byte_t first=fgFirst, const Byte_t last=fgLast);
    5464  void SetSaturationLimit(const Byte_t lim=fgSaturationLimit) { fSaturationLimit = lim; }
    55   void SetBlindPixelIdx( const UInt_t idx=fgBlindPixelIdx  ) { fBlindPixelIdx = idx;   } 
     65  void SetBlindPixelIdx(  const UInt_t idx=fgBlindPixelIdx  ) { fBlindPixelIdx   = idx; } 
     66
     67  Float_t GetPed()       const { return fPed;       }
     68  Float_t GetPedErr()    const { return fPedErr;    }
     69  Float_t GetPedRms()    const { return fPedRms;    }
     70  Float_t GetPedRmsErr() const { return fPedRmsErr; }
    5671
    5772  ClassDef(MExtractBlindPixel, 0) // Task to fill the Extracted BlindPixel Containers from raw data
     
    5974
    6075#endif
     76
Note: See TracChangeset for help on using the changeset viewer.