FairRoot/PandaRoot
PndEmcCR2RCPulseshape.cxx
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Implementation of class PndEmcCR2RCPulseshape
7 // see PndEmcCR2RCPulseshape.h for details
8 //
9 //-----------------------------------------------------------
10 
11 
12 // This Class' Header ------------------
13 #include "PndEmcCR2RCPulseshape.h"
14 
15 // C/C++ Headers ----------------------
16 #include "assert.h"
17 #include "math.h"
18 
19 // Collaborating Class Headers --------
20 
21 
22 // Class Member definitions -----------
24  : fTint(0), fTdif(0), fTsig(0)
25 {
26 }
27 
28 PndEmcCR2RCPulseshape::PndEmcCR2RCPulseshape(double Tint, double Tdif, double Tsig)
29  : fTint(Tint), fTdif(Tdif), fTsig(Tsig)
30 {
31  assert(fTint!=fTsig && fTdif!=fTsig);
32 }
33 
34 double
36  const double amp, const double toffset) const {
37  if(fTint==fTdif)return degenerate_solution(t,amp,toffset);
38  return general_solution(t,amp,toffset);
39 }
40 
41 
42 double
44  const double amp,
45  const double toffset) const
46 {
47  double dt=t-toffset;
48  if(dt<0) return 0; // piecewise definition!
49 
50  double l_int=1.0/fTint;
51  double l_dif=1.0/fTdif;
52  double l_sig=1.0/fTsig;
53 
54  double term1=exp(-dt*l_int)*(l_sig-l_dif)*(dt-1/(l_sig-l_int)-1/(l_dif-l_int));
55  double term2=exp(-dt*l_dif)*(l_sig-l_int)/(l_dif-l_int);
56  double term3=exp(-dt*l_sig)*(l_dif-l_int)/(l_sig-l_int);
57 
58  return amp/((l_sig-l_dif)*(l_sig-l_int)*(l_dif-l_int))*(term1+term2-term3);
59 }
60 
61 
62 double
63 PndEmcCR2RCPulseshape::degenerate_solution(const double t, // for Tdif=Tint
64  const double amp,
65  const double toffset) const
66 {
67  double dt=t-toffset;
68  if(dt<0) return 0; // piecewise definition!
69 
70  double l_shaper=1.0/fTdif;
71  double l_sig=1.0/fTsig;
72 
73  double dl=l_sig-l_shaper;
74 
75  double term1 = (exp(-l_shaper*dt)*(dl*dl*dt*dt/2.0 - dl*dt + 1.0 ) -
76  exp(-l_sig*dt));
77 
78  return amp*term1;
79 }
friend F32vec4 exp(const F32vec4 &a)
Definition: P4_F32vec4.h:109
virtual double operator()(const double t, const double amp, const double toffset) const
double general_solution(const double t, const double amp, const double toffset) const
TTree * t
Definition: bump_analys.C:13
double degenerate_solution(const double t, const double amp, const double toffset) const