Ignore:
Timestamp:
11/29/04 16:45:57 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mpedestal
Files:
3 edited

Legend:

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

    r5496 r5504  
    150150/////////////////////////////////////////////////////////////////////////////
    151151#include "MExtractPedestal.h"
     152#include "MExtractTimeAndCharge.h"
    152153
    153154#include "MParList.h"
     
    355356 
    356357  *fLog << inf;
    357   Print();
    358358 
    359359  return kTRUE;
     
    419419  }
    420420 
    421  
     421  if (fExtractor)
     422    fExtractor->InitArrays();
     423 
     424  Print();
     425
    422426  return kTRUE;
    423427}
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc

    r5498 r5504  
    100100//   fCheckWinFirst   =  fgCheckWinFirst   =  0
    101101//   fCheckWinLast    =  fgCheckWinLast    =  29
    102 //   fExtractWinFirst =  fgExtractWinFirst =  0
     102//   fExtractWinFirst =  fgExtractWinFirst =  15
    103103//   fExtractWinSize  =  fgExtractWinSize  =  6
    104104//   fMaxSignalVar    =  fgMaxSignalVar    = 40;
     
    108108//  to set the Window in which a signal is searched
    109109//
    110 //  SetExtractWindow(fExtractWindFirst,fExtractWinSize);
     110//  SetExtractWindow(fExtractWinFirst,fExtractWinSize);
    111111//  to set the Window from which a signal is extracted
    112112//
     
    239239  const UShort_t losamples = fRunHeader->GetNumSamplesLoGain();
    240240
     241  UShort_t lastavailable   = hisamples+losamples-1;
     242
    241243  if (fExtractor)
    242     SetExtractWindow(hisamples+fExtractor->GetHiGainFirst(),hisamples+fExtractor->GetHiGainLast());
    243  
     244    {
     245      SetExtractWindow(fExtractor->GetHiGainFirst(),(Int_t)fExtractor->GetNumHiGainSamples());
     246      lastavailable = losamples-1;
     247    }
     248
    244249  // If the size is not yet set, set the size
    245250  if (fSumx.GetSize()==0)
     
    250255  }
    251256 
    252   MExtractPedestal::ReInit(pList);
    253  
    254   UShort_t lastavailable = hisamples+losamples-1;
    255 
    256    if (fExtractWinLast > lastavailable) //changed to override check
     257  if (fExtractWinLast > lastavailable) //changed to override check
    257258   {
    258259     const UShort_t diff = fExtractWinLast - lastavailable;
     
    264265     fExtractWinSize -= diff;
    265266   }
    266 
    267    lastavailable = fRunHeader->GetNumSamplesHiGain()-1;
    268 
     267 
     268   lastavailable = hisamples + losamples -1;
     269   
    269270   if (fCheckWinLast > lastavailable) //changed to override check
    270    {
     271     {
    271272       *fLog << warn << GetDescriptor();
    272273       *fLog << " - WARNING: Last Check Window slice out of range...adjusting to last available slice ";
    273274       *fLog << lastavailable << endl;
    274 
     275       
    275276       fCheckWinLast = lastavailable;
    276    }
    277 
     277     }
     278
     279  MExtractPedestal::ReInit(pList);
     280 
    278281  return kTRUE;
    279282}
     
    488491
    489492  fPedestalsOut->SetReadyToSave();
     493
    490494  return kTRUE;
    491495}
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc

    r5487 r5504  
    202202Bool_t MPedCalcPedRun::ReInit(MParList *pList)
    203203{
     204
     205  if (fExtractor)
     206    SetExtractWindow(fExtractor->GetHiGainFirst(),(Int_t)fExtractor->GetNumHiGainSamples());
    204207
    205208  MExtractPedestal::ReInit(pList);
     
    291294        CalcSums( &pixel, sum, ab0, ab1);
    292295
    293       const Float_t msum = (Float_t)sum;
    294      
    295       fSumx[idx]          += msum;
    296       fAreaSumx[aidx]     += msum;
    297       fSectorSumx[sector] += msum;     
    298 
    299       const Float_t sqrsum  = msum*msum;
     296      fSumx[idx]          += sum;
     297      fAreaSumx[aidx]     += sum;
     298      fSectorSumx[sector] += sum;     
     299
     300      const Float_t sqrsum  = sum*sum;
    300301      fSumx2[idx]          += sqrsum;
    301302      fAreaSumx2[aidx]     += sqrsum;
     
    316317  return kTRUE;
    317318}
    318 
    319 
    320319
    321320void MPedCalcPedRun::CalcExtractor( MRawEvtPixelIter *pixel, Float_t &sum, MPedestalPix &ped)
     
    328327  Float_t dummy;
    329328  fExtractor->FindTimeAndChargeHiGain(first,logain,sum,dummy,dummy,dummy,sat,ped,abflag);
     329
    330330}
    331331
     
    458458Bool_t MPedCalcPedRun::IsPedBitSet()
    459459{
     460
    460461  if (fRunHeader->GetRunNumber() < gkFirstRunWithFinalBits)
    461462    return kFALSE;
Note: See TracChangeset for help on using the changeset viewer.