File indexing completed on 2025-01-18 09:59:04
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 class G4PhysicsTable;
0059 class G4Step;
0060 class G4Track;
0061
0062
0063
0064
0065
0066
0067 class G4Scintillation : public G4VRestDiscreteProcess
0068 {
0069 public:
0070 explicit G4Scintillation(const G4String& processName = "Scintillation",
0071 G4ProcessType type = fElectromagnetic);
0072 ~G4Scintillation();
0073
0074 G4Scintillation(const G4Scintillation& right) = delete;
0075 G4Scintillation& operator=(const G4Scintillation& right) = delete;
0076
0077
0078
0079
0080
0081 G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
0082
0083
0084
0085 void ProcessDescription(std::ostream&) const override;
0086 void DumpInfo() const override {ProcessDescription(G4cout);};
0087
0088 void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
0089
0090
0091 void PreparePhysicsTable(const G4ParticleDefinition& part) override;
0092 void Initialise();
0093
0094 G4double GetMeanFreePath(const G4Track& aTrack, G4double,
0095 G4ForceCondition*) override;
0096
0097
0098
0099
0100 G4double GetMeanLifeTime(const G4Track& aTrack, G4ForceCondition*) override;
0101
0102
0103
0104
0105 G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
0106 const G4Step& aStep) override;
0107 G4VParticleChange* AtRestDoIt(const G4Track& aTrack,
0108 const G4Step& aStep) override;
0109
0110 G4double GetScintillationYieldByParticleType(const G4Track& aTrack,
0111 const G4Step& aStep,
0112 G4double& yield1,
0113 G4double& yield2,
0114 G4double& yield3,
0115 G4double& timeconstant1,
0116 G4double& timeconstant2,
0117 G4double& timeconstant3);
0118
0119
0120
0121
0122
0123
0124 void SetTrackSecondariesFirst(const G4bool state);
0125
0126
0127
0128
0129 G4bool GetTrackSecondariesFirst() const;
0130
0131
0132 void SetFiniteRiseTime(const G4bool state);
0133
0134
0135
0136 G4bool GetFiniteRiseTime() const;
0137
0138
0139 G4PhysicsTable* GetIntegralTable1() const;
0140
0141
0142 G4PhysicsTable* GetIntegralTable2() const;
0143
0144
0145 G4PhysicsTable* GetIntegralTable3() const;
0146
0147
0148 void AddSaturation(G4EmSaturation* sat);
0149
0150
0151 void RemoveSaturation();
0152
0153
0154 G4EmSaturation* GetSaturation() const;
0155
0156
0157 void SetScintillationByParticleType(const G4bool);
0158
0159
0160
0161 G4bool GetScintillationByParticleType() const;
0162
0163
0164
0165 void SetScintillationTrackInfo(const G4bool trackType);
0166
0167
0168
0169 G4bool GetScintillationTrackInfo() const;
0170
0171
0172
0173 void SetStackPhotons(const G4bool);
0174
0175
0176 G4bool GetStackPhotons() const;
0177
0178
0179 G4int GetNumPhotons() const;
0180
0181
0182 void DumpPhysicsTable() const;
0183
0184
0185 void SetVerboseLevel(G4int);
0186
0187
0188 private:
0189
0190 G4PhysicsTable* fIntegralTable1;
0191 G4PhysicsTable* fIntegralTable2;
0192 G4PhysicsTable* fIntegralTable3;
0193
0194 G4EmSaturation* fEmSaturation;
0195 const G4ParticleDefinition* opticalphoton =
0196 G4OpticalPhoton::OpticalPhotonDefinition();
0197
0198 G4int fNumPhotons;
0199
0200 G4bool fScintillationByParticleType;
0201 G4bool fScintillationTrackInfo;
0202 G4bool fStackingFlag;
0203 G4bool fTrackSecondariesFirst;
0204 G4bool fFiniteRiseTime;
0205
0206 #ifdef G4DEBUG_SCINTILLATION
0207 G4double ScintTrackEDep, ScintTrackYield;
0208 #endif
0209
0210 G4double single_exp(G4double t, G4double tau2);
0211 G4double bi_exp(G4double t, G4double tau1, G4double tau2);
0212
0213
0214 G4double sample_time(G4double tau1, G4double tau2);
0215
0216 G4int secID = -1;
0217 G4int fNumEnergyWarnings = 0;
0218
0219 };
0220
0221
0222
0223
0224
0225 inline G4bool G4Scintillation::GetTrackSecondariesFirst() const
0226 {
0227 return fTrackSecondariesFirst;
0228 }
0229
0230 inline G4bool G4Scintillation::GetFiniteRiseTime() const
0231 {
0232 return fFiniteRiseTime;
0233 }
0234
0235 inline G4PhysicsTable* G4Scintillation::GetIntegralTable1() const
0236 {
0237 return fIntegralTable1;
0238 }
0239
0240 inline G4PhysicsTable* G4Scintillation::GetIntegralTable2() const
0241 {
0242 return fIntegralTable2;
0243 }
0244
0245 inline G4PhysicsTable* G4Scintillation::GetIntegralTable3() const
0246 {
0247 return fIntegralTable3;
0248 }
0249
0250 inline void G4Scintillation::AddSaturation(G4EmSaturation* sat)
0251 {
0252 fEmSaturation = sat;
0253 }
0254
0255 inline void G4Scintillation::RemoveSaturation() { fEmSaturation = nullptr; }
0256
0257 inline G4EmSaturation* G4Scintillation::GetSaturation() const
0258 {
0259 return fEmSaturation;
0260 }
0261
0262 inline G4bool G4Scintillation::GetScintillationByParticleType() const
0263 {
0264 return fScintillationByParticleType;
0265 }
0266
0267 inline G4bool G4Scintillation::GetScintillationTrackInfo() const
0268 {
0269 return fScintillationTrackInfo;
0270 }
0271
0272 inline G4bool G4Scintillation::GetStackPhotons() const { return fStackingFlag; }
0273
0274 inline G4int G4Scintillation::GetNumPhotons() const { return fNumPhotons; }
0275
0276 inline G4double G4Scintillation::single_exp(G4double t, G4double tau2)
0277 {
0278 return std::exp(-1.0 * t / tau2) / tau2;
0279 }
0280
0281 inline G4double G4Scintillation::bi_exp(G4double t, G4double tau1,
0282 G4double tau2)
0283 {
0284 return std::exp(-1.0 * t / tau2) * (1 - std::exp(-1.0 * t / tau1)) / tau2 /
0285 tau2 * (tau1 + tau2);
0286 }
0287
0288 #endif