216 if (!aMaterialPropertiesTable)
220 aMaterialPropertiesTable->
GetProperty(
"FASTCOMPONENT");
222 aMaterialPropertiesTable->
GetProperty(
"SLOWCOMPONENT");
224 if (!Fast_Intensity && !Slow_Intensity )
228 if (Fast_Intensity && Slow_Intensity) nscnt = 2;
233 if (fScintillationByParticleType) {
241 ScintillationYield = aMaterialPropertiesTable->
242 GetConstProperty(
"SCINTILLATIONYIELD");
245 ScintillationYield *= fYieldFactor;
248 G4double ResolutionScale = aMaterialPropertiesTable->
249 GetConstProperty(
"RESOLUTIONSCALE");
262 if (fScintillationByParticleType)
263 MeanNumberOfPhotons = ScintillationYield;
264 else if (fEmSaturation)
265 MeanNumberOfPhotons = ScintillationYield*
268 MeanNumberOfPhotons = ScintillationYield*TotalEnergyDeposit;
270 if (MeanNumberOfPhotons > 10.)
272 G4double sigma = ResolutionScale * std::sqrt(MeanNumberOfPhotons);
280 if ( fNumPhotons <= 0 || !fStackingFlag )
293 if (fTrackSecondariesFirst) {
305 G4int Num = fNumPhotons;
307 for (
G4int scnt = 1; scnt <= nscnt; scnt++) {
316 if (Fast_Intensity) {
317 ScintillationTime = aMaterialPropertiesTable->
318 GetConstProperty(
"FASTTIMECONSTANT");
319 if (fFiniteRiseTime) {
320 ScintillationRiseTime = aMaterialPropertiesTable->
321 GetConstProperty(
"FASTSCINTILLATIONRISETIME");
323 ScintillationType =
Fast;
324 ScintillationIntegral =
328 if (Slow_Intensity) {
329 ScintillationTime = aMaterialPropertiesTable->
330 GetConstProperty(
"SLOWTIMECONSTANT");
331 if (fFiniteRiseTime) {
332 ScintillationRiseTime = aMaterialPropertiesTable->
333 GetConstProperty(
"SLOWSCINTILLATIONRISETIME");
335 ScintillationType =
Slow;
336 ScintillationIntegral =
342 G4double yieldRatio = aMaterialPropertiesTable->
343 GetConstProperty(
"YIELDRATIO");
344 if ( fExcitationRatio == 1.0 || fExcitationRatio == 0.0) {
350 ScintillationTime = aMaterialPropertiesTable->
351 GetConstProperty(
"FASTTIMECONSTANT");
352 if (fFiniteRiseTime) {
353 ScintillationRiseTime = aMaterialPropertiesTable->
354 GetConstProperty(
"FASTSCINTILLATIONRISETIME");
356 ScintillationType =
Fast;
357 ScintillationIntegral =
363 Num = fNumPhotons - Num;
364 ScintillationTime = aMaterialPropertiesTable->
365 GetConstProperty(
"SLOWTIMECONSTANT");
366 if (fFiniteRiseTime) {
367 ScintillationRiseTime = aMaterialPropertiesTable->
368 GetConstProperty(
"SLOWSCINTILLATIONRISETIME");
370 ScintillationType =
Slow;
371 ScintillationIntegral =
376 if (!ScintillationIntegral)
continue;
382 for (
G4int i = 0; i < Num; i++) {
388 ScintillationIntegral->
GetEnergy(CIIvalue);
391 G4cout <<
"sampledEnergy = " << sampledEnergy <<
G4endl;
398 G4double sint = std::sqrt((1.-cost)*(1.+cost));
423 sinp = std::sin(phi);
424 cosp = std::cos(phi);
426 photonPolarization = cosp * photonPolarization + sinp * perp;
428 photonPolarization = photonPolarization.
unit();
436 (photonPolarization.x(),
437 photonPolarization.y(),
438 photonPolarization.z());
458 if (ScintillationRiseTime==0.0) {
459 deltaTime = deltaTime -
462 deltaTime = deltaTime +
463 sample_time(ScintillationRiseTime, ScintillationTime);
466 G4double aSecondaryTime = t0 + deltaTime;
481 if (fScintillationTrackInfo) aSecondaryTrack->
490 G4cout <<
"\n Exiting from G4Scintillation::DoIt -- NumberOfSecondaries = "
ThreeVector shoot(const G4int Ap, const G4int Af)
G4long G4Poisson(G4double mean)
G4int GetNumberOfSecondaries() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4double GetStepLength() const
const G4DynamicParticle * GetDynamicParticle() const
G4PhysicsTable * fFastIntegralTable
G4TrackStatus GetTrackStatus() const
G4PhysicsTable * fSlowIntegralTable
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4ParticleDefinition * GetDefinition() const
G4double GetVelocity() const
static constexpr double twopi
G4StepPoint * GetPreStepPoint() const
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetPosition() const
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4double VisibleEnergyDepositionAtAStep(const G4Step *) const
void SetKineticEnergy(G4double aEnergy)
G4double GetEnergy(G4double aValue)
G4double GetTotalEnergyDeposit() const
G4Material * GetMaterial() const
static G4OpticalPhoton * OpticalPhoton()
virtual void Initialize(const G4Track &)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
void SetNumberOfSecondaries(G4int totSecondaries)
void SetParentID(const G4int aValue)
G4StepPoint * GetPostStepPoint() const
G4ParticleChange aParticleChange
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void AddSecondary(G4Track *aSecondary)
G4double GetGlobalTime() const
Hep3Vector cross(const Hep3Vector &) const
void ProposeTrackStatus(G4TrackStatus status)
G4double GetPDGCharge() const
G4ThreeVector GetDeltaPosition() const
G4double GetScintillationYieldByParticleType(const G4Track &aTrack, const G4Step &aStep)
G4MaterialPropertyVector * GetProperty(const char *key)
const G4TouchableHandle & GetTouchableHandle() const