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;
92 double adc_charge_tochannel=20;
93 double PbWO4_light_yield =240/MeV;
98 double APD_size = 100*mm*mm;
99 double APD_gain = 150;
100 double APD_noise = 0.0033;
101 double AMP_input_noise = 9000;
102 double AMP_gain = 1800;
103 double light_speed =15;
131 double dRight = length/2 - lz;
132 double timeR = time + dRight/cm/light_speed;
134 timeR=timeR+G4RandGauss::shoot(0.,time_res);
136 TDC=int(timeR*tdc_time_to_channel);
137 if(TDC>tdc_max) TDC=(int)tdc_max;
140 double npe=G4Poisson(Etot*PbWO4_light_yield*0.5*APD_qe*APD_size/width/width);
147 double nel=npe*APD_gain;
148 nel=nel*G4RandGauss::shoot(1.,APD_noise);
151 nel=nel+AMP_input_noise*G4RandGauss::shoot(0.,1.);
154 double crg=nel*AMP_gain*1.6e-7;
156 ADC= (int) (crg*adc_charge_tochannel);
159 out.
dgtz.push_back(IDX);
160 out.
dgtz.push_back(IDY);
161 out.
dgtz.push_back(ADC);
162 out.
dgtz.push_back(TDC);
170 id[
id.size()-1].id_sharing = 1;
PH_output ProcessHit(MHit *, gemc_opts)
Method to process the hit.
vector< double > raws
Raw information.
vector< identifier > GetId()
string HCname
Hit Collection name.
vector< identifier > identity
Identifier.
vector< G4ThreeVector > GetLPos()
vector< G4ThreeVector > GetPos()
vector< double > GetTime()
vector< identifier > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
vector< double > dimensions
vector of dimensions. Size, units depends on solid type
vector< double > GetEdep()
vector< int > dgtz
Digitized information.