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

#include <G4NeutronHPEnAngCorrelation.hh>

Public Member Functions

 G4NeutronHPEnAngCorrelation ()
 
 ~G4NeutronHPEnAngCorrelation ()
 
void Init (std::ifstream &aDataFile)
 
G4ReactionProductSampleOne (G4double anEnergy)
 
G4ReactionProductVectorSample (G4double anEnergy)
 
void SetTarget (G4ReactionProduct &aTarget)
 
void SetNeutron (G4ReactionProduct &aNeutron)
 
G4bool InCharge ()
 
G4double GetTargetMass ()
 
G4double GetTotalMeanEnergy ()
 

Detailed Description

Definition at line 41 of file G4NeutronHPEnAngCorrelation.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPEnAngCorrelation()

G4NeutronHPEnAngCorrelation::G4NeutronHPEnAngCorrelation ( )
inline

Definition at line 44 of file G4NeutronHPEnAngCorrelation.hh.

45 {
46 theProducts = 0;
47 inCharge = false;
48 theTotalMeanEnergy = -1.;
49 }

◆ ~G4NeutronHPEnAngCorrelation()

G4NeutronHPEnAngCorrelation::~G4NeutronHPEnAngCorrelation ( )
inline

Definition at line 50 of file G4NeutronHPEnAngCorrelation.hh.

51 {
52 if(theProducts!=0) delete [] theProducts;
53 }

Member Function Documentation

◆ GetTargetMass()

G4double G4NeutronHPEnAngCorrelation::GetTargetMass ( )
inline

Definition at line 87 of file G4NeutronHPEnAngCorrelation.hh.

87{ return targetMass; }

Referenced by G4NeutronHPInelasticBaseFS::BaseApply().

◆ GetTotalMeanEnergy()

G4double G4NeutronHPEnAngCorrelation::GetTotalMeanEnergy ( )
inline

Definition at line 89 of file G4NeutronHPEnAngCorrelation.hh.

90 {
91 // cashed in 'sample' call
92 return theTotalMeanEnergy;
93 }

Referenced by G4NeutronHPInelasticBaseFS::BaseApply().

◆ InCharge()

G4bool G4NeutronHPEnAngCorrelation::InCharge ( )
inline

Definition at line 82 of file G4NeutronHPEnAngCorrelation.hh.

83 {
84 return inCharge;
85 }

◆ Init()

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

Definition at line 55 of file G4NeutronHPEnAngCorrelation.hh.

56 {
57 inCharge = true;
58 aDataFile>>targetMass>>frameFlag>>nProducts;
59 theProducts = new G4NeutronHPProduct[nProducts];
60 for(G4int i=0; i<nProducts; i++)
61 {
62 theProducts[i].Init(aDataFile);
63 }
64 }
int G4int
Definition: G4Types.hh:66
void Init(std::ifstream &aDataFile)

Referenced by G4NeutronHPCaptureFS::Init(), G4NeutronHPInelasticCompFS::Init(), and G4NeutronHPInelasticBaseFS::Init().

◆ Sample()

G4ReactionProductVector * G4NeutronHPEnAngCorrelation::Sample ( G4double  anEnergy)

Definition at line 62 of file G4NeutronHPEnAngCorrelation.cc.

