Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleHPPhotonDist.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 // Hadronic Process: Very Low Energy Neutron X-Sections
28 // original by H.P. Wellisch, TRIUMF, 14-Feb-97
29//
30// 070606 fix for Valgrind error by T. Koi
31// 070612 fix memory leaking by T. Koi
32// 070615 fix memory leaking by T. Koi
33// 080625 fix memory leaking by T. Koi
34//
35// P. Arce, June-2014 Conversion neutron_hp to particle_hp
36//
37#ifndef G4ParticleHPPhotonDist_h
38#define G4ParticleHPPhotonDist_h 1
39
40#include <fstream>
41
42#include "globals.hh"
43#include "G4ios.hh"
44#include "globals.hh"
45#include "G4ParticleHPVector.hh"
52#include "G4ReactionProduct.hh"
53#include "G4Gamma.hh"
55#include "G4Cache.hh"
56
58{
59public:
60
62 : repFlag( 0 )
63 , targetMass( 0.0 )
64 , nDiscrete( 0 )
65 , isoFlag( 0 )
66 , tabulationType( 0 )
67 , nDiscrete2( 0 )
68 , nIso( 0 )
69 , nPartials( 0 )
70 , theInternalConversionFlag( 0 )
71 , nGammaEnergies( 0 )
72 , theBaseEnergy( 0.0 )
73 {
74
75 disType = 0;
76 energy = 0;
77 theYield = 0;
78 thePartialXsec = 0;
79 theReactionXsec = 0;
80 isPrimary = 0;
81 theShells = 0;
82 theGammas = 0;
83 nNeu = 0;
84 theLegendre = 0;
85 theAngular = 0;
86 distribution = 0;
87 probs = 0;
88 partials = 0;
89 actualMult.Put( 0 );
90
91 theLevelEnergies = 0;
92 theTransitionProbabilities = 0;
93 thePhotonTransitionFraction = 0;
94
95 }
96
98 {
99 delete [] disType;
100 delete [] energy;
101 delete [] theYield;
102 delete [] thePartialXsec;
103// delete [] theReactionXsec;
104// DHW: not created in this class
105 delete [] isPrimary;
106 delete [] theShells;
107 delete [] theGammas;
108 delete [] nNeu;
109 delete [] theAngular;
110 delete [] distribution;
111 delete [] probs;
112
113 if ( theLegendre != 0 )
114 {
115 for ( G4int i = 0 ; i < (nDiscrete2-nIso) ; i++ )
116 if ( theLegendre[i] != 0 ) delete[] theLegendre[i];
117
118 delete [] theLegendre;
119 }
120
121 if ( partials != 0 )
122 {
123 for ( G4int i = 0 ; i < nPartials ; i++ )
124 { delete partials[i]; }
125
126 delete [] partials;
127 }
128
129 delete [] theLevelEnergies;
130 delete [] theTransitionProbabilities;
131 delete [] thePhotonTransitionFraction;
132 if (actualMult.Get() != 0) delete actualMult.Get();
133 }
134
135 G4bool InitMean(std::istream & aDataFile);
136
137 void InitAngular(std::istream & aDataFile);
138
139 void InitEnergies(std::istream & aDataFile);
140
141 void InitPartials(std::istream& aDataFile, G4ParticleHPVector* theXsec = 0);
142
144
145 inline G4double GetTargetMass() {return targetMass;}
146
147 inline G4bool NeedsCascade() {return repFlag==2;}
148
149 inline G4double GetLevelEnergy() {return theBaseEnergy;}
150
151private:
152
153 G4int repFlag; //representation as multiplicities or transition probability arrays.
154 G4double targetMass;
155
156 G4int nDiscrete; //number of discrete photons
157 G4int* disType; // discrete, or continuum photons
158 G4double* energy; // photon energies
159 G4ParticleHPVector* theYield; // multiplicity as a function of neutron energy.
160 G4ParticleHPVector theTotalXsec;
161 G4ParticleHPVector* thePartialXsec;
162 G4ParticleHPVector* theReactionXsec;
163 G4int* isPrimary;
164
165 G4int isoFlag; // isotropic or not?
166 G4int tabulationType;
167 G4int nDiscrete2;
168 G4int nIso;
169 G4double * theShells;
170 G4double * theGammas;
171 G4int * nNeu;
172 G4InterpolationManager theLegendreManager;
173 G4ParticleHPLegendreTable ** theLegendre;
174 G4ParticleHPAngularP ** theAngular;
175
176 G4int * distribution; // not used for the moment.
177 G4int nPartials;
178 G4ParticleHPVector * probs; // probabilities for the partial distributions.
179 G4ParticleHPPartial ** partials; // the partials, parallel to the above
180
181 G4Cache< std::vector<G4int>* > actualMult;
182
183 // for transition prob arrays start
184 G4int theInternalConversionFlag;
185 G4int nGammaEnergies;
186 G4double theBaseEnergy;
187 G4double * theLevelEnergies;
188 G4double * theTransitionProbabilities;
189 G4double * thePhotonTransitionFraction;
190 // for transition prob arrays end
191
192 G4ParticleHPFastLegendre theLegend; // fast look-up for leg-integrals
193 G4ParticleHPInterpolator theInt; // interpolation
194};
195
196#endif
std::vector< G4ReactionProduct * > G4ReactionProductVector
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
value_type & Get() const
Definition: G4Cache.hh:315
void Put(const value_type &val) const
Definition: G4Cache.hh:321
void InitEnergies(std::istream &aDataFile)
G4ReactionProductVector * GetPhotons(G4double anEnergy)
void InitAngular(std::istream &aDataFile)
void InitPartials(std::istream &aDataFile, G4ParticleHPVector *theXsec=0)
G4bool InitMean(std::istream &aDataFile)