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