BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEmcWaveform Class Reference

#include <BesEmcWaveform.hh>

Public Member Functions

 BesEmcWaveform ()
 BesEmcWaveform (G4long, G4double, G4double)
virtual ~BesEmcWaveform ()
G4double & operator[] (G4long) const
virtual BesEmcWaveformoperator*= (const G4double &)
virtual BesEmcWaveformoperator/= (const G4double &)
virtual BesEmcWaveformoperator+= (const BesEmcWaveform &)
virtual BesEmcWaveformoperator= (const BesEmcWaveform &)
G4long length () const
G4double * GetWave () const
G4double GetTau () const
G4double GetSampleTime () const
G4double GetPeakTime () const
G4double GetTimeOffset () const
G4int GetBitNb () const
G4int GetGainFlag () const
G4double GetPhotonsPerMeV () const
G4double GetNonuniformity () const
G4double max (G4long &binOfMax) const
void updateWaveform (BesEmcHit *)
void updateWaveform (BesEmcDigi *)
void makeWaveform (G4double energy, G4double time)
void digitize ()
void addElecNoise (G4double, G4double)
void print ()
 BesEmcWaveform ()
 BesEmcWaveform (G4long, G4double, G4double)
virtual ~BesEmcWaveform ()
G4double & operator[] (G4long) const
virtual BesEmcWaveformoperator*= (const G4double &)
virtual BesEmcWaveformoperator/= (const G4double &)
virtual BesEmcWaveformoperator+= (const BesEmcWaveform &)
virtual BesEmcWaveformoperator= (const BesEmcWaveform &)
G4long length () const
G4double * GetWave () const
G4double GetTau () const
G4double GetSampleTime () const
G4double GetPeakTime () const
G4double GetTimeOffset () const
G4int GetBitNb () const
G4int GetGainFlag () const
G4double GetPhotonsPerMeV () const
G4double GetNonuniformity () const
G4double max (G4long &binOfMax) const
void updateWaveform (BesEmcHit *)
void updateWaveform (BesEmcDigi *)
void makeWaveform (G4double energy, G4double time)
void digitize ()
void addElecNoise (G4double, G4double)
void print ()
 BesEmcWaveform ()
 BesEmcWaveform (G4long, G4double, G4double)
virtual ~BesEmcWaveform ()
G4double & operator[] (G4long) const
virtual BesEmcWaveformoperator*= (const G4double &)
virtual BesEmcWaveformoperator/= (const G4double &)
virtual BesEmcWaveformoperator+= (const BesEmcWaveform &)
virtual BesEmcWaveformoperator= (const BesEmcWaveform &)
G4long length () const
G4double * GetWave () const
G4double GetTau () const
G4double GetSampleTime () const
G4double GetPeakTime () const
G4double GetTimeOffset () const
G4int GetBitNb () const
G4int GetGainFlag () const
G4double GetPhotonsPerMeV () const
G4double GetNonuniformity () const
G4double max (G4long &binOfMax) const
void updateWaveform (BesEmcHit *)
void updateWaveform (BesEmcDigi *)
void makeWaveform (G4double energy, G4double time)
void digitize ()
void addElecNoise (G4double, G4double)
void print ()

Protected Attributes

G4double * emcWave
G4long array_size

Detailed Description

Constructor & Destructor Documentation

◆ BesEmcWaveform() [1/6]

BesEmcWaveform::BesEmcWaveform ( )

Definition at line 21 of file BesEmcWaveform.cc.

21 {
22 BesEmcParameter& emcPara = BesEmcParameter::GetInstance();
23 // BesEmcParameter emcPara;
24 // emcPara.ReadData();
25 array_size = emcPara.GetArraySize();
26 m_tau = emcPara.GetTau();
27 m_highRange = emcPara.GetHighRange();
28 m_midRange = emcPara.GetMidRange();
29 m_lowRange = emcPara.GetLowRange();
30 m_sampleTime = emcPara.GetSampleTime();
31 m_peakTime = emcPara.GetPeakTime();
32 m_timeOffset = emcPara.GetTimeOffset();
33 m_bitNb = emcPara.GetADCbit();
34 m_photonsPerMeV = emcPara.GetPhotonsPerMeV();
35 m_nonuniformity = emcPara.GetNonuniformity();
36 m_flag = -1;
37 m_highPrecision = m_highRange / ( (G4double)( 1 << m_bitNb ) );
38 m_midPrecision = m_midRange / ( (G4double)( 1 << m_bitNb ) );
39 m_lowPrecision = m_lowRange / ( (G4double)( 1 << m_bitNb ) );
40 emcWave = new G4double[array_size];
41
42 for ( G4long i = 0; i < array_size; i++ ) emcWave[i] = 0;
43}
static BesEmcParameter & GetInstance()

