Changeset 3032 for trunk/MagicSoft/Mars/manalysis/MArrivalTimeCalc.cc
- Timestamp:
- 02/05/04 17:37:02 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MArrivalTimeCalc.cc
r2944 r3032 61 61 // Default constructor. 62 62 // 63 // Initialize step size by default to 0.03 time slices == 100 ps. 64 // 63 65 MArrivalTimeCalc::MArrivalTimeCalc(const char *name, const char *title) 64 : fStepSize(0. 1)66 : fStepSize(0.03) 65 67 { 66 68 … … 80 82 // - MArrivalTime 81 83 // 84 82 85 Int_t MArrivalTimeCalc::PreProcess(MParList *pList) 83 86 { 87 88 84 89 fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData")); 85 90 if (!fRawEvt) … … 186 191 187 192 // 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 189 195 // 190 196 Double_t abscissa=0; … … 201 207 maxAb = abscissa; 202 208 } 209 // make step size a bit bigger first 203 210 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.