12#include "BesEmcWaveform.hh"
13#include "Randomize.hh"
14#include "CLHEP/Random/RanecuEngine.h"
15#include "CLHEP/Random/RandGauss.h"
16#include "BesEmcParameter.hh"
17#include "BesEmcDigi.hh"
38 m_highPrecision = m_highRange/((G4double)(1<<m_bitNb));
39 m_midPrecision = m_midRange/((G4double)(1<<m_bitNb));
40 m_lowPrecision = m_lowRange/((G4double)(1<<m_bitNb));
48 :m_tau(tau),m_sampleTime(sampleTime)
54 while(init!=
emcWave) *--init=0.0;
57 G4Exception(
"Invalid size");
88 if (
this != &assign) {
123 G4double
time = digi->
GetTime()*m_sampleTime+m_timeOffset-m_peakTime;
131 if(m_photonsPerMeV==0)
137 G4double photons =
energy*m_photonsPerMeV;
139 G4double photonStatFactor = RandGauss::shoot(photons, sqrt(photons))/photons;
140 amplitude =
energy*photonStatFactor;
149 G4double peak = m_peakTime*m_peakTime*m_peakTime*m_peakTime*
exp(-m_peakTime/m_tau)/24;
153 tempTime = i*m_sampleTime + m_timeOffset -
time;
155 emcWave[i] += amplitude*tempTime*tempTime*tempTime*tempTime*
exp(-tempTime/m_tau)/(24*peak);
161 G4double oneBitResolution;
162 oneBitResolution = m_midRange*2/((G4double)(1<<m_bitNb));
169 G4cout<<
"---In BesEmcWaveform: Over measurement!--- energy="<<
energy<<G4endl;
170 else if(
energy > m_midRange)
173 emcWave[i] = (G4double)((G4long)(
emcWave[i]/m_highPrecision))*m_highPrecision;
175 else if(
energy > m_lowRange)
178 emcWave[i] = (G4double)((G4long)(
emcWave[i]/m_midPrecision))*m_midPrecision;
183 emcWave[i] = (G4double)((G4long)(
emcWave[i]/m_lowPrecision))*m_lowPrecision;
190 G4cout<<
"New Wave!"<<G4endl;
200 emcWave[i] += RandGauss::shoot()*width;
EvtComplex exp(const EvtComplex &c)
************Class m_ypar INTEGER m_KeyWgt INTEGER m_nphot 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()