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.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 
 40 #include "G4Cache.hh"
 41 #include "G4Gamma.hh"
 42 #include "G4InterpolationManager.hh"
 43 #include "G4ParticleHPAngularP.hh"
 44 #include "G4ParticleHPFastLegendre.hh"
 45 #include "G4ParticleHPInterpolator.hh"
 46 #include "G4ParticleHPLegendreTable.hh"
 47 #include "G4ParticleHPPartial.hh"
 48 #include "G4ParticleHPVector.hh"
 49 #include "G4ReactionProduct.hh"
 50 #include "G4ReactionProductVector.hh"
 51 #include "G4ios.hh"
 52 #include "globals.hh"
 53 
 54 #include <fstream>
 55 
 56 class G4ParticleHPPhotonDist
 57 {
 58   public:
 59     G4ParticleHPPhotonDist()
 60     {
 61       disType = nullptr;
 62       energy = nullptr;
 63       theYield = nullptr;
 64       thePartialXsec = nullptr;
 65       theReactionXsec = nullptr;
 66       isPrimary = nullptr;
 67       theShells = nullptr;
 68       theGammas = nullptr;
 69       nNeu = nullptr;
 70       theLegendre = nullptr;
 71       theAngular = nullptr;
 72       distribution = nullptr;
 73       probs = nullptr;
 74       partials = nullptr;
 75       actualMult.Put(nullptr);
 76 
 77       theLevelEnergies = nullptr;
 78       theTransitionProbabilities = nullptr;
 79       thePhotonTransitionFraction = nullptr;
 80     }
 81 
 82     ~G4ParticleHPPhotonDist()
 83     {
 84       delete[] disType;
 85       delete[] energy;
 86       delete[] theYield;
 87       delete[] thePartialXsec;
 88       //     delete [] theReactionXsec;
 89       //     DHW: not created in this class
 90       delete[] isPrimary;
 91       delete[] theShells;
 92       delete[] theGammas;
 93       delete[] nNeu;
 94       delete[] theAngular;
 95       delete[] distribution;
 96       delete[] probs;
 97 
 98       if (theLegendre != nullptr) {
 99         for (G4int i = 0; i < (nDiscrete2 - nIso); i++)
100           if (theLegendre[i] != nullptr) delete[] theLegendre[i];
101 
102         delete[] theLegendre;
103       }
104 
105       if (partials != nullptr) {
106         for (G4int i = 0; i < nPartials; i++) {
107           delete partials[i];
108         }
109 
110         delete[] partials;
111       }
112 
113       delete[] theLevelEnergies;
114       delete[] theTransitionProbabilities;
115       delete[] thePhotonTransitionFraction;
116       if (actualMult.Get() != nullptr) delete actualMult.Get();
117     }
118 
119     G4bool InitMean(std::istream& aDataFile);
120 
121     void InitAngular(std::istream& aDataFile);
122 
123     void InitEnergies(std::istream& aDataFile);
124 
125     void InitPartials(std::istream& aDataFile, G4ParticleHPVector* theXsec = nullptr);
126 
127     G4ReactionProductVector* GetPhotons(G4double anEnergy);
128 
129     inline G4double GetTargetMass() { return targetMass; }
130 
131     inline G4bool NeedsCascade() { return repFlag == 2; }
132 
133     inline G4double GetLevelEnergy() { return theBaseEnergy; }
134 
135   private:
136     G4int repFlag{0};  // representation as multiplicities or transition probability arrays.
137     G4double targetMass{0.0};
138 
139     G4int nDiscrete{0};  // number of discrete photons
140     G4int* disType;  // discrete, or continuum photons
141     G4double* energy;  // photon energies
142     G4ParticleHPVector* theYield;  // multiplicity as a function of neutron energy.
143     G4ParticleHPVector theTotalXsec;
144     G4ParticleHPVector* thePartialXsec;
145     G4ParticleHPVector* theReactionXsec;
146     G4int* isPrimary;
147 
148     G4int isoFlag{0};  // isotropic or not?
149     G4int tabulationType{0};
150     G4int nDiscrete2{0};
151     G4int nIso{0};
152     G4double* theShells;
153     G4double* theGammas;
154     G4int* nNeu;
155     G4InterpolationManager theLegendreManager;
156     G4ParticleHPLegendreTable** theLegendre;
157     G4ParticleHPAngularP** theAngular;
158 
159     G4int* distribution;  // not used for the moment.
160     G4int nPartials{0};
161     G4ParticleHPVector* probs;  // probabilities for the partial distributions.
162     G4ParticleHPPartial** partials;  // the partials, parallel to the above
163 
164     G4Cache<std::vector<G4int>*> actualMult;
165 
166     // for transition prob arrays start
167     G4int theInternalConversionFlag{0};
168     G4int nGammaEnergies{0};
169     G4double theBaseEnergy{0.0};
170     G4double* theLevelEnergies;
171     G4double* theTransitionProbabilities;
172     G4double* thePhotonTransitionFraction;
173     // for transition prob arrays end
174 
175     G4ParticleHPFastLegendre theLegend;  // fast look-up for leg-integrals
176 };
177 
178 #endif
179