2 #include "G4Poisson.hh" 3 #include "Randomize.hh" 9 #include "CLHEP/Units/PhysicalConstants.h" 10 using namespace CLHEP;
14 map<string, double> dgtz;
15 vector<identifier> identity = aHit->
GetId();
22 double tdc_time_to_channel=20;
24 double adc_charge_tochannel=20;
25 double PbWO4_light_yield =120/MeV;
29 double APD_size = 25*mm*mm;
30 double APD_gain = 250;
31 double APD_noise = 0.006;
32 double AMP_input_noise = 4500;
33 double AMP_gain = 2500;
34 double light_speed =15;
42 int idx = identity[0].id;
43 int idy = identity[1].id;
51 vector<G4double> times = aHit->
GetTime();
52 vector<G4ThreeVector> Lpos = aHit->
GetLPos();
53 vector<G4double> Edep = aHit->
GetEdep();
56 for(
unsigned int s=0; s<tInfos.
nsteps; s++)
58 double dRight = length/2 - Lpos[s].z();
59 double timeR = times[s] + dRight/cm/light_speed;
60 if(Edep[s]>1*MeV) Tmin=min(Tmin,timeR);
62 tdc=int(Tmin*tdc_time_to_channel);
63 if(tdc>tdc_max) tdc=(int)tdc_max;
65 double npe=G4Poisson(tInfos.
eTot*PbWO4_light_yield/2*APD_qe*APD_size/width/width);
67 double nel=npe*APD_gain;
68 nel=nel*G4RandGauss::shoot(1.,APD_noise);
71 nel=nel+AMP_input_noise*G4RandGauss::shoot(0.,1.);
74 double crg=nel*AMP_gain*1.6e-7;
76 adc= (int) (crg*adc_charge_tochannel);
91 id[
id.size()-1].id_sharing = 1;
98 map< string, vector <int> > MH;
vector< identifier > processID(vector< identifier >, G4Step *, detector)
map< string, double > integrateDgt(MHit *, int)
vector< identifier > GetId()
map< string, vector< int > > multiDgt(MHit *, int)
vector< G4ThreeVector > GetLPos()
vector< double > GetTime()
vector< double > dimensions
vector of dimensions. Size, units depends on solid type
vector< double > GetEdep()