Ignore:
Timestamp:
04/01/04 21:11:50 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/msignal
Files:
2 edited

Legend:

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

    r3413 r3628  
    1515! *
    1616!
    17 !
    1817!   Author(s): Sebastian Raducci 12/2003 <mailto:raducci@fisica.uniud.it>
    1918!
     
    6261using namespace std;
    6362
     63const Byte_t MArrivalTimeCalc::fgSaturationLimit = 254;
    6464// --------------------------------------------------------------------------
    6565//
     
    7272    fName  = name  ? name  : "MArrivalTimeCalc";
    7373    fTitle = title ? title : "Calculate photons arrival time";
    74 
     74   
     75    SetSaturationLimit();
    7576}
    7677
     
    149150      // If pixel is saturated we use LoGains
    150151      //
    151       if (pixel.GetMaxHiGainSample() == 0xff && pixel.HasLoGain())
     152      if ((pixel.GetMaxHiGainSample() >= fSaturationLimit) && pixel.HasLoGain())
    152153        {
    153154         
     
    191192  // Initialize the spline
    192193  //
    193     MCubicSpline *spline = new MCubicSpline(fadcSamples); 
     194  MCubicSpline *spline = new MCubicSpline(fadcSamples); 
    194195
    195196  //
    196197  // Now find the maximum 
    197198  //
    198     Double_t abMaximum = spline->EvalAbMax();
    199     Double_t maximum = spline->EvalMax();
    200     const MPedestalPix &ped = (*fPedestals)[idx];
    201     const Double_t pedestal = ped.GetPedestal();
    202     const Double_t halfMax = (maximum + pedestal)/2.;
    203     Float_t time = (halfMax > pedestal) ? (Float_t ) spline->FindVal(halfMax,abMaximum,'l'): 0.0;
    204     delete spline;
    205     return time;
    206    
    207 }
    208 
     199  Double_t abMaximum = spline->EvalAbMax();
     200  Double_t maximum = spline->EvalMax();
     201  const MPedestalPix &ped = (*fPedestals)[idx];
     202  const Double_t pedestal = ped.GetPedestal();
     203  const Double_t halfMax = (maximum + pedestal)/2.;
     204  Float_t time = (halfMax > pedestal) ? (Float_t ) spline->FindVal(halfMax,abMaximum,'l'): 0.0;
     205  delete spline;
     206  return time;
     207   
     208}
     209
  • trunk/MagicSoft/Mars/msignal/MArrivalTimeCalc.h

    r3368 r3628  
    1313{
    1414
    15     MRawEvtData    *fRawEvt;     // raw event data (time slices)
    16     MRawRunHeader  *fRunHeader;  // RunHeader information
    17     MPedestalCam   *fPedestals;  // pedestal information
    18 
    19     MArrivalTimeCam *fArrTime;   // Container with the photons arrival times
    20 
    21     Int_t PreProcess(MParList *pList);
    22     Bool_t ReInit(MParList *pList);
    23     Int_t Process();
    24     Int_t PostProcess() {return kTRUE;}
    25 
    26     Float_t Calc(const Byte_t *fadcSamples, const Short_t nslices, const UInt_t idx);
    27  
     15  static const Byte_t fgSaturationLimit; // Default for fSaturationLimit
     16  Byte_t              fSaturationLimit; // Maximum FADC counts before being considered as saturated
     17 
     18  MRawEvtData    *fRawEvt;     // raw event data (time slices)
     19  MRawRunHeader  *fRunHeader;  // RunHeader information
     20  MPedestalCam   *fPedestals;  // pedestal information
     21 
     22  MArrivalTimeCam *fArrTime;   // Container with the photons arrival times
     23 
     24  Int_t PreProcess(MParList *pList);
     25  Bool_t ReInit(MParList *pList);
     26  Int_t Process();
     27  Int_t PostProcess() {return kTRUE;}
     28 
     29  Float_t Calc(const Byte_t *fadcSamples, const Short_t nslices, const UInt_t idx);
     30 
    2831public:
    2932    MArrivalTimeCalc(const char *name=NULL, const char *title=NULL);
    3033    ~MArrivalTimeCalc(){}
    3134 
     35    void SetSaturationLimit(const Byte_t lim=fgSaturationLimit) { fSaturationLimit = lim; }
     36   
    3237    ClassDef(MArrivalTimeCalc, 0)   // Task to calculate Arrival Times from raw data
    3338};
Note: See TracChangeset for help on using the changeset viewer.