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