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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/hadronic/models/im_r_matrix/src/G4XnpTotalLowE.cc (Version 11.3.0) and /processes/hadronic/models/im_r_matrix/src/G4XnpTotalLowE.cc (Version 1.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 //      GEANT4 Class file                         
 29 //                                                
 30 //      For information related to this code c    
 31 //                                                
 32 //      File name:     G4XnpTotalLowE             
 33 //                                                
 34 //      Author:                                   
 35 //                                                
 36 //      Creation date: 15 April 1999              
 37 //                                                
 38 //      Modifications:                            
 39 //                                                
 40 // Neutron-Proton total  cross section            
 41 // Linear interpolation from data table           
 42 //                                                
 43 // -------------------------------------------    
 44                                                   
 45 #include "globals.hh"                             
 46 #include "G4ios.hh"                               
 47 #include "G4Exp.hh"                               
 48 #include "G4Log.hh"                               
 49 #include "G4SystemOfUnits.hh"                     
 50 #include "G4XnpTotalLowE.hh"                      
 51 #include "G4KineticTrack.hh"                      
 52 #include "G4ParticleDefinition.hh"                
 53 #include "G4PhysicsVector.hh"                     
 54 #include "G4PhysicsLogVector.hh"                  
 55 #include "G4Proton.hh"                            
 56 #include "G4Neutron.hh"                           
 57                                                   
 58 const G4double G4XnpTotalLowE::_lowLimit = 0.;    
 59 const G4double G4XnpTotalLowE::_highLimit = 3.    
 60                                                   
 61 // Low energy limit of the cross-section table    
 62 // Units are assigned when filling the Physics    
 63 const G4double G4XnpTotalLowE::_eMinTable = 1.    
 64 const G4double G4XnpTotalLowE::_eStepLog = 0.0    
 65                                                   
 66 // Cross-sections in mb                           
 67 // Units are assigned when filling the Physics    
 68 const G4int G4XnpTotalLowE::_tableSize = 101;     
 69 const G4double G4XnpTotalLowE::_sigmaTable[101    
 70 {                                                 
 71   1500.0,                                         
 72   248.20, 93.38, 55.26, 44.50, 41.33, 38.48, 3    
 73   35.02, 34.47, 34.37, 34.67, 35.23, 35.97, 36    
 74   37.77, 38.03, 38.40, 38.83, 39.26, 39.67, 40    
 75   40.79, 41.06, 41.31, 41.52, 41.70, 41.81, 41    
 76   42.12, 42.29, 42.55, 42.82, 43.01, 43.12, 43    
 77   43.06, 42.95, 42.81, 42.67, 42.54, 42.45, 42    
 78   42.30, 42.29, 42.28, 42.26, 42.24, 42.21, 42    
 79   42.10, 42.07, 42.06, 42.05, 42.04, 42.03, 42    
 80   41.97, 41.94, 41.89, 41.84, 41.79, 41.73, 41    
 81   41.55, 41.49, 41.44, 41.38, 41.34, 41.31, 41    
 82   41.27, 41.28, 41.30, 41.33, 41.36, 41.40, 41    
 83   41.50, 41.51, 41.51, 41.51, 41.52, 41.51, 41    
 84   41.50, 41.49, 41.47, 41.46                      
 85 };                                                
 86                                                   
 87                                                   
 88 G4XnpTotalLowE::G4XnpTotalLowE()                  
 89 {                                                 
 90   // Cross-sections are available in the range    
 91                                                   
 92   _eMin = _eMinTable * GeV;                       
 93   _eMin = G4Exp(G4Log(_eMinTable)-_eStepLog)*G    
 94   _eMax = G4Exp(G4Log(_eMinTable) + _tableSize    
 95                                                   
 96   // Protections: validity limits must be comp    
 97 //  @@GF  this ought to be _lowLimit < _eMin      
 98   if (_eMin < _lowLimit)                          
 99     throw G4HadronicException(__FILE__, __LINE    
100                                                   
101   if (_highLimit > _eMax)                         
102     throw G4HadronicException(__FILE__, __LINE    
103                                                   
104   _sigma = new G4PhysicsLogVector(_eMin,_eMax,    
105   G4int i;                                        
106   for (i=0; i<_tableSize; i++)                    
107     {                                             
108       G4double value = _sigmaTable[i] * millib    
109       _sigma->PutValue(i,value);                  
110     }                                             
111 }                                                 
112                                                   
113                                                   
114 G4XnpTotalLowE::~G4XnpTotalLowE()                 
115 {                                                 
116   if (_sigma) delete _sigma;                      
117   _sigma=0;                                       
118 }                                                 
119                                                   
120                                                   
121 G4bool G4XnpTotalLowE::operator==(const G4XnpT    
122 {                                                 
123   return (this == (G4XnpTotalLowE *) &right);     
124 }                                                 
125                                                   
126                                                   
127 G4bool G4XnpTotalLowE::operator!=(const G4XnpT    
128 {                                                 
129   return (this != (G4XnpTotalLowE *) &right);     
130 }                                                 
131                                                   
132                                                   
133 G4double G4XnpTotalLowE::CrossSection(const G4    
134 {                                                 
135   G4double sigma = 0.;                            
136   G4double sqrtS = (trk1.Get4Momentum() + trk2    
137   G4bool dummy = false;                           
138                                                   
139   const G4ParticleDefinition* proton = G4Proto    
140   const G4ParticleDefinition* neutron = G4Neut    
141                                                   
142   const G4ParticleDefinition* def1 = trk1.GetD    
143   const G4ParticleDefinition* def2 = trk2.GetD    
144   if ( (def1 == proton && def2 == neutron) ||     
145        (def1 == neutron && def2 == proton) )      
146     {                                             
147       if (sqrtS >= _eMin && sqrtS <= _eMax)       
148   {                                               
149     sigma = _sigma->GetValue(sqrtS,dummy);        
150   } else if ( sqrtS < _eMin )                     
151         {                                         
152           sigma = _sigma->GetValue(_eMin,dummy    
153         }                                         
154     }                                             
155                                                   
156   return sigma;                                   
157 }                                                 
158                                                   
159 void G4XnpTotalLowE::Print() const                
160 {                                                 
161   // Dump the cross-section table                 
162                                                   
163   G4cout << Name() << "Cross-section table: "     
164   G4bool dummy = false;                           
165   G4int i;                                        
166                                                   
167   for (i=0; i<_tableSize; i++)                    
168     {                                             
169       G4double e = _sigma->GetLowEdgeEnergy(i)    
170       G4double sigma = _sigma->GetValue(e,dumm    
171       G4cout << i << ") e = " << e << " GeV --    
172     }                                             
173                                                   
174   G4VCrossSectionSource::Print();                 
175 }                                                 
176                                                   
177                                                   
178 G4String G4XnpTotalLowE::Name() const             
179 {                                                 
180   G4String name("NNTotalLowE");                   
181   return name;                                    
182 }                                                 
183                                                   
184                                                   
185 G4bool G4XnpTotalLowE::IsValid(G4double e) con    
186 {                                                 
187   G4bool answer = InLimits(e,_lowLimit,_highLi    
188                                                   
189   return answer;                                  
190 }                                                 
191                                                   
192                                                   
193