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