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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/dna/models/src/G4DNAMeltonAttachmentModel.cc (Version 11.3.0) and /processes/electromagnetic/dna/models/src/G4DNAMeltonAttachmentModel.cc (Version 9.2.p4)


  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 // Created by Z. Francis                          
 29                                                   
 30 #include "G4DNAMeltonAttachmentModel.hh"          
 31 #include "G4SystemOfUnits.hh"                     
 32 #include "G4DNAChemistryManager.hh"               
 33 #include "G4DNAMolecularMaterial.hh"              
 34                                                   
 35 //....oooOO0OOooo........oooOO0OOooo........oo    
 36                                                   
 37 using namespace std;                              
 38                                                   
 39 //#define MELTON_VERBOSE // prevent checking c    
 40                                                   
 41 //....oooOO0OOooo........oooOO0OOooo........oo    
 42                                                   
 43 G4DNAMeltonAttachmentModel::G4DNAMeltonAttachm    
 44                                                   
 45 G4VEmModel(nam)                                   
 46 {                                                 
 47   fpWaterDensity = nullptr;                       
 48                                                   
 49   SetLowEnergyLimit(4.*eV);                       
 50   SetHighEnergyLimit(13.*eV);                     
 51                                                   
 52   verboseLevel = 0;                               
 53   // Verbosity scale:                             
 54   // 0 = nothing                                  
 55   // 1 = warning for energy non-conservation      
 56   // 2 = details of energy budget                 
 57   // 3 = calculation of cross sections, file o    
 58   // 4 = entering in methods                      
 59                                                   
 60 #ifdef MELTON_VERBOSE                             
 61   if (verboseLevel > 0)                           
 62   {                                               
 63     G4cout << "Melton Attachment model is cons    
 64            << G4endl                              
 65            << "Energy range: "                    
 66            << LowEnergyLimit() / eV << " eV -     
 67            << HighEnergyLimit() / eV << " eV"     
 68            << G4endl;                             
 69   }                                               
 70 #endif                                            
 71                                                   
 72   fParticleChangeForGamma = nullptr;              
 73   fDissociationFlag = true;                       
 74   fData = nullptr;                                
 75                                                   
 76   // Selection of stationary mode                 
 77                                                   
 78   statCode = false;                               
 79 }                                                 
 80                                                   
 81 //....oooOO0OOooo........oooOO0OOooo........oo    
 82                                                   
 83 G4DNAMeltonAttachmentModel::~G4DNAMeltonAttach    
 84 {                                                 
 85   delete fData;                                   
 86 }                                                 
 87                                                   
 88 //....oooOO0OOooo........oooOO0OOooo........oo    
 89                                                   
 90 void G4DNAMeltonAttachmentModel::Initialise(co    
 91                                             co    
 92 {                                                 
 93 #ifdef MELTON_VERBOSE                             
 94   if (verboseLevel > 3)                           
 95     G4cout                                        
 96       << "Calling G4DNAMeltonAttachmentModel::    
 97 #endif                                            
 98                                                   
 99   // Only electron                                
100                                                   
101   if(particle->GetParticleName() != "e-")         
102   {                                               
103     G4Exception("G4DNAMeltonAttachmentModel::I    
104                 "em0002",                         
105                 FatalException,                   
106                 "Model not applicable to parti    
107   }                                               
108                                                   
109   // Energy limits                                
110                                                   
111   if (LowEnergyLimit() < 4.*eV)                   
112   {                                               
113     G4ExceptionDescription errMsg;                
114     errMsg << "G4DNAMeltonAttachmentModel: low    
115     LowEnergyLimit()/eV << " eV to " << 4.  <<    
116                                                   
117     G4Exception("G4DNAMeltonAttachmentModel::I    
118                 "Melton_LowerEBoundary",          
119                 JustWarning,                      
120                 errMsg);                          
121                                                   
122     SetLowEnergyLimit(4*eV);                      
123   }                                               
124                                                   
125   if (HighEnergyLimit() > 13.*eV)                 
126   {                                               
127     G4ExceptionDescription errMsg;                
128     errMsg << "G4DNAMeltonAttachmentModel: hig    
129     HighEnergyLimit()/eV << " eV to " << 13. <    
130                                                   
131     G4Exception("G4DNAMeltonAttachmentModel::I    
132                 "Melton_HigherEBoundary",         
133                 JustWarning,                      
134                 errMsg);                          
135                                                   
136     SetHighEnergyLimit(13.*eV);                   
137   }                                               
138                                                   
139   // Reading of data files                        
140                                                   
141   G4double scaleFactor = 1e-18*cm2;               
142                                                   
143   // For total cross section                      
144   G4String fileElectron("dna/sigma_attachment_    
145                                                   
146   fData = new G4DNACrossSectionDataSet(new G4L    
147                                         eV, sc    
148   fData->LoadData(fileElectron);                  
149                                                   
150                                                   
151 #ifdef MELTON_VERBOSE                             
152   if( verboseLevel >0)                            
153   {                                               
154     if (verboseLevel > 2)                         
155     {                                             
156       G4cout << "Loaded cross section data for    
157     }                                             
158                                                   
159     G4cout << "Melton Attachment model is init    
160     << "Energy range: "                           
161     << LowEnergyLimit() / eV << " eV - "          
162     << HighEnergyLimit() / eV << " eV"            
163     << G4endl;                                    
164   }                                               
165 #endif                                            
166                                                   
167   // Initialize water density pointer             
168   fpWaterDensity = G4DNAMolecularMaterial::Ins    
169       GetNumMolPerVolTableFor(G4Material::GetM    
170                                                   
171   if (isInitialised) return;                      
172                                                   
173   fParticleChangeForGamma = GetParticleChangeF    
174   isInitialised = true;                           
175 }                                                 
176                                                   
177 //....oooOO0OOooo........oooOO0OOooo........oo    
178                                                   
179 G4double                                          
180 G4DNAMeltonAttachmentModel::CrossSectionPerVol    
181                                                   
182                                                   
183                                                   
184                                                   
185 {                                                 
186 #ifdef MELTON_VERBOSE                             
187   if (verboseLevel > 3)                           
188     G4cout                                        
189       << "Calling CrossSectionPerVolume() of G    
190       << G4endl;                                  
191 #endif                                            
192                                                   
193   // Calculate total cross section for model      
194                                                   
195   G4double sigma = 0.;                            
196                                                   
197   G4double waterDensity = (*fpWaterDensity)[ma    
198                                                   
199   if (ekin >= LowEnergyLimit() && ekin <= High    
200     sigma = fData->FindValue(ekin);               
201                                                   
202 #ifdef MELTON_VERBOSE                             
203   if (verboseLevel > 2)                           
204   {                                               
205     G4cout << "_______________________________    
206     G4cout << "=== G4DNAMeltonAttachmentModel     
207     G4cout << "--- Kinetic energy(eV)=" << eki    
208            << " particle : " << particleDefini    
209            << G4endl;                             
210     G4cout << "--- Cross section per water mol    
211            << sigma/cm/cm << G4endl;              
212     G4cout << "--- Cross section per water mol    
213            << sigma*waterDensity/(1./cm) << G4    
214     G4cout << "--- G4DNAMeltonAttachmentModel     
215   }                                               
216 #endif                                            
217                                                   
218   return sigma*waterDensity;                      
219 }                                                 
220                                                   
221 //....oooOO0OOooo........oooOO0OOooo........oo    
222                                                   
223 void                                              
224 G4DNAMeltonAttachmentModel::                      
225 SampleSecondaries(std::vector<G4DynamicParticl    
226                   const G4MaterialCutsCouple*     
227                   const G4DynamicParticle* aDy    
228                   G4double,                       
229                   G4double)                       
230 {                                                 
231                                                   
232 #ifdef MELTON_VERBOSE                             
233   if (verboseLevel > 3)                           
234     G4cout                                        
235     << "Calling SampleSecondaries() of G4DNAMe    
236 #endif                                            
237                                                   
238   // Electron is killed                           
239                                                   
240   G4double electronEnergy0 = aDynamicElectron-    
241                                                   
242   if (!statCode)                                  
243   {                                               
244       fParticleChangeForGamma->SetProposedKine    
245       fParticleChangeForGamma->ProposeTrackSta    
246       fParticleChangeForGamma->ProposeLocalEne    
247   }                                               
248                                                   
249   else                                            
250   {                                               
251       fParticleChangeForGamma->SetProposedKine    
252       fParticleChangeForGamma->ProposeLocalEne    
253   }                                               
254                                                   
255   if(fDissociationFlag)                           
256   {                                               
257     G4DNAChemistryManager::Instance()->           
258       CreateWaterMolecule(eDissociativeAttachm    
259                           -1,                     
260                           fParticleChangeForGa    
261   }                                               
262   return;                                         
263 }                                                 
264