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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 /examples/extended/electromagnetic/TestEm0/DirectAccess.cc (Version 11.3.0) and /examples/extended/electromagnetic/TestEm0/DirectAccess.cc (Version 6.0.p1)


  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 /// \file electromagnetic/TestEm0/DirectAccess    
 27 /// \brief Main program of the electromagnetic    
 28 //                                                
 29 //                                                
 30 //                                                
 31 // -------------------------------------------    
 32 //                                                
 33 //  To print cross sections per atom and mean     
 34 //                                                
 35 #include "G4BetheBlochModel.hh"                   
 36 #include "G4BetheHeitlerModel.hh"                 
 37 #include "G4BraggModel.hh"                        
 38 #include "G4DataVector.hh"                        
 39 #include "G4Electron.hh"                          
 40 #include "G4Gamma.hh"                             
 41 #include "G4KleinNishinaCompton.hh"               
 42 #include "G4Material.hh"                          
 43 #include "G4MollerBhabhaModel.hh"                 
 44 #include "G4MuBetheBlochModel.hh"                 
 45 #include "G4MuBremsstrahlungModel.hh"             
 46 #include "G4MuPairProductionModel.hh"             
 47 #include "G4MuonPlus.hh"                          
 48 #include "G4NistManager.hh"                       
 49 #include "G4PEEffectFluoModel.hh"                 
 50 #include "G4ParticleTable.hh"                     
 51 #include "G4Positron.hh"                          
 52 #include "G4Proton.hh"                            
 53 #include "G4SeltzerBergerModel.hh"                
 54 #include "G4SystemOfUnits.hh"                     
 55 #include "G4UnitsTable.hh"                        
 56 #include "G4eeToTwoGammaModel.hh"                 
 57 #include "globals.hh"                             
 58                                                   
 59 int main()                                        
 60 {                                                 
 61   G4UnitDefinition::BuildUnitsTable();            
 62                                                   
 63   G4ParticleDefinition* gamma = G4Gamma::Gamma    
 64   G4ParticleDefinition* posit = G4Positron::Po    
 65   G4ParticleDefinition* elec = G4Electron::Ele    
 66   G4ParticleDefinition* prot = G4Proton::Proto    
 67   G4ParticleDefinition* muon = G4MuonPlus::Muo    
 68   G4ParticleTable* partTable = G4ParticleTable    
 69   partTable->SetReadiness();                      
 70                                                   
 71   G4DataVector cuts;                              
 72   cuts.push_back(1 * keV);                        
 73                                                   
 74   // define materials                             
 75   //                                              
 76   G4Material* material = G4NistManager::Instan    
 77                                                   
 78   G4cout << *(G4Material::GetMaterialTable())     
 79                                                   
 80   G4MaterialCutsCouple* couple = new G4Materia    
 81   couple->SetIndex(0);                            
 82                                                   
 83   // work only for simple materials               
 84   G4double Z = material->GetZ();                  
 85   G4double A = material->GetA();                  
 86                                                   
 87   // initialise gamma processes (models)          
 88   //                                              
 89   G4VEmModel* phot = new G4PEEffectFluoModel()    
 90   G4VEmModel* comp = new G4KleinNishinaCompton    
 91   G4VEmModel* conv = new G4BetheHeitlerModel()    
 92   phot->Initialise(gamma, cuts);                  
 93   comp->Initialise(gamma, cuts);                  
 94   conv->Initialise(gamma, cuts);                  
 95                                                   
 96   // valid pointer to a couple is needed for t    
 97   phot->SetCurrentCouple(couple);                 
 98                                                   
 99   // compute CrossSection per atom and MeanFre    
100   //                                              
101   G4double Emin = 1.01 * MeV, Emax = 2.01 * Me    
102                                                   
103   G4cout << "\n #### Gamma : CrossSectionPerAt    
104          << G4endl;                               
105   G4cout << "\n Energy \t PhotoElec \t Compton    
106   G4cout << "\t PhotoElec \t Compton \t Conver    
107                                                   
108   for (G4double Energy = Emin; Energy <= Emax;    
109     G4cout << "\n " << G4BestUnit(Energy, "Ene    
110            << G4BestUnit(phot->ComputeCrossSec    
111            << G4BestUnit(comp->ComputeCrossSec    
112            << G4BestUnit(conv->ComputeCrossSec    
113            << G4BestUnit(phot->ComputeMeanFree    
114            << G4BestUnit(comp->ComputeMeanFree    
115            << G4BestUnit(conv->ComputeMeanFree    
116   }                                               
117                                                   
118   G4cout << G4endl;                               
119                                                   
120   // initialise positron annihilation (model)     
121   //                                              
122   G4VEmModel* anni = new G4eeToTwoGammaModel()    
123   anni->Initialise(posit, cuts);                  
124                                                   
125   // compute CrossSection per atom and MeanFre    
126   //                                              
127   Emin = 1.01 * MeV;                              
128   Emax = 2.01 * MeV;                              
129   dE = 100 * keV;                                 
130                                                   
131   G4cout << "\n #### e+ annihilation : CrossSe    
132          << " for " << material->GetName() <<     
133   G4cout << "\n Energy \t e+ annihil \t";         
134   G4cout << "\t e+ annihil" << G4endl;            
135                                                   
136   for (G4double Energy = Emin; Energy <= Emax;    
137     G4cout << "\n " << G4BestUnit(Energy, "Ene    
138            << G4BestUnit(anni->ComputeCrossSec    
139            << G4BestUnit(anni->ComputeMeanFree    
140   }                                               
141                                                   
142   G4cout << G4endl;                               
143                                                   
144   // initialise electron processes (models)       
145   //                                              
146   G4VEmModel* ioni = new G4MollerBhabhaModel()    
147   G4VEmModel* brem = new G4SeltzerBergerModel(    
148   ioni->Initialise(elec, cuts);                   
149   brem->Initialise(elec, cuts);                   
150                                                   
151   // compute CrossSection per atom and MeanFre    
152   //                                              
153   Emin = 1.01 * MeV;                              
154   Emax = 101.01 * MeV;                            
155   dE = 10 * MeV;                                  
156   G4double Ecut = 100 * keV;                      
157                                                   
158   G4cout << "\n ####electron: CrossSection, Me    
159          << " for " << material->GetName() <<     
160          << G4endl;                               
161                                                   
162   G4cout << "\n Energy \t ionization \t bremss    
163   G4cout << "\t ionization \t bremsstra \t";      
164   G4cout << "\t ionization \t bremsstra" << G4    
165                                                   
166   for (G4double Energy = Emin; Energy <= Emax;    
167     G4cout << "\n " << G4BestUnit(Energy, "Ene    
168            << G4BestUnit(ioni->ComputeCrossSec    
169            << "\t"                                
170            << G4BestUnit(brem->ComputeCrossSec    
171            << "\t \t"                             
172            << G4BestUnit(ioni->ComputeMeanFree    
173            << G4BestUnit(brem->ComputeMeanFree    
174            << "\t \t"                             
175            << G4BestUnit(ioni->ComputeDEDXPerV    
176            << "\t"                                
177            << G4BestUnit(brem->ComputeDEDXPerV    
178   }                                               
179                                                   
180   G4cout << G4endl;                               
181                                                   
182   // initialise proton processes (models)         
183   //                                              
184   ioni = new G4BetheBlochModel();                 
185   ioni->Initialise(prot, cuts);                   
186                                                   
187   // compute CrossSection per atom and MeanFre    
188   //                                              
189   Emin = 1.01 * MeV;                              
190   Emax = 102.01 * MeV;                            
191   dE = 10 * MeV;                                  
192   Ecut = 100 * keV;                               
193                                                   
194   G4cout << "\n #### proton : CrossSection, Me    
195          << " for " << material->GetName() <<     
196          << G4endl;                               
197                                                   
198   G4cout << "\n Energy \t ionization \t";         
199   G4cout << "\t ionization \t";                   
200   G4cout << "\t ionization" << G4endl;            
201                                                   
202   for (G4double Energy = Emin; Energy <= Emax;    
203     G4cout << "\n " << G4BestUnit(Energy, "Ene    
204            << G4BestUnit(ioni->ComputeCrossSec    
205            << "\t \t"                             
206            << G4BestUnit(ioni->ComputeMeanFree    
207            << "\t \t"                             
208            << G4BestUnit(ioni->ComputeDEDXPerV    
209   }                                               
210                                                   
211   G4cout << G4endl;                               
212                                                   
213   // low energy : Bragg Model                     
214   ioni = new G4BraggModel(prot);                  
215   ioni->Initialise(prot, cuts);                   
216                                                   
217   // compute CrossSection per atom and MeanFre    
218   //                                              
219   Emin = 1.1 * keV;                               
220   Emax = 2.01 * MeV;                              
221   dE = 300 * keV;                                 
222   Ecut = 10 * keV;                                
223                                                   
224   G4cout << "\n #### proton : low energy model    
225          << ";\tEnergy cut = " << G4BestUnit(E    
226                                                   
227   G4cout << "\n Energy \t ionization \t";         
228   G4cout << "\t ionization \t";                   
229   G4cout << "\t ionization" << G4endl;            
230                                                   
231   for (G4double Energy = Emin; Energy <= Emax;    
232     G4cout << "\n " << G4BestUnit(Energy, "Ene    
233            << G4BestUnit(ioni->ComputeCrossSec    
234            << "\t \t"                             
235            << G4BestUnit(ioni->ComputeMeanFree    
236            << "\t \t"                             
237            << G4BestUnit(ioni->ComputeDEDXPerV    
238   }                                               
239                                                   
240   G4cout << G4endl;                               
241                                                   
242   // initialise muon processes (models)           
243   //                                              
244   ioni = new G4MuBetheBlochModel();               
245   brem = new G4MuBremsstrahlungModel();           
246   G4VEmModel* pair = new G4MuPairProductionMod    
247   ioni->Initialise(muon, cuts);                   
248   brem->Initialise(muon, cuts);                   
249   pair->Initialise(muon, cuts);                   
250                                                   
251   // compute CrossSection per atom and MeanFre    
252   //                                              
253   Emin = 1.01 * GeV;                              
254   Emax = 101.01 * GeV;                            
255   dE = 10 * GeV;                                  
256   Ecut = 10 * MeV;                                
257                                                   
258   G4cout << "\n ####muon: CrossSection and Mea    
259          << ";\tEnergy cut = " << G4BestUnit(E    
260                                                   
261   G4cout << "\n Energy \t ionization \t bremss    
262   G4cout << "\t ionization \t bremsstra \t pai    
263                                                   
264   for (G4double Energy = Emin; Energy <= Emax;    
265     G4cout << "\n " << G4BestUnit(Energy, "Ene    
266            << G4BestUnit(ioni->ComputeCrossSec    
267            << "\t"                                
268            << G4BestUnit(brem->ComputeCrossSec    
269            << "\t"                                
270            << G4BestUnit(pair->ComputeCrossSec    
271            << "\t \t"                             
272            << G4BestUnit(ioni->ComputeMeanFree    
273            << G4BestUnit(brem->ComputeMeanFree    
274            << G4BestUnit(pair->ComputeMeanFree    
275   }                                               
276                                                   
277   G4cout << G4endl;                               
278                                                   
279   G4cout << "\n ####muon: StoppingPower for "     
280          << ";\tEnergy cut = " << G4BestUnit(E    
281                                                   
282   G4cout << "\n Energy \t ionization \t bremss    
283                                                   
284   for (G4double Energy = Emin; Energy <= Emax;    
285     G4cout << "\n " << G4BestUnit(Energy, "Ene    
286            << G4BestUnit(ioni->ComputeDEDXPerV    
287            << "\t"                                
288            << G4BestUnit(brem->ComputeDEDXPerV    
289            << "\t"                                
290            << G4BestUnit(pair->ComputeDEDXPerV    
291   }                                               
292                                                   
293   G4cout << G4endl;                               
294   return EXIT_SUCCESS;                            
295 }                                                 
296                                                   
297 //....oooOO0OOooo........oooOO0OOooo........oo    
298