Referenced by operator*=(), operator+=(), operator/=(), and operator=().

◆ BesEmcWaveform() [2/6]

BesEmcWaveform::BesEmcWaveform ( G4long size,
G4double tau,
G4double sampleTime )

Definition at line 45 of file BesEmcWaveform.cc.

46 : m_tau( tau ), m_sampleTime( sampleTime ) {
47 if ( size > 0 )
48 {
49 array_size = size;
50 emcWave = new G4double[array_size];
51 G4double* init = emcWave + array_size;
52 while ( init != emcWave ) *--init = 0.0;
53 }
54 else
55 {
56 G4cout << "BesEmcWaveform:: Invalid size" << G4endl;
57 exit( -1 );
58 }
59}
InputRawInit init

◆ ~BesEmcWaveform() [1/3]

BesEmcWaveform::~BesEmcWaveform ( )
virtual

Definition at line 62 of file BesEmcWaveform.cc.

62 {
63 delete[] emcWave;
64 emcWave = 0;
65}

◆ BesEmcWaveform() [3/6]

BesEmcWaveform::BesEmcWaveform ( )

◆ BesEmcWaveform() [4/6]

BesEmcWaveform::BesEmcWaveform ( G4long ,
G4double ,
G4double  )

◆ ~BesEmcWaveform() [2/3]

virtual BesEmcWaveform::~BesEmcWaveform ( )
virtual

◆ BesEmcWaveform() [5/6]

BesEmcWaveform::BesEmcWaveform ( )

◆ BesEmcWaveform() [6/6]

BesEmcWaveform::BesEmcWaveform ( G4long ,
G4double ,
G4double  )

◆ ~BesEmcWaveform() [3/3]

virtual BesEmcWaveform::~BesEmcWaveform ( )
virtual

Member Function Documentation

◆ addElecNoise() [1/3]

void BesEmcWaveform::addElecNoise ( G4double width,
G4double coherentNoise )

Definition at line 185 of file BesEmcWaveform.cc.

185 {
186 for ( G4int i = 0; i < array_size; i++ )
187 {
188 emcWave[i] += RandGauss::shoot() * width;
189 emcWave[i] += coherentNoise;
190 emcWave[i] = emcWave[i] > 0 ? emcWave[i] : 0;
191 }
192}

Referenced by BesEmcDigitizer::AddNoise5x5(), BesEmcDigitizer::AddNoiseAll(), and BesEmcDigitizer::Digitize().

◆ addElecNoise() [2/3]

void BesEmcWaveform::addElecNoise ( G4double ,
G4double  )

◆ addElecNoise() [3/3]

void BesEmcWaveform::addElecNoise ( G4double ,
G4double  )

◆ digitize() [1/3]

void BesEmcWaveform::digitize ( )

Definition at line 151 of file BesEmcWaveform.cc.

151 {
152 G4double oneBitResolution;
153 oneBitResolution = m_midRange * 2 / ( (G4double)( 1 << m_bitNb ) ); // not used now
154 G4double energy;
155
156 for ( G4long i = 0; i < array_size; i++ )
157 {
158 energy = emcWave[i];
159 if ( energy > m_highRange )
160 G4cout << "---In BesEmcWaveform: Over measurement!--- energy=" << energy << G4endl;
161 else if ( energy > m_midRange )
162 {
163 m_flag = 2;
164 emcWave[i] = (G4double)( (G4long)( emcWave[i] / m_highPrecision ) ) * m_highPrecision;
165 }
166 else if ( energy > m_lowRange )
167 {
168 m_flag = 1;
169 emcWave[i] = (G4double)( (G4long)( emcWave[i] / m_midPrecision ) ) * m_midPrecision;
170 }
171 else
172 {
173 m_flag = 0;
174 emcWave[i] = (G4double)( (G4long)( emcWave[i] / m_lowPrecision ) ) * m_lowPrecision;
175 }
176 }
177}
************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

