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

#include <G4NeutronHPProduct.hh>

Public Member Functions

 G4NeutronHPProduct ()
 
 ~G4NeutronHPProduct ()
 
G4double GetMassCode ()
 
G4double GetMass ()
 
void Init (std::ifstream &aDataFile)
 
G4ReactionProductVectorSample (G4double anEnergy)
 
G4double GetMeanYield (G4double anEnergy)
 
void SetNeutron (G4ReactionProduct *aNeutron)
 
void SetTarget (G4ReactionProduct *aTarget)
 
G4ReactionProductGetTarget ()
 
G4ReactionProductGetNeutron ()
 
G4double MeanEnergyOfThisInteraction ()
 
G4double GetQValue ()
 

Detailed Description

Definition at line 49 of file G4NeutronHPProduct.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPProduct()

G4NeutronHPProduct::G4NeutronHPProduct ( )
inline

Definition at line 52 of file G4NeutronHPProduct.hh.

53 {
54 theDist = 0;
55 }

◆ ~G4NeutronHPProduct()

G4NeutronHPProduct::~G4NeutronHPProduct ( )
inline

Definition at line 56 of file G4NeutronHPProduct.hh.

57 {
58 if(theDist != 0) delete theDist;
59 }

Member Function Documentation

◆ GetMass()

G4double G4NeutronHPProduct::GetMass ( )
inline

Definition at line 65 of file G4NeutronHPProduct.hh.

65{return theMass;};

◆ GetMassCode()

G4double G4NeutronHPProduct::GetMassCode ( )
inline

Definition at line 64 of file G4NeutronHPProduct.hh.

64{return theMassCode;};

◆ GetMeanYield()

G4double G4NeutronHPProduct::GetMeanYield ( G4double  anEnergy)
inline

Definition at line 132 of file G4NeutronHPProduct.hh.

133 {
134 return theYield.GetY(anEnergy);
135 }
G4double GetY(G4double x)

◆ GetNeutron()

G4ReactionProduct * G4NeutronHPProduct::GetNeutron ( )
inline

Definition at line 149 of file G4NeutronHPProduct.hh.

149{ return theNeutron; }

◆ GetQValue()

G4double G4NeutronHPProduct::GetQValue ( )
inline

Definition at line 166 of file G4NeutronHPProduct.hh.

166{ return theActualStateQValue; }

Referenced by G4NeutronHPEnAngCorrelation::Sample().

◆ GetTarget()

G4ReactionProduct * G4NeutronHPProduct::GetTarget ( )
inline

Definition at line 147 of file G4NeutronHPProduct.hh.

147{ return theTarget; }

◆ Init()

void G4NeutronHPProduct::Init ( std::ifstream &  aDataFile)
inline

Definition at line 67 of file G4NeutronHPProduct.hh.

