Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronHPContEnergyAngular Class Reference

#include <G4NeutronHPContEnergyAngular.hh>

+ Inheritance diagram for G4NeutronHPContEnergyAngular:

Public Member Functions

 G4NeutronHPContEnergyAngular ()
 
 ~G4NeutronHPContEnergyAngular ()
 
void Init (std::ifstream &aDataFile)
 
G4double MeanEnergyOfThisInteraction ()
 
G4ReactionProductSample (G4double anEnergy, G4double massCode, G4double mass)
 
void ClearHistories ()
 
- Public Member Functions inherited from G4VNeutronHPEnergyAngular
 G4VNeutronHPEnergyAngular ()
 
virtual ~G4VNeutronHPEnergyAngular ()
 
virtual void Init (std::ifstream &aDataFile)=0
 
virtual G4ReactionProductSample (G4double anEnergy, G4double massCode, G4double mass)=0
 
virtual G4double MeanEnergyOfThisInteraction ()=0
 
void SetNeutron (G4ReactionProduct *aNeutron)
 
void SetTarget (G4ReactionProduct *aTarget)
 
G4ReactionProductGetTarget ()
 
G4ReactionProductGetNeutron ()
 
G4ReactionProductGetCMS ()
 
void SetQValue (G4double aValue)
 
virtual void ClearHistories ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4VNeutronHPEnergyAngular
G4double GetQValue ()
 

Detailed Description

Definition at line 43 of file G4NeutronHPContEnergyAngular.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPContEnergyAngular()

G4NeutronHPContEnergyAngular::G4NeutronHPContEnergyAngular ( )
inline

Definition at line 47 of file G4NeutronHPContEnergyAngular.hh.

48 {
49 theAngular = 0;
50 currentMeanEnergy = -2;
51 }

◆ ~G4NeutronHPContEnergyAngular()

G4NeutronHPContEnergyAngular::~G4NeutronHPContEnergyAngular ( )
inline

Definition at line 53 of file G4NeutronHPContEnergyAngular.hh.

54 {
55 if(theAngular!=0) delete [] theAngular;
56 }

Member Function Documentation

◆ ClearHistories()

void G4NeutronHPContEnergyAngular::ClearHistories ( )
virtual

Reimplemented from G4VNeutronHPEnergyAngular.

Definition at line 94 of file G4NeutronHPContEnergyAngular.cc.

95{
96 if ( theAngular!= NULL )
97 {
98 for ( G4int i = 0 ; i< nEnergy ; i++ )
99 theAngular[i].ClearHistories();
100 }
101}
int G4int
Definition: G4Types.hh:66

Referenced by ClearHistories().

◆ Init()

void G4NeutronHPContEnergyAngular::Init ( std::ifstream &  aDataFile)
inlinevirtual

Implements G4VNeutronHPEnergyAngular.

Definition at line 60 of file G4NeutronHPContEnergyAngular.hh.

61 {
62 aDataFile >> theTargetCode >> theAngularRep >> theInterpolation >> nEnergy;
63 theAngular = new G4NeutronHPContAngularPar[nEnergy];
64 theManager.Init(aDataFile);
65 for(G4int i=0; i<nEnergy; i++)
66 {
67 theAngular[i].Init(aDataFile);
68 theAngular[i].SetInterpolation(theInterpolation);
69 }
70 }
void Init(G4int aScheme, G4int aRange)
void Init(std::ifstream &aDataFile)
void SetInterpolation(G4int theInterpolation)

◆ MeanEnergyOfThisInteraction()

G4double G4NeutronHPContEnergyAngular::MeanEnergyOfThisInteraction ( )
virtual

Implements G4VNeutronHPEnergyAngular.

Definition at line 76 of file G4NeutronHPContEnergyAngular.cc.

78{
79 G4double result(0);
80 if(currentMeanEnergy<-1)
81 {
82 throw G4HadronicException(__FILE__, __LINE__, "G4NeutronHPContEnergyAngular: Logical error in Product class");
83 }
84 else
85 {
86 result = currentMeanEnergy;
87 }
88 currentMeanEnergy = -2;
89 return result;
90}
double G4double
Definition: G4Types.hh:64

◆ Sample()

G4ReactionProduct * G4NeutronHPContEnergyAngular::Sample ( G4double  anEnergy,
G4double  massCode,
G4double  mass 
)
virtual

Implements G4VNeutronHPEnergyAngular.

Definition at line 35 of file G4NeutronHPContEnergyAngular.cc.

36{
37 G4ReactionProduct * result;
38 G4int i(0);
39 G4int it(0);
40 for(i=0;i<nEnergy;i++)
41 {
42 it = i;
43 if(theAngular[i].GetEnergy()>anEnergy) break;
44 }
45 G4double targetMass = GetTarget()->GetMass();
46 if(it==0)
47 {
48 theAngular[0].SetTarget(GetTarget());
49 theAngular[0].SetTargetCode(theTargetCode);
50 theAngular[0].SetPrimary(GetNeutron());
51 result = theAngular[0].Sample(anEnergy, massCode, targetMass,
52 theAngularRep, theInterpolation);
53 currentMeanEnergy = theAngular[0].MeanEnergyOfThisInteraction();
54 }
55 else
56 {
57 // interpolation through alternating sampling. This needs improvement @@@
58 // This is the cause of the He3 problem !!!!!!!!
59 // See to it, if you can improve this.
60 //080714 TK commnet Randomizing use angular distribution
61 //080714 TK Always use the upper side distribution. enabling ClearHistories method.
62 //G4double random = G4UniformRand();
63 //G4double deltaE = theAngular[it].GetEnergy()-theAngular[it-1].GetEnergy();
64 //G4double offset = theAngular[it].GetEnergy()-anEnergy;
65 //if(random<offset/deltaE) it--;
66 theAngular[it].SetTarget(GetTarget());
67 theAngular[it].SetTargetCode(theTargetCode);
68 theAngular[it].SetPrimary(GetNeutron());
69 result = theAngular[it].Sample(anEnergy, massCode, targetMass,
70 theAngularRep, theInterpolation);
71 currentMeanEnergy = theAngular[it].MeanEnergyOfThisInteraction();
72 }
73 return result;
74}
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass, G4int angularRep, G4int interpol)
void SetTarget(G4ReactionProduct *aTarget)
void SetPrimary(G4ReactionProduct *aPrimary)
void SetTargetCode(G4double aTargetCode)
G4double GetMass() const

The documentation for this class was generated from the following files: