Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 "G4ParticleHPList.hh"
34#include "G4ParticleHPVector.hh"
35#include "globals.hh"
36
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 theSimpleMean.Init(aDataFile, CLHEP::eV);
65 }
66 else {
67 theMean.Init(aDataFile);
68 }
69 }
70
71 void InitPrompt(std::istream& aDataFile)
72 {
73 hasPromptData = true;
74 G4int iflag;
75 aDataFile >> targetMass >> iflag;
76 if (iflag == 2) spontPrompt = false;
77 if (spontPrompt) {
78 aDataFile >> theSpontPrompt;
79 }
80 else {
81 thePrompt.Init(aDataFile, CLHEP::eV);
82 }
83 }
84
85 void InitDelayed(std::istream& aDataFile)
86 {
87 hasDelayedData = true;
88 G4int iflag;
89 aDataFile >> targetMass >> iflag;
90 thePrecursorDecayConstants.Init(aDataFile, 1. / CLHEP::s); // s is the CLHEP unit second
91 if (iflag == 2) spontDelayed = false;
92 if (spontDelayed) {
93 aDataFile >> theSpontDelayed;
94 }
95 else {
96 theDelayed.Init(aDataFile, CLHEP::eV);
97 }
98 }
99
101 {
102 if (simpleMean) {
103 return theSimpleMean.GetY(anEnergy);
104 }
105 return theMean.GetValue(anEnergy);
106 }
107
109 {
110 if (!hasPromptData) return 0;
111 if (spontPrompt) {
112 return theSpontPrompt;
113 }
114 return thePrompt.GetY(anEnergy);
115 }
116
118 {
119 if (!hasDelayedData) return 0;
120 if (spontDelayed) {
121 return theSpontDelayed;
122 }
123 return theDelayed.GetY(anEnergy);
124 }
125
126 inline G4double GetDecayConstant(G4int i) { return thePrecursorDecayConstants.GetValue(i); }
127
128 private:
129 G4double targetMass;
130 // total mean
131 G4bool simpleMean;
133 G4ParticleHPVector theSimpleMean;
134
135 // Prompt neutrons
136 G4bool hasPromptData;
137 G4bool spontPrompt;
138 G4ParticleHPVector thePrompt;
139 G4double theSpontPrompt;
140
141 // delayed neutrons
142 G4bool hasDelayedData;
143 G4bool spontDelayed;
144 G4ParticleHPList thePrecursorDecayConstants;
145 G4ParticleHPVector theDelayed;
146 G4double theSpontDelayed;
147};
148#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)
~G4ParticleHPParticleYield()=default
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 GetY(G4double x)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)