149 G4double cvelScint=c_light/m_refIndexEc;
151 G4ThreeVector pos=hit->
GetPos();
157 G4double timeFlight=hit->
GetTime()-m_beamTime;
165 G4double nx=pDirection.x();
166 G4double ny=pDirection.y();
167 G4double nz=pDirection.z();
174 NphStep=G4int(edep*m_phNConstEc*m_Cpe2pmtEc*0.66*m_QEEc*m_CEEc*m_peCorFacEc);
179 for (G4int i=0;i<NphStep;i++)
182 ddS=stepL*G4UniformRand();
183 ddT=deltaT*G4UniformRand();
184 G4ThreeVector emtPos;
185 emtPos.setX(pos.x() + nx*ddS);
186 emtPos.setY(pos.y() + ny*ddS);
187 emtPos.setZ(pos.z() + nz*ddS);
193 DirectPh(partId, emtPos, pathL, forb);
196 G4double ran=G4UniformRand();
197 if (pathL>0 &&
exp(-pathL/m_attenEc) > ran)
200 G4double scinSwim=pathL/cvelScint;
208 G4double endTime= timeFlight + ddT + scinSwim + scinTime + transitTime;
214 if (m_t1st[forb]>endTime) m_t1st[forb] = endTime;
215 if (m_tLast[forb]<endTime) m_tLast[forb]= endTime;
227 G4double cos_spanEc = 1;
232 G4double dcosEc = cos_spanEc*(ran*2.0-1.0);
233 G4double r2=sqrt(emtPos.x()*emtPos.x()+emtPos.y()*emtPos.y());
234 if (dcosEc > 0.0 && dcosEc != 1)
237 pathL = (r2-m_ecR1)/(1.0-dcosEc);
239 else if (dcosEc < 0 && dcosEc != -1)
242 pathL=(2*838-r2-m_ecR1)/(1.0+dcosEc);
248 G4double tmp_tauRatio,tmp_tau1,tmp_tau2,tmp_tau3;
249 tmp_tauRatio = m_tauRatioEc;
254 G4double UniformR = tmp_tauRatio/(1+tmp_tauRatio);
255 G4double EmissionTime;
256 if (G4UniformRand()>UniformR) {
258 EmissionTime = -tmp_tau2*log( G4UniformRand() );
259 if (G4UniformRand()-
exp(EmissionTime/tmp_tau2-EmissionTime/tmp_tau1)>1.E-8)
263 else EmissionTime = -tmp_tau3*log( G4UniformRand() );
316 static G4int istore_snpe=-1;
320 G4double tau = m_riseTimeEc;
321 G4double norma_const=sqrt(
M_PI)*tau*tau*tau/4.0;
322 G4double echarge=1.6e-7;
336 t=(i+1)*m_timeBinSize;
337 snpe[i]=m_PMTgainEc*m_CeEc*
t*
t*
exp(- (
t/tau) * (
t/tau) )/norma_const;
343 for (G4int j=0;j<2;j++)
348 for (G4int j=0; j<fb; j++)
350 if (m_totalPhot[j] > 0)
352 n1=G4int(m_t1st[j]/m_timeBinSize);
353 n2=G4int(m_tLast[j]/m_timeBinSize);
360 for (G4int i=
n1;i<
n2;i++)
369 profPmt[ii][j] += phtn*snpe[ihst];
378 profPmt[i][j] = m_preGainEc*profPmt[i][j]+G4RandGauss::shoot(0,m_noiseSigmaEc);
385 if (profPmt[i][j]>max)
389 G4double tmp_HLthresh, tmp_LLthresh;
391 tmp_HLthresh = m_HLthreshEc;
392 tmp_LLthresh = m_LLthreshEc;
395 tmp_HLthresh = m_HLthreshEc;
396 tmp_LLthresh = m_LLthreshEc;
400 if (max>=tmp_HLthresh)
404 if ( profPmt[i][j] >= tmp_LLthresh )
406 m_TDC[j] = i*m_timeBinSize;
407 m_ADC[j] = m_preGainEc*m_totalPhot[j]*echarge*m_PMTgainEc;