Changeset 3931


Ignore:
Timestamp:
05/03/04 10:47:30 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3929 r3931  
    2020
    2121 2004/05/03: Markus Gaug
     22
     23   * mpedestals/MPedestalPix.[h,cc]
     24     - add a dedicated fValid flag in order to be able to discard pixels
     25       from outside (e.g. from MBadPixelsCam)
     26
     27   * mpedestals/MPedCalcPedRun.[h,cc]
     28     - catch badpixels cam from parameter list, if existing and set
     29       corresponding pixels to not valid in MPedestalPix
    2230
    2331   * mjobs/MGCamDisplays.[h,cc]
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc

    r3889 r3931  
    116116#include "MGeomCam.h"
    117117
     118#include "MBadPixelsPix.h"
     119#include "MBadPixelsCam.h"
     120
    118121#include "MGeomCamMagic.h"
    119122
     
    133136//
    134137// Sets:
     138// - all pointers to NULL
    135139// - fWindowSizeHiGain to fgHiGainWindowSize
    136140// - fWindowSizeLoGain to fgLoGainWindowSize
     
    144148MPedCalcPedRun::MPedCalcPedRun(const char *name, const char *title)
    145149    : fWindowSizeHiGain(fgHiGainWindowSize),
    146       fWindowSizeLoGain(fgLoGainWindowSize)
     150      fWindowSizeLoGain(fgLoGainWindowSize),
     151      fGeom(NULL),fBad(NULL)
    147152{
    148153  fName  = name  ? name  : "MPedCalcPedRun";
     
    263268//  - MRawRunHeader
    264269//  - MGeomCam
     270//  - MBadPixelsCam
    265271//
    266272// The following output containers are also searched and created if
     
    298304  if (!fPedestals)
    299305    return kFALSE;
     306
     307  fBad       =  (MBadPixelsCam*)pList->FindObject("MBadPixelsCam");
    300308
    301309  return kTRUE;
     
    318326// modifying the ranges again, if necessary.
    319327//
     328// A loop over the MBadPixelsCam is performed and bad pixels are set
     329// to MPedestalPix::SetValid(kFALSE);
     330//
    320331Bool_t MPedCalcPedRun::ReInit(MParList *pList)
    321332{
     
    385396  *fLog << inf << GetDescriptor() << ": Taking " << (int)fWindowSizeLoGain
    386397        << " LoGain FADC samples starting with slice: " << (int)fLoGainFirst << endl;
     398
     399
     400  if (fBad)
     401    {
     402      const Int_t nbads = fBad->GetSize();
     403      for (Int_t i=0; i<(nbads>npixels?npixels:nbads);i++)
     404        if ((*fBad)[i].IsBad())
     405          (*fPedestals)[i].SetValid(kFALSE);
     406    }
    387407 
    388408  return kTRUE;
    389  
     409     
    390410}
    391411// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.h

    r3888 r3931  
    1515
    1616class MGeomCam;
     17class MBadPixelsCam;
    1718class MPedCalcPedRun : public MExtractor
    1819{
     
    3031 
    3132  MGeomCam     *fGeom;       // Camera geometry
     33  MBadPixelsCam *fBad;       // Bad Pixels
    3234 
    3335  TArrayF fSumx;         // sum of values
  • trunk/MagicSoft/Mars/mpedestal/MPedestalCam.cc

    r3803 r3931  
    314314
    315315  if (GetSize() <= idx)
     316    return kFALSE;
     317
     318  if (!(*this)[idx].IsValid())
    316319    return kFALSE;
    317320
  • trunk/MagicSoft/Mars/mpedestal/MPedestalPix.cc

    r3803 r3931  
    1717!
    1818!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
     19!              Markus Gaug   04/2004 <mailto:markus@ifae.es>               
    1920!
    20 !   Copyright: MAGIC Software Development, 2000-2001
     21!   Copyright: MAGIC Software Development, 2000-2004
    2122!
    2223!
     
    4142
    4243MPedestalPix::MPedestalPix()
     44    : fValid(kTRUE)
    4345{
    4446  Clear();
     
    5254void MPedestalPix::Clear(Option_t *o)
    5355{
    54   fPedestal = -1.;
     56  fPedestal    = -1.;
    5557  fPedestalRms = -1.;
    56 
    5758}
    5859
     
    6061{
    6162
    62   fPedestal = 0.;
     63  fPedestal    = 0.;
    6364  fPedestalRms = 0.;
    6465}
     
    6768void MPedestalPix::Set(Float_t m, Float_t r)
    6869{
    69   fPedestal = m;
     70  fPedestal    = m;
    7071  fPedestalRms = r;
    7172}
     
    7374Bool_t MPedestalPix::IsValid() const
    7475{
     76
     77  if (!fValid)
     78    return kFALSE;
     79
    7580 return fPedestal>=0||fPedestalRms>=0;
    7681}
  • trunk/MagicSoft/Mars/mpedestal/MPedestalPix.h

    r3803 r3931  
    1212  Float_t fPedestal;     // mean value of pedestal (PMT offset)
    1313  Float_t fPedestalRms;  // root mean square / sigma  / standard deviation of pedestal
     14  Bool_t  fValid;        // flag to set pixel valid
    1415 
    1516public:
     
    2627 
    2728  void Set(const Float_t m, const Float_t r);
     29  void SetValid(const Bool_t b=kTRUE)    { fValid = b;  }
    2830 
    2931  // Getters
Note: See TracChangeset for help on using the changeset viewer.