91 , fIntegralTable1(nullptr)
92 , fIntegralTable2(nullptr)
93 , fIntegralTable3(nullptr)
94 , fEmSaturation(nullptr)
100#ifdef G4DEBUG_SCINTILLATION
102 ScintTrackYield = 0.;
135 out <<
"Scintillation simulates production of optical photons produced\n"
136 "by a high energy particle traversing matter.\n"
137 "Various material properties need to be defined.\n";
210 for(
size_t i = 0; i < numOfMaterials; ++i)
219 ((*materialTable)[i])->GetMaterialPropertiesTable();
246 currentPM = MPV->
Energy(ii);
247 currentIN = (*MPV)[ii];
249 prevCII + 0.5 * (currentPM - prevPM) * (prevIN + currentIN);
254 prevCII = currentCII;
282 currentPM = MPV->
Energy(ii);
283 currentIN = (*MPV)[ii];
285 prevCII + 0.5 * (currentPM - prevPM) * (prevIN + currentIN);
290 prevCII = currentCII;
317 currentPM = MPV->
Energy(ii);
318 currentIN = (*MPV)[ii];
320 prevCII + 0.5 * (currentPM - prevPM) * (prevIN + currentIN);
325 prevCII = currentCII;
373 G4int N_timeconstants = 1;
396 aTrack, aStep, yield1, yield2, yield3);
415 MeanNumberOfPhotons *=
418 MeanNumberOfPhotons *= TotalEnergyDeposit;
420 sum_yields = yield1 + yield2 + yield3;
422 if(MeanNumberOfPhotons > 10.)
424 G4double sigma = ResolutionScale * std::sqrt(MeanNumberOfPhotons);
457 for(
G4int scnt = 0; scnt < N_timeconstants; ++scnt)
462 if(N_timeconstants == 1)
482 if(N_timeconstants == 2)
516 for(
size_t i = 0; i < numPhot; ++i)
524 G4cout <<
"sampledEnergy = " << sampledEnergy <<
G4endl;
530 G4double sint = std::sqrt((1. - cost) * (1. + cost));
537 G4ThreeVector photonPolarization(cost * cosp, cost * sinp, -sint);
540 sinp = std::sin(phi);
541 cosp = std::cos(phi);
542 photonPolarization = (cosp * photonPolarization + sinp * perp).unit();
576 G4Track* secTrack =
new G4Track(scintPhoton, secTime, secPosition);
590 G4cout <<
"\n Exiting from G4Scintillation::DoIt -- NumberOfSecondaries = "
627 G4double t = -1.0 * tau2 * std::log(1. - ran1);
629 if(ran2 <=
bi_exp(t, tau1, tau2) / gg)
747 ed <<
"\nG4Scintillation::PostStepDoIt(): "
748 <<
"Request for scintillation yield for energy deposit and particle\n"
749 <<
"type without correct entry in MaterialPropertiesTable.\n"
750 <<
"ScintillationByParticleType requires at minimum that \n"
751 <<
"ELECTRONSCINTILLATIONYIELD is set by the user\n"
753 G4String comments =
"Missing MaterialPropertiesTable entry - No correct "
754 "entry in MaterialPropertiesTable";
770 if(PreStepKineticEnergy <= yieldVector->GetMaxEnergy())
776 yieldVector->
Value(PreStepKineticEnergy) -
777 yieldVector->
Value(PreStepKineticEnergy - StepEnergyDeposit);
782 ed <<
"\nG4Scintillation::GetScintillationYieldByParticleType(): Request\n"
783 <<
"for scintillation light yield above the available energy range\n"
784 <<
"specified in G4MaterialPropertiesTable. A linear interpolation\n"
785 <<
"will be performed to compute the scintillation light yield using\n"
786 <<
"(L_max / E_max) as the photon yield per unit energy." <<
G4endl;
787 G4String cmt =
"\nScintillation yield may be unphysical!\n";
788 G4Exception(
"G4Scintillation::GetScintillationYieldByParticleType()",
796#ifdef G4DEBUG_SCINTILLATION
798 ScintTrackYield += ScintillationYield;
799 ScintTrackEDep += StepEnergyDeposit;
801 G4cout <<
"\n--- G4Scintillation::GetScintillationYieldByParticleType() ---\n"
805 <<
"-- TrackID = " << aTrack.
GetTrackID() <<
"\n"
806 <<
"-- ParentID = " << aTrack.
GetParentID() <<
"\n"
811 <<
"-- Track EDep = " << ScintTrackEDep /
MeV <<
" MeV\n"
814 <<
"-- Step yield = " << ScintillationYield <<
" photons\n"
815 <<
"-- Track yield = " << ScintTrackYield <<
" photons\n"
824 ScintTrackYield = 0.;
828 return ScintillationYield;
877 G4Exception(
"G4Scintillation::SetScintillationByParticleType",
"Scint02",
879 "Redefinition: Birks Saturation is replaced by "
880 "ScintillationByParticleType!");
G4double condition(const G4ErrorSymMatrix &m)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
@ kSCINTILLATIONCOMPONENT1
@ kSCINTILLATIONCOMPONENT2
@ kSCINTILLATIONCOMPONENT3
@ kELECTRONSCINTILLATIONYIELD
@ kALPHASCINTILLATIONYIELD
@ kPROTONSCINTILLATIONYIELD
@ kDEUTERONSCINTILLATIONYIELD
@ kTRITONSCINTILLATIONYIELD
@ kSCINTILLATIONTIMECONSTANT1
@ kSCINTILLATIONRISETIME2
@ kTRITONSCINTILLATIONYIELD1
@ kDEUTERONSCINTILLATIONYIELD3
@ kIONSCINTILLATIONYIELD1
@ kSCINTILLATIONRISETIME1
@ kDEUTERONSCINTILLATIONYIELD2
@ kTRITONSCINTILLATIONYIELD2
@ kALPHASCINTILLATIONYIELD2
@ kELECTRONSCINTILLATIONYIELD3
@ kALPHASCINTILLATIONYIELD1
@ kELECTRONSCINTILLATIONYIELD2
@ kIONSCINTILLATIONYIELD2
@ kIONSCINTILLATIONYIELD3
@ kSCINTILLATIONRISETIME3
@ kPROTONSCINTILLATIONYIELD2
@ kDEUTERONSCINTILLATIONYIELD1
@ kTRITONSCINTILLATIONYIELD3
@ kSCINTILLATIONTIMECONSTANT3
@ kPROTONSCINTILLATIONYIELD3
@ kELECTRONSCINTILLATIONYIELD1
@ kALPHASCINTILLATIONYIELD3
@ kSCINTILLATIONTIMECONSTANT2
@ kPROTONSCINTILLATIONYIELD1
std::vector< G4Material * > G4MaterialTable
G4long G4Poisson(G4double mean)
static constexpr double twopi
static constexpr double MeV
G4GLOB_DLL std::ostream G4cout
Hep3Vector cross(const Hep3Vector &) const
static G4Alpha * AlphaDefinition()
static G4Deuteron * DeuteronDefinition()
void SetPolarization(const G4ThreeVector &)
G4ParticleDefinition * GetDefinition() const
void SetKineticEnergy(G4double aEnergy)
G4double VisibleEnergyDepositionAtAStep(const G4Step *) const
G4bool ConstPropertyExists(const G4String &key) const
G4double GetConstProperty(const G4String &key) const
G4MaterialPropertyVector * GetProperty(const char *key) const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
static size_t GetNumberOfMaterials()
static G4MaterialTable * GetMaterialTable()
static G4Neutron * NeutronDefinition()
void SetScintByParticleType(G4bool)
void SetScintTrackSecondariesFirst(G4bool)
G4int GetScintVerboseLevel() const
void SetScintVerboseLevel(G4int)
void SetScintStackPhotons(G4bool)
G4bool GetScintStackPhotons() const
static G4OpticalParameters * Instance()
void SetScintFiniteRiseTime(G4bool)
G4bool GetScintByParticleType() const
void SetScintTrackInfo(G4bool)
G4bool GetScintFiniteRiseTime() const
G4bool GetScintTrackInfo() const
G4bool GetScintTrackSecondariesFirst() const
void AddSecondary(G4Track *aSecondary)
virtual void Initialize(const G4Track &)
const G4String & GetParticleType() const
G4bool IsShortLived() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
void InsertValues(const G4double energy, const G4double value)
static G4int GetModelID(const G4int modelIndex)
std::size_t entries() const
void insertAt(std::size_t, G4PhysicsVector *)
G4double GetEnergy(const G4double value) const
G4double GetMaxEnergy() const
G4double GetMaxValue() const
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
static G4Proton * ProtonDefinition()
G4PhysicsTable * fIntegralTable3
G4VParticleChange * AtRestDoIt(const G4Track &aTrack, const G4Step &aStep) override
G4EmSaturation * fEmSaturation
G4double GetScintillationYieldByParticleType(const G4Track &aTrack, const G4Step &aStep, G4double &yield1, G4double &yield2, G4double &yield3)
void SetTrackSecondariesFirst(const G4bool state)
G4bool fScintillationTrackInfo
void SetStackPhotons(const G4bool)
G4bool fScintillationByParticleType
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *) override
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType) override
G4PhysicsTable * fIntegralTable1
void SetVerboseLevel(G4int)
G4double single_exp(G4double t, G4double tau2)
void SetScintillationTrackInfo(const G4bool trackType)
G4double sample_time(G4double tau1, G4double tau2)
G4double GetMeanLifeTime(const G4Track &aTrack, G4ForceCondition *) override
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
G4bool IsApplicable(const G4ParticleDefinition &aParticleType) override
void DumpPhysicsTable() const
G4bool fTrackSecondariesFirst
void SetFiniteRiseTime(const G4bool state)
G4Scintillation(const G4String &processName="Scintillation", G4ProcessType type=fElectromagnetic)
G4double bi_exp(G4double t, G4double tau1, G4double tau2)
void PreparePhysicsTable(const G4ParticleDefinition &part) override
void SetScintillationByParticleType(const G4bool)
G4PhysicsTable * fIntegralTable2
void ProcessDescription(std::ostream &) const override
const G4ParticleDefinition * opticalphoton
G4StepStatus GetStepStatus() const
G4double GetVelocity() const
G4double GetGlobalTime() const
const G4ThreeVector & GetPosition() const
const G4TouchableHandle & GetTouchableHandle() const
G4double GetKineticEnergy() const
G4ThreeVector GetDeltaPosition() const
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
G4TrackStatus GetTrackStatus() const
G4double GetVertexKineticEnergy() const
const G4ParticleDefinition * GetParticleDefinition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetKineticEnergy() const
void SetUserInformation(G4VUserTrackInformation *aValue) const
void SetCreatorModelID(const G4int id)
G4int GetParentID() const
void SetParentID(const G4int aValue)
static G4Triton * TritonDefinition()
void ProposeTrackStatus(G4TrackStatus status)
G4int GetNumberOfSecondaries() const
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
void SetProcessSubType(G4int)
virtual void DumpInfo() const
const G4String & GetProcessName() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
ThreeVector shoot(const G4int Ap, const G4int Af)