Geant4_10
G4NeutronHPProduct.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 #ifndef G4NeutronHPProduct_h
29 #define G4NeutronHPProduct_h 1
30 
31 #include <fstream>
33 
34 #include "globals.hh"
35 #include "G4ios.hh"
36 #include "Randomize.hh"
37 #include "G4HadronicException.hh"
38 #include "G4NeutronHPVector.hh"
41 
44 #include "G4NeutronHPIsotropic.hh"
47 
49 {
50  public:
52  {
53  theDist = 0;
54  }
56  {
57  if(theDist != 0) delete theDist;
58  }
59 
60 
61  //TK120515 For migration of frameFlag (MF6 LCT) = 3 in
62  //G4NeutronHPEnAngCorrelation
63  G4double GetMassCode(){return theMassCode;};
64  G4double GetMass(){return theMass;};
65 
66  inline void Init(std::istream & aDataFile)
67  {
68  aDataFile >> theMassCode>>theMass>>theIsomerFlag>>theDistLaw
69  >> theGroundStateQValue>>theActualStateQValue;
70  theGroundStateQValue*= CLHEP::eV;
71  theActualStateQValue*= CLHEP::eV;
72  theYield.Init(aDataFile, CLHEP::eV);
73  if(theDistLaw==0)
74  {
75  // distribution not known, use E-independent, isotropic angular distribution
76  theDist = new G4NeutronHPIsotropic;
77  }
78  else if(theDistLaw == 1)
79  {
80  // Continuum energy-angular distribution
81  theDist = new G4NeutronHPContEnergyAngular;
82  }
83  else if(theDistLaw == 2)
84  {
85  // Discrete 2-body scattering
86  theDist = new G4NeutronHPDiscreteTwoBody;
87  }
88  else if(theDistLaw == 3)
89  {
90  // Isotropic emission
91  theDist = new G4NeutronHPIsotropic;
92  }
93  else if(theDistLaw == 4)
94  {
95  // Discrete 2-body recoil modification
96  // not used for now. @@@@
97  theDist = new G4NeutronHPDiscreteTwoBody;
98  // the above is only temporary;
99  // recoils need to be addressed
100  // properly
101  delete theDist;
102  theDist = 0;
103  }
104  else if(theDistLaw == 5)
105  {
106  // charged particles only, to be used in a later stage. @@@@
107  }
108  else if(theDistLaw == 6)
109  {
110  // N-Body phase space
111  theDist = new G4NeutronHPNBodyPhaseSpace;
112  }
113  else if(theDistLaw == 7)
114  {
115  // Laboratory angular energy paraetrisation
116  theDist = new G4NeutronHPLabAngularEnergy;
117  }
118  else
119  {
120  throw G4HadronicException(__FILE__, __LINE__, "distribution law unknown to G4NeutronHPProduct");
121  }
122  if(theDist!=0)
123  {
124  theDist->SetQValue(theActualStateQValue);
125  theDist->Init(aDataFile);
126  }
127  }
128 
130 
132  {
133  return theYield.GetY(anEnergy);
134  }
135 
136  void SetNeutron(G4ReactionProduct * aNeutron)
137  {
138  theNeutron = aNeutron;
139  }
140 
141  void SetTarget(G4ReactionProduct * aTarget)
142  {
143  theTarget = aTarget;
144  }
145 
146  inline G4ReactionProduct * GetTarget() { return theTarget; }
147 
148  inline G4ReactionProduct * GetNeutron() { return theNeutron; }
149 
151  {
153  if(theDist == 0)
154  {
155  result = 0;
156  }
157  else
158  {
159  result=theDist->MeanEnergyOfThisInteraction();
160  result *= theCurrentMultiplicity;
161  }
162  return result;
163  }
164 
165  inline G4double GetQValue() { return theActualStateQValue; }
166  private:
167 
168  // data members
169 
170  G4double theMassCode;
171  G4double theMass;
172  G4int theIsomerFlag;
173  G4double theGroundStateQValue;
174  G4double theActualStateQValue;
175  G4int theDistLaw; // redundant
176  G4NeutronHPVector theYield;
177  G4VNeutronHPEnergyAngular * theDist;
178 
179  // Utility quantities
180 
181  G4ReactionProduct * theTarget;
182  G4ReactionProduct * theNeutron;
183 
184  // cashed values
185 
186  G4int theCurrentMultiplicity;
187 
188 };
189 
190 #endif
G4double GetY(G4double x)
G4double G4NeutronHPJENDLHEData::G4double result
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
int G4int
Definition: G4Types.hh:78
G4ReactionProduct * GetNeutron()
std::vector< G4ReactionProduct * > G4ReactionProductVector
void Init(std::istream &aDataFile)
G4ReactionProductVector * Sample(G4double anEnergy)
void SetTarget(G4ReactionProduct *aTarget)
G4double MeanEnergyOfThisInteraction()
virtual G4double MeanEnergyOfThisInteraction()=0
G4double GetMeanYield(G4double anEnergy)
G4ReactionProduct * GetTarget()
virtual void Init(std::istream &aDataFile)=0
double G4double
Definition: G4Types.hh:76
void SetNeutron(G4ReactionProduct *aNeutron)