Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 #include "globals.hh"
40 #include <fstream>
41 #include "G4ios.hh"
42 #include "globals.hh"
43 #include "G4ParticleHPVector.hh"
45 #include "G4ParticleHPAngularP.hh"
46 #include "G4ParticleHPPartial.hh"
50 #include "G4ReactionProduct.hh"
51 #include "G4Gamma.hh"
53 #include "G4Cache.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  actualMult.Put( NULL );
88 
89  theLevelEnergies = 0;
90  theTransitionProbabilities = 0;
91  thePhotonTransitionFraction = 0;
92 
93  }
94 
96  {
97  delete [] disType;
98  delete [] energy;
99  delete [] theYield;
100  delete [] thePartialXsec;
101  delete [] isPrimary;
102  delete [] theShells;
103  delete [] theGammas;
104  delete [] nNeu;
105  delete [] theAngular;
106  delete [] distribution;
107  delete [] probs;
108 
109  if ( theLegendre != NULL )
110  {
111  for ( G4int i = 0 ; i < (nDiscrete2-nIso) ; i++ )
112  if ( theLegendre[i] != NULL ) delete[] theLegendre[i];
113 
114  delete [] theLegendre;
115  }
116 
117  if ( partials != 0 )
118  {
119  for ( G4int i = 0 ; i < nPartials ; i++ )
120  { delete partials[i]; }
121 
122  delete [] partials;
123  }
124 
125  //delete [] actualMult;
126 
127  // delete theLevelEnergies;
128  // delete theTransitionProbabilities;
129  // delete thePhotonTransitionFraction;
130 // TKDB
131  delete [] theLevelEnergies;
132  delete [] theTransitionProbabilities;
133  delete [] thePhotonTransitionFraction;
134  }
135 
136  G4bool InitMean(std::istream & aDataFile);
137 
138  void InitAngular(std::istream & aDataFile);
139 
140  void InitEnergies(std::istream & aDataFile);
141 
142  void InitPartials(std::istream & aDataFile);
143 
145 
146  inline G4double GetTargetMass() {return targetMass;}
147 
148  inline G4bool NeedsCascade() {return repFlag==2;}
149 
150  inline G4double GetLevelEnergy() {return theBaseEnergy;}
151 
152 private:
153 
154  G4int repFlag; //representation as multiplicities or transition probability arrays.
155  G4double targetMass;
156 
157  G4int nDiscrete; //number of discrete photons
158  G4int * disType; // discrete, or continuum photons
159  G4double * energy; // photon energies
160  G4ParticleHPVector * theYield; // multiplicity as a function of neutron energy.
161  G4ParticleHPVector theTotalXsec;
162  G4ParticleHPVector * thePartialXsec;
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  //G4int * actualMult;
182  G4Cache< std::vector<G4int>* > actualMult;
183 
184  // for transition prob arrays start
185  G4int theInternalConversionFlag;
186  G4int nGammaEnergies;
187  G4double theBaseEnergy;
188  G4double * theLevelEnergies;
189  G4double * theTransitionProbabilities;
190  G4double * thePhotonTransitionFraction;
191  // for transition prob arrays end
192 
193  G4ParticleHPFastLegendre theLegend; // fast look-up for leg-integrals
194  G4ParticleHPInterpolator theInt; // interpolation
195 };
196 
197 #endif
int G4int
Definition: G4Types.hh:78
void InitPartials(std::istream &aDataFile)
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4bool InitMean(std::istream &aDataFile)
bool G4bool
Definition: G4Types.hh:79
G4ReactionProductVector * GetPhotons(G4double anEnergy)
void InitEnergies(std::istream &aDataFile)
double G4double
Definition: G4Types.hh:76
void InitAngular(std::istream &aDataFile)
void Put(const value_type &val) const
Definition: G4Cache.hh:286