Ignore:
Timestamp:
02/05/04 17:37:02 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r2944 r3032  
    6161// Default constructor.
    6262//
     63// Initialize step size by default to 0.03 time slices == 100 ps.
     64//
    6365MArrivalTimeCalc::MArrivalTimeCalc(const char *name, const char *title)
    64     : fStepSize(0.1)
     66    : fStepSize(0.03)
    6567{
    6668
     
    8082//  - MArrivalTime
    8183//
     84
    8285Int_t MArrivalTimeCalc::PreProcess(MParList *pList)
    8386{
     87
     88
    8489    fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData"));
    8590    if (!fRawEvt)
     
    186191
    187192  //
    188   // Now find the maximum evaluating the spline function at every 1/10 time slice
     193  // Now find the half maximum (!)
     194  // evaluating the spline function at every fStepSize time slice
    189195  //
    190196  Double_t abscissa=0;
     
    201207          maxAb  = abscissa;
    202208        }
     209      // make step size a bit bigger first
    203210      abscissa += fStepSize;
    204     }
    205 
    206   return (Float_t)maxAb;
    207 }
    208 
     211      //      abscissa += fStepSize;
     212    }
     213
     214  //
     215  // another (much smaller) loop to move back from the maximum
     216  //
     217  Double_t halfMaxAb = 0;
     218
     219  abscissa = maxAb;
     220 
     221  while (abscissa > 0)
     222    {
     223     
     224      const Double_t swap = spline.Eval(abscissa);
     225     
     226      if (swap < maxOrd/2.)
     227        {
     228          halfMaxAb = abscissa;
     229          break;
     230        }
     231     
     232      abscissa -= fStepSize;
     233    }
     234 
     235
     236  //  return (Float_t)maxAb;
     237  return (Float_t)halfMaxAb;
     238}
     239
Note: See TracChangeset for help on using the changeset viewer.