Changeset 3198 for trunk/MagicSoft


Ignore:
Timestamp:
02/16/04 15:32:07 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
5 edited

Legend:

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

    r3196 r3198  
    4040#include "MRawEvtPixelIter.h"
    4141
    42 #include "MPedestalCam.h"
    43 #include "MPedestalPix.h"
    44 
    4542#include "MExtractedSignalBlindPixel.h"
    4643
     
    8683// The PreProcess searches for the following input containers:
    8784//  - MRawEvtData
    88 //  - MPedestalCam
    8985//
    9086// The following output containers are also searched and created if
     
    109105    fBlindPixel->SetUsedFADCSlices(fFirst, fLast);
    110106
    111     fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
    112 
    113     if (!fPedestals)
    114     {
    115         *fLog << err << AddSerialNumber("MPedestalCam") << " not found... aborting" << endl;
    116         return kFALSE;
    117     }
    118 
    119     const MPedestalPix &ped   = (*fPedestals)[fBlindPixelIdx];
    120 
    121     if (&ped)
    122       {
    123         fPedestal = ped.GetPedestal();
    124         fPedRms   = ped.GetPedestalRms();
    125       }
    126     else
    127       {
    128         *fLog << err << " Cannot find MPedestalPix of the Blind Pixel (idx="
    129               << fBlindPixelIdx << ")" << endl;
    130         return kFALSE;
    131       }
    132107
    133108    return kTRUE;
     
    149124 
    150125    UInt_t sat  = 0;
    151     UInt_t max  = 0;
    152126
    153127    Byte_t *ptr = pixel.GetHiGainSamples();
    154128   
    155     UInt_t sumhi = 0;
    156     UInt_t sumlo = 0;
    157129    //
    158130    // We need a dedicated signal extractor for the blind pixel
     
    179151      {
    180152        sum += *ptr;
    181 
    182         if (*ptr > max)
    183           max = *ptr;
    184153
    185154        if (*ptr++ >= fSaturationLimit)
     
    197166            sum += *ptr;
    198167
    199             if (*ptr > max)
    200               max = *ptr;
    201 
    202168            if (*ptr++ >= fSaturationLimit)
    203169              sat++;
     
    206172      }
    207173   
    208     sumhi = sum;
    209    
    210     ptr = pixel.GetLoGainSamples();
    211    
    212     start   = ptr + fFirst - 1;
    213     end     = ptr + fLast  - 1;
    214    
    215     ptr = start;
    216    
    217     sum = 0;
    218    
    219     while (ptr<=end)
    220       {
    221        
    222       sum += *ptr;
    223    
    224       if (*ptr > max)
    225         max = *ptr;
    226      
    227       if (*ptr++ >= fSaturationLimit)
    228         sat++;
    229       }
    230    
    231     sumlo = sum;
    232    
    233     fBlindPixel->SetExtractedSignal(sum - fPedestal*fNumSamples, fPedRms*fSqrtSamples);
    234     fBlindPixel->SetSaturation(sat);
     174    fBlindPixel->SetExtractedSignal(sum);
     175    fBlindPixel->SetNumSaturated(sat);
    235176
    236177    if (sat)
  • trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.h

    r3196 r3198  
    2929  static const Byte_t fgLast;
    3030
    31   MPedestalCam                *fPedestals;    // Pedestals of all pixels in the camera
    3231  MExtractedSignalBlindPixel  *fBlindPixel;   // Extracted signal of the Blind Pixel
    3332
     
    4342  UInt_t  fBlindPixelIdx;
    4443
    45   Float_t fPedestal;
    46   Float_t fPedRms;
    47  
    48   void   FindSignal(Byte_t *ptr, Int_t size, UInt_t &sum, UInt_t &sum2, UInt_t &sat, UInt_t &max) const;
    49  
    5044  Int_t  PreProcess(MParList *pList);
    5145  Int_t  Process();
  • trunk/MagicSoft/Mars/mcalib/MExtractedSignalBlindPixel.cc

    r3196 r3198  
    4040using namespace std;
    4141
    42 static const Float_t gkSignalInitializer = 99999.9;
     42static const UInt_t gkSignalInitializer = 99999;
    4343
    4444// ------------------------------------------------------------------------
     
    6666void MExtractedSignalBlindPixel::Clear(Option_t *o)
    6767{
    68   fExtractedSignal          = gkSignalInitializer;
    69   fExtractedSignalErr       = gkSignalInitializer;
     68
     69  fExtractedSignal    = gkSignalInitializer;
    7070
    7171  fNumSaturated       = 0;
     
    7979
    8080
    81 void MExtractedSignalBlindPixel::SetExtractedSignal(const Float_t sig, const Float_t sigerr)   
    82 {
    83   fExtractedSignal      = sig;
    84   fExtractedSignalErr = sigerr;
    85 }
    86 
    87 
    8881Bool_t MExtractedSignalBlindPixel::IsValid() const
    8982{
    90     return fExtractedSignal >= 0. || fExtractedSignalErr >= 0.;
    91 }
    92 
    93 void MExtractedSignalBlindPixel::SetSaturation(const Byte_t numsat)
    94 {
    95   fNumSaturated = numsat;
     83    return fExtractedSignal >= 0 && fExtractedSignal <  gkSignalInitializer;
    9684}
    9785
     
    9987{
    10088  *fLog << " Signal: " << fExtractedSignal
    101         << " +- " << fExtractedSignalErr
    10289        << " Nr. Saturation: " <<  fNumSaturated
    10390        << endl;
  • trunk/MagicSoft/Mars/mcalib/MExtractedSignalBlindPixel.h

    r3196 r3198  
    1010private:
    1111
    12   Float_t fExtractedSignal;    // mean value of the extracted signal
    13   Float_t fExtractedSignalErr; // error of the mean value of the extracted signal
     12  UInt_t fExtractedSignal;    // mean value of the extracted signal
    1413
    1514  Byte_t fFirst;
     
    1817
    1918public:
    20     MExtractedSignalBlindPixel(const char* name=NULL, const char* title=NULL);
    2119
    22     void Clear(Option_t *o="");
    23     void Print(Option_t *o="") const;
     20  MExtractedSignalBlindPixel(const char* name=NULL, const char* title=NULL);
    2421
    25     // Setter
    26     void SetExtractedSignal(const Float_t sig, const Float_t sigerr);
    27     void SetSaturation(   const Byte_t numsat);
    28     void SetUsedFADCSlices( const Byte_t first, const Byte_t num);
     22  void Clear(Option_t *o="");
     23  void Print(Option_t *o="") const;
     24 
     25  // Setter
     26  void SetExtractedSignal(const UInt_t sig)          { fExtractedSignal = sig;  }
     27  void SetNumSaturated(  const Byte_t numsat)       { fNumSaturated    = numsat;  }
     28  void SetUsedFADCSlices( const Byte_t first, const Byte_t num);
    2929   
    3030    // Getter
    31     Float_t GetExtractedSignal()    const { return fExtractedSignal; }
    32     Float_t GetExtractedSignalErr() const { return fExtractedSignalErr; }
     31  UInt_t GetExtractedSignal()    const { return fExtractedSignal; }
    3332
    34     Byte_t  GetNumFADCSamples()     const { return fNumFADCSamples;  }
    35    
    36     Bool_t IsValid() const;   
     33  Byte_t  GetNumFADCSamples()     const { return fNumFADCSamples;  }
     34 
     35  Bool_t IsValid() const;   
    3736
    38     ClassDef(MExtractedSignalBlindPixel, 0)     // Storage Container for Extracted Signal of the blind pixel
     37  ClassDef(MExtractedSignalBlindPixel, 0)       // Storage Container for Extracted Signal of the blind pixel
    3938};
    4039
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc

    r3170 r3198  
    212212  if (fHGausHist.Fill(f) == -1)
    213213    return kFALSE;
    214  
    215   return kTRUE;
     214
     215 return kTRUE;
    216216}
    217217
Note: See TracChangeset for help on using the changeset viewer.