183 if (!aMaterialPropertiesTable)
187 aMaterialPropertiesTable->
GetProperty(
"FASTCOMPONENT");
189 aMaterialPropertiesTable->
GetProperty(
"SLOWCOMPONENT");
191 if (!Fast_Intensity && !Slow_Intensity )
195 if (Fast_Intensity && Slow_Intensity) nscnt = 2;
213 Scint_Yield_Vector = aMaterialPropertiesTable->
214 GetProperty(
"PROTONSCINTILLATIONYIELD");
218 Scint_Yield_Vector = aMaterialPropertiesTable->
219 GetProperty(
"DEUTERONSCINTILLATIONYIELD");
223 Scint_Yield_Vector = aMaterialPropertiesTable->
224 GetProperty(
"TRITONSCINTILLATIONYIELD");
228 Scint_Yield_Vector = aMaterialPropertiesTable->
229 GetProperty(
"ALPHASCINTILLATIONYIELD");
235 Scint_Yield_Vector = aMaterialPropertiesTable->
236 GetProperty(
"IONSCINTILLATIONYIELD");
242 Scint_Yield_Vector = aMaterialPropertiesTable->
243 GetProperty(
"ELECTRONSCINTILLATIONYIELD");
247 Scint_Yield_Vector = aMaterialPropertiesTable->
248 GetProperty(
"ELECTRONSCINTILLATIONYIELD");
253 if(!Scint_Yield_Vector){
254 Scint_Yield_Vector = aMaterialPropertiesTable->
255 GetProperty(
"ELECTRONSCINTILLATIONYIELD");
259 if (!Scint_Yield_Vector) {
261 ed <<
"\nG4Scintillation::PostStepDoIt(): "
262 <<
"Request for scintillation yield for energy deposit and particle type without correct entry in MaterialPropertiesTable\n"
263 <<
"ScintillationByParticleType requires at minimum that ELECTRONSCINTILLATIONYIELD is set by the user\n"
265 G4String comments =
"Missing MaterialPropertiesTable entry - No correct entry in MaterialPropertiesTable";
266 G4Exception(
"G4Scintillation::PostStepDoIt",
"Scint01",
274 <<
"Energy Dep. = " << TotalEnergyDeposit/
MeV <<
"\n"
276 << Scint_Yield_Vector->
Value(TotalEnergyDeposit)
284 ScintillationYield = Scint_Yield_Vector->
285 Value(TotalEnergyDeposit);
288 ScintillationYield = aMaterialPropertiesTable->
289 GetConstProperty(
"SCINTILLATIONYIELD");
295 G4double ResolutionScale = aMaterialPropertiesTable->
296 GetConstProperty(
"RESOLUTIONSCALE");
310 MeanNumberOfPhotons = ScintillationYield;
311 else if (emSaturation)
312 MeanNumberOfPhotons = ScintillationYield*
315 MeanNumberOfPhotons = ScintillationYield*TotalEnergyDeposit;
319 if (MeanNumberOfPhotons > 10.)
321 G4double sigma = ResolutionScale * std::sqrt(MeanNumberOfPhotons);
322 NumPhotons =
G4int(G4RandGauss::shoot(MeanNumberOfPhotons,sigma)+0.5);
354 G4int Num = NumPhotons;
356 for (
G4int scnt = 1; scnt <= nscnt; scnt++) {
365 ScintillationTime = aMaterialPropertiesTable->
366 GetConstProperty(
"FASTTIMECONSTANT");
368 ScintillationRiseTime = aMaterialPropertiesTable->
369 GetConstProperty(
"FASTSCINTILLATIONRISETIME");
371 ScintillationIntegral =
375 ScintillationTime = aMaterialPropertiesTable->
376 GetConstProperty(
"SLOWTIMECONSTANT");
378 ScintillationRiseTime = aMaterialPropertiesTable->
379 GetConstProperty(
"SLOWSCINTILLATIONRISETIME");
381 ScintillationIntegral =
386 G4double YieldRatio = aMaterialPropertiesTable->
387 GetConstProperty(
"YIELDRATIO");
389 Num =
G4int (std::min(YieldRatio,1.0) * NumPhotons);
394 ScintillationTime = aMaterialPropertiesTable->
395 GetConstProperty(
"FASTTIMECONSTANT");
397 ScintillationRiseTime = aMaterialPropertiesTable->
398 GetConstProperty(
"FASTSCINTILLATIONRISETIME");
400 ScintillationIntegral =
405 Num = NumPhotons - Num;
406 ScintillationTime = aMaterialPropertiesTable->
407 GetConstProperty(
"SLOWTIMECONSTANT");
409 ScintillationRiseTime = aMaterialPropertiesTable->
410 GetConstProperty(
"SLOWSCINTILLATIONRISETIME");
412 ScintillationIntegral =
416 if (!ScintillationIntegral)
continue;
422 for (
G4int i = 0; i < Num; i++) {
428 ScintillationIntegral->
GetEnergy(CIIvalue);
431 G4cout <<
"sampledEnergy = " << sampledEnergy <<
G4endl;
438 G4double sint = std::sqrt((1.-cost)*(1.+cost));
463 sinp = std::sin(phi);
464 cosp = std::cos(phi);
466 photonPolarization = cosp * photonPolarization + sinp * perp;
468 photonPolarization = photonPolarization.
unit();
476 (photonPolarization.
x(),
477 photonPolarization.
y(),
478 photonPolarization.
z());
498 if (ScintillationRiseTime==0.0) {
499 deltaTime = deltaTime -
502 deltaTime = deltaTime +
503 sample_time(ScintillationRiseTime, ScintillationTime);
506 G4double aSecondaryTime = t0 + deltaTime;
512 new G4Track(aScintillationPhoton,aSecondaryTime,aSecondaryPosition);
526 G4cout <<
"\n Exiting from G4Scintillation::DoIt -- NumberOfSecondaries = "
552 for (
G4int i=0 ; i < numOfMaterials; i++)
562 G4Material* aMaterial = (*theMaterialTable)[i];
567 if (aMaterialPropertiesTable) {
570 aMaterialPropertiesTable->
GetProperty(
"FASTCOMPONENT");
572 if (theFastLightVector) {
577 G4double currentIN = (*theFastLightVector)[0];
579 if (currentIN >= 0.0) {
588 aPhysicsOrderedFreeVector->
589 InsertValues(currentPM , currentCII);
604 currentPM = theFastLightVector->
Energy(ii);
605 currentIN = (*theFastLightVector)[ii];
607 currentCII = 0.5 * (prevIN + currentIN);
609 currentCII = prevCII +
610 (currentPM - prevPM) * currentCII;
612 aPhysicsOrderedFreeVector->
613 InsertValues(currentPM, currentCII);
616 prevCII = currentCII;
624 aMaterialPropertiesTable->
GetProperty(
"SLOWCOMPONENT");
626 if (theSlowLightVector) {
631 G4double currentIN = (*theSlowLightVector)[0];
633 if (currentIN >= 0.0) {
642 bPhysicsOrderedFreeVector->
643 InsertValues(currentPM , currentCII);
658 currentPM = theSlowLightVector->
Energy(ii);
659 currentIN = (*theSlowLightVector)[ii];
661 currentCII = 0.5 * (prevIN + currentIN);
663 currentCII = prevCII +
664 (currentPM - prevPM) * currentCII;
666 bPhysicsOrderedFreeVector->
667 InsertValues(currentPM, currentCII);
670 prevCII = currentCII;
694 G4Exception(
"G4Scintillation::SetScintillationByParticleType",
"Scint02",
695 JustWarning,
"Redefinition: Birks Saturation is replaced by ScintillationByParticleType!");
742 G4double t = -1.0*tau2*std::log(1-ran1);
744 if (ran2 <= bi_exp(t,tau1,tau2)/gg)
return t;