Ignore:
Timestamp:
03/03/07 22:33:56 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mpedestal
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc

    r8305 r8357  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.26 2007-02-04 15:49:08 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.27 2007-03-03 22:27:50 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    311311}
    312312
     313Bool_t MExtractPedestal::SetRangeFromExtractor(const MExtractor &ext, Bool_t logain)
     314{
     315    const Bool_t haslogains = ext.GetLoGainFirst()!=0 && ext.GetLoGainLast()!=0;
     316
     317    Bool_t rc1 = kTRUE;
     318    if (!haslogains)
     319    {
     320        // We assume that in case without lo-gains we
     321        // deal with pedestal events only
     322        rc1 = SetCheckRange(ext.GetHiGainFirst(), ext.GetHiGainLast());
     323    }
     324
     325    const Int_t f = logain && haslogains ? ext.GetLoGainFirst() : ext.GetHiGainFirst();
     326    const Int_t l = logain && haslogains ? ext.GetLoGainLast()  : ext.GetHiGainLast();
     327
     328    const Int_t w = (l-f+1);
     329
     330    // Setup to use the hi-gain extraction window in the lo-gain
     331    // range (the start of the lo-gain range is added automatically
     332    // by MPedCalcFromLoGain)
     333    const Bool_t rc2 = SetExtractWindow(f, w);
     334
     335    return rc1 && rc2;
     336}
    313337
    314338// --------------------------------------------------------------------------
     
    556580            return kFALSE;
    557581
     582        SetRangeFromExtractor(*fExtractor);
     583        /*
    558584        // If an extractor is set determin the window size automatically!
    559585        fExtractWinFirst = fExtractor->GetHiGainFirst();
    560586        fExtractWinLast  = fExtractor->GetHiGainLast();
    561587
     588        if (!fExtractor->HasLoGain())
     589        {
     590            fCheckWinFirst=fExtractWinFirst;
     591            fCheckWinLast =fExtractWinLast;
     592        }*/
    562593        // fSignal->GetNumSamples() not yet initialized!!!
    563594        const UInt_t num = fRunHeader->GetNumSamplesHiGain()+fRunHeader->GetNumSamplesLoGain();
  • trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.h

    r8296 r8357  
    1515
    1616class MGeomCam;
     17class MExtractor;
    1718class MPedestalCam;
    1819class MRawEvtData;
     
    103104  void CheckExtractionWindow(UInt_t offset=0);
    104105
     106  Bool_t SetRangeFromExtractor(const MExtractor &ext, Bool_t logain);
     107
    105108public:
    106109  MExtractPedestal(const char *name=NULL, const char *title=NULL);
     
    112115  Bool_t SetExtractWindow(UShort_t first, UShort_t size);
    113116  Bool_t SetCheckRange(UShort_t checkfirst=fgCheckWinFirst, UShort_t checklast=fgCheckWinLast);
     117
     118  virtual Bool_t SetRangeFromExtractor(const MExtractor &ext) = 0;
    114119
    115120  void SetMaxSignalVar(UShort_t maxvar=40)  { fMaxSignalVar = maxvar;    }
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.h

    r8151 r8357  
    6363    void SetPedestalUpdate(Bool_t b=kTRUE) { fPedestalUpdate      = b; }
    6464
     65    Bool_t SetRangeFromExtractor(const MExtractor &ext)
     66    {
     67        return MExtractPedestal::SetRangeFromExtractor(ext, kTRUE);
     68    }
     69
    6570    void Print(Option_t *o="") const;
    6671
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.h

    r8151 r8357  
    3838    void Print(Option_t *o="") const;
    3939    void Reset();
     40
     41    Bool_t SetRangeFromExtractor(const MExtractor &ext)
     42    {
     43        return MExtractPedestal::SetRangeFromExtractor(ext, kFALSE);
     44    }
    4045   
    4146    Int_t Finalize();
Note: See TracChangeset for help on using the changeset viewer.