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4.p3 ] [ 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/highenergy/src/G4mplIonisationWithDeltaModel.cc (Version 11.3.0) and /processes/electromagnetic/highenergy/src/G4mplIonisationWithDeltaModel.cc (Version 5.0)


  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 // GEANT4 Class header file                       
 30 //                                                
 31 //                                                
 32 // File name:     G4mplIonisationWithDeltaMode    
 33 //                                                
 34 // Author:        Vladimir Ivanchenko             
 35 //                                                
 36 // Creation date: 06.09.2005                      
 37 //                                                
 38 // Modifications:                                 
 39 // 12.08.2007 Changing low energy approximatio    
 40 //            Small bug fixing and refactoring    
 41 // 13.11.2007 Use low-energy asymptotic from [    
 42 //                                                
 43 //                                                
 44 // -------------------------------------------    
 45 // References                                     
 46 // [1] Steven P. Ahlen: Energy loss of relativ    
 47 //     S.P. Ahlen, Rev. Mod. Phys 52(1980), p1    
 48 // [2] K.A. Milton arXiv:hep-ex/0602040           
 49 // [3] S.P. Ahlen and K. Kinoshita, Phys. Rev.    
 50                                                   
 51                                                   
 52 //....oooOO0OOooo........oooOO0OOooo........oo    
 53 //....oooOO0OOooo........oooOO0OOooo........oo    
 54                                                   
 55 #include "G4mplIonisationWithDeltaModel.hh"       
 56 #include "Randomize.hh"                           
 57 #include "G4PhysicalConstants.hh"                 
 58 #include "G4SystemOfUnits.hh"                     
 59 #include "G4ParticleChangeForLoss.hh"             
 60 #include "G4Electron.hh"                          
 61 #include "G4DynamicParticle.hh"                   
 62 #include "G4ProductionCutsTable.hh"               
 63 #include "G4MaterialCutsCouple.hh"                
 64 #include "G4Log.hh"                               
 65 #include "G4Pow.hh"                               
 66                                                   
 67 //....oooOO0OOooo........oooOO0OOooo........oo    
 68                                                   
 69 using namespace std;                              
 70                                                   
 71 std::vector<G4double>* G4mplIonisationWithDelt    
 72                                                   
 73 G4mplIonisationWithDeltaModel::G4mplIonisation    
 74                                                   
 75   : G4VEmModel(nam),G4VEmFluctuationModel(nam)    
 76   magCharge(mCharge),                             
 77   twoln10(std::log(100.0)),                       
 78   betalow(0.01),                                  
 79   betalim(0.1),                                   
 80   beta2lim(betalim*betalim),                      
 81   bg2lim(beta2lim*(1.0 + beta2lim))               
 82 {                                                 
 83   nmpl = G4lrint(std::abs(magCharge) * 2 * fin    
 84   if(nmpl > 6)      { nmpl = 6; }                 
 85   else if(nmpl < 1) { nmpl = 1; }                 
 86   pi_hbarc2_over_mc2 = pi * hbarc * hbarc / el    
 87   chargeSquare = magCharge * magCharge;           
 88   dedxlim = 45.*nmpl*nmpl*GeV*cm2/g;              
 89   fParticleChange = nullptr;                      
 90   theElectron = G4Electron::Electron();           
 91   G4cout << "### Monopole ionisation model wit    
 92          << magCharge/eplus << G4endl;            
 93   monopole = nullptr;                             
 94   mass = 0.0;                                     
 95 }                                                 
 96                                                   
 97 //....oooOO0OOooo........oooOO0OOooo........oo    
 98                                                   
 99 G4mplIonisationWithDeltaModel::~G4mplIonisatio    
100 {                                                 
101   if(IsMaster()) { delete dedx0; }                
102 }                                                 
103                                                   
104 //....oooOO0OOooo........oooOO0OOooo........oo    
105                                                   
106 void G4mplIonisationWithDeltaModel::SetParticl    
107 {                                                 
108   monopole = p;                                   
109   mass     = monopole->GetPDGMass();              
110   G4double emin =                                 
111     std::min(LowEnergyLimit(),0.1*mass*(1./sqr    
112   G4double emax =                                 
113     std::max(HighEnergyLimit(),10*mass*(1./sqr    
114   SetLowEnergyLimit(emin);                        
115   SetHighEnergyLimit(emax);                       
116 }                                                 
117                                                   
118 //....oooOO0OOooo........oooOO0OOooo........oo    
119                                                   
120 void                                              
121 G4mplIonisationWithDeltaModel::Initialise(cons    
122                                           cons    
123 {                                                 
124   if(!monopole) { SetParticle(p); }               
125   if(!fParticleChange) { fParticleChange = Get    
126   if(IsMaster()) {                                
127     if(!dedx0) { dedx0 = new std::vector<G4dou    
128     G4ProductionCutsTable* theCoupleTable=        
129       G4ProductionCutsTable::GetProductionCuts    
130     G4int numOfCouples = (G4int)theCoupleTable    
131     G4int n = (G4int)dedx0->size();               
132     if(n < numOfCouples) { dedx0->resize(numOf    
133     G4Pow* g4calc = G4Pow::GetInstance();         
134                                                   
135     // initialise vector assuming low conducti    
136     for(G4int i=0; i<numOfCouples; ++i) {         
137                                                   
138       const G4Material* material =                
139         theCoupleTable->GetMaterialCutsCouple(    
140       G4double eDensity = material->GetElectro    
141       G4double vF2 = 2*electron_Compton_length    
142       (*dedx0)[i] = pi_hbarc2_over_mc2*eDensit    
143         (G4Log(vF2/fine_structure_const) - 0.5    
144     }                                             
145   }                                               
146 }                                                 
147                                                   
148 //....oooOO0OOooo........oooOO0OOooo........oo    
149                                                   
150 G4double                                          
151 G4mplIonisationWithDeltaModel::MinEnergyCut(co    
152                                             co    
153 {                                                 
154   return couple->GetMaterial()->GetIonisation(    
155 }                                                 
156                                                   
157 //....oooOO0OOooo........oooOO0OOooo........oo    
158                                                   
159 G4double                                          
160 G4mplIonisationWithDeltaModel::ComputeDEDXPerV    
161                                                   
162                                                   
163                                                   
164 {                                                 
165   if(!monopole) { SetParticle(p); }               
166   G4double tmax = MaxSecondaryEnergy(p,kinetic    
167   G4double cutEnergy = std::min(tmax, maxEnerg    
168   cutEnergy = std::max(LowEnergyLimit(), cutEn    
169   G4double tau   = kineticEnergy / mass;          
170   G4double gam   = tau + 1.0;                     
171   G4double bg2   = tau * (tau + 2.0);             
172   G4double beta2 = bg2 / (gam * gam);             
173   G4double beta  = sqrt(beta2);                   
174                                                   
175   // low-energy asymptotic formula                
176   G4double dedx = (*dedx0)[CurrentCouple()->Ge    
177                                                   
178   // above asymptotic                             
179   if(beta > betalow) {                            
180                                                   
181     // high energy                                
182     if(beta >= betalim) {                         
183       dedx = ComputeDEDXAhlen(material, bg2, c    
184                                                   
185     } else {                                      
186       G4double dedx1 = (*dedx0)[CurrentCouple(    
187       G4double dedx2 = ComputeDEDXAhlen(materi    
188                                                   
189       // extrapolation between two formula        
190       G4double kapa2 = beta - betalow;            
191       G4double kapa1 = betalim - beta;            
192       dedx = (kapa1*dedx1 + kapa2*dedx2)/(kapa    
193     }                                             
194   }                                               
195   return dedx;                                    
196 }                                                 
197                                                   
198 //....oooOO0OOooo........oooOO0OOooo........oo    
199                                                   
200 G4double                                          
201 G4mplIonisationWithDeltaModel::ComputeDEDXAhle    
202                                                   
203                                                   
204 {                                                 
205   G4double eDensity = material->GetElectronDen    
206   G4double eexc  = material->GetIonisation()->    
207                                                   
208   // Ahlen's formula for nonconductors, [1]p15    
209   G4double dedx =                                 
210     0.5*(G4Log(2.0*electron_mass_c2*bg2*cutEne    
211                                                   
212   // Kazama et al. cross-section correction       
213   G4double  k = 0.406;                            
214   if(nmpl > 1) { k = 0.346; }                     
215                                                   
216   // Bloch correction                             
217   const G4double B[7] = { 0.0, 0.248, 0.672, 1    
218                                                   
219   dedx += 0.5 * k - B[nmpl];                      
220                                                   
221   // density effect correction                    
222   G4double x = G4Log(bg2)/twoln10;                
223   dedx -= material->GetIonisation()->DensityCo    
224                                                   
225   // now compute the total ionization loss        
226   dedx *=  pi_hbarc2_over_mc2 * eDensity * nmp    
227                                                   
228   dedx = std::max(dedx, 0.0);                     
229   return dedx;                                    
230 }                                                 
231                                                   
232 //....oooOO0OOooo........oooOO0OOooo........oo    
233                                                   
234 G4double                                          
235 G4mplIonisationWithDeltaModel::ComputeCrossSec    
236                                            con    
237                                            G4d    
238                                            G4d    
239                                            G4d    
240 {                                                 
241   if(!monopole) { SetParticle(p); }               
242   G4double tmax = MaxSecondaryEnergy(p, kineti    
243   G4double maxEnergy = std::min(tmax, maxKinEn    
244   G4double cutEnergy = std::max(LowEnergyLimit    
245   G4double cross = (cutEnergy < maxEnergy)        
246     ? (0.5/cutEnergy - 0.5/maxEnergy)*pi_hbarc    
247   return cross;                                   
248 }                                                 
249                                                   
250 //....oooOO0OOooo........oooOO0OOooo........oo    
251                                                   
252 G4double                                          
253 G4mplIonisationWithDeltaModel::ComputeCrossSec    
254                                           cons    
255                                           G4do    
256                                           G4do    
257                                           G4do    
258                                           G4do    
259 {                                                 
260   G4double cross =                                
261     Z*ComputeCrossSectionPerElectron(p,kinetic    
262   return cross;                                   
263 }                                                 
264                                                   
265 //....oooOO0OOooo........oooOO0OOooo........oo    
266                                                   
267 void                                              
268 G4mplIonisationWithDeltaModel::SampleSecondari    
269                                                   
270                                                   
271                                                   
272                                                   
273 {                                                 
274   G4double kineticEnergy = dp->GetKineticEnerg    
275   G4double tmax = MaxSecondaryEnergy(dp->GetDe    
276                                                   
277   G4double maxKinEnergy = std::min(maxEnergy,t    
278   if(minKinEnergy >= maxKinEnergy) { return; }    
279                                                   
280   //G4cout << "G4mplIonisationWithDeltaModel::    
281   //         << kineticEnergy/GeV << " M(GeV)=    
282   //         << " tmin(MeV)= " << minKinEnergy    
283                                                   
284   G4double totEnergy     = kineticEnergy + mas    
285   G4double etot2         = totEnergy*totEnergy    
286   G4double beta2         = kineticEnergy*(kine    
287                                                   
288   // sampling without nuclear size effect         
289   G4double q = G4UniformRand();                   
290   G4double deltaKinEnergy = minKinEnergy*maxKi    
291     /(minKinEnergy*(1.0 - q) + maxKinEnergy*q)    
292                                                   
293   // delta-electron is produced                   
294   G4double totMomentum = totEnergy*sqrt(beta2)    
295   G4double deltaMomentum =                        
296            sqrt(deltaKinEnergy * (deltaKinEner    
297   G4double cost = deltaKinEnergy * (totEnergy     
298                                    (deltaMomen    
299   cost = std::min(cost, 1.0);                     
300                                                   
301   G4double sint = sqrt((1.0 - cost)*(1.0 + cos    
302                                                   
303   G4double phi = twopi * G4UniformRand() ;        
304                                                   
305   G4ThreeVector deltaDirection(sint*cos(phi),s    
306   G4ThreeVector direction = dp->GetMomentumDir    
307   deltaDirection.rotateUz(direction);             
308                                                   
309   // create G4DynamicParticle object for delta    
310   G4DynamicParticle* delta =                      
311     new G4DynamicParticle(theElectron,deltaDir    
312                                                   
313   vdp->push_back(delta);                          
314                                                   
315   // Change kinematics of primary particle        
316   kineticEnergy       -= deltaKinEnergy;          
317   G4ThreeVector finalP = direction*totMomentum    
318   finalP               = finalP.unit();           
319                                                   
320   fParticleChange->SetProposedKineticEnergy(ki    
321   fParticleChange->SetProposedMomentumDirectio    
322 }                                                 
323                                                   
324 //....oooOO0OOooo........oooOO0OOooo........oo    
325                                                   
326 G4double G4mplIonisationWithDeltaModel::Sample    
327                                        const G    
328                                        const G    
329                                        const G    
330                                        const G    
331                                        const G    
332                                        const G    
333 {                                                 
334   G4double siga = Dispersion(couple->GetMateri    
335   G4double loss = meanLoss;                       
336   siga = std::sqrt(siga);                         
337   G4double twomeanLoss = meanLoss + meanLoss;     
338                                                   
339   if(twomeanLoss < siga) {                        
340     G4double x;                                   
341     do {                                          
342       loss = twomeanLoss*G4UniformRand();         
343       x = (loss - meanLoss)/siga;                 
344       // Loop checking, 07-Aug-2015, Vladimir     
345     } while (1.0 - 0.5*x*x < G4UniformRand());    
346   } else {                                        
347     do {                                          
348       loss = G4RandGauss::shoot(meanLoss,siga)    
349       // Loop checking, 07-Aug-2015, Vladimir     
350     } while (0.0 > loss || loss > twomeanLoss)    
351   }                                               
352   return loss;                                    
353 }                                                 
354                                                   
355 //....oooOO0OOooo........oooOO0OOooo........oo    
356                                                   
357 G4double                                          
358 G4mplIonisationWithDeltaModel::Dispersion(cons    
359                                           cons    
360             const G4double tcut,                  
361             const G4double tmax,                  
362             const G4double length)                
363 {                                                 
364   G4double siga = 0.0;                            
365   G4double tau   = dp->GetKineticEnergy()/mass    
366   if(tau > 0.0) {                                 
367     const G4double beta = dp->GetBeta();          
368     siga  = (tmax/(beta*beta) - 0.5*tcut) * tw    
369       * material->GetElectronDensity() * charg    
370   }                                               
371   return siga;                                    
372 }                                                 
373                                                   
374 //....oooOO0OOooo........oooOO0OOooo........oo    
375                                                   
376 G4double                                          
377 G4mplIonisationWithDeltaModel::MaxSecondaryEne    
378                                                   
379 {                                                 
380   G4double tau = kinEnergy/mass;                  
381   return 2.0*electron_mass_c2*tau*(tau + 2.);     
382 }                                                 
383                                                   
384 //....oooOO0OOooo........oooOO0OOooo........oo    
385