BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh
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: BesEmcWaveform.hh
34
35#ifndef BesEmcWaveform_h
36#define BesEmcWaveform_h
37
38#include "EmcSim/BesEmcHit.hh"
39#include "globals.hh"
40
41class BesEmcHit;
42class BesEmcDigi;
43
44class BesEmcWaveform {
45
46public:
47 // Constructors
49 BesEmcWaveform( G4long, G4double, G4double );
50
51 // Destructors
52 virtual ~BesEmcWaveform();
53
54 // Operators
55 inline G4double& operator[]( G4long ) const;
56 virtual BesEmcWaveform& operator*=( const G4double& );
57 virtual BesEmcWaveform& operator/=( const G4double& );
60
61 // Selectors
62 inline G4long length() const { return array_size; }
63 inline G4double* GetWave() const { return emcWave; }
64 inline G4double GetTau() const { return m_tau; }
65 inline G4double GetSampleTime() const { return m_sampleTime; }
66 inline G4double GetPeakTime() const { return m_peakTime; }
67 inline G4double GetTimeOffset() const { return m_timeOffset; }
68 inline G4int GetBitNb() const { return m_bitNb; }
69 inline G4int GetGainFlag() const { return m_flag; }
70 inline G4double GetPhotonsPerMeV() const { return m_photonsPerMeV; }
71 inline G4double GetNonuniformity() const { return m_nonuniformity; }
72 G4double max( G4long& binOfMax ) const;
73 // returns the max of the array
74
75 // Modifiers
78 void makeWaveform( G4double energy, G4double time );
79 void digitize();
80 void addElecNoise( G4double, G4double ); // first parameter: incoherent noise width
81 // second parameter: coherent noise
82 void print();
83
84protected:
85 G4double* emcWave;
86 G4long array_size;
87
88private:
89 G4double m_tau; // tau_CsI=tau_CR=tau_RC=1000.*ns
90 G4double m_sampleTime; // sample time = 50.*ns
91 G4double m_peakTime; // peak time = 4000.*ns
92 G4double m_timeOffset; // the beginning of sample time = 2500.*ns
93 G4int m_bitNb; // 10 bit flash ADC
94 G4int m_flag;
95 // flag = 0, 1, 2 correspond to three different range of measurement
96
97 G4double m_photonsPerMeV; // photons produced in crystal per MeV
98 G4double m_nonuniformity; // non-uniformity of Light Output
99
100 G4double m_highRange; // 2.5GeV
101 G4double m_highPrecision;
102 G4double m_midRange; // 0.625GeV
103 G4double m_midPrecision;
104 G4double m_lowRange; // 0.078GeV
105 G4double m_lowPrecision;
106};
107
108inline G4double& BesEmcWaveform::operator[]( G4long index ) const {
109 if ( index < 0 || index > array_size - 1 )
110 {
111 G4cout << "Array bounds exceeded. Index " << index << G4endl;
112 ::abort();
113 }
114 return emcWave[index];
115}
116
117#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
virtual BesEmcWaveform & operator*=(const G4double &)
virtual BesEmcWaveform & operator/=(const G4double &)
void updateWaveform(BesEmcHit *)
void makeWaveform(G4double energy, G4double time)
G4double & operator[](G4long) const
virtual ~BesEmcWaveform()
virtual BesEmcWaveform & operator=(const BesEmcWaveform &)
void updateWaveform(BesEmcDigi *)
void addElecNoise(G4double, G4double)
BesEmcWaveform(G4long, G4double, G4double)
G4double max(G4long &binOfMax) const
virtual BesEmcWaveform & operator+=(const BesEmcWaveform &)