12#include "EmcSim/BesEmcWaveform.hh"
13#include "CLHEP/Random/RandGauss.h"
14#include "CLHEP/Random/RanecuEngine.h"
15#include "EmcSim/BesEmcDigi.hh"
16#include "EmcSim/BesEmcParameter.hh"
17#include "Randomize.hh"
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 ) );
46 : m_tau( tau ), m_sampleTime( sampleTime ) {
52 while ( init !=
emcWave ) *--init = 0.0;
56 G4cout <<
"BesEmcWaveform:: Invalid size" << G4endl;
84 if (
this != &assign )
117 G4double
time = digi->
GetTime() * m_sampleTime + m_timeOffset - m_peakTime;
124 if ( m_photonsPerMeV == 0 ) { amplitude =
energy; }
127 G4double photons =
energy * m_photonsPerMeV;
130 G4double photonStatFactor = RandGauss::shoot( photons, sqrt( photons ) ) / photons;
131 amplitude =
energy * photonStatFactor;
133 else { amplitude = 0; }
140 m_peakTime * m_peakTime * m_peakTime * m_peakTime *
exp( -m_peakTime / m_tau ) / 24;
144 tempTime = i * m_sampleTime + m_timeOffset -
time;
146 emcWave[i] += amplitude * tempTime * tempTime * tempTime * tempTime *
147 exp( -tempTime / m_tau ) / ( 24 * peak );
152 G4double oneBitResolution;
153 oneBitResolution = m_midRange * 2 / ( (G4double)( 1 << m_bitNb ) );
159 if (
energy > m_highRange )
160 G4cout <<
"---In BesEmcWaveform: Over measurement!--- energy=" <<
energy << G4endl;
161 else if (
energy > m_midRange )
164 emcWave[i] = (G4double)( (G4long)(
emcWave[i] / m_highPrecision ) ) * m_highPrecision;
166 else if (
energy > m_lowRange )
169 emcWave[i] = (G4double)( (G4long)(
emcWave[i] / m_midPrecision ) ) * m_midPrecision;
174 emcWave[i] = (G4double)( (G4long)(
emcWave[i] / m_lowPrecision ) ) * m_lowPrecision;
180 G4cout <<
"New Wave!" << G4endl;
188 emcWave[i] += RandGauss::shoot() * width;
EvtComplex exp(const EvtComplex &c)
************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
G4double GetTimeCrystal()
G4double GetEdepCrystal()
static BesEmcParameter & GetInstance()
G4double GetNonuniformity()
G4double GetPhotonsPerMeV()