Warning, file /include/Geant4/G4WentzelVIModel.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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
0051
0052
0053
0054 #ifndef G4WentzelVIModel_h
0055 #define G4WentzelVIModel_h 1
0056
0057
0058
0059 #include "G4VMscModel.hh"
0060 #include "G4MaterialCutsCouple.hh"
0061 #include "G4WentzelOKandVIxSection.hh"
0062
0063
0064
0065 class G4WentzelVIModel : public G4VMscModel
0066 {
0067
0068 public:
0069
0070 explicit G4WentzelVIModel(G4bool comb=true, const G4String& nam = "WentzelVIUni");
0071
0072 ~G4WentzelVIModel() override;
0073
0074 void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0075
0076 void InitialiseLocal(const G4ParticleDefinition*,
0077 G4VEmModel* masterModel) override;
0078
0079 void StartTracking(G4Track*) override;
0080
0081 G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
0082 G4double KineticEnergy,
0083 G4double AtomicNumber,
0084 G4double AtomicWeight=0.,
0085 G4double cut = DBL_MAX,
0086 G4double emax= DBL_MAX) override;
0087
0088 G4ThreeVector& SampleScattering(const G4ThreeVector&,
0089 G4double safety) override;
0090
0091 G4double
0092 ComputeTruePathLengthLimit(const G4Track& track,
0093 G4double& currentMinimalStep) override;
0094
0095 G4double ComputeGeomPathLength(G4double truePathLength) override;
0096
0097 G4double ComputeTrueStepLength(G4double geomStepLength) override;
0098
0099
0100 void SetFixedCut(G4double);
0101
0102
0103 G4double GetFixedCut() const;
0104
0105
0106 void SetWVICrossSection(G4WentzelOKandVIxSection*);
0107
0108 G4WentzelOKandVIxSection* GetWVICrossSection();
0109
0110 void SetUseSecondMoment(G4bool);
0111
0112 G4bool UseSecondMoment() const;
0113
0114 G4PhysicsTable* GetSecondMomentTable();
0115
0116 G4double SecondMoment(const G4ParticleDefinition*,
0117 const G4MaterialCutsCouple*,
0118 G4double kineticEnergy);
0119
0120 void SetSingleScatteringFactor(G4double);
0121
0122 void DefineMaterial(const G4MaterialCutsCouple*);
0123
0124 G4WentzelVIModel & operator=(const G4WentzelVIModel &right) = delete;
0125 G4WentzelVIModel(const G4WentzelVIModel&) = delete;
0126
0127 protected:
0128
0129 G4double ComputeTransportXSectionPerVolume(G4double cosTheta);
0130
0131 inline void SetupParticle(const G4ParticleDefinition*);
0132
0133 private:
0134
0135 G4double ComputeSecondMoment(const G4ParticleDefinition*,
0136 G4double kineticEnergy);
0137
0138 protected:
0139
0140 G4WentzelOKandVIxSection* wokvi;
0141 const G4MaterialCutsCouple* currentCouple = nullptr;
0142 const G4Material* currentMaterial = nullptr;
0143
0144 const G4ParticleDefinition* particle = nullptr;
0145 G4ParticleChangeForMSC* fParticleChange = nullptr;
0146 const G4DataVector* currentCuts = nullptr;
0147 G4PhysicsTable* fSecondMoments = nullptr;
0148
0149 G4double lowEnergyLimit;
0150 G4double tlimitminfix;
0151 G4double ssFactor = 1.05;
0152 G4double invssFactor = 1.0;
0153
0154
0155 G4double preKinEnergy = 0.0;
0156 G4double tPathLength = 0.0;
0157 G4double zPathLength = 0.0;
0158 G4double lambdaeff = 0.0;
0159 G4double currentRange = 0.0;
0160 G4double cosTetMaxNuc = 0.0;
0161
0162 G4double fixedCut = -1.0;
0163
0164
0165 G4double effKinEnergy = 0.0;
0166
0167
0168 G4double cosThetaMin = 1.0;
0169 G4double cosThetaMax = -1.0;
0170 G4double xtsec = 0.0;
0171
0172 G4int currentMaterialIndex = 0;
0173 size_t idx2 = 0;
0174
0175
0176 G4int nelments = 0;
0177
0178
0179 G4bool singleScatteringMode;
0180 G4bool isCombined;
0181 G4bool useSecondMoment;
0182
0183 std::vector<G4double> xsecn;
0184 std::vector<G4double> prob;
0185 };
0186
0187
0188
0189
0190 inline void G4WentzelVIModel::SetupParticle(const G4ParticleDefinition* p)
0191 {
0192
0193 if(p != particle) {
0194 particle = p;
0195 wokvi->SetupParticle(p);
0196 }
0197 }
0198
0199
0200
0201 inline void G4WentzelVIModel::SetFixedCut(G4double val)
0202 {
0203 fixedCut = val;
0204 }
0205
0206
0207
0208 inline G4double G4WentzelVIModel::GetFixedCut() const
0209 {
0210 return fixedCut;
0211 }
0212
0213
0214
0215 inline void G4WentzelVIModel::SetWVICrossSection(G4WentzelOKandVIxSection* ptr)
0216 {
0217 if(ptr != wokvi) {
0218 delete wokvi;
0219 wokvi = ptr;
0220 }
0221 }
0222
0223
0224
0225 inline G4WentzelOKandVIxSection* G4WentzelVIModel::GetWVICrossSection()
0226 {
0227 return wokvi;
0228 }
0229
0230
0231
0232 inline void G4WentzelVIModel::SetUseSecondMoment(G4bool val)
0233 {
0234 useSecondMoment = val;
0235 }
0236
0237
0238
0239 inline G4bool G4WentzelVIModel::UseSecondMoment() const
0240 {
0241 return useSecondMoment;
0242 }
0243
0244
0245
0246 inline G4PhysicsTable* G4WentzelVIModel::GetSecondMomentTable()
0247 {
0248 return fSecondMoments;
0249 }
0250
0251
0252
0253 inline G4double
0254 G4WentzelVIModel::SecondMoment(const G4ParticleDefinition* part,
0255 const G4MaterialCutsCouple* couple,
0256 G4double ekin)
0257 {
0258 G4double x = 0.0;
0259 if(useSecondMoment) {
0260 DefineMaterial(couple);
0261 x = (fSecondMoments) ?
0262 (*fSecondMoments)[(*theDensityIdx)[currentMaterialIndex]]->Value(ekin, idx2)
0263 *(*theDensityFactor)[currentMaterialIndex]/(ekin*ekin)
0264 : ComputeSecondMoment(part, ekin);
0265 }
0266 return x;
0267 }
0268
0269
0270
0271 #endif
0272