82 fTrackSecondariesFirst(
false),
83 fFiniteRiseTime(
false),
85 fExcitationRatio(1.0),
86 fScintillationByParticleType(
false),
87 fScintillationTrackInfo(
false),
90 fEmSaturation(nullptr)
94 #ifdef G4DEBUG_SCINTILLATION
183 if (!aMaterialPropertiesTable)
191 if (!Fast_Intensity && !Slow_Intensity )
195 if (Fast_Intensity && Slow_Intensity) nscnt = 2;
208 ScintillationYield = aMaterialPropertiesTable->
215 G4double ResolutionScale = aMaterialPropertiesTable->
230 MeanNumberOfPhotons = ScintillationYield;
232 MeanNumberOfPhotons = ScintillationYield*
235 MeanNumberOfPhotons = ScintillationYield*TotalEnergyDeposit;
237 if (MeanNumberOfPhotons > 10.)
239 G4double sigma = ResolutionScale * std::sqrt(MeanNumberOfPhotons);
274 for (
G4int scnt = 1; scnt <= nscnt; scnt++) {
283 if (Fast_Intensity) {
284 ScintillationTime = aMaterialPropertiesTable->
287 ScintillationRiseTime = aMaterialPropertiesTable->
290 ScintillationType =
Fast;
291 ScintillationIntegral =
295 if (Slow_Intensity) {
296 ScintillationTime = aMaterialPropertiesTable->
299 ScintillationRiseTime = aMaterialPropertiesTable->
302 ScintillationType =
Slow;
303 ScintillationIntegral =
309 G4double yieldRatio = aMaterialPropertiesTable->
317 ScintillationTime = aMaterialPropertiesTable->
320 ScintillationRiseTime = aMaterialPropertiesTable->
323 ScintillationType =
Fast;
324 ScintillationIntegral =
331 ScintillationTime = aMaterialPropertiesTable->
334 ScintillationRiseTime = aMaterialPropertiesTable->
337 ScintillationType =
Slow;
338 ScintillationIntegral =
343 if (!ScintillationIntegral)
continue;
349 for (
G4int i = 0; i < Num; i++) {
355 ScintillationIntegral->
GetEnergy(CIIvalue);
358 G4cout <<
"sampledEnergy = " << sampledEnergy <<
G4endl;
365 G4double sint = std::sqrt((1.-cost)*(1.+cost));
390 sinp = std::sin(phi);
391 cosp = std::cos(phi);
393 photonPolarization = cosp * photonPolarization + sinp *
perp;
395 photonPolarization = photonPolarization.
unit();
403 (photonPolarization.
x(),
404 photonPolarization.
y(),
405 photonPolarization.
z());
425 if (ScintillationRiseTime==0.0) {
426 deltaTime = deltaTime -
429 deltaTime = deltaTime +
430 sample_time(ScintillationRiseTime, ScintillationTime);
433 G4double aSecondaryTime = t0 + deltaTime;
457 G4cout <<
"\n Exiting from G4Scintillation::DoIt -- NumberOfSecondaries = "
485 for (
G4int i=0 ; i < numOfMaterials; i++)
495 G4Material* aMaterial = (*theMaterialTable)[i];
500 if (aMaterialPropertiesTable) {
505 if (theFastLightVector) {
510 G4double currentIN = (*theFastLightVector)[0];
512 if (currentIN >= 0.0) {
521 aPhysicsOrderedFreeVector->
522 InsertValues(currentPM , currentCII);
537 currentPM = theFastLightVector->
Energy(ii);
538 currentIN = (*theFastLightVector)[ii];
540 currentCII = 0.5 * (prevIN + currentIN);
542 currentCII = prevCII +
543 (currentPM - prevPM) * currentCII;
545 aPhysicsOrderedFreeVector->
546 InsertValues(currentPM, currentCII);
549 prevCII = currentCII;
559 if (theSlowLightVector) {
564 G4double currentIN = (*theSlowLightVector)[0];
566 if (currentIN >= 0.0) {
575 bPhysicsOrderedFreeVector->
576 InsertValues(currentPM , currentCII);
591 currentPM = theSlowLightVector->
Energy(ii);
592 currentIN = (*theSlowLightVector)[ii];
594 currentCII = 0.5 * (prevIN + currentIN);
596 currentCII = prevCII +
597 (currentPM - prevPM) * currentCII;
599 bPhysicsOrderedFreeVector->
600 InsertValues(currentPM, currentCII);
603 prevCII = currentCII;
624 G4Exception(
"G4Scintillation::SetScintillationByParticleType",
"Scint02",
625 JustWarning,
"Redefinition: Birks Saturation is replaced by ScintillationByParticleType!");
675 if (ran2 <=
bi_exp(t,tau1,tau2)/gg)
return t;
699 Scint_Yield_Vector = aMaterialPropertiesTable->
704 Scint_Yield_Vector = aMaterialPropertiesTable->
709 Scint_Yield_Vector = aMaterialPropertiesTable->
714 Scint_Yield_Vector = aMaterialPropertiesTable->
721 Scint_Yield_Vector = aMaterialPropertiesTable->
728 Scint_Yield_Vector = aMaterialPropertiesTable->
733 Scint_Yield_Vector = aMaterialPropertiesTable->
738 if(!Scint_Yield_Vector)
739 Scint_Yield_Vector = aMaterialPropertiesTable->
743 if (!Scint_Yield_Vector) {
745 ed <<
"\nG4Scintillation::PostStepDoIt(): "
746 <<
"Request for scintillation yield for energy deposit and particle\n"
747 <<
"type without correct entry in MaterialPropertiesTable.\n"
748 <<
"ScintillationByParticleType requires at minimum that \n"
749 <<
"ELECTRONSCINTILLATIONYIELD is set by the user\n"
751 G4String comments =
"Missing MaterialPropertiesTable entry - No correct entry in MaterialPropertiesTable";
752 G4Exception(
"G4Scintillation::PostStepDoIt",
"Scint01",
769 if(PreStepKineticEnergy <= Scint_Yield_Vector->GetMaxEnergy()){
770 G4double Yield1 = Scint_Yield_Vector->
Value(PreStepKineticEnergy);
771 G4double Yield2 = Scint_Yield_Vector->
772 Value(PreStepKineticEnergy - StepEnergyDeposit);
773 ScintillationYield = Yield1 - Yield2;
776 ed <<
"\nG4Scintillation::GetScintillationYieldByParticleType(): Request\n"
777 <<
"for scintillation light yield above the available energy range\n"
778 <<
"specifed in G4MaterialPropertiesTable. A linear interpolation\n"
779 <<
"will be performed to compute the scintillation light yield using\n"
780 <<
"(L_max / E_max) as the photon yield per unit energy."
782 G4String cmt =
"\nScintillation yield may be unphysical!\n";
783 G4Exception(
"G4Scintillation::GetScintillationYieldByParticleType()",
790 ScintillationYield = LinearYield * StepEnergyDeposit;
793 #ifdef G4DEBUG_SCINTILLATION
796 ScintTrackYield += ScintillationYield;
797 ScintTrackEDep += StepEnergyDeposit;
799 G4cout <<
"\n--- G4Scintillation::GetScintillationYieldByParticleType() ---\n"
802 <<
"-- TrackID = " << aTrack.
GetTrackID() <<
"\n"
803 <<
"-- ParentID = " << aTrack.
GetParentID() <<
"\n"
806 <<
"-- Track EDep = " << ScintTrackEDep/
MeV <<
" MeV\n"
808 <<
"-- Step yield = " << ScintillationYield <<
" photons\n"
809 <<
"-- Track yield = " << ScintTrackYield <<
" photons\n"
818 ScintTrackYield = 0.;
823 return ScintillationYield;
832 for (
G4int i = 0 ; i < PhysicsTableSize ; i++ )
843 for (
G4int i = 0 ; i < PhysicsTableSize ; i++ )