4 #include "G4UnitsTable.hh" 5 #include "G4Poisson.hh" 6 #include "Randomize.hh" 22 int nsteps = aHit->
GetPos().size();
26 vector<G4double> Edep = aHit->
GetEdep();
27 for(
int s=0; s<nsteps; s++) Etot = Etot + Edep[s];
32 x = y = z = lx = ly = lz = 0;
33 vector<G4ThreeVector> pos = aHit->
GetPos();
34 vector<G4ThreeVector> Lpos = aHit->
GetLPos();
37 for(
int s=0; s<nsteps; s++)
39 x = x + pos[s].x()*Edep[s]/Etot;
40 y = y + pos[s].y()*Edep[s]/Etot;
41 z = z + pos[s].z()*Edep[s]/Etot;
42 lx = lx + Lpos[s].x()*Edep[s]/Etot;
43 ly = ly + Lpos[s].y()*Edep[s]/Etot;
44 lz = lz + Lpos[s].z()*Edep[s]/Etot;
58 vector<G4double> times = aHit->
GetTime();
59 for(
int s=0; s<nsteps; s++) time = time + times[s]/nsteps;
62 double Ene = aHit->
GetE();
64 out.
raws.push_back(Etot);
65 out.
raws.push_back(x);
66 out.
raws.push_back(y);
67 out.
raws.push_back(z);
68 out.
raws.push_back(lx);
69 out.
raws.push_back(ly);
70 out.
raws.push_back(lz);
71 out.
raws.push_back(time);
76 out.
raws.push_back(Ene);
89 double tdc_time_to_channel=20;
91 double adc_charge_tochannel=20;
92 double PbWO4_light_yield =120/MeV;
96 double APD_size = 25*mm*mm;
97 double APD_gain = 250;
98 double APD_noise = 0.006;
99 double AMP_input_noise = 4500;
100 double AMP_gain = 2500;
101 double light_speed =15;
117 double Tmin = 99999.;
120 for(
int s=0; s<nsteps; s++)
122 double dRight = length/2 - Lpos[s].z();
123 double timeR = times[s] + dRight/cm/light_speed;
124 if(Edep[s]>1*MeV) Tmin=min(Tmin,timeR);
126 TDC=int(Tmin*tdc_time_to_channel);
127 if(TDC>tdc_max) TDC=(int)tdc_max;
129 double npe=G4Poisson(Etot*PbWO4_light_yield/2*APD_qe*APD_size/width/width);
131 double nel=npe*APD_gain;
132 nel=nel*G4RandGauss::shoot(1.,APD_noise);
135 nel=nel+AMP_input_noise*G4RandGauss::shoot(0.,1.);
138 double crg=nel*AMP_gain*1.6e-7;
140 ADC= (int) (crg*adc_charge_tochannel);
143 out.
dgtz.push_back(IDX);
144 out.
dgtz.push_back(IDY);
145 out.
dgtz.push_back(ADC);
146 out.
dgtz.push_back(TDC);
154 id[
id.size()-1].id_sharing = 1;
vector< double > raws
Raw information.
vector< identifier > GetId()
string HCname
Hit Collection name.
vector< identifier > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
vector< identifier > identity
Identifier.
PH_output ProcessHit(MHit *, gemc_opts)
Method to process the hit.
vector< G4ThreeVector > GetLPos()
vector< G4ThreeVector > GetPos()
vector< double > GetTime()
vector< double > dimensions
vector of dimensions. Size, units depends on solid type
vector< double > GetEdep()
vector< int > dgtz
Digitized information.