BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcWaveform.h
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oriented Simulation Tool //
3//---------------------------------------------------------------------------//
4//Description:
5//
6// The shape of the ideal signal is generated from the response function of
7// the crystal-photodiode-preAmplifier-mainAmplifier combination. The signal
8// from crystal is an exponential decay with the time constant tau_CsI. In
9// the Laplace domain, it equals 1/(s+a), where a=1/tau_CsI. Assume that the
10// preAmplifier has a step function 1/s. The mainAmplifier has a CR-RC-RC
11// shape. CR=s/(s+b), RC=1/(s+b), where b=1/tau_s, the shaping time constant.
12// The response time of the photodiode, and the time of deposition of energy
13// in the CsI crystal are presumed to be infinitely short, the response
14// funtion is then
15//
16// F(s) = [1/(s+a)]*(1/s)*[s/(s+b)^3] = 1/(s+a)(s+b)^3.
17//
18// In BESIII EMC, tau_CsI=tau_s=1.0e-6s. So the response fuction is 1/(s+a)^4.
19// In time domain, it is
20//
21// f(t) = t^3*exp(-t/tau)/6
22//
23//Author: Hemiao
24//Created: Oct 25, 2004
25//Modified:
26// May 23, 2005
27// The mainAmplifier changes to CR-RC-RC-RC, and the response funtion is then
28// F(s) = [1/(s+a)]*(1/s)*[s/(s+b)^4] = 1/(s+a)(s+b)^4.
29// In time domain, it is
30// f(t) = t^4*exp(-t/tau)/24
31//Comment:
32//---------------------------------------------------------------------------//
33// $Id: EmcWaveform.h
34
35#ifndef EMC_WAVEFORM_H
36#define EMC_WAVEFORM_H
37
38#include <iostream>
39#include <stdlib.h>
40using namespace std;
41
43
44public:
45
46 // Constructors
48 EmcWaveform(int, double, double);
49
50 // Destructors
52
53 // Operators
54 inline double &operator[](int ) const;
55 EmcWaveform &operator*=(const double);
56 EmcWaveform &operator/=(const double);
59
60 // Selectors
61 inline int length() const { return array_size;}
62 inline double* GetWave() const { return emcWave; }
63 inline double GetTau() const { return m_tau; }
64 inline double GetTauTrg() const { return m_tauTrg; }
65 inline double GetSampleTime() const { return m_sampleTime; }
66 inline double GetSampleTimeTrg() const { return m_sampleTimeTrg; }
67 inline double GetPeakTime() const { return m_peakTime; }
68 inline double GetPeakTimeTrg() const { return m_peakTimeTrg; }
69 inline double GetTimeOffset() const { return m_timeOffset; }
70 inline double GetTimeOffsetTrg() const { return m_timeOffsetTrg; }
71
72 double max(int &binOfMax) const; // returns the max of the array
73 double getADCTrg(int time); // return ADC in a certain time
74 int frontEdgeTrg(double thres); // returns the time over the threshold
75
76 // Modifiers
77 void makeWaveform(double energy, double time);
78 void makeWaveformTrg(double energy, double time);
79
80 void print();
81
82protected:
83
84 double *emcWave;
86
87private:
88
89 double m_tau; //tau_CsI=tau_CR=tau_RC=1000.*ns
90 double m_tauTrg; //tau_CsI=tau_CR=tau_RC=1000.*ns
91 double m_sampleTime; //sample time = 50.*ns
92 double m_sampleTimeTrg; //sample time = 50.*ns
93 double m_peakTime; //peak time = 4000.*ns
94 double m_peakTimeTrg; //peak time = 4000.*ns
95 double m_timeOffset; //the beginning of sample time = 2500.*ns
96 double m_timeOffsetTrg; //the beginning of sample time = 2500.*ns
97
98};
99
100inline double &EmcWaveform::operator[](int index) const
101{
102 if(index<0 || index>array_size-1){
103 cout << "Array bounds exceeded. Index " << index << endl;
104 ::abort();
105 }
106 return emcWave[index];
107}
108
109#endif
Double_t time
************Class m_ypar INTEGER m_KeyWgt INTEGER m_KeyIHVP INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
Definition: KK2f.h:50
double GetTau() const
Definition: EmcWaveform.h:63
EmcWaveform & operator+=(const EmcWaveform &)
Definition: EmcWaveform.cxx:60
double & operator[](int) const
Definition: EmcWaveform.h:100
double getADCTrg(int time)
Definition: EmcWaveform.cxx:92
int array_size
Definition: EmcWaveform.h:85
EmcWaveform & operator/=(const double)
Definition: EmcWaveform.cxx:54
double GetSampleTime() const
Definition: EmcWaveform.h:65
EmcWaveform & operator=(const EmcWaveform &)
Definition: EmcWaveform.cxx:66
double GetTimeOffsetTrg() const
Definition: EmcWaveform.h:70
void makeWaveformTrg(double energy, double time)
int length() const
Definition: EmcWaveform.h:61
double * emcWave
Definition: EmcWaveform.h:84
double GetTimeOffset() const
Definition: EmcWaveform.h:69
EmcWaveform & operator*=(const double)
Definition: EmcWaveform.cxx:48
double GetPeakTime() const
Definition: EmcWaveform.h:67
void makeWaveform(double energy, double time)
double GetTauTrg() const
Definition: EmcWaveform.h:64
double GetPeakTimeTrg() const
Definition: EmcWaveform.h:68
double * GetWave() const
Definition: EmcWaveform.h:62
int frontEdgeTrg(double thres)
double GetSampleTimeTrg() const
Definition: EmcWaveform.h:66