23 #ifndef coldelecReponse_H 24 #define coldelecReponse_H 31 if (time <=0 || time >= 10*shaping) {
35 const double reltime = time/shaping;
41 return 4.31054*exp(-2.94809*reltime)*gain
42 -2.6202*exp(-2.82833*reltime)*cos(1.19361*reltime)*gain
43 -2.6202*exp(-2.82833*reltime)*cos(1.19361*reltime)*cos(2.38722*reltime)*gain
44 +0.464924*exp(-2.40318*reltime)*cos(2.5928*reltime)*gain
45 +0.464924*exp(-2.40318*reltime)*cos(2.5928*reltime)*cos(5.18561*reltime)*gain
46 +0.762456*exp(-2.82833*reltime)*sin(1.19361*reltime)*gain
47 -0.762456*exp(-2.82833*reltime)*cos(2.38722*reltime)*sin(1.19361*reltime)*gain
48 +0.762456*exp(-2.82833*reltime)*cos(1.19361*reltime)*sin(2.38722*reltime)*gain
49 -2.620200*exp(-2.82833*reltime)*sin(1.19361*reltime)*sin(2.38722*reltime)*gain
50 -0.327684*exp(-2.40318*reltime)*sin(2.5928*reltime)*gain +
51 +0.327684*exp(-2.40318*reltime)*cos(5.18561*reltime)*sin(2.5928*reltime)*gain
52 -0.327684*exp(-2.40318*reltime)*cos(2.5928*reltime)*sin(5.18561*reltime)*gain
53 +0.464924*exp(-2.40318*reltime)*sin(2.5928*reltime)*sin(5.18561*reltime)*gain;
58 double gain = pars[0];
60 double shaping = pars[1];
61 double offset = pars[2];
67 double gain = gainIn != 0.0 ? gainIn : 10.0;
68 double shaping = shapingIn > 0 ? shapingIn : 1.0;
69 bool havePars = gainIn > 0 && shaping > 0.0;
72 pf->SetParName(0,
"Height");
73 pf->SetParName(1,
"Shaping");
74 pf->SetParName(2,
"T0");
75 pf->SetParameter(0, gain);
76 pf->SetParameter(1, shaping);
77 pf->SetParameter(2, t0);
78 double limfac = havePars ? 2.0 : 10.0;
80 pf->SetParLimits(0, gain/limfac, limfac*gain);
82 pf->SetParLimits(0, limfac*gain, gain/limfac);
84 pf->SetParLimits(1, shaping/limfac, limfac*shaping);
code to link reconstructed objects back to the MC truth information
double coldelecResponseFunction(double *x, double *pars)
double coldelecResponse(double time, double gain, double shaping)
TF1 * coldelecResponseTF1(double gainIn, double shapingIn, double t0, std::string fname="ceresp")