199 G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
200 G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
204 G4double t0 = pPreStepPoint->GetGlobalTime();
206 G4double TotalEnergyDeposit = aStep.GetTotalEnergyDeposit();
210 if (!aMaterialPropertiesTable)
214 aMaterialPropertiesTable->
GetProperty(
"FASTCOMPONENT");
216 aMaterialPropertiesTable->
GetProperty(
"SLOWCOMPONENT");
218 if (!Fast_Intensity && !Slow_Intensity )
222 if (Fast_Intensity && Slow_Intensity) nscnt = 2;
235 ScintillationYield = aMaterialPropertiesTable->
236 GetConstProperty(
"SCINTILLATIONYIELD");
242 G4double ResolutionScale = aMaterialPropertiesTable->
243 GetConstProperty(
"RESOLUTIONSCALE");
257 MeanNumberOfPhotons = ScintillationYield;
259 MeanNumberOfPhotons = ScintillationYield*
262 MeanNumberOfPhotons = ScintillationYield*TotalEnergyDeposit;
266 if (MeanNumberOfPhotons > 10.)
268 G4double sigma = ResolutionScale * std::sqrt(MeanNumberOfPhotons);
290 if (aTrack.GetTrackStatus() == fAlive )
301 G4int Num = NumPhotons;
303 for (
G4int scnt = 1; scnt <= nscnt; scnt++) {
311 if (Fast_Intensity) {
312 ScintillationTime = aMaterialPropertiesTable->
313 GetConstProperty(
"FASTTIMECONSTANT");
315 ScintillationRiseTime = aMaterialPropertiesTable->
316 GetConstProperty(
"FASTSCINTILLATIONRISETIME");
318 ScintillationIntegral =
322 if (Slow_Intensity) {
323 ScintillationTime = aMaterialPropertiesTable->
324 GetConstProperty(
"SLOWTIMECONSTANT");
326 ScintillationRiseTime = aMaterialPropertiesTable->
327 GetConstProperty(
"SLOWSCINTILLATIONRISETIME");
329 ScintillationIntegral =
335 G4double yieldRatio = aMaterialPropertiesTable->
336 GetConstProperty(
"YIELDRATIO");
343 ScintillationTime = aMaterialPropertiesTable->
344 GetConstProperty(
"FASTTIMECONSTANT");
346 ScintillationRiseTime = aMaterialPropertiesTable->
347 GetConstProperty(
"FASTSCINTILLATIONRISETIME");
349 ScintillationIntegral =
355 Num = NumPhotons - Num;
356 ScintillationTime = aMaterialPropertiesTable->
357 GetConstProperty(
"SLOWTIMECONSTANT");
359 ScintillationRiseTime = aMaterialPropertiesTable->
360 GetConstProperty(
"SLOWSCINTILLATIONRISETIME");
362 ScintillationIntegral =
367 if (!ScintillationIntegral)
continue;
373 for (
G4int i = 0; i < Num; i++) {
379 ScintillationIntegral->
GetEnergy(CIIvalue);
382 G4cout <<
"sampledEnergy = " << sampledEnergy <<
G4endl;
389 G4double sint = std::sqrt((1.-cost)*(1.+cost));
414 sinp = std::sin(phi);
415 cosp = std::cos(phi);
417 photonPolarization = cosp * photonPolarization + sinp * perp;
419 photonPolarization = photonPolarization.
unit();
427 (photonPolarization.x(),
428 photonPolarization.y(),
429 photonPolarization.z());
443 G4double delta = rand * aStep.GetStepLength();
444 G4double deltaTime = delta / (pPreStepPoint->GetVelocity()+
445 rand*(pPostStepPoint->GetVelocity()-
446 pPreStepPoint->GetVelocity())/2.);
449 if (ScintillationRiseTime==0.0) {
450 deltaTime = deltaTime -
453 deltaTime = deltaTime +
454 sample_time(ScintillationRiseTime, ScintillationTime);
457 G4double aSecondaryTime = t0 + deltaTime;
460 x0 + rand * aStep.GetDeltaPosition();
462 G4Track* aSecondaryTrack =
new G4Track(aScintillationPhoton,
466 aSecondaryTrack->SetTouchableHandle(
467 aStep.GetPreStepPoint()->GetTouchableHandle());
470 aSecondaryTrack->SetParentID(aTrack.GetTrackID());
478 G4cout <<
"\n Exiting from G4Scintillation::DoIt -- NumberOfSecondaries = " ThreeVector shoot(const G4int Ap, const G4int Af)
G4long G4Poisson(G4double mean)
G4MaterialPropertyVector * GetProperty(const char *key)
G4bool fTrackSecondariesFirst
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4PhysicsTable * fFastIntegralTable
G4EmSaturation * fEmSaturation
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4PhysicsTable * fSlowIntegralTable
G4GLOB_DLL std::ostream G4cout
Hep3Vector cross(const Hep3Vector &) const
static const double twopi
void SetPolarization(G4double polX, G4double polY, G4double polZ)
void SetKineticEnergy(G4double aEnergy)
G4double GetEnergy(G4double aValue)
G4double fExcitationRatio
static G4OpticalPhoton * OpticalPhoton()
G4ParticleChange aParticleChange
G4ParticleDefinition * GetDefinition() const
G4double sample_time(G4double tau1, G4double tau2)
G4double GetScintillationYieldByParticleType(const G4Track &aTrack, const G4Step &aStep)
G4double GetPDGCharge() const
G4double VisibleEnergyDepositionAtAStep(const G4Step *)
G4bool fScintillationByParticleType