Referenced by BesEmcDigitizer::AddNoise5x5(), BesEmcDigitizer::AddNoiseAll(), and BesEmcDigitizer::Digitize().

◆ digitize() [2/3]

void BesEmcWaveform::digitize ( )

◆ digitize() [3/3]

void BesEmcWaveform::digitize ( )

◆ GetBitNb() [1/3]

G4int BesEmcWaveform::GetBitNb ( ) const
inline

Definition at line 68 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcWaveform.hh.

68{ return m_bitNb; }

◆ GetBitNb() [2/3]

G4int BesEmcWaveform::GetBitNb ( ) const
inline

Definition at line 68 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcWaveform.hh.

68{ return m_bitNb; }

◆ GetBitNb() [3/3]

G4int BesEmcWaveform::GetBitNb ( ) const
inline

Definition at line 68 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

68{ return m_bitNb; }

◆ GetGainFlag() [1/3]

G4int BesEmcWaveform::GetGainFlag ( ) const
inline

Definition at line 69 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcWaveform.hh.

69{ return m_flag; }

◆ GetGainFlag() [2/3]

G4int BesEmcWaveform::GetGainFlag ( ) const
inline

Definition at line 69 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcWaveform.hh.

69{ return m_flag; }

◆ GetGainFlag() [3/3]

G4int BesEmcWaveform::GetGainFlag ( ) const
inline

Definition at line 69 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

69{ return m_flag; }

◆ GetNonuniformity() [1/3]

G4double BesEmcWaveform::GetNonuniformity ( ) const
inline

Definition at line 71 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcWaveform.hh.

71{ return m_nonuniformity; }

◆ GetNonuniformity() [2/3]

G4double BesEmcWaveform::GetNonuniformity ( ) const
inline

Definition at line 71 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcWaveform.hh.

71{ return m_nonuniformity; }

◆ GetNonuniformity() [3/3]

G4double BesEmcWaveform::GetNonuniformity ( ) const
inline

Definition at line 71 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

71{ return m_nonuniformity; }

◆ GetPeakTime() [1/3]

G4double BesEmcWaveform::GetPeakTime ( ) const
inline

Definition at line 66 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcWaveform.hh.

66{ return m_peakTime; }

◆ GetPeakTime() [2/3]

G4double BesEmcWaveform::GetPeakTime ( ) const
inline

Definition at line 66 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcWaveform.hh.

66{ return m_peakTime; }

◆ GetPeakTime() [3/3]

G4double BesEmcWaveform::GetPeakTime ( ) const
inline

Definition at line 66 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

66{ return m_peakTime; }

◆ GetPhotonsPerMeV() [1/3]

G4double BesEmcWaveform::GetPhotonsPerMeV ( ) const
inline

Definition at line 70 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcWaveform.hh.

70{ return m_photonsPerMeV; }

◆ GetPhotonsPerMeV() [2/3]

G4double BesEmcWaveform::GetPhotonsPerMeV ( ) const
inline

Definition at line 70 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcWaveform.hh.

70{ return m_photonsPerMeV; }

◆ GetPhotonsPerMeV() [3/3]

G4double BesEmcWaveform::GetPhotonsPerMeV ( ) const
inline

Definition at line 70 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

70{ return m_photonsPerMeV; }

◆ GetSampleTime() [1/3]

G4double BesEmcWaveform::GetSampleTime ( ) const
inline

Definition at line 65 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcWaveform.hh.

65{ return m_sampleTime; }

◆ GetSampleTime() [2/3]

G4double BesEmcWaveform::GetSampleTime ( ) const
inline

Definition at line 65 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcWaveform.hh.

65{ return m_sampleTime; }

◆ GetSampleTime() [3/3]

G4double BesEmcWaveform::GetSampleTime ( ) const
inline

Definition at line 65 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

65{ return m_sampleTime; }

◆ GetTau() [1/3]

G4double BesEmcWaveform::GetTau ( ) const
inline

Definition at line 64 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcWaveform.hh.

64{ return m_tau; }

◆ GetTau() [2/3]

G4double BesEmcWaveform::GetTau ( ) const
inline

