Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
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
49 targetMass = 0.0;
50 theSpontPrompt = 0.0;
51 spontDelayed = true;
52 theSpontDelayed = 0.0;
53 }
55
56 G4double GetTargetMass() { return targetMass; }
57
58 void InitMean(std::istream & aDataFile)
59 {
60 G4int iflag;
61 aDataFile >> targetMass >>iflag;
62 if(iflag == 1) simpleMean=false;
63 if(simpleMean)
64 {
65 theSimpleMean.Init(aDataFile, CLHEP::eV);
66 }
67 else
68 {
69 theMean.Init(aDataFile);
70 }
71 }
72
73 void InitPrompt(std::istream & aDataFile)
74 {
75 hasPromptData = true;
76 G4int iflag;
77 aDataFile >> targetMass >>iflag;
78 if(iflag == 2) spontPrompt = false;
79 if(spontPrompt)
80 {
81 aDataFile >> theSpontPrompt;
82 }
83 else
84 {
85 thePrompt.Init(aDataFile, CLHEP::eV);
86 }
87 }
88
89 void InitDelayed(std::istream & aDataFile)
90 {
91 hasDelayedData = true;
92 G4int iflag;
93 aDataFile >> targetMass >>iflag;
94 thePrecursorDecayConstants.Init(aDataFile, 1./CLHEP::s); // s is the CLHEP unit second
95 if(iflag == 2) spontDelayed = false;
96 if(spontDelayed)
97 {
98 aDataFile >> theSpontDelayed;
99 }
100 else
101 {
102 theDelayed.Init(aDataFile, CLHEP::eV);
103 }
104 }
105
107 {
108 if(simpleMean)
109 {
110 return theSimpleMean.GetY(anEnergy);
111 }
112 return theMean.GetValue(anEnergy);
113 }
114
116 {
117 if(!hasPromptData) return 0;
118 if(spontPrompt)
119 {
120 return theSpontPrompt;
121 }
122 return thePrompt.GetY(anEnergy);
123 }
124
126 {
127 if(!hasDelayedData) return 0;
128 if(spontDelayed)
129 {
130 return theSpontDelayed;
131 }
132 return theDelayed.GetY(anEnergy);
133 }
134
136 {
137 return thePrecursorDecayConstants.GetValue(i);
138 }
139
140 private:
141
142 G4double targetMass;
143 // total mean
144 G4bool simpleMean;
146 G4ParticleHPVector theSimpleMean;
147
148 // Prompt neutrons
149 G4bool hasPromptData;
150 G4bool spontPrompt;
151 G4ParticleHPVector thePrompt;
152 G4double theSpontPrompt;
153
154 // delayed neutrons
155 G4bool hasDelayedData;
156 G4bool spontDelayed;
157 G4ParticleHPList thePrecursorDecayConstants;
158 G4ParticleHPVector theDelayed;
159 G4double theSpontDelayed;
160
161};
162#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
void Init(std::istream &aDataFile, G4int nPar, G4double unit=1.)
G4double GetValue(G4int i)
G4double GetMean(G4double anEnergy)
void InitMean(std::istream &aDataFile)
void InitDelayed(std::istream &aDataFile)
G4double GetPrompt(G4double anEnergy)
void InitPrompt(std::istream &aDataFile)
G4double GetDelayed(G4double anEnergy)
G4double GetValue(G4double anEnergy)
G4double GetY(G4double x)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)