Geant4  10.01.p02
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 
54 #include "G4Cache.hh"
55 
57 {
58 public:
59 
61  : repFlag( 0 )
62  , targetMass( 0.0 )
63  , nDiscrete( 0 )
64  , isoFlag( 0 )
65  , tabulationType( 0 )
66  , nDiscrete2( 0 )
67  , nIso( 0 )
68  , nPartials( 0 )
70  , nGammaEnergies( 0 )
71  , theBaseEnergy( 0.0 )
72  {
73 
74  disType = 0;
75  energy = 0;
76  theYield = 0;
77  thePartialXsec = 0;
78  isPrimary = 0;
79  theShells = 0;
80  theGammas = 0;
81  nNeu = 0;
82  theLegendre = 0;
83  theAngular = 0;
84  distribution = 0;
85  probs = 0;
86  partials = 0;
87  //actualMult = 0;
88  actualMult.Put( NULL );
89 
90  theLevelEnergies = 0;
93 
94  }
95 
97  {
98  delete [] disType;
99  delete [] energy;
100  delete [] theYield;
101  delete [] thePartialXsec;
102  delete [] isPrimary;
103  delete [] theShells;
104  delete [] theGammas;
105  delete [] nNeu;
106  delete [] theAngular;
107  delete [] distribution;
108  delete [] probs;
109 
110  if ( theLegendre != NULL )
111  {
112  for ( G4int i = 0 ; i < (nDiscrete2-nIso) ; i++ )
113  if ( theLegendre[i] != NULL ) delete[] theLegendre[i];
114 
115  delete [] theLegendre;
116  }
117 
118  if ( partials != 0 )
119  {
120  for ( G4int i = 0 ; i < nPartials ; i++ )
121  { delete partials[i]; }
122 
123  delete [] partials;
124  }
125 
126  //delete [] actualMult;
127 
128  // delete theLevelEnergies;
129  // delete theTransitionProbabilities;
130  // delete thePhotonTransitionFraction;
131 // TKDB
132  delete [] theLevelEnergies;
133  delete [] theTransitionProbabilities;
134  delete [] thePhotonTransitionFraction;
135  }
136 
137  G4bool InitMean(std::istream & aDataFile);
138 
139  void InitAngular(std::istream & aDataFile);
140 
141  void InitEnergies(std::istream & aDataFile);
142 
143  void InitPartials(std::istream & aDataFile);
144 
146 
147  inline G4double GetTargetMass() {return targetMass;}
148 
149  inline G4bool NeedsCascade() {return repFlag==2;}
150 
152 
153 private:
154 
155  G4int repFlag; //representation as multiplicities or transition probability arrays.
157 
158  G4int nDiscrete; //number of discrete photons
159  G4int * disType; // discrete, or continuum photons
160  G4double * energy; // photon energies
161  G4NeutronHPVector * theYield; // multiplicity as a function of neutron energy.
165 
166  G4int isoFlag; // isotropic or not?
176 
177  G4int * distribution; // not used for the moment.
179  G4NeutronHPVector * probs; // probabilities for the partial distributions.
180  G4NeutronHPPartial ** partials; // the partials, parallel to the above
181 
182  //G4int * actualMult;
184 
185  // for transition prob arrays start
192  // for transition prob arrays end
193 
194  G4NeutronHPFastLegendre theLegend; // fast look-up for leg-integrals
195  G4NeutronHPInterpolator theInt; // interpolation
196 };
197 
198 #endif
G4ReactionProductVector * GetPhotons(G4double anEnergy)
G4NeutronHPPartial ** partials
int G4int
Definition: G4Types.hh:78
G4NeutronHPFastLegendre theLegend
G4NeutronHPAngularP ** theAngular
std::vector< G4ReactionProduct * > G4ReactionProductVector
void InitAngular(std::istream &aDataFile)
bool G4bool
Definition: G4Types.hh:79
G4NeutronHPVector theTotalXsec
void InitEnergies(std::istream &aDataFile)
G4bool InitMean(std::istream &aDataFile)
G4InterpolationManager theLegendreManager
G4NeutronHPLegendreTable ** theLegendre
G4Cache< std::vector< G4int > * > actualMult
G4NeutronHPInterpolator theInt
G4NeutronHPVector * thePartialXsec
double G4double
Definition: G4Types.hh:76
G4NeutronHPVector * theYield
void Put(const value_type &val) const
Definition: G4Cache.hh:286
void InitPartials(std::istream &aDataFile)