Definition at line 64 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcWaveform.hh.

64{ return m_tau; }

◆ GetTau() [3/3]

G4double BesEmcWaveform::GetTau ( ) const
inline

Definition at line 64 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

64{ return m_tau; }

◆ GetTimeOffset() [1/3]

G4double BesEmcWaveform::GetTimeOffset ( ) const
inline

Definition at line 67 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcWaveform.hh.

67{ return m_timeOffset; }

◆ GetTimeOffset() [2/3]

G4double BesEmcWaveform::GetTimeOffset ( ) const
inline

Definition at line 67 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcWaveform.hh.

67{ return m_timeOffset; }

◆ GetTimeOffset() [3/3]

G4double BesEmcWaveform::GetTimeOffset ( ) const
inline

Definition at line 67 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

67{ return m_timeOffset; }

◆ GetWave() [1/3]

G4double * BesEmcWaveform::GetWave ( ) const
inline

◆ GetWave() [2/3]

G4double * BesEmcWaveform::GetWave ( ) const
inline

◆ GetWave() [3/3]

G4double * BesEmcWaveform::GetWave ( ) const
inline

Definition at line 63 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

63{ return emcWave; }

◆ length() [1/3]

G4long BesEmcWaveform::length ( ) const
inline

◆ length() [2/3]

G4long BesEmcWaveform::length ( ) const
inline

◆ length() [3/3]

G4long BesEmcWaveform::length ( ) const
inline

Definition at line 62 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcWaveform.hh.

62{ return array_size; }

◆ makeWaveform() [1/3]

void BesEmcWaveform::makeWaveform ( G4double energy,
G4double time )

Definition at line 122 of file BesEmcWaveform.cc.

122 {
123 G4double amplitude;
124 if ( m_photonsPerMeV == 0 ) { amplitude = energy; }
125 else
126 {
127 G4double photons = energy * m_photonsPerMeV;
128 if ( photons > 0 )
129 {
130 G4double photonStatFactor = RandGauss::shoot( photons, sqrt( photons ) ) / photons;
131 amplitude = energy * photonStatFactor;
132 }
133 else { amplitude = 0; }
134 }
135
136 G4double tempTime;
137 tempTime = 0;
138
139 G4double peak =
140 m_peakTime * m_peakTime * m_peakTime * m_peakTime * exp( -m_peakTime / m_tau ) / 24;
141
142 for ( G4long i = 0; i < array_size; i++ )
143 {
144 tempTime = i * m_sampleTime + m_timeOffset - time;
145 if ( tempTime > 0 )
146 emcWave[i] += amplitude * tempTime * tempTime * tempTime * tempTime *
147 exp( -tempTime / m_tau ) / ( 24 * peak );
148 }
149}
Double_t time
EvtComplex exp(const EvtComplex &c)

Referenced by updateWaveform(), and updateWaveform().

◆ makeWaveform() [2/3]

void BesEmcWaveform::makeWaveform ( G4double energy,
G4double time )

◆ makeWaveform() [3/3]

void BesEmcWaveform::makeWaveform ( G4double energy,
G4double time )

◆ max() [1/3]

G4double BesEmcWaveform::max ( G4long & binOfMax) const

Definition at line 94 of file BesEmcWaveform.cc.

94 {
95 G4double maxi = emcWave[0];
96 binOfMax = 0;
97 for ( G4long i = 1; i < array_size; i++ )
98 {
99 if ( emcWave[i] > maxi )
100 {
101 maxi = emcWave[i];
102 binOfMax = i;
103 }
104 }
105 return maxi;
106}

Referenced by BesEmcDigitizer::AddNoise5x5(), BesEmcDigitizer::AddNoiseAll(), and BesEmcDigitizer::Digitize().

◆ max() [2/3]

G4double BesEmcWaveform::max ( G4long & binOfMax) const

◆ max() [3/3]

G4double BesEmcWaveform::max ( G4long & binOfMax) const

◆ operator*=() [1/3]

BesEmcWaveform & BesEmcWaveform::operator*= ( const G4double & scale)
virtual

Definition at line 68 of file BesEmcWaveform.cc.

68 {
69 for ( G4long i = 0; i < array_size; i++ ) emcWave[i] *= scale;
70 return *this;
71}

◆ operator*=() [2/3]

