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 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/standard/include/G4WentzelVIModel.hh (Version 11.3.0) and /processes/electromagnetic/standard/include/G4WentzelVIModel.hh (Version 5.1)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 // -------------------------------------------    
 28 //                                                
 29 //                                                
 30 // GEANT4 Class header file                       
 31 //                                                
 32 //                                                
 33 // File name:     G4WentzelVIModel                
 34 //                                                
 35 // Author:        V.Ivanchenko                    
 36 //                                                
 37 // Creation date: 09.04.2008 from G4MuMscModel    
 38 //                                                
 39 // Modifications:                                 
 40 // 27-05-2010 V.Ivanchenko added G4WentzelOKan    
 41 //              compute cross sections and sam    
 42 //                                                
 43 // Class Description:                             
 44 //                                                
 45 // Implementation of the model of multiple sca    
 46 // G.Wentzel, Z. Phys. 40 (1927) 590.             
 47 // H.W.Lewis, Phys Rev 78 (1950) 526.             
 48 // J.M. Fernandez-Varea et al., NIM B73 (1993)    
 49 // L.Urban, CERN-OPEN-2006-077.                   
 50                                                   
 51 // -------------------------------------------    
 52 //                                                
 53                                                   
 54 #ifndef G4WentzelVIModel_h                        
 55 #define G4WentzelVIModel_h 1                      
 56                                                   
 57 //....oooOO0OOooo........oooOO0OOooo........oo    
 58                                                   
 59 #include "G4VMscModel.hh"                         
 60 #include "G4MaterialCutsCouple.hh"                
 61 #include "G4WentzelOKandVIxSection.hh"            
 62                                                   
 63 //....oooOO0OOooo........oooOO0OOooo........oo    
 64                                                   
 65 class G4WentzelVIModel : public G4VMscModel       
 66 {                                                 
 67                                                   
 68 public:                                           
 69                                                   
 70   explicit G4WentzelVIModel(G4bool comb=true,     
 71                                                   
 72   ~G4WentzelVIModel() override;                   
 73                                                   
 74   void Initialise(const G4ParticleDefinition*,    
 75                                                   
 76   void InitialiseLocal(const G4ParticleDefinit    
 77            G4VEmModel* masterModel) override;     
 78                                                   
 79   void StartTracking(G4Track*) override;          
 80                                                   
 81   G4double ComputeCrossSectionPerAtom(const G4    
 82               G4double KineticEnergy,             
 83               G4double AtomicNumber,              
 84               G4double AtomicWeight=0.,           
 85               G4double cut = DBL_MAX,             
 86               G4double emax= DBL_MAX) override    
 87                                                   
 88   G4ThreeVector& SampleScattering(const G4Thre    
 89           G4double safety) override;              
 90                                                   
 91   G4double                                        
 92   ComputeTruePathLengthLimit(const G4Track& tr    
 93            G4double& currentMinimalStep) overr    
 94                                                   
 95   G4double ComputeGeomPathLength(G4double true    
 96                                                   
 97   G4double ComputeTrueStepLength(G4double geom    
 98                                                   
 99   // defines low energy limit on energy transf    
100   void SetFixedCut(G4double);                     
101                                                   
102   // low energy limit on energy transfer to at    
103   G4double GetFixedCut() const;                   
104                                                   
105   // access to cross section class                
106   void SetWVICrossSection(G4WentzelOKandVIxSec    
107                                                   
108   G4WentzelOKandVIxSection* GetWVICrossSection    
109                                                   
110   void SetUseSecondMoment(G4bool);                
111                                                   
112   G4bool UseSecondMoment() const;                 
113                                                   
114   G4PhysicsTable* GetSecondMomentTable();         
115                                                   
116   G4double SecondMoment(const G4ParticleDefini    
117       const G4MaterialCutsCouple*,                
118       G4double kineticEnergy);                    
119                                                   
120   void SetSingleScatteringFactor(G4double);       
121                                                   
122   void DefineMaterial(const G4MaterialCutsCoup    
123                                                   
124   G4WentzelVIModel & operator=(const G4Wentzel    
125   G4WentzelVIModel(const G4WentzelVIModel&) =     
126                                                   
127 protected:                                        
128                                                   
129   G4double ComputeTransportXSectionPerVolume(G    
130                                                   
131   inline void SetupParticle(const G4ParticleDe    
132                                                   
133 private:                                          
134                                                   
135   G4double ComputeSecondMoment(const G4Particl    
136              G4double kineticEnergy);             
137                                                   
138 protected:                                        
139                                                   
140   G4WentzelOKandVIxSection* wokvi;                
141   const G4MaterialCutsCouple* currentCouple =     
142   const G4Material* currentMaterial = nullptr;    
143                                                   
144   const G4ParticleDefinition* particle = nullp    
145   G4ParticleChangeForMSC* fParticleChange = nu    
146   const G4DataVector* currentCuts = nullptr;      
147   G4PhysicsTable* fSecondMoments = nullptr;       
148                                                   
149   G4double lowEnergyLimit;                        
150   G4double tlimitminfix;                          
151   G4double ssFactor = 1.05;                       
152   G4double invssFactor = 1.0;                     
153                                                   
154   // cache kinematics                             
155   G4double preKinEnergy = 0.0;                    
156   G4double tPathLength = 0.0;                     
157   G4double zPathLength = 0.0;                     
158   G4double lambdaeff = 0.0;                       
159   G4double currentRange = 0.0;                    
160   G4double cosTetMaxNuc = 0.0;                    
161                                                   
162   G4double fixedCut = -1.0;                       
163                                                   
164   // cache kinematics                             
165   G4double effKinEnergy = 0.0;                    
166                                                   
167   // single scattering parameters                 
168   G4double cosThetaMin = 1.0;                     
169   G4double cosThetaMax = -1.0;                    
170   G4double xtsec = 0.0;                           
171                                                   
172   G4int  currentMaterialIndex = 0;                
173   size_t idx2 = 0;                                
174                                                   
175   // data for single scattering mode              
176   G4int nelments = 0;                             
177                                                   
178   // flags                                        
179   G4bool   singleScatteringMode;                  
180   G4bool   isCombined;                            
181   G4bool   useSecondMoment;                       
182                                                   
183   std::vector<G4double> xsecn;                    
184   std::vector<G4double> prob;                     
185 };                                                
186                                                   
187 //....oooOO0OOooo........oooOO0OOooo........oo    
188 //....oooOO0OOooo........oooOO0OOooo........oo    
189                                                   
190 inline void G4WentzelVIModel::SetupParticle(co    
191 {                                                 
192   // Initialise mass and charge                   
193   if(p != particle) {                             
194     particle = p;                                 
195     wokvi->SetupParticle(p);                      
196   }                                               
197 }                                                 
198                                                   
199 //....oooOO0OOooo........oooOO0OOooo........oo    
200                                                   
201 inline void G4WentzelVIModel::SetFixedCut(G4do    
202 {                                                 
203   fixedCut = val;                                 
204 }                                                 
205                                                   
206 //....oooOO0OOooo........oooOO0OOooo........oo    
207                                                   
208 inline G4double G4WentzelVIModel::GetFixedCut(    
209 {                                                 
210   return fixedCut;                                
211 }                                                 
212                                                   
213 //....oooOO0OOooo........oooOO0OOooo........oo    
214                                                   
215 inline void G4WentzelVIModel::SetWVICrossSecti    
216 {                                                 
217   if(ptr != wokvi) {                              
218     delete wokvi;                                 
219     wokvi = ptr;                                  
220   }                                               
221 }                                                 
222                                                   
223 //....oooOO0OOooo........oooOO0OOooo........oo    
224                                                   
225 inline G4WentzelOKandVIxSection* G4WentzelVIMo    
226 {                                                 
227   return wokvi;                                   
228 }                                                 
229                                                   
230 //....oooOO0OOooo........oooOO0OOooo........oo    
231                                                   
232 inline void G4WentzelVIModel::SetUseSecondMome    
233 {                                                 
234   useSecondMoment = val;                          
235 }                                                 
236                                                   
237 //....oooOO0OOooo........oooOO0OOooo........oo    
238                                                   
239 inline G4bool G4WentzelVIModel::UseSecondMomen    
240 {                                                 
241   return useSecondMoment;                         
242 }                                                 
243                                                   
244 //....oooOO0OOooo........oooOO0OOooo........oo    
245                                                   
246 inline G4PhysicsTable* G4WentzelVIModel::GetSe    
247 {                                                 
248   return fSecondMoments;                          
249 }                                                 
250                                                   
251 //....oooOO0OOooo........oooOO0OOooo........oo    
252                                                   
253 inline G4double                                   
254 G4WentzelVIModel::SecondMoment(const G4Particl    
255              const G4MaterialCutsCouple* coupl    
256              G4double ekin)                       
257 {                                                 
258   G4double x = 0.0;                               
259   if(useSecondMoment) {                           
260     DefineMaterial(couple);                       
261     x = (fSecondMoments) ?                        
262       (*fSecondMoments)[(*theDensityIdx)[curre    
263       *(*theDensityFactor)[currentMaterialInde    
264       : ComputeSecondMoment(part, ekin);          
265   }                                               
266   return x;                                       
267 }                                                 
268                                                   
269 //....oooOO0OOooo........oooOO0OOooo........oo    
270                                                   
271 #endif                                            
272                                                   
273