68 {
69 aDataFile >> theMassCode>>theMass>>theIsomerFlag>>theDistLaw
70 >> theGroundStateQValue>>theActualStateQValue;
71 theGroundStateQValue*= CLHEP::eV;
72 theActualStateQValue*= CLHEP::eV;
73 theYield.Init(aDataFile, CLHEP::eV);
74 if(theDistLaw==0)
75 {
76 // distribution not known, use E-independent, isotropic angular distribution
77 theDist = new G4NeutronHPIsotropic;
78 }
79 else if(theDistLaw == 1)
80 {
81 // Continuum energy-angular distribution
82 theDist = new G4NeutronHPContEnergyAngular;
83 }
84 else if(theDistLaw == 2)
85 {
86 // Discrete 2-body scattering
87 theDist = new G4NeutronHPDiscreteTwoBody;
88 }
89 else if(theDistLaw == 3)
90 {
91 // Isotropic emission
92 theDist = new G4NeutronHPIsotropic;
93 }
94 else if(theDistLaw == 4)
95 {
96 // Discrete 2-body recoil modification
97 // not used for now. @@@@
98 theDist = new G4NeutronHPDiscreteTwoBody;
99 // the above is only temporary;
100 // recoils need to be addressed
101 // properly
102 delete theDist;
103 theDist = 0;
104 }
105 else if(theDistLaw == 5)
106 {
107 // charged particles only, to be used in a later stage. @@@@
108 }
109 else if(theDistLaw == 6)
110 {
111 // N-Body phase space
112 theDist = new G4NeutronHPNBodyPhaseSpace;
113 }
114 else if(theDistLaw == 7)
115 {
116 // Laboratory angular energy paraetrisation
117 theDist = new G4NeutronHPLabAngularEnergy;
118 }
119 else
120 {
121 throw G4HadronicException(__FILE__, __LINE__, "distribution law unknown to G4NeutronHPProduct");
122 }
123 if(theDist!=0)
124 {
125 theDist->SetQValue(theActualStateQValue);
126 theDist->Init(aDataFile);
127 }
128 }
void Init(std::ifstream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
virtual void Init(std::ifstream &aDataFile)=0

Referenced by G4NeutronHPEnAngCorrelation::Init().

◆ MeanEnergyOfThisInteraction()

G4double G4NeutronHPProduct::MeanEnergyOfThisInteraction ( )
inline

Definition at line 151 of file G4NeutronHPProduct.hh.

152 {
153 G4double result;
154 if(theDist == 0)
155 {
156 result = 0;
157 }
158 else
159 {
160 result=theDist->MeanEnergyOfThisInteraction();
161 result *= theCurrentMultiplicity;
162 }
163 return result;
164 }
double G4double
Definition: G4Types.hh:64
virtual G4double MeanEnergyOfThisInteraction()=0

Referenced by G4NeutronHPEnAngCorrelation::Sample().

◆ Sample()

G4ReactionProductVector * G4NeutronHPProduct::Sample ( G4double  anEnergy)

Definition at line 42 of file G4NeutronHPProduct.cc.

43{
44 if(theDist == 0) { return 0; }
46 G4double mean = theYield.GetY(anEnergy);
47 G4int multi;
48 multi = G4int(mean+0.0001);
49 //if(theMassCode==0) multi = G4Poisson(mean); // @@@@gammas. please X-check this
50 //080718
51 if ( theMassCode == 0 )
52 {
53 if ( G4int ( mean ) == mean )
54 {
55 multi = (G4int) mean;
56 }
57 else
58 {
59 multi = G4Poisson ( mean );
60 }
61 }
62 theDist->SetTarget(theTarget);
63 theDist->SetNeutron(theNeutron);
64 G4int i;
65// G4double eMax = GetTarget()->GetMass()+GetNeutron()->GetMass()
66// - theActualStateQValue;
67 theCurrentMultiplicity = static_cast<G4int>(mean);
69 theDist->ClearHistories();
70 for(i=0;i<multi;i++)
71 {
72 tmp = theDist->Sample(anEnergy, theMassCode, theMass);
73 if(tmp != 0) { result->push_back(tmp); }
74 }
75 if(multi == 0)
76 {
77 tmp = theDist->Sample(anEnergy, theMassCode, theMass);
78 delete tmp;
79 }
80/*
81//080901 TK Comment out, too many secondaries are produced in deuteron reactions
82 if(theTarget->GetMass()<2*GeV) // @@@ take care of residuals in all cases
83 {
84 tmp = theDist->Sample(anEnergy, theMassCode, theMass);
85 tmp->SetDefinition(G4Proton::Proton());
86 if(tmp != 0) { result->push_back(tmp); }
87 }
88*/
89 return result;
90}
G4long G4Poisson(G4double mean)
Definition: G4Poisson.hh:50
std::vector< G4ReactionProduct * > G4ReactionProductVector
int G4int
Definition: G4Types.hh:66
virtual G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass)=0
void SetNeutron(G4ReactionProduct *aNeutron)
void SetTarget(G4ReactionProduct *aTarget)

Referenced by G4NeutronHPEnAngCorrelation::Sample(), and G4NeutronHPEnAngCorrelation::SampleOne().

◆ SetNeutron()

void G4NeutronHPProduct::SetNeutron ( G4ReactionProduct aNeutron)
inline

Definition at line 137 of file G4NeutronHPProduct.hh.

138 {
139 theNeutron = aNeutron;
140 }

◆ SetTarget()

void G4NeutronHPProduct::SetTarget ( G4ReactionProduct aTarget)
inline

Definition at line 142 of file G4NeutronHPProduct.hh.

143 {
144 theTarget = aTarget;
145 }

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