00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #include "G4LENDCrossSection.hh"
00041 #include "G4SystemOfUnits.hh"
00042 #include "G4ElementTable.hh"
00043 #include "G4HadronicException.hh"
00044
00045
00046 G4bool G4LENDCrossSection::IsIsoApplicable( const G4DynamicParticle* dp, G4int , G4int ,
00047 const G4Element* , const G4Material* )
00048 {
00049 G4double eKin = dp->GetKineticEnergy();
00050 if ( dp->GetDefinition() != proj ) return false;
00051 if ( eKin > GetMaxKinEnergy() || eKin < GetMinKinEnergy() ) return false;
00052
00053 return true;
00054 }
00055
00056 G4double G4LENDCrossSection::GetIsoCrossSection( const G4DynamicParticle* dp , G4int iZ , G4int iA ,
00057 const G4Isotope* , const G4Element* , const G4Material* material )
00058 {
00059
00060 G4double xs = 0.0;
00061 G4double ke = dp->GetKineticEnergy();
00062 G4double temp = material->GetTemperature();
00063
00064 G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA ) )->second->GetTarget();
00065
00066 xs = getLENDCrossSection ( aTarget , ke , temp );
00067
00068 return xs;
00069 }
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 G4LENDCrossSection::G4LENDCrossSection( const G4String nam )
00083 :G4VCrossSectionDataSet( nam )
00084 {
00085
00086 default_evaluation = "endl99";
00087 allow_nat = false;
00088 allow_any = false;
00089
00090 SetMinKinEnergy( 0*MeV );
00091 SetMaxKinEnergy( 20*MeV );
00092
00093 lend_manager = G4LENDManager::GetInstance();
00094
00095 }
00096
00097 G4LENDCrossSection::~G4LENDCrossSection()
00098 {
00099
00100 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
00101 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
00102 {
00103 delete it->second;
00104 }
00105
00106 }
00107
00108 void G4LENDCrossSection::BuildPhysicsTable( const G4ParticleDefinition& )
00109 {
00110 create_used_target_map();
00111 }
00112
00113 void G4LENDCrossSection::DumpPhysicsTable(const G4ParticleDefinition& aP)
00114 {
00115
00116 if ( &aP != proj )
00117 throw G4HadronicException(__FILE__, __LINE__, "Attempt to use LEND data for particles other than neutrons!!!");
00118
00119 G4cout << G4endl;
00120 G4cout << "Dump Cross Sections of " << GetName() << G4endl;
00121 G4cout << "(Pointwise cross-section at 300 Kelvin.)" << G4endl;
00122 G4cout << G4endl;
00123
00124 G4cout << "Target informaiton " << G4endl;
00125
00126 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
00127 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
00128 {
00129 G4cout
00130 << "Wanted " << it->second->GetWantedEvaluation()
00131 << ", Z= " << it->second->GetWantedZ()
00132 << ", A= " << it->second->GetWantedA()
00133 << "; Actual " << it->second->GetActualEvaluation()
00134 << ", Z= " << it->second->GetActualZ()
00135 << ", A= " << it->second->GetActualA()
00136 << ", " << it->second->GetTarget()
00137 << G4endl;
00138
00139 G4int ie = 0;
00140
00141 G4GIDI_target* aTarget = it->second->GetTarget();
00142 G4double aT = 300;
00143 for ( ie = 0 ; ie < 130 ; ie++ )
00144 {
00145 G4double ke = 1.0e-5 * std::pow ( 10.0 , ie/10.0 ) *eV;
00146
00147 if ( ke < 20*MeV )
00148 {
00149 G4cout << " " << GetName() << ", cross section at " << ke/eV << " [eV] = " << getLENDCrossSection ( aTarget , ke , aT )/barn << " [barn] " << G4endl;
00150 }
00151 }
00152 G4cout << G4endl;
00153
00154 }
00155
00156 }
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256 void G4LENDCrossSection::recreate_used_target_map()
00257 {
00258 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
00259 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
00260 {
00261 delete it->second;
00262 }
00263 usedTarget_map.clear();
00264
00265 create_used_target_map();
00266 }
00267
00268
00269
00270 void G4LENDCrossSection::create_used_target_map()
00271 {
00272
00273 lend_manager->RequestChangeOfVerboseLevel( verboseLevel );
00274
00275 size_t numberOfElements = G4Element::GetNumberOfElements();
00276 static const G4ElementTable* theElementTable = G4Element::GetElementTable();
00277
00278 for ( size_t i = 0 ; i < numberOfElements ; ++i )
00279 {
00280
00281 const G4Element* anElement = (*theElementTable)[i];
00282 G4int numberOfIsotope = anElement->GetNumberOfIsotopes();
00283
00284 if ( numberOfIsotope > 0 )
00285 {
00286
00287 for ( G4int i_iso = 0 ; i_iso < numberOfIsotope ; i_iso++ )
00288 {
00289 G4int iZ = anElement->GetIsotope( i_iso )->GetZ();
00290 G4int iA = anElement->GetIsotope( i_iso )->GetN();
00291
00292
00293 G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iA );
00294 if ( allow_nat == true ) aTarget->AllowNat();
00295 if ( allow_any == true ) aTarget->AllowAny();
00296 usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iA ) , aTarget ) );
00297 }
00298 }
00299 else
00300 {
00301
00302 G4NistElementBuilder* nistElementBuild = lend_manager->GetNistElementBuilder();
00303 G4int iZ = int ( anElement->GetZ() );
00304
00305 G4int numberOfNistIso = nistElementBuild->GetNumberOfNistIsotopes( int ( anElement->GetZ() ) );
00306
00307 for ( G4int ii = 0 ; ii < numberOfNistIso ; ii++ )
00308 {
00309
00310 if ( nistElementBuild->GetIsotopeAbundance( iZ , nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii ) > 0 )
00311 {
00312 G4int iMass = nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii;
00313
00314
00315 G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iMass );
00316 if ( allow_nat == true ) aTarget->AllowNat();
00317 if ( allow_any == true ) aTarget->AllowAny();
00318 usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iMass ) , aTarget ) );
00319
00320 }
00321
00322 }
00323 }
00324 }
00325
00326 G4cout << "Dump UsedTarget for " << GetName() << G4endl;
00327 G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) , Pointer of Target" << G4endl;
00328 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
00329 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
00330 {
00331 G4cout
00332 << " " << it->second->GetWantedEvaluation()
00333 << ", " << it->second->GetWantedZ()
00334 << ", " << it->second->GetWantedA()
00335 << " -> " << it->second->GetActualEvaluation()
00336 << ", " << it->second->GetActualZ()
00337 << ", " << it->second->GetActualA()
00338 << ", " << it->second->GetTarget()
00339 << G4endl;
00340 }
00341
00342 }
00343
00344
00345 G4double G4LENDCrossSection::GetUltraLowEnergyExtrapolatedXS( G4double x1, G4double x2, G4double y1, G4double y2 , G4double ke )
00346 {
00347
00348
00349 G4double a = ( y2 - y1 ) / ( 1/std::sqrt(x2) - 1/std::sqrt(x1) );
00350 G4double b = y1 - a * 1/std::sqrt(x1);
00351 G4double result = a * 1/std::sqrt(ke) + b;
00352 return result;
00353 }