Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/event/include/G4SPSEneDistribution.hh

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.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 ]

Diff markup

Differences between /event/include/G4SPSEneDistribution.hh (Version 11.3.0) and /event/include/G4SPSEneDistribution.hh (Version 10.6.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4SPSEneDistribution                        <<  26 ///////////////////////////////////////////////////////////////////////////////
                                                   >>  27 //
                                                   >>  28 // MODULE:        G4SPSEneDistribution.hh
                                                   >>  29 //
                                                   >>  30 // Version:      1.0
                                                   >>  31 // Date:         5/02/04
                                                   >>  32 // Author:       Fan Lei 
                                                   >>  33 // Organisation: QinetiQ ltd.
                                                   >>  34 // Customer:     ESA/ESTEC
                                                   >>  35 //
                                                   >>  36 ///////////////////////////////////////////////////////////////////////////////
                                                   >>  37 //
                                                   >>  38 // CHANGE HISTORY
                                                   >>  39 // --------------
                                                   >>  40 //
                                                   >>  41 //
                                                   >>  42 // Version 1.0, 05/02/2004, Fan Lei, Created.
                                                   >>  43 //    Based on the G4GeneralParticleSource class in Geant4 v6.0
                                                   >>  44 //
                                                   >>  45 //
                                                   >>  46 //  26/03/2014, Andrew Green.
                                                   >>  47 //      Modification to used STL vectors instead of C-style arrays. This should save some space,
                                                   >>  48 //      particularly when the blackbody function is not used. Also moved to dynamically allocated
                                                   >>  49 //      memory in the LinearInterpolation, ExpInterpolation and LogInterpolation functions. Again,
                                                   >>  50 //      this will save space if these functions are unused.
                                                   >>  51 //
                                                   >>  52 // 06/06/2014  A Dotti
                                                   >>  53 //    For thread safety: this is a shared object,
                                                   >>  54 //    mutex has been added to control access to shared resources (data members).
                                                   >>  55 //    in Getters and Setters, mutex is NOT used in GenerateOne because it is
                                                   >>  56 //    assumed that properties are not changed during event loop.
                                                   >>  57 //
                                                   >>  58 // 24/11/2017  Fan Lei
                                                   >>  59 //    Added cutoff power-law distribution option. Implementation is similar to that of the BlackBody one.
                                                   >>  60 //
                                                   >>  61 ///////////////////////////////////////////////////////////////////////////////
                                                   >>  62 //
 27 //                                                 63 //
 28 // Class Description:                              64 // Class Description:
 29 //                                                 65 //
 30 // To generate the energy of a primary vertex  <<  66 // To generate the energy of a primary vertex according to the defined distribution 
 31 // defined distribution. This is a shared clas <<  67 //
 32 // Only one thread should use the set-methods  <<  68 ///////////////////////////////////////////////////////////////////////////////
 33 // Note that this is exactly what is achieved  <<  69 //
 34 // If you use the set methods to set defaults  <<  70 // MEMBER FUNCTIONS
 35 // care that only one thread is executing them <<  71 // ----------------
 36 // In addition take care of calling these meth <<  72 //
 37 // started. Do not use the setters during the  <<  73 // G4SPSEneDistribution ()
                                                   >>  74 //    Constructor: Initializes variables
                                                   >>  75 //
                                                   >>  76 // ~G4SPSEneDistribution ()
                                                   >>  77 //    Destructor: 
                                                   >>  78 //
                                                   >>  79 // void SetEnergyDisType(G4String)
                                                   >>  80 //    Allows the user to choose the energy distribution type. The arguments
                                                   >>  81 //    are Mono (mono-energetic), Lin (linear), Pow (power-law), Exp 
                                                   >>  82 //    (exponential), Gauss (gaussian), Brem (bremsstrahlung), BBody (black-body), Cdg
                                                   >>  83 //    (cosmic diffuse gamma-ray), User (user-defined), Arb (arbitrary
                                                   >>  84 //    point-wise), Epn (energy per nucleon).
                                                   >>  85 //
                                                   >>  86 // void SetEmin(G4double)
                                                   >>  87 //    Sets the minimum energy.
                                                   >>  88 //
                                                   >>  89 // void SetEmax(G4double)
                                                   >>  90 //    Sets the maximum energy.
                                                   >>  91 //
                                                   >>  92 // void SetMonoEnergy(G4double)
                                                   >>  93 //    Sets energy for mono-energetic distribution.
                                                   >>  94 //
                                                   >>  95 // void SetAlpha(G4double)
                                                   >>  96 //    Sets alpha for a power-law distribution.
                                                   >>  97 //
                                                   >>  98 // void SetTemp(G4double)
                                                   >>  99 //    Sets Temperature for a Brem or BBody distributions.
                                                   >> 100 //
                                                   >> 101 // void SetEzero(G4double)
                                                   >> 102 //    Sets Ezero for an exponential distribution.
                                                   >> 103 //
                                                   >> 104 // void SetGradient(G4double)
                                                   >> 105 //    Sets gradient for a linear distribution.
                                                   >> 106 //
                                                   >> 107 // void SetInterCept(G4double)
                                                   >> 108 //    Sets intercept for a linear distribution.
                                                   >> 109 //
                                                   >> 110 // void UserEnergyHisto(G4ThreeVector)
                                                   >> 111 //    Allows user to defined a histogram for the energy distribution.
                                                   >> 112 //
                                                   >> 113 // void ArbEnergyHisto(G4ThreeVector)
                                                   >> 114 //    Allows the user to define an Arbitrary set of points for the
                                                   >> 115 //    energy distribution.
                                                   >> 116 //
                                                   >> 117 // void EpnEnergyHisto(G4ThreeVector)
                                                   >> 118 //    Allows the user to define an Energy per nucleon histogram.
                                                   >> 119 //
                                                   >> 120 // void Calculate()
                                                   >> 121 //    Controls the calculation of Integral PDF for the Cdg and BBody
                                                   >> 122 //    distributions.
                                                   >> 123 //
                                                   >> 124 // void InputEnergySpectra(G4bool)
                                                   >> 125 //    Allows the user to choose between momentum and energy histograms
                                                   >> 126 //    for user-defined histograms and arbitrary point-wise spectr.
                                                   >> 127 //    The default is true (energy).
                                                   >> 128 //
                                                   >> 129 // void InputDifferentialSpectra(G4bool)
                                                   >> 130 //    Allows the user to choose between integral and differential 
                                                   >> 131 //    distributions when using the arbitrary point-wise option.
                                                   >> 132 //
                                                   >> 133 // void ArbInterpolate(G4String)
                                                   >> 134 //    ArbInterpolate allows the user to specify the type of function to
                                                   >> 135 //    interpolate the Arbitrary points spectrum with.
                                                   >> 136 //
                                                   >> 137 //  void SetBiasRndm (G4SPSRandomGenerator* a)
                                                   >> 138 //    Sets the biased random number generator
                                                   >> 139 //
                                                   >> 140 //  G4double GenerateOne(G4ParticleDefinition*);
                                                   >> 141 //    Generate one random energy for the specified particle
                                                   >> 142 //
                                                   >> 143 //  void ReSetHist(G4String);
                                                   >> 144 //    Re-sets the histogram for user defined distribution
                                                   >> 145 //
                                                   >> 146 // void SetVerbosity(G4int)
                                                   >> 147 //    Sets the verbosity level.
                                                   >> 148 //
                                                   >> 149 ///////////////////////////////////////////////////////////////////////////////
 38                                                   150 
 39 // Author:       Fan Lei, QinetiQ ltd.         << 151 #ifndef G4SPSEneDistribution_h
 40 // Customer:     ESA/ESTEC                     << 152 #define G4SPSEneDistribution_h 1
 41 // History:                                    << 
 42 // - 05/02/2004, Fan Lei - Created.            << 
 43 //     Based on the G4GeneralParticleSource cl << 
 44 // - 26/03/2014, Andrew Green.                 << 
 45 //     Modification to use STL vectors instead << 
 46 //     Also moved to dynamically allocated mem << 
 47 //     ExpInterpolation() and LogInterpolation << 
 48 // - 06/06/2014, Andrea Dotti.                 << 
 49 //     For thread safety: this is a shared obj << 
 50 //     Added mutex to control access to shared << 
 51 //     in Getters and Setters, mutex is NOT us << 
 52 //     is assumed that properties are not chan << 
 53 // - 24/11/2017, Fan Lei                       << 
 54 //    Added cutoff power-law distribution opti << 
 55 //    to that of the BlackBody one.            << 
 56 // ------------------------------------------- << 
 57 #ifndef G4SPSEneDistribution_hh                << 
 58 #define G4SPSEneDistribution_hh 1              << 
 59                                                   153 
 60 #include "G4PhysicsFreeVector.hh"              << 154 #include "G4PhysicsOrderedFreeVector.hh"
 61 #include "G4ParticleMomentum.hh"                  155 #include "G4ParticleMomentum.hh"
 62 #include "G4ParticleDefinition.hh"                156 #include "G4ParticleDefinition.hh"
 63 #include "G4DataInterpolation.hh"                 157 #include "G4DataInterpolation.hh"
 64 #include "G4Threading.hh"                         158 #include "G4Threading.hh"
 65 #include "G4Cache.hh"                             159 #include "G4Cache.hh"
 66 #include <vector>                                 160 #include <vector>
 67                                                   161 
 68 #include "G4SPSRandomGenerator.hh"                162 #include "G4SPSRandomGenerator.hh"
 69                                                   163 
 70 class G4SPSEneDistribution                     << 164 /** Andrea Dotti Feb 2015
 71 {                                              << 165  * Important: This is a shared class between threads.
 72   public:                                      << 166  * Only one thread should use the set-methods here.
 73                                                << 167  * Note that this is exactly what is achieved using UI commands.
 74     G4SPSEneDistribution();                    << 168  * If you use the set methods to set defaults in your
 75       // Constructor: initializes variables    << 169  * application take care that only one thread is executing them.
 76    ~G4SPSEneDistribution();                    << 170  * In addition take care of calling these methods before the run is started
 77       // Destructor                            << 171  * Do not use these setters during the event loop
 78                                                << 172  */
 79     void SetEnergyDisType(const G4String&);    << 173 
 80       // Allows the user to choose the energy  << 174 class G4SPSEneDistribution {
 81       // The arguments are: Mono (mono-energet << 175 public:
 82       // Pow (power-law), Exp (exponential), G << 176   G4SPSEneDistribution();//
 83       // Brem (bremsstrahlung), BBody (black-b << 177   ~G4SPSEneDistribution();//
 84       // Cdg (cosmic diffuse gamma-ray), User  << 178 
 85       // Arb (arbitrary point-wise), Epn (ener << 179   void SetEnergyDisType(G4String);//
 86                                                << 180     G4String GetEnergyDisType();//
 87     const G4String& GetEnergyDisType();        << 181   void SetEmin(G4double);//
 88                                                << 182     G4double GetEmin();//
 89     void SetEmin(G4double);                    << 183     G4double GetArbEmin();//
 90       // Sets the minimum energy               << 184   void SetEmax(G4double);//
 91                                                << 185     G4double GetEmax();//
 92     G4double GetEmin() const;                  << 186     G4double GetArbEmax();//
 93     G4double GetArbEmin();                     << 187   void SetMonoEnergy(G4double);//
 94                                                << 188   void SetAlpha(G4double);//
 95     void SetEmax(G4double);                    << 189   void SetBiasAlpha(G4double);//
 96       // Sets the maximum energy               << 190   void SetTemp(G4double);//
 97                                                << 191   void SetBeamSigmaInE(G4double);////
 98     G4double GetEmax() const;                  << 192   void SetEzero(G4double);//
 99     G4double GetArbEmax();                     << 193   void SetGradient(G4double);//
100                                                << 194   void SetInterCept(G4double);//
101     void SetMonoEnergy(G4double);              << 195   void UserEnergyHisto(G4ThreeVector);//
102       // Sets energy for mono-energetic distri << 196   void ArbEnergyHisto(G4ThreeVector);//
103                                                << 197   void ArbEnergyHistoFile(G4String);//
104     void SetAlpha(G4double);                   << 198   void EpnEnergyHisto(G4ThreeVector);//
105       // Sets alpha for a power-law distributi << 199 
106                                                << 200   void InputEnergySpectra(G4bool);//
107     void SetBiasAlpha(G4double);               << 201   void InputDifferentialSpectra(G4bool);//
108                                                << 202   void ArbInterpolate(G4String);//
109     void SetTemp(G4double);                    << 203   G4String GetIntType();//
110       // Sets Temperature for a Brem or BBody  << 
111                                                << 
112     void SetBeamSigmaInE(G4double);            << 
113                                                << 
114     void SetEzero(G4double);                   << 
115       // Sets Ezero for an exponential distrib << 
116                                                << 
117     void SetGradient(G4double);                << 
118       // Sets gradient for a linear distributi << 
119                                                << 
120     void SetInterCept(G4double);               << 
121       // Sets intercept for a linear distribut << 
122                                                << 
123     void UserEnergyHisto(const G4ThreeVector&) << 
124       // Allows user to defined a histogram fo << 
125                                                << 
126     void ArbEnergyHisto(const G4ThreeVector&); << 
127       // Allows the user to define an Arbitrar << 
128       // energy distribution                   << 
129                                                << 
130     void ArbEnergyHistoFile(const G4String&);  << 
131                                                << 
132     void EpnEnergyHisto(const G4ThreeVector&); << 
133       // Allows the user to define an Energy p << 
134                                                << 
135     void InputEnergySpectra(G4bool);           << 
136       // Allows the user to choose between mom << 
137       // for user-defined histograms and arbit << 
138       // The default is true (energy)          << 
139                                                << 
140     void InputDifferentialSpectra(G4bool);     << 
141       // Allows the user to choose between int << 
142       // distributions when using the arbitrar << 
143                                                << 
144     void ArbInterpolate(const G4String&);      << 
145       // Allows the user to specify the type o << 
146       // interpolate the Arbitrary points spec << 
147                                                << 
148     const G4String& GetIntType();              << 
149                                                   204     
150     void Calculate();                          << 205   void Calculate();//
151       // Controls the calculation of Integral  << 
152       // distributions                         << 
153                                                << 
154     void SetBiasRndm(G4SPSRandomGenerator* a); << 
155       // Sets the biased random number generat << 
156                                                << 
157     void ReSetHist(const G4String&);           << 
158       // Resets the histogram for user defined << 
159                                                << 
160     void SetVerbosity(G4int a);                << 
161       // Sets the verbosity level              << 
162                                                << 
163     G4double GetWeight() const;                << 
164                                                << 
165     G4double GetMonoEnergy();                  << 
166       // Mono-energetic energy                 << 
167                                                   206 
168     G4double GetSE();                          << 207   void SetBiasRndm(G4SPSRandomGenerator* a);//
169       // Standard deviation for Gaussian distr << 208   // method to re-set the histograms
                                                   >> 209   void ReSetHist(G4String);//
                                                   >> 210   // Set the verbosity level.
                                                   >> 211   void SetVerbosity(G4int a);//
                                                   >> 212 
                                                   >> 213   //x
                                                   >> 214   G4double GetWeight();
                                                   >> 215 
                                                   >> 216   G4double GetMonoEnergy(); //Mono-energteic energy
                                                   >> 217   G4double GetSE();// Standard deviation for Gaussion distrbution in energy
                                                   >> 218   G4double Getalpha(); // alpha (pow)
                                                   >> 219   G4double GetEzero(); // E0 (exp)
                                                   >> 220   G4double GetTemp(); // Temp (bbody,brem)
                                                   >> 221   G4double Getgrad(); // gradient and intercept for linear spectra
                                                   >> 222   G4double Getcept(); //
                                                   >> 223 
                                                   >> 224     G4PhysicsOrderedFreeVector GetUserDefinedEnergyHisto(); //
                                                   >> 225   G4PhysicsOrderedFreeVector GetArbEnergyHisto(); //
                                                   >> 226 
                                                   >> 227   G4double GenerateOne(G4ParticleDefinition*);
                                                   >> 228   G4double GetProbability (G4double);
                                                   >> 229 
                                                   >> 230 
                                                   >> 231 private:
                                                   >> 232   void LinearInterpolation();//
                                                   >> 233   void LogInterpolation();//
                                                   >> 234   void ExpInterpolation();//
                                                   >> 235   void SplineInterpolation();//
                                                   >> 236   void CalculateCdgSpectrum();//
                                                   >> 237   void CalculateBbodySpectrum();//
                                                   >> 238   void CalculateCPowSpectrum();//
                                                   >> 239 
                                                   >> 240   // The following methods generate energies according to the spectral
                                                   >> 241   // parameters defined above.
                                                   >> 242   void GenerateMonoEnergetic();//G4double& outputEne);//
                                                   >> 243   void GenerateBiasPowEnergies();//G4double& outputEne,G4double& outputWeight);//
                                                   >> 244   void GenerateGaussEnergies();//
                                                   >> 245   void GenerateBremEnergies();//
                                                   >> 246   void GenerateBbodyEnergies();//
                                                   >> 247   void GenerateCdgEnergies();//
                                                   >> 248   void GenUserHistEnergies();//
                                                   >> 249   void GenEpnHistEnergies();//
                                                   >> 250   void GenArbPointEnergies();//<<<<<<<<<<< DOES NOT WORK, REQUIRES UPDATE OF DATA MEMBERS.
                                                   >> 251     void GenerateExpEnergies(G4bool);//
                                                   >> 252   void GenerateLinearEnergies(G4bool);//
                                                   >> 253   void GeneratePowEnergies(G4bool);//
                                                   >> 254   void GenerateCPowEnergies();//
170                                                   255 
171     G4double Getalpha() const;                 << 256     // converts energy per nucleon to energy.
172       // Alpha (pow)                           << 257   void ConvertEPNToEnergy();
173                                                << 
174     G4double GetEzero() const;                 << 
175       // E0 (exp)                              << 
176                                                << 
177     G4double GetTemp();                        << 
178       // Temp (bbody,brem)                     << 
179                                                << 
180     G4double Getgrad() const;                  << 
181       // Gradient and intercept for linear spe << 
182                                                << 
183     G4double Getcept() const;                  << 
184                                                << 
185     G4PhysicsFreeVector GetUserDefinedEnergyHi << 
186                                                << 
187     G4PhysicsFreeVector GetArbEnergyHisto();   << 
188                                                << 
189     G4double GenerateOne(G4ParticleDefinition* << 
190        // Generate one random energy for the s << 
191                                                << 
192     G4double GetProbability (G4double);        << 
193                                                << 
194     G4double GetArbEneWeight(G4double);        << 
195                                                << 
196     inline void ApplyEnergyWeight(G4bool val)  << 
197     inline G4bool IfApplyEnergyWeight() const  << 
198                                                << 
199   private:                                     << 
200                                                << 
201     void LinearInterpolation();                << 
202     void LogInterpolation();                   << 
203     void ExpInterpolation();                   << 
204     void SplineInterpolation();                << 
205     void CalculateCdgSpectrum();               << 
206     void CalculateBbodySpectrum();             << 
207     void CalculateCPowSpectrum();              << 
208                                                << 
209     // The following methods generate energies << 
210     // to the spectral parameters defined abov << 
211                                                << 
212     void GenerateMonoEnergetic();              << 
213     void GenerateBiasPowEnergies();            << 
214     void GenerateGaussEnergies();              << 
215     void GenerateBremEnergies();               << 
216     void GenerateBbodyEnergies();              << 
217     void GenerateCdgEnergies();                << 
218     void GenUserHistEnergies();                << 
219     void GenEpnHistEnergies();                 << 
220     void GenArbPointEnergies(); // NOTE: REQUI << 
221     void GenerateExpEnergies(G4bool);          << 
222     void GenerateLinearEnergies(G4bool);       << 
223     void GeneratePowEnergies(G4bool);          << 
224     void GenerateCPowEnergies();               << 
225                                                << 
226     void ConvertEPNToEnergy();                 << 
227       // Converts energy per nucleon to energy << 
228                                                   258     
229     void BBInitHists();                        << 259     void BBInitHists();//
230     void CPInitHists();                        << 260   void CPInitHists();//
231                                                << 
232   private:  // Non invariant data members beco << 
233                                                   261 
234     G4String EnergyDisType; // energy dis type << 262 private:
235     G4double weight; // particle weight //// N << 
236     G4double MonoEnergy; //Mono-energteic ener << 
237     G4double SE; // Standard deviation for Gau << 
238                                                   263 
239     G4double Emin, Emax; // emin and emax //// << 264   G4String EnergyDisType; // energy dis type Variable  - Mono,Lin,Exp,etc
240     G4double alpha, Ezero;// alpha (pow), E0 ( << 265   G4double weight; // particle weight //// NOT INVARIANT
                                                   >> 266   G4double MonoEnergy; //Mono-energteic energy
                                                   >> 267   G4double SE; // Standard deviation for Gaussion distrbution in energy
                                                   >> 268     //Non invariant data members become G4Cache
                                                   >> 269   G4double Emin, Emax; // emin and emax                                         ////// NOT INVARIANT
                                                   >> 270   G4double alpha, Ezero;// alpha (pow), E0 (exp)                                ////// NOT INVARIANT
241     G4double Temp; // Temp (bbody,brem)           271     G4double Temp; // Temp (bbody,brem)
242     G4double biasalpha; // biased power index  << 272   G4double biasalpha; // biased power index
243     G4double grad, cept; // gradient and inter << 273   G4double grad, cept; // gradient and intercept for linear spectra             ////// NOT INVARIANT
244     G4double prob_norm; // normalisation facto    274     G4double prob_norm; // normalisation factor use in calculate the probability
245     G4bool Biased = false; // biased to power- << 275     G4bool Biased; // true - biased to power-law
246     G4bool EnergySpec = true; // energy spectr << 276   G4bool EnergySpec; // true - energy spectra, false - momentum spectra
247     G4bool DiffSpec = true; // differential sp << 277   G4bool DiffSpec; // true - differential spec, false integral spec
248                                                << 278   //G4bool ApplyRig; // false no rigidity cutoff, true then apply one
249     G4PhysicsFreeVector UDefEnergyH; // energy << 279   //G4double ERig; // energy of rigidity cutoff
250     G4PhysicsFreeVector IPDFEnergyH;           << 280   G4PhysicsOrderedFreeVector UDefEnergyH; // energy hist data
251     G4bool IPDFEnergyExist = false, IPDFArbExi << 281   G4PhysicsOrderedFreeVector IPDFEnergyH;
252     G4PhysicsFreeVector ArbEnergyH; // Arb x,y << 282   G4bool IPDFEnergyExist, IPDFArbExist, Epnflag;
253     G4PhysicsFreeVector IPDFArbEnergyH; // IPD << 283   G4PhysicsOrderedFreeVector ArbEnergyH; // Arb x,y histogram
254     G4PhysicsFreeVector EpnEnergyH;            << 284   G4PhysicsOrderedFreeVector IPDFArbEnergyH; // IPDF for Arb
255     G4double CDGhist[3]; // cumulative histo f << 285   G4PhysicsOrderedFreeVector EpnEnergyH;
                                                   >> 286   G4double CDGhist[3]; // cumulative histo for cdg
                                                   >> 287     
                                                   >> 288     //AG: Begin edit to use STL vectors.
                                                   >> 289 //  G4double BBHist[10001], Bbody_x[10001];
                                                   >> 290     std::vector<G4double>* BBHist;
                                                   >> 291     std::vector<G4double>* Bbody_x;
                                                   >> 292     G4bool BBhistInit;
                                                   >> 293     G4bool BBhistCalcd;
                                                   >> 294 //  For cutoff power-law  
                                                   >> 295     std::vector<G4double>* CPHist;
                                                   >> 296     std::vector<G4double>* CP_x;
                                                   >> 297     G4bool CPhistInit;
                                                   >> 298     G4bool CPhistCalcd;
                                                   >> 299   
256                                                   300     
257     std::vector<G4double>* BBHist = nullptr;   << 301     //AG: Edit here to use dynamic memory, will save space inless these functions are used.
258     std::vector<G4double>* Bbody_x = nullptr;  << 302   G4String IntType; // Interpolation type
259     G4bool BBhistInit = false;                 << 303 //  G4double Arb_grad[1024], Arb_cept[1024]; // grad and cept for 1024 segments AG: Switched to DMA
260     G4bool BBhistCalcd = false;                << 304     G4double* Arb_grad;
261                                                << 305     G4double* Arb_cept;
262     //  For cutoff power-law                   << 306     G4bool Arb_grad_cept_flag;
263     //                                         << 307 //  G4double Arb_alpha[1024], Arb_Const[1024]; // alpha and constants AG: Switched to DMA
264     std::vector<G4double>* CPHist = nullptr;   << 308     G4double* Arb_alpha;
265     std::vector<G4double>* CP_x = nullptr;     << 309     G4double* Arb_Const;
266     G4bool CPhistInit = false;                 << 310     G4bool Arb_alpha_Const_flag;
267     G4bool CPhistCalcd = false;                << 311 //  G4double Arb_ezero[1024]; // ezero AG: Switched to DMA
268                                                << 312     G4double* Arb_ezero;
269     G4String IntType; // Interpolation type    << 313     G4bool Arb_ezero_flag;
270     G4double* Arb_grad = nullptr;              << 314   G4double ArbEmin, ArbEmax; // Emin and Emax for the whole arb distribution used primarily for debug.
271     G4double* Arb_cept = nullptr;              << 315 
272     G4bool Arb_grad_cept_flag = false;         << 316   G4double particle_energy;
273     G4double* Arb_alpha = nullptr;             << 317 
274     G4double* Arb_Const = nullptr;             << 318   G4SPSRandomGenerator* eneRndm;
275     G4bool Arb_alpha_Const_flag = false;       << 
276     G4double* Arb_ezero = nullptr;             << 
277     G4bool Arb_ezero_flag = false;             << 
278                                                << 
279     G4bool applyEvergyWeight = false;          << 
280                                                << 
281     G4double ArbEmin, ArbEmax;                 << 
282       // Emin and Emax for the whole arb distr << 
283                                                << 
284     G4double particle_energy;                  << 
285                                                << 
286     G4SPSRandomGenerator* eneRndm = nullptr;   << 
287                                                << 
288     G4int verbosityLevel;                      << 
289                                                << 
290     G4PhysicsFreeVector ZeroPhysVector; // for << 
291                                                << 
292     std::vector<G4DataInterpolation*> SplineIn << 
293       // Holds Spline stuff required for sampl << 
294     G4DataInterpolation* Splinetemp = nullptr; << 
295       // Holds a temp Spline used for calculat << 
296                                                   319 
297     G4Mutex mutex; // protect access to shared << 320   // Verbosity
                                                   >> 321   G4int verbosityLevel;
                                                   >> 322 
                                                   >> 323   G4PhysicsOrderedFreeVector ZeroPhysVector; // for re-set only
                                                   >> 324 
                                                   >> 325     std::vector<G4DataInterpolation*> SplineInt;//[1024]; // holds Spline stuff required for sampling
                                                   >> 326   G4DataInterpolation *Splinetemp; // holds a temp Spline used for calculating area
298                                                   327 
299     // Thread local data (non-invariant during << 328     G4Mutex mutex; // protect access to shared resources
300     // These are copied from master one at the << 329     //Thread local data (non-invariant during event loop).
301     // generation of each event                << 330     //These are copied from master one at the beginning of generation
302     //                                         << 331     //of each event
303     struct threadLocal_t                       << 332     struct threadLocal_t {
304     {                                          << 333         G4double Emin;
305       G4double Emin;                           << 334         G4double Emax;
306       G4double Emax;                           << 335         G4double alpha;
307       G4double alpha;                          << 336         G4double Ezero;
308       G4double Ezero;                          << 337         G4double grad;
309       G4double grad;                           << 338         G4double cept;
310       G4double cept;                           << 339         G4ParticleDefinition* particle_definition;
311       G4ParticleDefinition* particle_definitio << 340         G4double weight;
312       G4double weight;                         << 341         G4double particle_energy;
313       G4double particle_energy;                << 
314     };                                            342     };
315     G4Cache<threadLocal_t> threadLocalData;       343     G4Cache<threadLocal_t> threadLocalData;
316 };                                                344 };
317                                                   345 
318 #endif                                            346 #endif
                                                   >> 347 
319                                                   348