Ignore:
Timestamp:
05/23/06 16:31:41 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc

    r7095 r7731  
    6363#include "MExtractTimeAndCharge.h"
    6464
     65#include <TRandom.h>
     66
    6567#include "MLog.h"
    6668#include "MLogManip.h"
     
    8789const Float_t MExtractTimeAndCharge::fgLoGainStartShift = -3.5;
    8890const Byte_t  MExtractTimeAndCharge::fgLoGainSwitch = 120;
     91
    8992// --------------------------------------------------------------------------
    9093//
     
    197200      // Make sure that in cases the time couldn't be correctly determined
    198201      // more meaningfull default values are assigned
    199       if (timehi<0)
    200           timehi = -1;
    201       if (timehi>pixel.GetNumHiGainSamples())
    202           timehi = pixel.GetNumHiGainSamples();
     202      if (timehi<=0 || timehi>pixel.GetNumHiGainSamples())
     203          timehi = gRandom->Uniform(pixel.GetNumHiGainSamples());
    203204     
    204205      Float_t sumlo =0., deltasumlo =-1.; // invalidate logain of MExtractedSignalPix
     
    235236          // Make sure that in cases the time couldn't be correctly determined
    236237          // more meaningfull default values are assigned
    237           if (timelo<0)
    238               timelo = -1;
    239           if (timelo>pixel.GetNumLoGainSamples())
    240               timelo = pixel.GetNumLoGainSamples();
     238          if (timelo<=0 || timelo>pixel.GetNumLoGainSamples())
     239              timelo = gRandom->Uniform(pixel.GetNumLoGainSamples());
    241240      }
    242241
Note: See TracChangeset for help on using the changeset viewer.