virtual BesEmcWaveform & BesEmcWaveform::operator*= ( const G4double & )
virtual

◆ operator*=() [3/3]

virtual BesEmcWaveform & BesEmcWaveform::operator*= ( const G4double & )
virtual

◆ operator+=() [1/3]

BesEmcWaveform & BesEmcWaveform::operator+= ( const BesEmcWaveform & assign)
virtual

Definition at line 78 of file BesEmcWaveform.cc.

78 {
79 for ( G4long i = 0; i < array_size; i++ ) emcWave[i] += assign[i];
80 return *this;
81}

◆ operator+=() [2/3]

virtual BesEmcWaveform & BesEmcWaveform::operator+= ( const BesEmcWaveform & )
virtual

◆ operator+=() [3/3]

virtual BesEmcWaveform & BesEmcWaveform::operator+= ( const BesEmcWaveform & )
virtual

◆ operator/=() [1/3]

BesEmcWaveform & BesEmcWaveform::operator/= ( const G4double & scale)
virtual

Definition at line 73 of file BesEmcWaveform.cc.

73 {
74 for ( G4long i = 0; i < array_size; i++ ) emcWave[i] /= scale;
75 return *this;
76}

◆ operator/=() [2/3]

virtual BesEmcWaveform & BesEmcWaveform::operator/= ( const G4double & )
virtual

◆ operator/=() [3/3]

virtual BesEmcWaveform & BesEmcWaveform::operator/= ( const G4double & )
virtual

◆ operator=() [1/3]

BesEmcWaveform & BesEmcWaveform::operator= ( const BesEmcWaveform & assign)
virtual

Definition at line 83 of file BesEmcWaveform.cc.

83 {
84 if ( this != &assign )
85 {
86 if ( emcWave != 0 ) delete[] emcWave;
87 emcWave = new G4double[assign.array_size];
88 array_size = assign.array_size;
89 for ( G4long i = 0; i < array_size; i++ ) emcWave[i] = assign[i];
90 }
91 return *this;
92}

◆ operator=() [2/3]

virtual BesEmcWaveform & BesEmcWaveform::operator= ( const BesEmcWaveform & )
virtual

◆ operator=() [3/3]

virtual BesEmcWaveform & BesEmcWaveform::operator= ( const BesEmcWaveform & )
virtual

◆ operator[]() [1/3]

G4double & BesEmcWaveform::operator[] ( G4long index) const
inline

Definition at line 108 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcWaveform.hh.

108 {
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}

◆ operator[]() [2/3]

G4double & BesEmcWaveform::operator[] ( G4long ) const
inline

◆ operator[]() [3/3]

G4double & BesEmcWaveform::operator[] ( G4long ) const
inline

◆ print() [1/3]

void BesEmcWaveform::print ( )

Definition at line 179 of file BesEmcWaveform.cc.

179 {
180 G4cout << "New Wave!" << G4endl;
181 for ( G4long i = 0; i < array_size; i++ ) G4cout << emcWave[i] << "\t";
182 G4cout << G4endl;
183}

◆ print() [2/3]

void BesEmcWaveform::print ( )

◆ print() [3/3]

void BesEmcWaveform::print ( )

◆ updateWaveform() [1/6]

void BesEmcWaveform::updateWaveform ( BesEmcDigi * digi)

Definition at line 115 of file BesEmcWaveform.cc.

115 {
116 G4double energy = digi->GetEnergy();
117 G4double time = digi->GetTime() * m_sampleTime + m_timeOffset - m_peakTime;
118
120}
void makeWaveform(G4double energy, G4double time)

◆ updateWaveform() [2/6]

void BesEmcWaveform::updateWaveform ( BesEmcDigi * )

◆ updateWaveform() [3/6]

void BesEmcWaveform::updateWaveform ( BesEmcDigi * )

◆ updateWaveform() [4/6]

void BesEmcWaveform::updateWaveform ( BesEmcHit * hit)

◆ updateWaveform() [5/6]

void BesEmcWaveform::updateWaveform ( BesEmcHit * )

◆ updateWaveform() [6/6]

void BesEmcWaveform::updateWaveform ( BesEmcHit * )

Member Data Documentation

◆ array_size

◆ emcWave


The documentation for this class was generated from the following files: