Geant4 Cross Reference |
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