Changeset 8296 for trunk/MagicSoft


Ignore:
Timestamp:
02/03/07 20:04:00 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8295 r8296  
    3737   * callisto_DecJan04.rc:
    3838     - set fall- and rise-time for spline artificially to 0.5
     39
     40   * mhbase/MFillH.cc:
     41     - added comments
     42
     43   * mpedestal/MExtractPedestal.[h,cc],
     44     mpedestal/MPedCalcFromLoGain.cc, mpedestal/MPedCalcPedRun.cc:
     45     - fixed the range check.In case of the lo-gain extraction
     46       the range could infact leak out of the fadc slices
    3947
    4048
  • trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc

    r8271 r8296  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.24 2007-01-26 21:10:14 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.25 2007-02-03 20:03:35 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    268268Bool_t MExtractPedestal::SetExtractWindow(UShort_t windowf, UShort_t windows)
    269269{
    270 
    271   Bool_t rc = kTRUE;
    272 
    273   const Int_t odd  = TMath::Odd(windows);
    274  
    275   if (odd && !fExtractor)
    276   {
    277       *fLog << warn << GetDescriptor();
    278       *fLog << " - WARNING: Window size in SetExtractWindow has to be even... ";
    279       *fLog << " lowering from " << windows << " to ";
    280       windows -= 1;
    281       *fLog << windows << "!" << endl;
    282       rc = kFALSE;
    283   }
    284 
    285   if (windows==0)
    286   {
    287       *fLog << warn << GetDescriptor();
    288       *fLog << " - WARNING: Window size in SetExtractWindow has to be > 0... adjusting to 2!" << endl;
    289       windows = 2;
    290       rc = kFALSE;
    291   }
    292 
    293   fExtractWinSize  = windows;
    294   fExtractWinFirst = windowf;
    295   fExtractWinLast  = fExtractWinFirst+fExtractWinSize-1;
    296 
    297   return rc;
     270    Bool_t rc = kTRUE;
     271
     272    if (windows==0)
     273    {
     274        *fLog << warn << GetDescriptor();
     275        *fLog << " - WARNING: Window size in SetExtractWindow has to be > 0... adjusting to 2!" << endl;
     276        windows = 2;
     277        rc = kFALSE;
     278    }
     279
     280    fExtractWinSize  = windows;
     281    fExtractWinFirst = windowf;
     282    fExtractWinLast  = fExtractWinFirst+fExtractWinSize-1;
     283
     284    return rc;
    298285}
    299286
     
    329316// Check (and if neccesary: correct) the extraction and check ranges.
    330317//
    331 void MExtractPedestal::CheckExtractionWindow()
     318void MExtractPedestal::CheckExtractionWindow(UInt_t offset)
    332319{
    333320    // fSignal->GetNumSamples() not yet initialized!!!
     
    336323    if (fCheckWinLast >= num)
    337324    {
    338         *fLog << warn << endl;
    339         *fLog << "Selected CheckWindow [" << fCheckWinFirst << "," << fCheckWinLast;
    340         *fLog << "] ranges out of range [0," << num-1 << "]." << endl;
    341         *fLog << "Resetting upper edge." << endl;
    342 
    343         fCheckWinLast = num;
    344     }
    345 
    346     if (fExtractWinLast >= num)
    347     {
    348         *fLog << warn << endl;
    349         *fLog << "Selected ExtractWindow [" << fExtractWinFirst << "," << fExtractWinLast;
    350         *fLog << "] ranges out of range [0," << num-1 << "]." << endl;
    351         *fLog << "Resetting upper edge." << endl;
    352 
    353         fExtractWinLast = num;
     325        *fLog << inf;
     326        *fLog << "CheckWindow [" << fCheckWinFirst+offset << "," << fCheckWinLast+offset;
     327        *fLog << "] out of range [0," << num-1 << "]... ";
     328        *fLog << "reset upper edge." << endl;
     329
     330        fCheckWinLast = num-1;
     331    }
     332
     333    if (offset+fExtractWinLast >= num)
     334    {
     335        *fLog << inf;
     336        *fLog << "ExtractWindow [" << fExtractWinFirst+offset << "," << fExtractWinLast+offset;
     337        *fLog << "] out of range [0," << num-1 << "]... ";
     338        *fLog << "reset upper edge." << endl;
     339
     340        fExtractWinLast = num-offset-1;
    354341    }
    355342
     
    359346        return;
    360347
    361     fExtractWinLast += fExtractWinLast==num-1 ? -1 : +1;
    362 
    363     *fLog << warn << endl;
    364     *fLog << "ExtractionWindow odd...";
    365     *fLog << "New extraction window [" << fExtractWinFirst << "," << fExtractWinLast << "]" << endl;
     348    fExtractWinLast += offset+fExtractWinLast==num-1 ? -1 : +1;
     349
     350    *fLog << inf;
     351    *fLog << "ExtractionWindow odd... set to [";
     352    *fLog << fExtractWinFirst+offset << "," << fExtractWinLast+offset << "]" << endl;
    366353
    367354    fExtractWinSize = fExtractWinLast-fExtractWinFirst+1;
     
    582569    }
    583570
    584     CheckExtractionWindow();
     571    //CheckExtractionWindow();
    585572
    586573    return kTRUE;
  • trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.h

    r8151 r8296  
    101101  Bool_t  CheckVariation(UInt_t idx) const;
    102102
    103   void CheckExtractionWindow();
     103  void CheckExtractionWindow(UInt_t offset=0);
    104104
    105105public:
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc

    r8151 r8296  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedCalcFromLoGain.cc,v 1.34 2006-10-24 07:58:13 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedCalcFromLoGain.cc,v 1.35 2007-02-03 20:03:35 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    158158using namespace std;
    159159
    160 const UShort_t MPedCalcFromLoGain::fgExtractWinFirst = 17;
    161 const UShort_t MPedCalcFromLoGain::fgExtractWinSize  =  6;
     160const UShort_t MPedCalcFromLoGain::fgExtractWinFirst =  17;
     161const UShort_t MPedCalcFromLoGain::fgExtractWinSize  =   6;
    162162const UInt_t   MPedCalcFromLoGain::fgNumDump         = 500;
    163163
     
    213213    if (!MExtractPedestal::ReInit(pList))
    214214        return kFALSE;
     215
     216    CheckExtractionWindow(fRunHeader->GetNumSamplesHiGain());
    215217
    216218    return kTRUE;
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc

    r8151 r8296  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedCalcPedRun.cc,v 1.49 2006-10-24 07:58:13 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedCalcPedRun.cc,v 1.50 2007-02-03 20:03:35 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    205205        return kFALSE;
    206206
     207    CheckExtractionWindow();
     208
    207209    //
    208210    // If this is the first ped run, the next run (call to ReInit)
Note: See TracChangeset for help on using the changeset viewer.