G4NeutronHPPhotonDist.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029  // Hadronic Process: Very Low Energy Neutron X-Sections
00030  // original by H.P. Wellisch, TRIUMF, 14-Feb-97
00031 //
00032 // 070606 fix for Valgrind error by T. Koi
00033 // 070612 fix memory leaking by T. Koi
00034 // 070615 fix memory leaking by T. Koi
00035 // 080625 fix memory leaking by T. Koi
00036 //
00037  
00038 #ifndef G4NeutronHPPhotonDist_h
00039 #define G4NeutronHPPhotonDist_h 1
00040 #include "globals.hh"
00041 #include <fstream>
00042 #include "G4ios.hh"
00043 #include "globals.hh"
00044 #include "G4NeutronHPVector.hh"
00045 #include "G4NeutronHPLegendreTable.hh"
00046 #include "G4NeutronHPAngularP.hh"
00047 #include "G4NeutronHPPartial.hh"
00048 #include "G4NeutronHPFastLegendre.hh"
00049 #include "G4NeutronHPInterpolator.hh"
00050 #include "G4ReactionProductVector.hh"
00051 #include "G4ReactionProduct.hh"
00052 #include "G4Gamma.hh"
00053 #include "G4InterpolationManager.hh"
00054 
00055 class G4NeutronHPPhotonDist
00056 {
00057 public:
00058 
00059   G4NeutronHPPhotonDist()
00060       : repFlag( 0 ) 
00061       , targetMass( 0.0 ) 
00062       , nDiscrete( 0 ) 
00063       , isoFlag( 0 )
00064       , tabulationType( 0 )
00065       , nDiscrete2( 0 ) 
00066       , nIso( 0 ) 
00067       , nPartials( 0 )
00068       , theInternalConversionFlag( 0 )
00069       , nGammaEnergies( 0 )
00070       , theBaseEnergy( 0.0 )
00071   {
00072 
00073      disType = 0;
00074      energy = 0;
00075      theYield = 0;
00076      thePartialXsec = 0;
00077      isPrimary = 0;
00078      theShells = 0;
00079      theGammas = 0;
00080      nNeu = 0;
00081      theLegendre = 0;
00082      theAngular = 0;
00083      distribution = 0;
00084      probs = 0;
00085      partials = 0;
00086      actualMult = 0;
00087 
00088      theLevelEnergies = 0;
00089      theTransitionProbabilities = 0;
00090      thePhotonTransitionFraction = 0;
00091 
00092   }
00093 
00094   ~G4NeutronHPPhotonDist()
00095   {
00096      delete [] disType;
00097      delete [] energy;
00098      delete [] theYield;
00099      delete [] thePartialXsec;
00100      delete [] isPrimary;
00101      delete [] theShells;
00102      delete [] theGammas;
00103      delete [] nNeu;
00104      delete [] theAngular;
00105      delete [] distribution;
00106      delete [] probs;
00107 
00108      if ( theLegendre != NULL )
00109      {
00110         for ( G4int i = 0 ; i < (nDiscrete2-nIso) ; i++ )
00111            if ( theLegendre[i] != NULL ) delete[] theLegendre[i]; 
00112 
00113         delete [] theLegendre;
00114      }
00115 
00116      if ( partials != 0 ) 
00117      {
00118         for ( G4int i = 0 ; i < nPartials ; i++ )
00119            { delete partials[i]; }
00120 
00121         delete [] partials;
00122      }
00123 
00124      delete [] actualMult;
00125 
00126      // delete theLevelEnergies;
00127      // delete theTransitionProbabilities;
00128      // delete thePhotonTransitionFraction;
00129 // TKDB
00130      delete [] theLevelEnergies;
00131      delete [] theTransitionProbabilities;
00132      delete [] thePhotonTransitionFraction;
00133   }
00134   
00135   G4bool InitMean(std::ifstream & aDataFile);
00136     
00137   void InitAngular(std::ifstream & aDataFile);
00138   
00139   void InitEnergies(std::ifstream & aDataFile);
00140   
00141   void InitPartials(std::ifstream & aDataFile);
00142   
00143   G4ReactionProductVector * GetPhotons(G4double anEnergy);
00144   
00145   inline G4double GetTargetMass() {return targetMass;}
00146   
00147   inline G4bool NeedsCascade() {return repFlag==2;}
00148   
00149   inline G4double GetLevelEnergy() {return theBaseEnergy;}
00150 
00151 private:
00152 
00153    G4int repFlag;  //representation as multiplicities or transition probability arrays.
00154    G4double targetMass;
00155    
00156    G4int nDiscrete;  //number of discrete photons 
00157    G4int * disType;  // discrete, or continuum photons
00158    G4double * energy;  // photon energies
00159    G4NeutronHPVector * theYield; // multiplicity as a function of neutron energy.
00160    G4NeutronHPVector theTotalXsec;
00161    G4NeutronHPVector * thePartialXsec;
00162    G4int * isPrimary;
00163   
00164    G4int isoFlag; // isotropic or not?
00165    G4int tabulationType;
00166    G4int nDiscrete2;
00167    G4int nIso;
00168    G4double * theShells;
00169    G4double * theGammas;
00170    G4int * nNeu;
00171    G4InterpolationManager theLegendreManager;
00172    G4NeutronHPLegendreTable ** theLegendre;
00173    G4NeutronHPAngularP ** theAngular;
00174    
00175    G4int * distribution; // not used for the moment.                                 
00176    G4int nPartials;
00177    G4NeutronHPVector *  probs; // probabilities for the partial distributions.
00178    G4NeutronHPPartial ** partials; // the partials, parallel to the above
00179 
00180    G4int * actualMult;
00181    
00182     // for transition prob arrays start
00183    G4int theInternalConversionFlag;
00184    G4int nGammaEnergies;
00185    G4double theBaseEnergy;
00186    G4double * theLevelEnergies;
00187    G4double * theTransitionProbabilities;
00188    G4double * thePhotonTransitionFraction;
00189     // for transition prob arrays end
00190 
00191    G4NeutronHPFastLegendre theLegend; // fast look-up for leg-integrals
00192    G4NeutronHPInterpolator theInt; // interpolation
00193 };
00194 
00195 #endif

Generated on Mon May 27 17:49:04 2013 for Geant4 by  doxygen 1.4.7