1 #include "ShapeParameters.h" 6 double UCorrelator::shape::getRiseTime(
const TGraph * g,
double min,
double max,
int peak)
10 if (peak < 0 || peak >= g->GetN())
16 for (
int i = peak; i >=0; i--)
19 if (g->GetY()[i] <= min)
24 if (g->GetY()[i] <= max && ilast < 0)
30 if (ifirst < 0 || ilast < 0)
return -1;
32 return g->GetX()[ilast] - g->GetX()[ifirst];
35 double UCorrelator::shape::getFallTime(
const TGraph * g,
double min,
double max,
int peak)
39 if (peak < 0 || peak >= g->GetN())
45 for (
int i = peak; i < g->GetN(); i++)
48 if (g->GetY()[i] <= min)
53 if (g->GetY()[i] <= max && ifirst < 0)
59 if (ifirst < 0 || ilast < 0)
return -1;
61 return g->GetX()[ilast] - g->GetX()[ifirst];
65 double UCorrelator::shape::getWidth(
const TGraph * g,
double val,
int * start,
int * end,
int peak)
71 if (peak < 0 || peak >= g->GetN())
77 for (
int i = peak; i < g->GetN(); i++)
79 if (g->GetY()[i] <=val)
87 for (
int i = peak; i >= 0; i--)
89 if (g->GetY()[i] <=val)
102 double t0 = g->GetX()[ifirst];
103 double t1 = g->GetX()[ilast];
105 if (start) *start = ifirst;
106 if (end) *end = ilast;