#include <G4NeutronHPContEnergyAngular.hh>
Inheritance diagram for G4NeutronHPContEnergyAngular:
Public Member Functions | |
G4NeutronHPContEnergyAngular () | |
~G4NeutronHPContEnergyAngular () | |
void | Init (std::ifstream &aDataFile) |
G4double | MeanEnergyOfThisInteraction () |
G4ReactionProduct * | Sample (G4double anEnergy, G4double massCode, G4double mass) |
void | ClearHistories () |
Definition at line 43 of file G4NeutronHPContEnergyAngular.hh.
G4NeutronHPContEnergyAngular::G4NeutronHPContEnergyAngular | ( | ) | [inline] |
G4NeutronHPContEnergyAngular::~G4NeutronHPContEnergyAngular | ( | ) | [inline] |
void G4NeutronHPContEnergyAngular::ClearHistories | ( | ) | [virtual] |
Reimplemented from G4VNeutronHPEnergyAngular.
Definition at line 94 of file G4NeutronHPContEnergyAngular.cc.
00095 { 00096 if ( theAngular!= NULL ) 00097 { 00098 for ( G4int i = 0 ; i< nEnergy ; i++ ) 00099 theAngular[i].ClearHistories(); 00100 } 00101 }
void G4NeutronHPContEnergyAngular::Init | ( | std::ifstream & | aDataFile | ) | [inline, virtual] |
Implements G4VNeutronHPEnergyAngular.
Definition at line 60 of file G4NeutronHPContEnergyAngular.hh.
References G4InterpolationManager::Init(), and G4NeutronHPContAngularPar::SetInterpolation().
00061 { 00062 aDataFile >> theTargetCode >> theAngularRep >> theInterpolation >> nEnergy; 00063 theAngular = new G4NeutronHPContAngularPar[nEnergy]; 00064 theManager.Init(aDataFile); 00065 for(G4int i=0; i<nEnergy; i++) 00066 { 00067 theAngular[i].Init(aDataFile); 00068 theAngular[i].SetInterpolation(theInterpolation); 00069 } 00070 }
G4double G4NeutronHPContEnergyAngular::MeanEnergyOfThisInteraction | ( | ) | [virtual] |
Implements G4VNeutronHPEnergyAngular.
Definition at line 77 of file G4NeutronHPContEnergyAngular.cc.
00078 { 00079 G4double result(0); 00080 if(currentMeanEnergy<-1) 00081 { 00082 throw G4HadronicException(__FILE__, __LINE__, "G4NeutronHPContEnergyAngular: Logical error in Product class"); 00083 } 00084 else 00085 { 00086 result = currentMeanEnergy; 00087 } 00088 currentMeanEnergy = -2; 00089 return result; 00090 }
G4ReactionProduct * G4NeutronHPContEnergyAngular::Sample | ( | G4double | anEnergy, | |
G4double | massCode, | |||
G4double | mass | |||
) | [virtual] |
Implements G4VNeutronHPEnergyAngular.
Definition at line 35 of file G4NeutronHPContEnergyAngular.cc.
References G4ReactionProduct::GetMass(), G4VNeutronHPEnergyAngular::GetNeutron(), G4VNeutronHPEnergyAngular::GetTarget(), G4NeutronHPContAngularPar::MeanEnergyOfThisInteraction(), G4NeutronHPContAngularPar::Sample(), G4NeutronHPContAngularPar::SetPrimary(), G4NeutronHPContAngularPar::SetTarget(), and G4NeutronHPContAngularPar::SetTargetCode().
00036 { 00037 G4ReactionProduct * result; 00038 G4int i(0); 00039 G4int it(0); 00040 for(i=0;i<nEnergy;i++) 00041 { 00042 it = i; 00043 if(theAngular[i].GetEnergy()>anEnergy) break; 00044 } 00045 G4double targetMass = GetTarget()->GetMass(); 00046 if(it==0) 00047 { 00048 theAngular[0].SetTarget(GetTarget()); 00049 theAngular[0].SetTargetCode(theTargetCode); 00050 theAngular[0].SetPrimary(GetNeutron()); 00051 result = theAngular[0].Sample(anEnergy, massCode, targetMass, 00052 theAngularRep, theInterpolation); 00053 currentMeanEnergy = theAngular[0].MeanEnergyOfThisInteraction(); 00054 } 00055 else 00056 { 00057 // interpolation through alternating sampling. This needs improvement @@@ 00058 // This is the cause of the He3 problem !!!!!!!! 00059 // See to it, if you can improve this. 00060 //080714 TK commnet Randomizing use angular distribution 00061 //080714 TK Always use the upper side distribution. enabling ClearHistories method. 00062 //G4double random = G4UniformRand(); 00063 //G4double deltaE = theAngular[it].GetEnergy()-theAngular[it-1].GetEnergy(); 00064 //G4double offset = theAngular[it].GetEnergy()-anEnergy; 00065 //if(random<offset/deltaE) it--; 00066 theAngular[it].SetTarget(GetTarget()); 00067 theAngular[it].SetTargetCode(theTargetCode); 00068 theAngular[it].SetPrimary(GetNeutron()); 00069 result = theAngular[it].Sample(anEnergy, massCode, targetMass, 00070 theAngularRep, theInterpolation); 00071 currentMeanEnergy = theAngular[it].MeanEnergyOfThisInteraction(); 00072 } 00073 return result; 00074 }