File indexing completed on 2026-09-23 09:11:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 #ifndef G4Scintillation_h
0051 #define G4Scintillation_h 1
0052
0053 #include "globals.hh"
0054 #include "G4EmSaturation.hh"
0055 #include "G4OpticalPhoton.hh"
0056 #include "G4VRestDiscreteProcess.hh"
0057
0058 #include <map>
0059
0060 class G4PhysicsTable;
0061 class G4Step;
0062 class G4Track;
0063
0064
0065
0066
0067
0068
0069 class G4Scintillation : public G4VRestDiscreteProcess
0070 {
0071 public:
0072 explicit G4Scintillation(const G4String& processName = "Scintillation",
0073 G4ProcessType type = fElectromagnetic);
0074 ~G4Scintillation();
0075
0076 G4Scintillation(const G4Scintillation& right) = delete;
0077 G4Scintillation& operator=(const G4Scintillation& right) = delete;
0078
0079
0080
0081
0082
0083 G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
0084
0085
0086
0087 void ProcessDescription(std::ostream&) const override;
0088 void DumpInfo() const override {ProcessDescription(G4cout);};
0089
0090 void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
0091
0092
0093 void PreparePhysicsTable(const G4ParticleDefinition& part) override;
0094 void Initialise();
0095
0096 G4double GetMeanFreePath(const G4Track& aTrack, G4double,
0097 G4ForceCondition*) override;
0098
0099
0100
0101
0102 G4double GetMeanLifeTime(const G4Track& aTrack, G4ForceCondition*) override;
0103
0104
0105
0106
0107 G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
0108 const G4Step& aStep) override;
0109 G4VParticleChange* AtRestDoIt(const G4Track& aTrack,
0110 const G4Step& aStep) override;
0111
0112 G4double GetScintillationYieldByParticleType(const G4Track& aTrack,
0113 const G4Step& aStep,
0114 G4double& yield1,
0115 G4double& yield2,
0116 G4double& yield3,
0117 G4double& timeconstant1,
0118 G4double& timeconstant2,
0119 G4double& timeconstant3);
0120
0121
0122
0123
0124
0125
0126 void SetTrackSecondariesFirst(const G4bool state);
0127
0128
0129
0130
0131 G4bool GetTrackSecondariesFirst() const;
0132
0133
0134 void SetFiniteRiseTime(const G4bool state);
0135
0136
0137
0138 G4bool GetFiniteRiseTime() const;
0139
0140
0141 G4PhysicsTable* GetIntegralTable1() const;
0142
0143
0144 G4PhysicsTable* GetIntegralTable2() const;
0145
0146
0147 G4PhysicsTable* GetIntegralTable3() const;
0148
0149
0150 void AddSaturation(G4EmSaturation* sat);
0151
0152
0153 void RemoveSaturation();
0154
0155
0156 G4EmSaturation* GetSaturation() const;
0157
0158
0159 void SetScintillationByParticleType(const G4bool);
0160
0161
0162
0163 G4bool GetScintillationByParticleType() const;
0164
0165
0166
0167 void SetScintillationTrackInfo(const G4bool trackType);
0168
0169
0170
0171 G4bool GetScintillationTrackInfo() const;
0172
0173
0174
0175 void SetStackPhotons(const G4bool);
0176
0177
0178 G4bool GetStackPhotons() const;
0179
0180
0181 G4int GetNumPhotons() const;
0182
0183
0184 void DumpPhysicsTable() const;
0185
0186
0187 void SetVerboseLevel(G4int);
0188
0189
0190 private:
0191 void BuildInverseCdfTable(const G4MaterialPropertyVector* MPV,
0192 G4PhysicsFreeVector* vec) const;
0193
0194
0195
0196 private:
0197
0198 G4PhysicsTable* fIntegralTable1;
0199 G4PhysicsTable* fIntegralTable2;
0200 G4PhysicsTable* fIntegralTable3;
0201 std::map<std::size_t, std::size_t> fIndexMPT;
0202
0203 G4EmSaturation* fEmSaturation;
0204 const G4ParticleDefinition* opticalphoton =
0205 G4OpticalPhoton::OpticalPhotonDefinition();
0206
0207 G4int fNumPhotons;
0208
0209 G4bool fScintillationByParticleType;
0210 G4bool fScintillationTrackInfo;
0211 G4bool fStackingFlag;
0212 G4bool fTrackSecondariesFirst;
0213 G4bool fFiniteRiseTime;
0214
0215 #ifdef G4DEBUG_SCINTILLATION
0216 G4double ScintTrackEDep, ScintTrackYield;
0217 #endif
0218
0219 G4double single_exp(G4double t, G4double tau2);
0220 G4double bi_exp(G4double t, G4double tau1, G4double tau2);
0221
0222
0223 G4double sample_time(G4double tau1, G4double tau2);
0224
0225 G4int secID = -1;
0226 G4int fNumEnergyWarnings = 0;
0227
0228 };
0229
0230
0231
0232
0233
0234 inline G4bool G4Scintillation::GetTrackSecondariesFirst() const
0235 {
0236 return fTrackSecondariesFirst;
0237 }
0238
0239 inline G4bool G4Scintillation::GetFiniteRiseTime() const
0240 {
0241 return fFiniteRiseTime;
0242 }
0243
0244 inline G4PhysicsTable* G4Scintillation::GetIntegralTable1() const
0245 {
0246 return fIntegralTable1;
0247 }
0248
0249 inline G4PhysicsTable* G4Scintillation::GetIntegralTable2() const
0250 {
0251 return fIntegralTable2;
0252 }
0253
0254 inline G4PhysicsTable* G4Scintillation::GetIntegralTable3() const
0255 {
0256 return fIntegralTable3;
0257 }
0258
0259 inline void G4Scintillation::AddSaturation(G4EmSaturation* sat)
0260 {
0261 fEmSaturation = sat;
0262 }
0263
0264 inline void G4Scintillation::RemoveSaturation() { fEmSaturation = nullptr; }
0265
0266 inline G4EmSaturation* G4Scintillation::GetSaturation() const
0267 {
0268 return fEmSaturation;
0269 }
0270
0271 inline G4bool G4Scintillation::GetScintillationByParticleType() const
0272 {
0273 return fScintillationByParticleType;
0274 }
0275
0276 inline G4bool G4Scintillation::GetScintillationTrackInfo() const
0277 {
0278 return fScintillationTrackInfo;
0279 }
0280
0281 inline G4bool G4Scintillation::GetStackPhotons() const { return fStackingFlag; }
0282
0283 inline G4int G4Scintillation::GetNumPhotons() const { return fNumPhotons; }
0284
0285 inline G4double G4Scintillation::single_exp(G4double t, G4double tau2)
0286 {
0287 return std::exp(-1.0 * t / tau2) / tau2;
0288 }
0289
0290 inline G4double G4Scintillation::bi_exp(G4double t, G4double tau1,
0291 G4double tau2)
0292 {
0293 return std::exp(-1.0 * t / tau2) * (1 - std::exp(-1.0 * t / tau1)) / tau2 /
0294 tau2 * (tau1 + tau2);
0295 }
0296
0297 #endif