63{
65 G4int i;
67 G4ReactionProduct theCMS;
69 //TK120515 migrate frameFlag (MF6 LCT) = 3
70 //if(frameFlag==2)
71 if(frameFlag==2||frameFlag==3)
72 {
73 // simplify and double check @
74 G4ThreeVector the3Neutron = theNeutron.GetMomentum(); //theNeutron has value in LAB
75 G4double nEnergy = theNeutron.GetTotalEnergy();
76 G4ThreeVector the3Target = theTarget.GetMomentum(); //theTarget has value in LAB
77 G4double tEnergy = theTarget.GetTotalEnergy();
78 G4double totE = nEnergy+tEnergy;
79 G4ThreeVector the3CMS = the3Target+the3Neutron;
80 theCMS.SetMomentum(the3CMS);
81 G4double cmsMom = std::sqrt(the3CMS*the3CMS);
82 G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
83 theCMS.SetMass(sqrts);
84 theCMS.SetTotalEnergy(totE);
85 G4ReactionProduct aNeutron;
86 aNeutron.Lorentz(theNeutron, theCMS);
87 //TKDB 100413
88 //ENDF-6 Formats Manual ENDF-102
89 //CHAPTER 6. FILE 6: PRODUCT ENERGY-ANGLE DISTRIBUTIONS
90 //LCT Reference system for secondary energy and angle (incident energy is always given in the LAB system)
91 //anEnergy = aNeutron.GetKineticEnergy();
92 anEnergy = theNeutron.GetKineticEnergy(); //should be same argumment of "anEnergy"
93
94 G4LorentzVector Ptmp (aNeutron.GetMomentum(), aNeutron.GetTotalEnergy());
95
96 toZ.rotateZ(-1*Ptmp.phi());
97 toZ.rotateY(-1*Ptmp.theta());
98 }
99 theTotalMeanEnergy=0;
100 G4LorentzRotation toLab(toZ.inverse()); //toLab only change axis NOT to LAB system
101 for(i=0; i<nProducts; i++)
102 {
103 it = theProducts[i].Sample(anEnergy);
104 G4double aMeanEnergy = theProducts[i].MeanEnergyOfThisInteraction();
105 if(aMeanEnergy>0)
106 {
107 theTotalMeanEnergy += aMeanEnergy;
108 }
109 else
110 {
111 theTotalMeanEnergy = anEnergy/nProducts+theProducts[i].GetQValue();
112 }
113 if(it!=0)
114 {
115 for(unsigned int ii=0; ii<it->size(); ii++)
116 {
117 G4LorentzVector pTmp1 (it->operator[](ii)->GetMomentum(),
118 it->operator[](ii)->GetTotalEnergy());
119 pTmp1 = toLab*pTmp1;
120 it->operator[](ii)->SetMomentum(pTmp1.vect());
121 it->operator[](ii)->SetTotalEnergy(pTmp1.e());
122 if(frameFlag==1) // target rest //TK 100413 should be LAB?
123 {
124 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theTarget); //TK 100413 Is this really need?
125 }
126 else if(frameFlag==2) // CMS
127 {
128#ifdef G4_NHP_DEBUG
129 cout <<"G4NeutronHPEnAngCorrelation: "<<
130 it->at(ii)->GetTotalEnergy()<<" "<<
131 it->at(ii)->GetMomentum()<<G4endl;
132#endif
133 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
134 }
135 //TK120515 migrate frameFlag (MF6 LCT) = 3
136 else if(frameFlag==3) // CMS A<=4 other LAB
137 {
138 if ( theProducts[i].GetMassCode() > 4 ) //Alpha AWP 3.96713
139 {
140 //LAB
141 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theTarget); //TK 100413 Is this really need?
142 }
143 else
144 {
145 //CMS
146 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
147 }
148 }
149 else
150 {
151 throw G4HadronicException(__FILE__, __LINE__, "G4NeutronHPEnAngCorrelation::Sample: The frame of the finalstate is not specified");
152 }
153 result->push_back(it->operator[](ii));
154 }
155 delete it;
156 }
157 }
158 return result;
159}
std::vector< G4ReactionProduct * > G4ReactionProductVector
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
G4double MeanEnergyOfThisInteraction()
G4ReactionProductVector * Sample(G4double anEnergy)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetMass(const G4double mas)

Referenced by G4NeutronHPCaptureFS::ApplyYourself(), G4NeutronHPInelasticBaseFS::BaseApply(), and G4NeutronHPInelasticCompFS::CompositeApply().

◆ SampleOne()

G4ReactionProduct * G4NeutronHPEnAngCorrelation::SampleOne ( G4double  anEnergy)

Definition at line 37 of file G4NeutronHPEnAngCorrelation.cc.

38{
40
41 // do we have an appropriate distribution
42 if(nProducts!=1) throw G4HadronicException(__FILE__, __LINE__, "More than one product in SampleOne");
43
44 // get the result
46 G4int i=0;
47 while(temp == 0) temp = theProducts[i++].Sample(anEnergy);
48
49 // is the multiplicity correct
50 if(temp->size()!=1) throw G4HadronicException(__FILE__, __LINE__, "SampleOne: Yield not correct");
51
52 // fill result
53 result = temp->operator[](0);
54
55 // some garbage collection
56 delete temp;
57
58 // return result
59 return result;
60}

◆ SetNeutron()

void G4NeutronHPEnAngCorrelation::SetNeutron ( G4ReactionProduct aNeutron)
inline

Definition at line 76 of file G4NeutronHPEnAngCorrelation.hh.

77 {
78 theNeutron = aNeutron;
79 for(G4int i=0;i<nProducts;i++)theProducts[i].SetNeutron(&theNeutron);
80 }
void SetNeutron(G4ReactionProduct &aNeutron)

Referenced by G4NeutronHPCaptureFS::ApplyYourself(), G4NeutronHPInelasticBaseFS::BaseApply(), G4NeutronHPInelasticCompFS::InitDistributionInitialState(), and SetNeutron().

◆ SetTarget()

void G4NeutronHPEnAngCorrelation::SetTarget ( G4ReactionProduct aTarget)
inline

Definition at line 70 of file G4NeutronHPEnAngCorrelation.hh.

71 {
72 theTarget = aTarget;
73 for(G4int i=0;i<nProducts;i++)theProducts[i].SetTarget(&theTarget);
74 }
void SetTarget(G4ReactionProduct &aTarget)

Referenced by G4NeutronHPCaptureFS::ApplyYourself(), G4NeutronHPInelasticBaseFS::BaseApply(), G4NeutronHPInelasticCompFS::InitDistributionInitialState(), and SetTarget().


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