Geant4  10.02
G4ParticleHPParticleYield.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 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
28 //
29 #ifndef G4ParticleHPParticleYield_h
30 #define G4ParticleHPParticleYield_h 1
31 
32 #include <CLHEP/Units/SystemOfUnits.h>
33 
34 #include "globals.hh"
35 #include "G4ParticleHPVector.hh"
37 #include "G4ParticleHPList.hh"
38 
40 {
41  public:
43  {
44  simpleMean = true;
45  spontPrompt = true;
46  hasPromptData = false;
47  hasDelayedData = false;
48  }
50 
52 
53  void InitMean(std::istream & aDataFile)
54  {
55  G4int iflag;
56  aDataFile >> targetMass >>iflag;
57  if(iflag == 1) simpleMean=false;
58  if(simpleMean)
59  {
60  theSimpleMean.Init(aDataFile, CLHEP::eV);
61  }
62  else
63  {
64  theMean.Init(aDataFile);
65  }
66  }
67 
68  void InitPrompt(std::istream & aDataFile)
69  {
70  hasPromptData = true;
71  G4int iflag;
72  aDataFile >> targetMass >>iflag;
73  if(iflag == 2) spontPrompt = false;
74  if(spontPrompt)
75  {
76  aDataFile >> theSpontPrompt;
77  }
78  else
79  {
80  thePrompt.Init(aDataFile, CLHEP::eV);
81  }
82  }
83 
84  void InitDelayed(std::istream & aDataFile)
85  {
86  hasDelayedData = true;
87  G4int iflag;
88  aDataFile >> targetMass >>iflag;
89  thePrecursorDecayConstants.Init(aDataFile, 1./CLHEP::s); // s is the CLHEP unit second
90  if(iflag == 2) spontDelayed = false;
91  if(spontDelayed)
92  {
93  aDataFile >> theSpontDelayed;
94  }
95  else
96  {
97  theDelayed.Init(aDataFile, CLHEP::eV);
98  }
99  }
100 
102  {
103  if(simpleMean)
104  {
105  return theSimpleMean.GetY(anEnergy);
106  }
107  return theMean.GetValue(anEnergy);
108  }
109 
111  {
112  if(!hasPromptData) return 0;
113  if(spontPrompt)
114  {
115  return theSpontPrompt;
116  }
117  return thePrompt.GetY(anEnergy);
118  }
119 
121  {
122  if(!hasDelayedData) return 0;
123  if(spontDelayed)
124  {
125  return theSpontDelayed;
126  }
127  return theDelayed.GetY(anEnergy);
128  }
129 
131  {
133  }
134 
135  private:
136 
138  // total mean
142 
143  // Prompt neutrons
148 
149  // delayed neutrons
155 
156 };
157 #endif
G4ParticleHPPolynomExpansion theMean
void Init(std::istream &aDataFile, G4int nPar, G4double unit=1.)
int G4int
Definition: G4Types.hh:78
G4double GetPrompt(G4double anEnergy)
static const double s
Definition: G4SIunits.hh:168
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
bool G4bool
Definition: G4Types.hh:79
void InitDelayed(std::istream &aDataFile)
G4double GetY(G4double x)
static const double eV
Definition: G4SIunits.hh:212
G4double GetValue(G4double anEnergy)
void InitMean(std::istream &aDataFile)
G4double GetValue(G4int i)
double G4double
Definition: G4Types.hh:76
G4double GetDelayed(G4double anEnergy)
G4double GetMean(G4double anEnergy)
void InitPrompt(std::istream &aDataFile)