15 const float ts2 = 10.;
16 const float ts3 = 29.3;
17 const float thpd = 4.;
18 const float tpre = 9.;
21 const float wd2 = 0.7;
27 std::vector<float> ntmp(nbin,0.0);
28 std::vector<float> nth(nbin,0.0);
29 std::vector<float> ntp(nbin,0.0);
30 std::vector<float> ntd(nbin,0.0);
37 for(j=0;j<thpd && j<nbin;j++){
38 nth[
j] = 1.0 + ((float)j)/thpd;
42 for(j=0;j<thpd && j<nbin;j++){
48 for(j=0;j<6*tpre && j<nbin;j++){
49 ntp[
j] = ((float)j)*
exp(-((
float)(j*j))/(tpre*tpre));
53 for(j=0;j<6*tpre && j<nbin;j++){
61 int tmax = 6 * (int)ts3;
64 for(j=0;j<tmax && j<nbin;j++){
65 ntd[
j] = wd1 *
exp(-((
float)j)/ts1) +
66 wd2 *
exp(-((
float)j)/ts2) +
67 wd3 *
exp(-((
float)j)/ts3) ;
71 for(j=0;j<tmax && j<nbin;j++){
76 for(i=0;i<tmax && i<nbin;i++){
81 for(j=0;j<thpd && j<nbin;j++){
83 for(k=0;k<4*tpre && k<nbin;k++){
87 ntmp[ntb] += ntd[
i]*nth[
j]*ntp[
k];
100 for(i=0; i<nbin; i++){
105 for(i=0; i<nbin; i++){
114 const float ts = 3.0;
119 std::vector<float> ntmp(nbin,0.0);
126 for( j = 0; j < 3 * ts && j < nbin; j++){
127 ntmp[
j] = ((float)j)*
exp(-((
float)(j*j))/(ts*ts));
131 for( j = 0; j < 3 * ts && j < nbin; j++){
146 shape_=std::vector<float>(
n,0.0f);
150 if (i>=0 && i<nbin_) shape_[
i]=
f;
157 if (i>=0 && i<nbin_) rv=shape_[
i];
165 if (i>=0 && i<nbin_) rv=shape_[
i];
170 static const float int_delta_ns = 0.05f;
173 for (
double t = t1;
t < t2;
t+= int_delta_ns) {
174 float loedge =
at(
t);
175 float hiedge =
at(
t+int_delta_ns);
176 intval += (loedge+hiedge)*int_delta_ns/2.0;
179 return (
float)intval;
float operator()(double time) const
Exp< T >::type exp(const T &t)
float integrate(double tmin, double tmax) const
void computeHFShape(Shape &s)
static const double tmax[3]
float at(double time) const
void setShapeBin(int i, float f)
void computeHPDShape(Shape &s)