Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 // $Id$
28 //
29 #ifndef G4NeutronHPProduct_h
30 #define G4NeutronHPProduct_h 1
31 
32 #include <fstream>
34 
35 #include "globals.hh"
36 #include "G4ios.hh"
37 #include "Randomize.hh"
38 #include "G4HadronicException.hh"
39 #include "G4NeutronHPVector.hh"
42 
45 #include "G4NeutronHPIsotropic.hh"
48 
50 {
51  public:
53  {
54  theDist = 0;
55  }
57  {
58  if(theDist != 0) delete theDist;
59  }
60 
61 
62  //TK120515 For migration of frameFlag (MF6 LCT) = 3 in
63  //G4NeutronHPEnAngCorrelation
64  G4double GetMassCode(){return theMassCode;};
65  G4double GetMass(){return theMass;};
66 
67  inline void Init(std::ifstream & aDataFile)
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  }
129 
131 
133  {
134  return theYield.GetY(anEnergy);
135  }
136 
137  void SetNeutron(G4ReactionProduct * aNeutron)
138  {
139  theNeutron = aNeutron;
140  }
141 
142  void SetTarget(G4ReactionProduct * aTarget)
143  {
144  theTarget = aTarget;
145  }
146 
147  inline G4ReactionProduct * GetTarget() { return theTarget; }
148 
149  inline G4ReactionProduct * GetNeutron() { return theNeutron; }
150 
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  }
165 
166  inline G4double GetQValue() { return theActualStateQValue; }
167  private:
168 
169  // data members
170 
171  G4double theMassCode;
172  G4double theMass;
173  G4int theIsomerFlag;
174  G4double theGroundStateQValue;
175  G4double theActualStateQValue;
176  G4int theDistLaw; // redundant
177  G4NeutronHPVector theYield;
178  G4VNeutronHPEnergyAngular * theDist;
179 
180  // Utility quantities
181 
182  G4ReactionProduct * theTarget;
183  G4ReactionProduct * theNeutron;
184 
185  // cashed values
186 
187  G4int theCurrentMultiplicity;
188 
189 };
190 
191 #endif