Geant4  10.01.p01
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>
32 #include <CLHEP/Units/SystemOfUnits.h>
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 
48 #include "G4Cache.hh"
49 
51 {
52 
53  struct toBeCached {
57  toBeCached() : theNeutron(NULL),theTarget(NULL),theCurrentMultiplicity(-1) {};
58  };
59 
60  public:
62  {
63  theDist = 0;
64  toBeCached val;
65  fCache.Put( val );
66  }
68  {
69  if(theDist != 0) delete theDist;
70  }
71 
72 
73  //TK120515 For migration of frameFlag (MF6 LCT) = 3 in
74  //G4NeutronHPEnAngCorrelation
76  G4double GetMass(){return theMass;};
77 
78  inline void Init(std::istream & aDataFile)
79  {
83  theActualStateQValue*= CLHEP::eV;
84  theYield.Init(aDataFile, CLHEP::eV);
85  theYield.Hash();
86  if(theDistLaw==0)
87  {
88  // distribution not known, use E-independent, isotropic angular distribution
90  }
91  else if(theDistLaw == 1)
92  {
93  // Continuum energy-angular distribution
95  }
96  else if(theDistLaw == 2)
97  {
98  // Discrete 2-body scattering
100  }
101  else if(theDistLaw == 3)
102  {
103  // Isotropic emission
105  }
106  else if(theDistLaw == 4)
107  {
108  // Discrete 2-body recoil modification
109  // not used for now. @@@@
111  // the above is only temporary;
112  // recoils need to be addressed
113  // properly
114  delete theDist;
115  theDist = 0;
116  }
117  else if(theDistLaw == 5)
118  {
119  // charged particles only, to be used in a later stage. @@@@
120  }
121  else if(theDistLaw == 6)
122  {
123  // N-Body phase space
125  }
126  else if(theDistLaw == 7)
127  {
128  // Laboratory angular energy paraetrisation
130  }
131  else
132  {
133  throw G4HadronicException(__FILE__, __LINE__, "distribution law unknown to G4NeutronHPProduct");
134  }
135  if(theDist!=0)
136  {
137  theDist->SetQValue(theActualStateQValue);
138  theDist->Init(aDataFile);
139  }
140  }
141 
143 
145  {
146  return theYield.GetY(anEnergy);
147  }
148 
149  void SetNeutron(G4ReactionProduct * aNeutron)
150  {
151  fCache.Get().theNeutron = aNeutron;
152  }
153 
154  void SetTarget(G4ReactionProduct * aTarget)
155  {
156  fCache.Get().theTarget = aTarget;
157  }
158 
159  inline G4ReactionProduct * GetTarget() { return fCache.Get().theTarget; }
160 
161  inline G4ReactionProduct * GetNeutron() { return fCache.Get().theNeutron; }
162 
164  {
165  G4double result;
166  if(theDist == 0)
167  {
168  result = 0;
169  }
170  else
171  {
173  result *= fCache.Get().theCurrentMultiplicity;
174  }
175  return result;
176  }
177 
179  private:
180 
181  // data members
182 
188  G4int theDistLaw; // redundant
191 
192  // Utility quantities
193 
194  //G4ReactionProduct * theTarget;
195  //G4ReactionProduct * theNeutron;
196 
197  // cashed values
198 
199  //G4int theCurrentMultiplicity;
200  //
201  private:
203 };
204 
205 #endif
G4double GetY(G4double x)
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
G4Cache< toBeCached > fCache
void Init(std::istream &aDataFile)
G4NeutronHPVector theYield
G4ReactionProductVector * Sample(G4double anEnergy)
void SetTarget(G4ReactionProduct *aTarget)
G4double MeanEnergyOfThisInteraction()
static const double eV
Definition: G4SIunits.hh:194
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)
G4VNeutronHPEnergyAngular * theDist