Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/utils/include/G4LossTableManager.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 /processes/electromagnetic/utils/include/G4LossTableManager.hh (Version 11.3.0) and /processes/electromagnetic/utils/include/G4LossTableManager.hh (Version 10.2.p2)


  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 // $Id: G4LossTableManager.hh 95476 2016-02-12 09:39:50Z gcosmo $
                                                   >>  27 //
                                                   >>  28 //
 26 // -------------------------------------------     29 // -------------------------------------------------------------------
 27 //                                                 30 //
 28 // GEANT4 Class header file                        31 // GEANT4 Class header file
 29 //                                                 32 //
 30 //                                                 33 //
 31 // File name:     G4LossTableManager               34 // File name:     G4LossTableManager
 32 //                                                 35 //
 33 // Author:        Vladimir Ivanchenko on base      36 // Author:        Vladimir Ivanchenko on base of G4LossTables class
 34 //                and Maria Grazia Pia ideas       37 //                and Maria Grazia Pia ideas
 35 //                                                 38 //
 36 // Creation date: 03.01.2002                       39 // Creation date: 03.01.2002
 37 //                                                 40 //
 38 // Modifications by V.Ivanchenko               <<  41 // Modifications:
                                                   >>  42 //
                                                   >>  43 // 20-01-03 Migrade to cut per region (V.Ivanchenko)
                                                   >>  44 // 17-02-03 Fix problem of store/restore tables for ions (V.Ivanchenko)
                                                   >>  45 // 10-03-03 Add Ion registration (V.Ivanchenko)
                                                   >>  46 // 25-03-03 Add deregistration (V.Ivanchenko)
                                                   >>  47 // 26-03-03 Add GetDEDXDispersion (V.Ivanchenko)
                                                   >>  48 // 02-04-03 Change messenger (V.Ivanchenko)
                                                   >>  49 // 23-07-03 Add exchange with G4EnergyLossTables (V.Ivanchenko)
                                                   >>  50 // 05-10-03 Add G4VEmProcesses registration (V.Ivanchenko)
                                                   >>  51 // 17-10-03 Add SetParameters method (V.Ivanchenko)
                                                   >>  52 // 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
                                                   >>  53 // 14-01-04 Activate precise range calculation (V.Ivanchenko)
                                                   >>  54 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
                                                   >>  55 // 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
                                                   >>  56 // 20-01-06 Introduce GetSubDEDX method (VI)
                                                   >>  57 // 26-01-06 Rename GetRange -> GetRangeFromRestricteDEDX (V.Ivanchenko)
                                                   >>  58 // 10-05-06 Add methods  SetMscStepLimitation, FacRange and MscFlag (VI)
                                                   >>  59 // 22-05-06 Add methods  Set/Get bremsTh (VI)
                                                   >>  60 // 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
                                                   >>  61 // 18-06-07 Move definition of msc parameters to G4EmProcessOptions (V.Ivanchenko)
                                                   >>  62 // 12-04-10 Added PreparePhsyicsTables and BuildPhysicsTables entries (V.Ivanchenko)
                                                   >>  63 // 04-06-13 Adaptation for MT mode, new method LocalPhysicsTables (V.Ivanchenko)  
 39 //                                                 64 //
 40 // Class Description:                              65 // Class Description:
 41 //                                                 66 //
 42 // A utility static class, responsable for the     67 // A utility static class, responsable for the energy loss tables
 43 // for each particle                               68 // for each particle
 44 //                                                 69 //
 45 // Energy loss processes have to register thei     70 // Energy loss processes have to register their tables with this
 46 // class. The responsibility of creating and d     71 // class. The responsibility of creating and deleting the tables
 47 // remains with the energy loss classes.           72 // remains with the energy loss classes.
 48                                                    73 
 49 // -------------------------------------------     74 // -------------------------------------------------------------------
 50 //                                                 75 //
 51                                                    76 
 52 #ifndef G4LossTableManager_h                       77 #ifndef G4LossTableManager_h
 53 #define G4LossTableManager_h 1                     78 #define G4LossTableManager_h 1
 54                                                    79 
 55 #include <map>                                     80 #include <map>
 56 #include <vector>                                  81 #include <vector>
 57 #include "globals.hh"                              82 #include "globals.hh"
 58 #include "G4ThreadLocalSingleton.hh"               83 #include "G4ThreadLocalSingleton.hh"
 59 #include "G4VEnergyLossProcess.hh"             << 
 60 #include "G4EmParameters.hh"                       84 #include "G4EmParameters.hh"
                                                   >>  85 #include "G4VEnergyLossProcess.hh"
                                                   >>  86 #include "G4EmCorrections.hh"
                                                   >>  87 #include "G4LossTableBuilder.hh"
                                                   >>  88 #include "G4VAtomDeexcitation.hh"
                                                   >>  89 #include "G4VSubCutProducer.hh"
 61                                                    90 
 62 class G4PhysicsTable;                              91 class G4PhysicsTable;
 63 class G4MaterialCutsCouple;                        92 class G4MaterialCutsCouple;
                                                   >>  93 class G4EnergyLossMessenger;
 64 class G4ParticleDefinition;                        94 class G4ParticleDefinition;
 65 class G4Region;                                    95 class G4Region;
 66 class G4EmSaturation;                              96 class G4EmSaturation;
 67 class G4EmConfigurator;                            97 class G4EmConfigurator;
 68 class G4ElectronIonPair;                           98 class G4ElectronIonPair;
 69 class G4NIELCalculator;                        << 
 70 class G4VMultipleScattering;                       99 class G4VMultipleScattering;
 71 class G4VEmProcess;                               100 class G4VEmProcess;
 72 class G4EmCorrections;                         << 
 73 class G4LossTableBuilder;                      << 
 74 class G4VAtomDeexcitation;                     << 
 75 class G4VSubCutProducer;                       << 
 76                                                   101 
 77 class G4LossTableManager                          102 class G4LossTableManager
 78 {                                                 103 {
 79                                                   104 
 80 friend class G4ThreadLocalSingleton<G4LossTabl    105 friend class G4ThreadLocalSingleton<G4LossTableManager>;
 81                                                   106 
 82 public:                                           107 public:
 83                                                   108 
 84   static G4LossTableManager* Instance();          109   static G4LossTableManager* Instance();
 85                                                   110 
 86   ~G4LossTableManager();                          111   ~G4LossTableManager();
 87                                                   112 
 88   //------------------------------------------    113   //-------------------------------------------------
                                                   >> 114   // called from destructor
                                                   >> 115   //-------------------------------------------------
                                                   >> 116 
                                                   >> 117   void Clear();
                                                   >> 118 
                                                   >> 119   //-------------------------------------------------
 89   // initialisation before a new run              120   // initialisation before a new run
 90   //------------------------------------------    121   //-------------------------------------------------
 91                                                   122 
 92   void PreparePhysicsTable(const G4ParticleDef    123   void PreparePhysicsTable(const G4ParticleDefinition* aParticle,
 93                            G4VEnergyLossProces << 124                            G4VEnergyLossProcess* p, G4bool theMaster);
 94                                                   125 
 95   void PreparePhysicsTable(const G4ParticleDef    126   void PreparePhysicsTable(const G4ParticleDefinition* aParticle,
 96                            G4VEmProcess* p);   << 127                            G4VEmProcess* p, G4bool theMaster);
 97                                                   128 
 98   void PreparePhysicsTable(const G4ParticleDef    129   void PreparePhysicsTable(const G4ParticleDefinition* aParticle,
 99                            G4VMultipleScatteri << 130                            G4VMultipleScattering* p, G4bool theMaster);
100                                                   131 
101   void BuildPhysicsTable(const G4ParticleDefin    132   void BuildPhysicsTable(const G4ParticleDefinition* aParticle);
102                                                   133 
103   void BuildPhysicsTable(const G4ParticleDefin    134   void BuildPhysicsTable(const G4ParticleDefinition* aParticle, 
104                          G4VEnergyLossProcess*    135                          G4VEnergyLossProcess* p);
105                                                   136 
106   void LocalPhysicsTables(const G4ParticleDefi    137   void LocalPhysicsTables(const G4ParticleDefinition* aParticle, 
107                           G4VEnergyLossProcess    138                           G4VEnergyLossProcess* p);
108                                                << 139   
109   void DumpHtml();                             << 
110                                                << 
111   //------------------------------------------    140   //-------------------------------------------------
112   // Run time access to DEDX, range, energy fo    141   // Run time access to DEDX, range, energy for a given particle, 
113   // energy, and G4MaterialCutsCouple             142   // energy, and G4MaterialCutsCouple
114   //------------------------------------------    143   //-------------------------------------------------
115                                                   144 
116   inline G4double GetDEDX(                        145   inline G4double GetDEDX(
117     const G4ParticleDefinition *aParticle,        146     const G4ParticleDefinition *aParticle,
118     G4double kineticEnergy,                       147     G4double kineticEnergy,
119     const G4MaterialCutsCouple *couple);          148     const G4MaterialCutsCouple *couple);
120                                                   149 
                                                   >> 150   inline G4double GetSubDEDX(
                                                   >> 151     const G4ParticleDefinition *aParticle,
                                                   >> 152     G4double kineticEnergy,
                                                   >> 153     const G4MaterialCutsCouple *couple);
                                                   >> 154 
121   inline G4double GetRange(                       155   inline G4double GetRange(
122     const G4ParticleDefinition *aParticle,        156     const G4ParticleDefinition *aParticle,
123     G4double kineticEnergy,                       157     G4double kineticEnergy,
124     const G4MaterialCutsCouple *couple);          158     const G4MaterialCutsCouple *couple);
125                                                   159 
126   inline G4double GetCSDARange(                   160   inline G4double GetCSDARange(
127     const G4ParticleDefinition *aParticle,        161     const G4ParticleDefinition *aParticle,
128     G4double kineticEnergy,                       162     G4double kineticEnergy,
129     const G4MaterialCutsCouple *couple);          163     const G4MaterialCutsCouple *couple);
130                                                   164 
131   inline G4double GetRangeFromRestricteDEDX(      165   inline G4double GetRangeFromRestricteDEDX(
132     const G4ParticleDefinition *aParticle,        166     const G4ParticleDefinition *aParticle,
133     G4double kineticEnergy,                       167     G4double kineticEnergy,
134     const G4MaterialCutsCouple *couple);          168     const G4MaterialCutsCouple *couple);
135                                                   169 
136   inline G4double GetEnergy(                      170   inline G4double GetEnergy(
137     const G4ParticleDefinition *aParticle,        171     const G4ParticleDefinition *aParticle,
138     G4double range,                               172     G4double range,
139     const G4MaterialCutsCouple *couple);          173     const G4MaterialCutsCouple *couple);
140                                                   174 
141   inline G4double GetDEDXDispersion(              175   inline G4double GetDEDXDispersion(
142     const G4MaterialCutsCouple *couple,           176     const G4MaterialCutsCouple *couple,
143     const G4DynamicParticle* dp,                  177     const G4DynamicParticle* dp,
144           G4double& length);                      178           G4double& length);
145                                                   179 
146   //------------------------------------------    180   //-------------------------------------------------
147   // Methods to be called only at initialisati    181   // Methods to be called only at initialisation
148   // and at the end of the job                 << 
149   //------------------------------------------    182   //-------------------------------------------------
150                                                   183 
151   void Register(G4VEnergyLossProcess* p);         184   void Register(G4VEnergyLossProcess* p);
152                                                   185 
153   void DeRegister(G4VEnergyLossProcess* p);       186   void DeRegister(G4VEnergyLossProcess* p);
154                                                   187 
155   void Register(G4VMultipleScattering* p);        188   void Register(G4VMultipleScattering* p);
156                                                   189 
157   void DeRegister(G4VMultipleScattering* p);      190   void DeRegister(G4VMultipleScattering* p);
158                                                   191 
159   void Register(G4VEmProcess* p);                 192   void Register(G4VEmProcess* p);
160                                                   193 
161   void DeRegister(G4VEmProcess* p);               194   void DeRegister(G4VEmProcess* p);
162                                                   195 
163   void Register(G4VProcess* p);                << 
164                                                << 
165   void DeRegister(G4VProcess* p);              << 
166                                                << 
167   void Register(G4VEmModel* p);                   196   void Register(G4VEmModel* p);
168                                                   197 
169   void DeRegister(G4VEmModel* p);                 198   void DeRegister(G4VEmModel* p);
170                                                   199 
171   void Register(G4VEmFluctuationModel* p);        200   void Register(G4VEmFluctuationModel* p);
172                                                   201 
173   void DeRegister(G4VEmFluctuationModel* p);      202   void DeRegister(G4VEmFluctuationModel* p);
174                                                   203 
175   void RegisterExtraParticle(const G4ParticleD    204   void RegisterExtraParticle(const G4ParticleDefinition* aParticle, 
176                              G4VEnergyLossProc    205                              G4VEnergyLossProcess* p);
177                                                   206 
178   void SetVerbose(G4int val);                  << 207   void SetLossFluctuations(G4bool val);
179                                                   208 
180   void ResetParameters();                      << 209   void SetSubCutoff(G4bool val, const G4Region* r=0);
                                                   >> 210 
                                                   >> 211   void SetIntegral(G4bool val);
                                                   >> 212 
                                                   >> 213   void SetRandomStep(G4bool val);
                                                   >> 214 
                                                   >> 215   void SetMinSubRange(G4double val);
                                                   >> 216 
                                                   >> 217   void SetMinEnergy(G4double val);
                                                   >> 218 
                                                   >> 219   void SetMaxEnergy(G4double val);
                                                   >> 220 
                                                   >> 221   void SetMaxEnergyForCSDARange(G4double val);
                                                   >> 222 
                                                   >> 223   void SetMaxEnergyForMuons(G4double val);
                                                   >> 224 
                                                   >> 225   void SetDEDXBinning(G4int val);
                                                   >> 226 
                                                   >> 227   void SetDEDXBinningForCSDARange(G4int val);
                                                   >> 228 
                                                   >> 229   void SetLambdaBinning(G4int val);
                                                   >> 230 
                                                   >> 231   void SetStepFunction(G4double v1, G4double v2);
                                                   >> 232 
                                                   >> 233   void SetBuildCSDARange(G4bool val);
                                                   >> 234 
                                                   >> 235   void SetLinearLossLimit(G4double val);
                                                   >> 236 
                                                   >> 237   void SetVerbose(G4int val);
181                                                   238 
182   void SetAtomDeexcitation(G4VAtomDeexcitation    239   void SetAtomDeexcitation(G4VAtomDeexcitation*);
183                                                   240 
184   void SetSubCutProducer(G4VSubCutProducer*);     241   void SetSubCutProducer(G4VSubCutProducer*);
185                                                   242 
186   void SetNIELCalculator(G4NIELCalculator*);   << 
187                                                << 
188   //------------------------------------------    243   //-------------------------------------------------
189   // Access methods                               244   // Access methods
190   //------------------------------------------    245   //-------------------------------------------------
191                                                   246 
                                                   >> 247   G4EnergyLossMessenger* GetMessenger();
                                                   >> 248 
                                                   >> 249   inline G4bool BuildCSDARange() const;
                                                   >> 250 
192   inline G4bool IsMaster() const;                 251   inline G4bool IsMaster() const;
193                                                   252 
                                                   >> 253   inline G4double MinKinEnergy() const;
                                                   >> 254 
                                                   >> 255   inline G4double MaxKinEnergy() const;
                                                   >> 256 
                                                   >> 257   inline G4int GetNumberOfBinsPerDecade() const;
                                                   >> 258 
                                                   >> 259   inline 
194   G4VEnergyLossProcess* GetEnergyLossProcess(c    260   G4VEnergyLossProcess* GetEnergyLossProcess(const G4ParticleDefinition*);
195                                                   261  
196   const std::vector<G4VEnergyLossProcess*>& Ge    262   const std::vector<G4VEnergyLossProcess*>& GetEnergyLossProcessVector();
197                                                   263 
198   const std::vector<G4VEmProcess*>& GetEmProce    264   const std::vector<G4VEmProcess*>& GetEmProcessVector();
199                                                   265 
200   const std::vector<G4VMultipleScattering*>& G    266   const std::vector<G4VMultipleScattering*>& GetMultipleScatteringVector();
201                                                   267 
202   G4EmSaturation* EmSaturation();                 268   G4EmSaturation* EmSaturation();
203                                                   269 
204   G4EmConfigurator* EmConfigurator();             270   G4EmConfigurator* EmConfigurator();
205                                                   271 
206   G4ElectronIonPair* ElectronIonPair();           272   G4ElectronIonPair* ElectronIonPair();
207                                                   273 
208   G4NIELCalculator* NIELCalculator();          << 
209                                                << 
210   inline G4EmCorrections* EmCorrections();        274   inline G4EmCorrections* EmCorrections();
211                                                   275 
212   inline G4VAtomDeexcitation* AtomDeexcitation    276   inline G4VAtomDeexcitation* AtomDeexcitation();
213                                                   277 
214   inline G4VSubCutProducer* SubCutProducer();     278   inline G4VSubCutProducer* SubCutProducer();
215                                                   279 
216   inline G4LossTableBuilder* GetTableBuilder()    280   inline G4LossTableBuilder* GetTableBuilder();
217                                                   281 
218   inline void SetGammaGeneralProcess(G4VEmProc << 
219                                                << 
220   inline G4VEmProcess* GetGammaGeneralProcess( << 
221                                                << 
222   inline void SetElectronGeneralProcess(G4VEmP << 
223                                                << 
224   inline G4VEmProcess* GetElectronGeneralProce << 
225                                                << 
226   inline void SetPositronGeneralProcess(G4VEmP << 
227                                                << 
228   inline G4VEmProcess* GetPositronGeneralProce << 
229                                                << 
230   G4LossTableManager(G4LossTableManager &) = d << 
231   G4LossTableManager & operator=(const G4LossT << 
232                                                << 
233 private:                                          282 private:
234                                                   283 
235   //------------------------------------------    284   //-------------------------------------------------
236   // Private methods and members                  285   // Private methods and members
237   //------------------------------------------    286   //-------------------------------------------------
238                                                   287 
239   G4LossTableManager();                           288   G4LossTableManager();
240                                                   289 
241   void Clear();                                << 290   void ResetParameters();
242                                                   291 
243   G4VEnergyLossProcess* BuildTables(const G4Pa    292   G4VEnergyLossProcess* BuildTables(const G4ParticleDefinition* aParticle);
244                                                   293 
245   void CopyTables(const G4ParticleDefinition*     294   void CopyTables(const G4ParticleDefinition* aParticle, 
246                   G4VEnergyLossProcess*);         295                   G4VEnergyLossProcess*);
247                                                   296 
248   void ParticleHaveNoLoss(const G4ParticleDefi    297   void ParticleHaveNoLoss(const G4ParticleDefinition* aParticle);
249                                                   298 
                                                   >> 299   void SetParameters(const G4ParticleDefinition* aParticle,
                                                   >> 300                      G4VEnergyLossProcess*);
                                                   >> 301 
250   void CopyDEDXTables();                          302   void CopyDEDXTables();
251                                                   303 
252   void PrintEWarning(G4String, G4double);         304   void PrintEWarning(G4String, G4double);
253                                                   305 
                                                   >> 306   G4LossTableManager(G4LossTableManager &);
                                                   >> 307   G4LossTableManager & operator=(const G4LossTableManager &right);
                                                   >> 308 
254   static G4ThreadLocal G4LossTableManager* ins    309   static G4ThreadLocal G4LossTableManager* instance;
255                                                   310 
256   typedef const G4ParticleDefinition* PD;         311   typedef const G4ParticleDefinition* PD;
257                                                   312 
258   // cache                                     << 313   std::map<PD,G4VEnergyLossProcess*,std::less<PD> > loss_map;
259   G4VEnergyLossProcess* currentLoss{nullptr};  << 
260   PD currentParticle{nullptr};                 << 
261   PD theElectron;                              << 
262   PD theGenericIon{nullptr};                   << 
263   PD firstParticle{nullptr};                   << 
264                                                << 
265   G4LossTableBuilder* tableBuilder;            << 
266   G4EmCorrections* emCorrections;              << 
267   G4EmConfigurator* emConfigurator{nullptr};   << 
268   G4ElectronIonPair* emElectronIonPair{nullptr << 
269   G4NIELCalculator* nielCalculator{nullptr};   << 
270   G4VAtomDeexcitation* atomDeexcitation{nullpt << 
271   G4VSubCutProducer* subcutProducer{nullptr};  << 
272                                                << 
273   G4EmParameters* theParameters;               << 
274   G4VEmProcess* gGeneral{nullptr};             << 
275   G4VEmProcess* eGeneral{nullptr};             << 
276   G4VEmProcess* pGeneral{nullptr};             << 
277                                                << 
278   G4int verbose;                               << 
279   G4int n_loss{0};                             << 
280   G4int run{-1};                               << 
281                                                << 
282   G4bool all_tables_are_built{false};          << 
283   G4bool startInitialisation{false};           << 
284   G4bool resetParam{true};                     << 
285   G4bool isMaster{false};                      << 
286                                                   314 
287   std::vector<G4VEnergyLossProcess*> loss_vect    315   std::vector<G4VEnergyLossProcess*> loss_vector;
288   std::vector<PD> part_vector;                    316   std::vector<PD> part_vector;
289   std::vector<PD> base_part_vector;               317   std::vector<PD> base_part_vector;
                                                   >> 318   std::vector<G4bool> tables_are_built;
                                                   >> 319   std::vector<G4bool> isActive;
290   std::vector<G4PhysicsTable*> dedx_vector;       320   std::vector<G4PhysicsTable*> dedx_vector;
291   std::vector<G4PhysicsTable*> range_vector;      321   std::vector<G4PhysicsTable*> range_vector;
292   std::vector<G4PhysicsTable*> inv_range_vecto    322   std::vector<G4PhysicsTable*> inv_range_vector;
293   std::vector<G4bool> tables_are_built;        << 
294   std::vector<G4bool> isActive;                << 
295   std::vector<G4VMultipleScattering*> msc_vect    323   std::vector<G4VMultipleScattering*> msc_vector;
296   std::vector<G4VEmProcess*> emp_vector;          324   std::vector<G4VEmProcess*> emp_vector;
297   std::vector<G4VEmModel*> mod_vector;            325   std::vector<G4VEmModel*> mod_vector;
298   std::vector<G4VEmFluctuationModel*> fmod_vec    326   std::vector<G4VEmFluctuationModel*> fmod_vector;
299   std::vector<G4VProcess*> p_vector;           << 
300                                                   327 
301   std::map<PD,G4VEnergyLossProcess*,std::less< << 328   // cash
                                                   >> 329   G4VEnergyLossProcess* currentLoss;
                                                   >> 330   PD                    currentParticle;
                                                   >> 331   PD                    theElectron;
                                                   >> 332   PD                    theGenericIon;
                                                   >> 333   PD                    firstParticle;
                                                   >> 334 
                                                   >> 335   G4int n_loss;
                                                   >> 336   G4int run;
                                                   >> 337 
                                                   >> 338   G4bool all_tables_are_built;
                                                   >> 339   G4bool startInitialisation;
                                                   >> 340 
                                                   >> 341   G4bool subCutoffFlag;
                                                   >> 342   G4bool integral;
                                                   >> 343   G4bool integralActive;
                                                   >> 344   G4bool stepFunctionActive;
                                                   >> 345   G4bool isMaster;
                                                   >> 346 
                                                   >> 347   G4double maxRangeVariation;
                                                   >> 348   G4double maxFinalStep;
                                                   >> 349 
                                                   >> 350   G4LossTableBuilder*         tableBuilder;
                                                   >> 351   G4EnergyLossMessenger*      theMessenger;
                                                   >> 352   G4EmCorrections*            emCorrections;
                                                   >> 353   G4EmSaturation*             emSaturation;
                                                   >> 354   G4EmConfigurator*           emConfigurator;
                                                   >> 355   G4ElectronIonPair*          emElectronIonPair;
                                                   >> 356   G4VAtomDeexcitation*        atomDeexcitation;
                                                   >> 357   G4VSubCutProducer*          subcutProducer;
                                                   >> 358 
                                                   >> 359   G4EmParameters* theParameters;
                                                   >> 360 
                                                   >> 361   G4int verbose;
                                                   >> 362 
302 };                                                363 };
303                                                   364 
304 //....oooOO0OOooo........oooOO0OOooo........oo    365 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
305 //....oooOO0OOooo........oooOO0OOooo........oo    366 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
306                                                   367 
                                                   >> 368 inline G4VEnergyLossProcess* 
                                                   >> 369 G4LossTableManager::GetEnergyLossProcess(const G4ParticleDefinition *aParticle)
                                                   >> 370 {
                                                   >> 371   //G4cout << "G4LossTableManager::GetEnergyLossProcess: " 
                                                   >> 372   //   << aParticle << "  " << currentParticle << "  " << currentLoss << G4endl;
                                                   >> 373   if(aParticle != currentParticle) {
                                                   >> 374     currentParticle = aParticle;
                                                   >> 375     std::map<PD,G4VEnergyLossProcess*,std::less<PD> >::const_iterator pos;
                                                   >> 376     if ((pos = loss_map.find(aParticle)) != loss_map.end()) {
                                                   >> 377       currentLoss = (*pos).second;
                                                   >> 378     } else {
                                                   >> 379       currentLoss = 0;
                                                   >> 380       if ((pos = loss_map.find(theGenericIon)) != loss_map.end()) {
                                                   >> 381         currentLoss = (*pos).second;
                                                   >> 382       }
                                                   >> 383     }
                                                   >> 384   }
                                                   >> 385   return currentLoss;
                                                   >> 386 }
                                                   >> 387 
                                                   >> 388 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 389 
307 inline                                            390 inline
308 G4double G4LossTableManager::GetDEDX(const G4P    391 G4double G4LossTableManager::GetDEDX(const G4ParticleDefinition *aParticle,
309                                      G4double     392                                      G4double kineticEnergy,
310                                      const G4M    393                                      const G4MaterialCutsCouple *couple)
311 {                                                 394 {
312   if(aParticle != currentParticle) { GetEnergy    395   if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
313   return currentLoss ? currentLoss->GetDEDX(ki << 396   G4double x = 0.0;
                                                   >> 397   if(currentLoss) { x = currentLoss->GetDEDX(kineticEnergy, couple); }
                                                   >> 398   return x;
                                                   >> 399 }
                                                   >> 400 
                                                   >> 401 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
                                                   >> 402 
                                                   >> 403 inline
                                                   >> 404 G4double G4LossTableManager::GetSubDEDX(const G4ParticleDefinition *aParticle,
                                                   >> 405                                         G4double kineticEnergy,
                                                   >> 406                                         const G4MaterialCutsCouple *couple)
                                                   >> 407 {
                                                   >> 408   if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
                                                   >> 409   G4double x = 0.0;
                                                   >> 410   if(currentLoss) { x = currentLoss->GetDEDXForSubsec(kineticEnergy, couple); }
                                                   >> 411   return x;
314 }                                                 412 }
315                                                   413 
316 //....oooOO0OOooo........oooOO0OOooo........oo    414 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
317                                                   415 
318 inline                                            416 inline
319 G4double G4LossTableManager::GetCSDARange(cons    417 G4double G4LossTableManager::GetCSDARange(const G4ParticleDefinition *aParticle,
320                                           G4do    418                                           G4double kineticEnergy,
321                                           cons    419                                           const G4MaterialCutsCouple *couple)
322 {                                                 420 {
323   if(aParticle != currentParticle) { GetEnergy    421   if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
324   return currentLoss ? currentLoss->GetCSDARan << 422   G4double x = DBL_MAX;
                                                   >> 423   if(currentLoss) { x = currentLoss->GetCSDARange(kineticEnergy, couple); }
                                                   >> 424   return x;
325 }                                                 425 }
326                                                   426 
327 //....oooOO0OOooo........oooOO0OOooo........oo    427 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
328                                                   428 
329 inline                                            429 inline
330 G4double G4LossTableManager::GetRangeFromRestr    430 G4double G4LossTableManager::GetRangeFromRestricteDEDX(
331                              const G4ParticleD    431                              const G4ParticleDefinition *aParticle,
332                              G4double kineticE    432                              G4double kineticEnergy,
333                              const G4MaterialC    433                              const G4MaterialCutsCouple *couple)
334 {                                                 434 {
335   if(aParticle != currentParticle) { GetEnergy    435   if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
336   return currentLoss ? currentLoss->GetRange(k << 436   G4double x = DBL_MAX;
                                                   >> 437   if(currentLoss) { x = currentLoss->GetRangeForLoss(kineticEnergy, couple); }
                                                   >> 438   return x;
337 }                                                 439 }
338                                                   440 
339 //....oooOO0OOooo........oooOO0OOooo........oo    441 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
340                                                   442 
341 inline                                            443 inline
342 G4double G4LossTableManager::GetRange(const G4    444 G4double G4LossTableManager::GetRange(const G4ParticleDefinition *aParticle,
343                                       G4double    445                                       G4double kineticEnergy,
344                                       const G4    446                                       const G4MaterialCutsCouple *couple)
345 {                                                 447 {
346   if(aParticle != currentParticle) { GetEnergy    448   if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
347   return currentLoss ? currentLoss->GetRange(k << 449   G4double x = DBL_MAX;
                                                   >> 450   if(currentLoss) {
                                                   >> 451     x = currentLoss->GetRange(kineticEnergy, couple); 
                                                   >> 452   }
                                                   >> 453   return x;
348 }                                                 454 }
349                                                   455 
350 //....oooOO0OOooo........oooOO0OOooo........oo    456 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
351                                                   457 
352 inline                                            458 inline
353 G4double G4LossTableManager::GetEnergy(const G    459 G4double G4LossTableManager::GetEnergy(const G4ParticleDefinition *aParticle,
354                                        G4doubl    460                                        G4double range,
355                                        const G    461                                        const G4MaterialCutsCouple *couple)
356 {                                                 462 {
357   if(aParticle != currentParticle) { GetEnergy    463   if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
358   return currentLoss ? currentLoss->GetKinetic << 464   G4double x = 0;
                                                   >> 465   if(currentLoss) { x = currentLoss->GetKineticEnergy(range, couple); }
                                                   >> 466   return x;
359 }                                                 467 }
360                                                   468 
361 //....oooOO0OOooo........oooOO0OOooo........oo    469 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
362                                                   470 
363 inline                                            471 inline
364 G4double G4LossTableManager::GetDEDXDispersion    472 G4double G4LossTableManager::GetDEDXDispersion(
365                              const G4MaterialC    473                              const G4MaterialCutsCouple *couple,
366                              const G4DynamicPa    474                              const G4DynamicParticle* dp,
367                              G4double& length)    475                              G4double& length)
368 {                                                 476 {
369   const G4ParticleDefinition* aParticle = dp->    477   const G4ParticleDefinition* aParticle = dp->GetParticleDefinition();
370   if(aParticle != currentParticle) { GetEnergy    478   if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
371   return currentLoss ? currentLoss->GetDEDXDis << 479   G4double x = 0.0;
                                                   >> 480   if(currentLoss) { currentLoss->GetDEDXDispersion(couple, dp, length); }
                                                   >> 481   return x;
                                                   >> 482 }
                                                   >> 483 
                                                   >> 484 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
                                                   >> 485 
                                                   >> 486 inline G4bool G4LossTableManager::BuildCSDARange() const
                                                   >> 487 {
                                                   >> 488   return theParameters->BuildCSDARange();
372 }                                                 489 }
373                                                   490 
374 //....oooOO0OOooo........oooOO0OOooo........oo    491 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
375                                                   492 
376 inline G4bool G4LossTableManager::IsMaster() c    493 inline G4bool G4LossTableManager::IsMaster() const
377 {                                                 494 {
378   return isMaster;                                495   return isMaster;
379 }                                                 496 }
380                                                   497 
381 //....oooOO0OOooo........oooOO0OOooo........oo    498 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
382                                                   499 
                                                   >> 500 inline G4double G4LossTableManager::MinKinEnergy() const
                                                   >> 501 {
                                                   >> 502   return theParameters->MinKinEnergy();
                                                   >> 503 }
                                                   >> 504 
                                                   >> 505 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 506 
                                                   >> 507 inline G4double G4LossTableManager::MaxKinEnergy() const
                                                   >> 508 {
                                                   >> 509   return theParameters->MaxKinEnergy();
                                                   >> 510 }
                                                   >> 511 
                                                   >> 512 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
                                                   >> 513 
                                                   >> 514 G4int G4LossTableManager::GetNumberOfBinsPerDecade() const
                                                   >> 515 {
                                                   >> 516   return theParameters->NumberOfBinsPerDecade();
                                                   >> 517 }
                                                   >> 518 
                                                   >> 519 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 520 
383 inline G4EmCorrections* G4LossTableManager::Em    521 inline G4EmCorrections* G4LossTableManager::EmCorrections() 
384 {                                                 522 {
385   return emCorrections;                           523   return emCorrections;
386 }                                                 524 }
387                                                   525 
388 //....oooOO0OOooo........oooOO0OOooo........oo    526 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
389                                                   527 
390 inline G4VAtomDeexcitation* G4LossTableManager    528 inline G4VAtomDeexcitation* G4LossTableManager::AtomDeexcitation()
391 {                                                 529 {
392   return atomDeexcitation;                        530   return atomDeexcitation;
393 }                                                 531 }
394                                                   532 
395 //....oooOO0OOooo........oooOO0OOooo........oo    533 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
396                                                   534 
397 inline G4VSubCutProducer* G4LossTableManager::    535 inline G4VSubCutProducer* G4LossTableManager::SubCutProducer()
398 {                                                 536 { 
399   return subcutProducer;                          537   return subcutProducer;
400 }                                                 538 }
401                                                   539 
402 //....oooOO0OOooo........oooOO0OOooo........oo    540 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
403                                                   541 
404 inline G4LossTableBuilder* G4LossTableManager:    542 inline G4LossTableBuilder* G4LossTableManager::GetTableBuilder()
405 {                                                 543 {
406   return tableBuilder;                            544   return tableBuilder;
407 }                                                 545 }
408                                                   546 
409 //....oooOO0OOooo........oooOO0OOooo........oo << 
410                                                << 
411 inline void G4LossTableManager::SetGammaGenera << 
412 {                                              << 
413   gGeneral = ptr;                              << 
414 }                                              << 
415                                                << 
416 //....oooOO0OOooo........oooOO0OOooo........oo << 
417                                                << 
418 inline G4VEmProcess* G4LossTableManager::GetGa << 
419 {                                              << 
420   return gGeneral;                             << 
421 }                                              << 
422                                                << 
423 //....oooOO0OOooo........oooOO0OOooo........oo << 
424                                                << 
425 inline void G4LossTableManager::SetElectronGen << 
426 {                                              << 
427   eGeneral = ptr;                              << 
428 }                                              << 
429                                                << 
430 //....oooOO0OOooo........oooOO0OOooo........oo << 
431                                                << 
432 inline G4VEmProcess* G4LossTableManager::GetEl << 
433 {                                              << 
434   return eGeneral;                             << 
435 }                                              << 
436                                                << 
437 //....oooOO0OOooo........oooOO0OOooo........oo << 
438                                                << 
439 inline void G4LossTableManager::SetPositronGen << 
440 {                                              << 
441   pGeneral = ptr;                              << 
442 }                                              << 
443                                                << 
444 //....oooOO0OOooo........oooOO0OOooo........oo << 
445                                                << 
446 inline G4VEmProcess* G4LossTableManager::GetPo << 
447 {                                              << 
448   return pGeneral;                             << 
449 }                                              << 
450 //....oooOO0OOooo........oooOO0OOooo........oo << 
451                                                << 
452 #endif                                            547 #endif
                                                   >> 548 
453                                                   549