Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4NeutronHPEnAngCorrelation Class Reference

#include <G4NeutronHPEnAngCorrelation.hh>

Public Member Functions

 G4NeutronHPEnAngCorrelation ()
 
 ~G4NeutronHPEnAngCorrelation ()
 
void Init (std::istream &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 40 of file G4NeutronHPEnAngCorrelation.hh.

Constructor & Destructor Documentation

G4NeutronHPEnAngCorrelation::G4NeutronHPEnAngCorrelation ( )
inline

Definition at line 43 of file G4NeutronHPEnAngCorrelation.hh.

44  {
45  theProducts = 0;
46  inCharge = false;
47  theTotalMeanEnergy = -1.;
48  }
G4NeutronHPEnAngCorrelation::~G4NeutronHPEnAngCorrelation ( )
inline

Definition at line 49 of file G4NeutronHPEnAngCorrelation.hh.

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

Member Function Documentation

G4double G4NeutronHPEnAngCorrelation::GetTargetMass ( )
inline

Definition at line 86 of file G4NeutronHPEnAngCorrelation.hh.

Referenced by G4NeutronHPInelasticBaseFS::BaseApply().

86 { return targetMass; }
G4double G4NeutronHPEnAngCorrelation::GetTotalMeanEnergy ( )
inline

Definition at line 88 of file G4NeutronHPEnAngCorrelation.hh.

Referenced by G4NeutronHPInelasticBaseFS::BaseApply().

89  {
90  // cashed in 'sample' call
91  return theTotalMeanEnergy;
92  }
G4bool G4NeutronHPEnAngCorrelation::InCharge ( )
inline

Definition at line 81 of file G4NeutronHPEnAngCorrelation.hh.

82  {
83  return inCharge;
84  }
void G4NeutronHPEnAngCorrelation::Init ( std::istream &  aDataFile)
inline

Definition at line 54 of file G4NeutronHPEnAngCorrelation.hh.

References G4NeutronHPProduct::Init().

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

55  {
56  inCharge = true;
57  aDataFile>>targetMass>>frameFlag>>nProducts;
58  theProducts = new G4NeutronHPProduct[nProducts];
59  for(G4int i=0; i<nProducts; i++)
60  {
61  theProducts[i].Init(aDataFile);
62  }
63  }
int G4int
Definition: G4Types.hh:78
void Init(std::istream &aDataFile)
G4ReactionProductVector * G4NeutronHPEnAngCorrelation::Sample ( G4double  anEnergy)

Definition at line 62 of file G4NeutronHPEnAngCorrelation.cc.

References G4endl, G4ReactionProduct::GetKineticEnergy(), G4ReactionProduct::GetMomentum(), G4NeutronHPProduct::GetQValue(), G4ReactionProduct::GetTotalEnergy(), CLHEP::HepLorentzRotation::inverse(), G4ReactionProduct::Lorentz(), G4NeutronHPProduct::MeanEnergyOfThisInteraction(), CLHEP::HepLorentzRotation::rotateY(), CLHEP::HepLorentzRotation::rotateZ(), G4NeutronHPProduct::Sample(), G4ReactionProduct::SetMass(), G4ReactionProduct::SetMomentum(), and G4ReactionProduct::SetTotalEnergy().

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

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 }
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetMomentum(const G4double x, const G4double y, const G4double z)
int G4int
Definition: G4Types.hh:78
HepLorentzRotation & rotateY(double delta)
std::vector< G4ReactionProduct * > G4ReactionProductVector
void SetMass(const G4double mas)
void SetTotalEnergy(const G4double en)
G4ReactionProductVector * Sample(G4double anEnergy)
HepLorentzRotation & rotateZ(double delta)
G4double GetKineticEnergy() const
G4double MeanEnergyOfThisInteraction()
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
#define G4endl
Definition: G4ios.hh:61
HepLorentzRotation inverse() const
double G4double
Definition: G4Types.hh:76
G4ReactionProduct * G4NeutronHPEnAngCorrelation::SampleOne ( G4double  anEnergy)

Definition at line 37 of file G4NeutronHPEnAngCorrelation.cc.

References G4NeutronHPProduct::Sample().

38 {
39  G4ReactionProduct * result = new G4ReactionProduct;
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
45  G4ReactionProductVector * temp=0;
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 }
int G4int
Definition: G4Types.hh:78
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4ReactionProductVector * Sample(G4double anEnergy)
void G4NeutronHPEnAngCorrelation::SetNeutron ( G4ReactionProduct aNeutron)
inline

Definition at line 75 of file G4NeutronHPEnAngCorrelation.hh.

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

76  {
77  theNeutron = aNeutron;
78  for(G4int i=0;i<nProducts;i++)theProducts[i].SetNeutron(&theNeutron);
79  }
int G4int
Definition: G4Types.hh:78
void SetNeutron(G4ReactionProduct &aNeutron)
void G4NeutronHPEnAngCorrelation::SetTarget ( G4ReactionProduct aTarget)
inline

Definition at line 69 of file G4NeutronHPEnAngCorrelation.hh.

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

70  {
71  theTarget = aTarget;
72  for(G4int i=0;i<nProducts;i++)theProducts[i].SetTarget(&theTarget);
73  }
void SetTarget(G4ReactionProduct &aTarget)
int G4int
Definition: G4Types.hh:78

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