Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/management/include/G4VProcess.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/management/include/G4VProcess.hh (Version 11.3.0) and /processes/management/include/G4VProcess.hh (Version 10.3.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 // G4VProcess                                  << 
 27 //                                                 26 //
 28 // Class description:                          <<  27 // $Id: G4VProcess.hh 73928 2013-09-17 08:00:50Z gcosmo $
 29 //                                                 28 //
 30 // This class is the virtual class for physics <<  29 // 
 31 // It defines public methods which describe th <<  30 // ------------------------------------------------------------
 32 // a physics process.                          <<  31 //  GEANT 4 class header file
 33                                                <<  32 //
 34 // Authors:                                    <<  33 //  History: first implementation, based on object model of
 35 // - 2 December 1995, G.Cosmo - First implemen <<  34 //  2nd December 1995, G.Cosmo
 36 // - 18 December 1996, H.Kurashige - New Physi <<  35 //
 37 // ------------------------------------------- <<  36 // Class Description
 38 #ifndef G4VProcess_hh                          <<  37 //  This class is the virtual class for physics process objects. 
 39 #define G4VProcess_hh 1                        <<  38 //   It defines public methods which describe the behavior of 
                                                   >>  39 //   a physics process.
                                                   >>  40 //
                                                   >>  41 // ------------------------------------------------------------
                                                   >>  42 //   New Physics scheme           18 Dec. 1996  H.Kurahige
                                                   >>  43 // ------------------------------------------------------------
                                                   >>  44 //   change DoIt/GetPIL arguments type 20 Mar. 1997 H.Kurashige
                                                   >>  45 //   modified AlongStepGPIL       17 Dec. 1997 H.Kurashige
                                                   >>  46 //   modified for new ParticleChange 12 Mar. 1998  H.Kurashige
                                                   >>  47 //   Add process trype            27 Mar. 1998  H.Kurashige
                                                   >>  48 //   Remove thePhysicsTable       2 Aug. 1998   H.Kurashige
                                                   >>  49 //   Add PILfactor and GPIL       3 Nov. 2000   H.Kurashige
                                                   >>  50 //   Add Store/RetrievePhysicsTable 8  Nov. 2000   H.Kurashige
                                                   >>  51 //   Modify Store/RetrievePhysicsTable methods 9 Mar. 2001   H.Kurashige
                                                   >>  52 //   Added PreparePhysicsTable  20 Aug. 2004 H.Kurashige
                                                   >>  53 //   Added isXXXXDoItIsEnabled   2 Oct. 2007 H.Kurashige
                                                   >>  54 //   Added ProcessSubType   15 Nov. 2007 H.Kurashige
 40                                                    55 
 41 #include <cmath>                               <<  56 #ifndef G4VProcess_h 
                                                   >>  57 #define G4VProcess_h 1
 42                                                    58 
 43 #include "globals.hh"                              59 #include "globals.hh"
                                                   >>  60 #include <cmath>
 44 #include "G4ios.hh"                                61 #include "G4ios.hh"
 45 #include "Randomize.hh"                        <<  62 
                                                   >>  63 class G4ParticleDefinition;
                                                   >>  64 class G4DynamicParticle;
                                                   >>  65 class G4Track;
                                                   >>  66 class G4Step;
 46                                                    67 
 47 #include "G4PhysicsTable.hh"                       68 #include "G4PhysicsTable.hh"
 48 #include "G4VParticleChange.hh"                    69 #include "G4VParticleChange.hh"
 49 #include "G4ForceCondition.hh"                     70 #include "G4ForceCondition.hh"
 50 #include "G4GPILSelection.hh"                      71 #include "G4GPILSelection.hh"
 51 #include "G4ParticleChange.hh"                     72 #include "G4ParticleChange.hh"
 52 #include "G4ProcessType.hh"                        73 #include "G4ProcessType.hh"
 53                                                    74 
 54 class G4ParticleDefinition;                    << 
 55 class G4DynamicParticle;                       << 
 56 class G4Track;                                 << 
 57 class G4Step;                                  << 
 58 class G4ProcessTable;                          << 
 59                                                << 
 60 class G4VProcess                                   75 class G4VProcess 
 61 {                                                  76 {
                                                   >>  77   //  A virtual class for physics process objects. It defines
                                                   >>  78   //  public methods which describe the behavior of a
                                                   >>  79   //  physics process.
 62                                                    80 
 63   public:                                      <<  81   private:
 64                                                <<  82   // hide default constructor and assignment operator as private 
 65     G4VProcess(const G4String& aName = "NoName <<  83   //  do not hide default constructor for alpha version 
 66                G4ProcessType aType = fNotDefin <<  84   //  G4VProcess G4VProcess();  
 67       // Constructor requires the process name <<  85       G4VProcess & operator=(const G4VProcess &right);
 68                                                <<  86 
 69     G4VProcess(const G4VProcess& right);       <<  87   public: // with description
 70       // Copy constructor copies the name but  <<  88   //  constructor requires the process name and type
 71       // physics table (null pointer is assign <<  89       G4VProcess(const G4String& aName =  "NoName",
 72                                                <<  90      G4ProcessType   aType = fNotDefined );
 73     virtual ~G4VProcess();                     <<  91 
 74       // Destructor                            <<  92   //  copy constructor copys the name but does not copy the 
 75                                                <<  93   //  physics table (0 pointer is assigned)
 76     G4VProcess& operator=(const G4VProcess&) = <<  94       G4VProcess(const G4VProcess &right);
 77                                                <<  95 
 78     G4bool operator==(const G4VProcess& right) <<  96   public: 
 79     G4bool operator!=(const G4VProcess& right) <<  97   //  destructor 
 80       // Equality operators                    <<  98       virtual ~G4VProcess();
 81                                                <<  99 
 82     ////////////////////////////               << 100   // equal opperators
 83     // DoIt    /////////////////               << 101       G4int operator==(const G4VProcess &right) const;
 84     ////////////////////////////               << 102       G4int operator!=(const G4VProcess &right) const;
 85                                                << 103 
 86     virtual G4VParticleChange* PostStepDoIt(   << 104   public: // with description
 87                              const G4Track& tr << 105   ////////////////////////////
 88                              const G4Step& ste << 106   // DoIt    /////////////////
 89                             ) = 0;             << 107   ///////////////////////////
 90                                                << 108       virtual G4VParticleChange* PostStepDoIt(
 91     virtual G4VParticleChange* AlongStepDoIt(  << 109            const G4Track& track,
 92                              const G4Track& tr << 110            const G4Step&  stepData
 93                              const G4Step& ste << 111           ) = 0;
 94                             ) = 0;             << 112 
 95     virtual G4VParticleChange* AtRestDoIt(     << 113       virtual G4VParticleChange* AlongStepDoIt(
 96                              const G4Track& tr << 114            const G4Track& track,
 97                              const G4Step& ste << 115            const G4Step& stepData
 98                             ) = 0;             << 116           ) = 0;
 99       // A virtual base class function that ha << 117       virtual G4VParticleChange* AtRestDoIt(
100       // by any subclass. The DoIt() method ac << 118            const G4Track& track,
101       // physics process and determines either << 119            const G4Step& stepData
102       // of the production of secondaries etc. << 120           ) = 0;
103       //    Arguments                          << 121       //  A virtual base class function that has to be overridden
104       //      const G4Track& track:            << 122       //  by any subclass. The DoIt method actually performs the
                                                   >> 123       //  physics process and determines either momentum change
                                                   >> 124       //  of the production of secondaries etc.
                                                   >> 125       //    arguments
                                                   >> 126       //      const G4Track&    track:
105       //        reference to the current G4Tra    127       //        reference to the current G4Track information
106       //      const G4Step&  stepData:         << 128       //      const G4Step&     stepData:
107       //        reference to the current G4Ste    129       //        reference to the current G4Step information
108                                                   130 
109     //////////////////////////                 << 131   //////////////////////////
110     // GPIL    ///////////////                 << 132   // GPIL    //////////////
111     //////////////////////////                 << 133   /////////////////////////  
112                                                << 134       virtual G4double AlongStepGetPhysicalInteractionLength(
113     virtual G4double AlongStepGetPhysicalInter << 
114                              const G4Track& tr    135                              const G4Track& track,
115                              G4double previous << 136            G4double  previousStepSize,
116                              G4double currentM << 137            G4double  currentMinimumStep,
117                              G4double& propose << 138            G4double& proposedSafety,
118                              G4GPILSelection*     139                              G4GPILSelection* selection) = 0;
119                                                   140 
120     virtual G4double AtRestGetPhysicalInteract << 141       virtual G4double AtRestGetPhysicalInteractionLength(
121                              const G4Track& tr    142                              const G4Track& track,
122                              G4ForceCondition* << 143            G4ForceCondition* condition
                                                   >> 144           ) = 0;
123                                                   145 
124     virtual G4double PostStepGetPhysicalIntera << 146       virtual G4double PostStepGetPhysicalInteractionLength(
125                              const G4Track& tr    147                              const G4Track& track,
126                              G4double previous << 148            G4double   previousStepSize,
127                              G4ForceCondition* << 149            G4ForceCondition* condition
                                                   >> 150           ) = 0;
                                                   >> 151   
128       //  Returns the Step-size (actual length    152       //  Returns the Step-size (actual length) which is allowed 
129       //  by "this" process. (for AtRestGetPhy    153       //  by "this" process. (for AtRestGetPhysicalInteractionLength,
130       //  return value is Step-time) The Numbe    154       //  return value is Step-time) The NumberOfInteractionLengthLeft is
131       //  recalculated by using previousStepSi    155       //  recalculated by using previousStepSize and the Step-size is 
132       //  calucalted accoding to the resultant    156       //  calucalted accoding to the resultant NumberOfInteractionLengthLeft.
133       //  using NumberOfInteractionLengthLeft,    157       //  using NumberOfInteractionLengthLeft, which is recalculated at 
134       //    arguments                             158       //    arguments
135       //      const G4Track&    track:            159       //      const G4Track&    track:
136       //        reference to the current G4Tra    160       //        reference to the current G4Track information
137       //      G4double*          previousStepS    161       //      G4double*          previousStepSize: 
138       //        the Step-size (actual length)     162       //        the Step-size (actual length) of the previous Step 
139       //        of this track. Negative calue     163       //        of this track. Negative calue indicates that
140       //        NumberOfInteractionLengthLeft     164       //        NumberOfInteractionLengthLeft must be reset.
141       //        the current physical interacti    165       //        the current physical interaction legth of this process
142       //      G4ForceCondition* condition:        166       //      G4ForceCondition* condition:
143       //        the flag indicates DoIt of thi    167       //        the flag indicates DoIt of this process is forced 
144       //        to be called                      168       //        to be called
145       //         Forced:    Corresponding DoIt    169       //         Forced:    Corresponding DoIt is forced
146       //         NotForced: Corresponding DoIt    170       //         NotForced: Corresponding DoIt is called 
147       //                    if the Step size o    171       //                    if the Step size of this Step is determined 
148       //                    by this process       172       //                    by this process
149       //        !! AlongStepDoIt is always cal    173       //        !! AlongStepDoIt is always called !! 
150       //      G4double& currentMinimumStep:       174       //      G4double& currentMinimumStep:
151       //        this value is used for transfo    175       //        this value is used for transformation of
152       //        true path length to geometrica    176       //        true path length to geometrical path length
153                                                   177 
154     inline G4double GetCurrentInteractionLengt << 178       G4double GetCurrentInteractionLength() const;
155       // Returns currentInteractionLength         179       // Returns currentInteractionLength
156                                                   180 
157     ////////// PIL factor ////////             << 181       ////////// PIL factor ////////
158     //                                         << 182       void SetPILfactor(G4double value);
159     inline void SetPILfactor(G4double value);  << 183       G4double GetPILfactor() const;
160     inline G4double GetPILfactor() const;      << 
161       // Set/Get factor for PhysicsInteraction    184       // Set/Get factor for PhysicsInteractionLength 
162       // which is passed to G4SteppingManager     185       // which is passed to G4SteppingManager for both AtRest and PostStep
163                                                   186 
164     // These three GPIL methods are used by St << 187       // These three GPIL methods are used by Stepping Manager.
165     // They invoke virtual GPIL methods listed << 188       // They invoke virtual GPIL methods listed above.
166     // As for AtRest and PostStep the returned << 189       // As for AtRest and PostStep the returned value is multipled by thePILfactor 
167     // thePILfactor                            << 190       // 
168     //                                         << 191       G4double AlongStepGPIL( const G4Track& track,
169     inline G4double AlongStepGPIL( const G4Tra << 192                               G4double  previousStepSize,
170                                    G4double pr << 193                               G4double  currentMinimumStep,
171                                    G4double cu << 194                               G4double& proposedSafety,
172                                    G4double& p << 195                               G4GPILSelection* selection     );
173                                    G4GPILSelec << 196 
174                                                << 197       G4double AtRestGPIL( const G4Track& track,
175     inline G4double AtRestGPIL( const G4Track& << 198                            G4ForceCondition* condition );
176                                 G4ForceConditi << 199 
177                                                << 200       G4double PostStepGPIL( const G4Track& track,
178     inline G4double PostStepGPIL( const G4Trac << 201                              G4double   previousStepSize,
179                                   G4double pre << 202                              G4ForceCondition* condition );
180                                   G4ForceCondi << 
181                                                   203 
182     virtual G4bool IsApplicable(const G4Partic << 204   ////////////////////// 
                                                   >> 205       virtual G4bool IsApplicable(const G4ParticleDefinition&){return true;}
183       // Returns true if this process object i    206       // Returns true if this process object is applicable to
184       // the particle type. Process will not b << 207       // the particle type
185       // particle if IsApplicable is false     << 208       // Process will not be registered to a particle if IsApplicable is false   
186                                                   209 
187     virtual void BuildPhysicsTable(const G4Par << 210       virtual void BuildPhysicsTable(const G4ParticleDefinition&){}
188       // Messaged by the Particle definition (    211       // Messaged by the Particle definition (via the Process manager)
189       // whenever cross-section tables have to << 212       // whenever cross section tables have to be rebuilt (i.e. if new
190       // materials have been defined).            213       // materials have been defined). 
191       // It is overloaded by individual proces    214       // It is overloaded by individual processes when they need physics
192       // tables                                << 215       // tables. 
193                                                   216 
194     virtual void PreparePhysicsTable(const G4P << 217      virtual void PreparePhysicsTable(const G4ParticleDefinition&){}
195       // Messaged by the Particle definition (    218       // Messaged by the Particle definition (via the Process manager)
196       // whenever cross-section tables have to << 219       // whenever cross section tables have to be prepare for rebuilt 
197       // (i.e. if new materials have been defi    220       // (i.e. if new materials have been defined). 
198       // It is overloaded by individual proces    221       // It is overloaded by individual processes when they need physics
199       // tables                                << 222       // tables. 
200                                                   223 
201     // Processes which Build physics tables in << 224       // Processes which Build physics tables independent of cuts
202     // (for example in their constructors) sho << 225       // (for example in their constructors)
203     // void BuildThePhysicsTable() and void Pr << 226       // should preferably use private 
204     // *Not* another BuildPhysicsTable         << 227       // void BuildThePhysicsTable() and void PreparePhysicsTable().
                                                   >> 228       // Not another BuildPhysicsTable, please.
205                                                   229 
206     virtual G4bool StorePhysicsTable(const G4P << 230 
207                                      const G4S << 231       virtual G4bool StorePhysicsTable(const G4ParticleDefinition* ,
                                                   >> 232                const G4String&, G4bool){return true;}
208       // Store PhysicsTable in a file.            233       // Store PhysicsTable in a file.
209       // Return false in case of failure at I/ << 234       // (return false in case of failure at I/O )
210                                                   235 
211     virtual G4bool RetrievePhysicsTable(const  << 236       virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* ,
212                                       const G4 << 237              const G4String&, G4bool){return false;}
213       // Retrieve Physics from a file.            238       // Retrieve Physics from a file.
214       // Return true if the Physics Table can  << 239       // (return true if the Physics Table can be build by using file)
215       // Return false if the process has no fu << 240       // (return false if the process has no functionality or in case of failure)
216       // of failure. File name should be defin << 241       // File name should be defined by each process
217       // file should be placed under the direc << 242       // and the file should be placed under the directory specifed by the argument.
218                                                << 243       const G4String& GetPhysicsTableFileName(const G4ParticleDefinition* ,
219     const G4String& GetPhysicsTableFileName(co << 244                 const G4String& directory,
220                                             co << 245                 const G4String& tableName,
221                                             co << 246                 G4bool ascii =false);
222                                             G4 << 247       // this method is utility for Store/RetreivePhysicsTable
223       // This method is utility for Store/Retr << 248 
224                                                << 249   ////////////////////////////
225     inline const G4String& GetProcessName() co << 250       const G4String& GetProcessName() const;
226       // Returns the name of the process       << 251       //  Returns the name of the process.
227                                                << 252 
228     inline G4ProcessType GetProcessType() cons << 253       G4ProcessType GetProcessType() const;
229       // Returns the process type              << 254       //  Returns the process type.
230                                                << 255 
231     inline void SetProcessType(G4ProcessType); << 256       void SetProcessType(G4ProcessType );
232       // Sets the process type                 << 257       //  Set the process type.
233                                                << 258 
234     inline G4int GetProcessSubType() const;    << 259       G4int GetProcessSubType() const;
235       // Returns the process sub type          << 260       //  Returns the process sub type.
236                                                << 261 
237     inline void SetProcessSubType(G4int);      << 262       void SetProcessSubType(G4int );
238       // Sets the process sub type             << 263       //  Set the process sub type.
239                                                << 264 
240     static const G4String& GetProcessTypeName( << 265       static const G4String& GetProcessTypeName(G4ProcessType );
241       // Returns the process type name         << 266       //  Returns the process type name
242                                                << 267 
243     virtual const G4VProcess* GetCreatorProces << 268       virtual void StartTracking(G4Track*);
244       // Returns the process to be used as Cre << 269       virtual void EndTracking();
245       // coming from this process              << 270       // inform Start/End of tracking for each track to the physics process 
246                                                << 
247     virtual void StartTracking(G4Track*);      << 
248     virtual void EndTracking();                << 
249       // Inform Start/End of tracking for each << 
250                                                << 
251     virtual void SetProcessManager(const G4Pro << 
252       // A process manager sets its own pointe << 
253       // is registered in the process Manager  << 
254     virtual const G4ProcessManager* GetProcess << 
255       // Get the process manager which the pro << 
256                                                << 
257     virtual void ResetNumberOfInteractionLengt << 
258       // Reset (determine the value of) Number << 
259                                                   271 
260     inline G4double GetNumberOfInteractionLeng << 272   public:
261       // Get NumberOfInteractionLengthLeft     << 273       virtual void SetProcessManager(const G4ProcessManager*); 
262                                                << 274       // A process manager set its own pointer when the process is registered
263     inline G4double GetTotalNumberOfInteractio << 275       // the process Manager
264       // Get NumberOfInteractionLength after   << 276       virtual  const G4ProcessManager* GetProcessManager(); 
265       //  ResetNumberOfInteractionLengthLeft() << 277       // Get the process manager which the process belongs to
266                                                << 
267     inline G4bool isAtRestDoItIsEnabled() cons << 
268     inline G4bool isAlongStepDoItIsEnabled() c << 
269     inline G4bool isPostStepDoItIsEnabled() co << 
270       // These methods indicate which DoIt is  << 
271       // They are used by G4ProcessManager to  << 
272       // that ordering parameters are properly << 
273                                                   278   
274     virtual void  DumpInfo() const;            << 
275       // Dump out process information          << 
276                                                << 
277     virtual void ProcessDescription(std::ostre << 
278       // Write out to html file for automatic  << 
279                                                << 
280     inline void  SetVerboseLevel(G4int value); << 
281     inline G4int GetVerboseLevel() const;      << 
282       // set/get control flag for output messa << 
283       //  0: Silent                            << 
284       //  1: Warning message                   << 
285       //  2: More                              << 
286                                                << 
287     virtual void SetMasterProcess(G4VProcess*  << 
288       // Sets the master thread process instan << 
289     inline const G4VProcess* GetMasterProcess( << 
290       // Returns the master thread process ins << 
291       // Can be used to initialise worker type << 
292       // instances from master one (e.g. to sh << 
293       // if ( this != GetMasterProcess() ) { / << 
294       // else { /* master or sequential */ }   << 
295                                                << 
296     virtual void BuildWorkerPhysicsTable(const << 
297       // Messaged by the Particle definition ( << 
298       // in worker threads. See BuildWorkerPhy << 
299       // Can be used to share among threads ph << 
300       // Use GetMasterProcess() to get pointer << 
301       // worker thread.                        << 
302       // By default this method makes a forwar << 
303                                                << 
304     virtual void PrepareWorkerPhysicsTable(con << 
305       // Messaged by the Particle definition ( << 
306       // in worker threads. See Preparephysics << 
307       // Can be used to share among threads ph << 
308       // Use GetMasterProcess() to get pointer << 
309       // worker thread                         << 
310       // By default this method makes a forwar << 
311                                                << 
312   protected:                                      279   protected:
313                                                << 280       const G4ProcessManager* aProcessManager; 
314     inline void SubtractNumberOfInteractionLen << 
315       // Subtract NumberOfInteractionLengthLef << 
316       // to previousStepSize                   << 
317                                                   281  
318     inline void ClearNumberOfInteractionLength << 
319       // This method should be at the end of P << 
320                                                << 
321   protected:                                      282   protected:
322                                                << 283       G4VParticleChange* pParticleChange;
323     const G4ProcessManager* aProcessManager =  << 284       //  The pointer to G4VParticleChange object 
                                                   >> 285       //  which is modified and returned by address by the DoIt() method.
                                                   >> 286       //  This pointer should be set in each physics process
                                                   >> 287       //  after construction of derived class object.  
                                                   >> 288 
                                                   >> 289       G4ParticleChange aParticleChange;
                                                   >> 290       //  This object is kept for compatibility with old scheme
                                                   >> 291       //  This will be removed in future
                                                   >> 292 
                                                   >> 293       G4double          theNumberOfInteractionLengthLeft;
                                                   >> 294      // The flight length left for the current tracking particle
                                                   >> 295      // in unit of "Interaction length".
                                                   >> 296 
                                                   >> 297       G4double          currentInteractionLength;
                                                   >> 298      // The InteractionLength in the current material
                                                   >> 299 
                                                   >> 300       G4double          theInitialNumberOfInteractionLength;
                                                   >> 301      // The initial value when ResetNumberOfInteractionLengthLeft is invoked
                                                   >> 302 
                                                   >> 303  public: // with description
                                                   >> 304       virtual void      ResetNumberOfInteractionLengthLeft();
                                                   >> 305      // reset (determine the value of)NumberOfInteractionLengthLeft
                                                   >> 306 
                                                   >> 307       G4double GetNumberOfInteractionLengthLeft() const;
                                                   >> 308      // get NumberOfInteractionLengthLeft
                                                   >> 309 
                                                   >> 310       G4double GetTotalNumberOfInteractionLengthTraversed() const;
                                                   >> 311      // get NumberOfInteractionLength 
                                                   >> 312      //   after  ResetNumberOfInteractionLengthLeft is invoked
                                                   >> 313 
                                                   >> 314  protected:  // with description
                                                   >> 315      void      SubtractNumberOfInteractionLengthLeft(
                                                   >> 316           G4double previousStepSize
                                                   >> 317                                 );
                                                   >> 318      // subtract NumberOfInteractionLengthLeft by the value corresponding to 
                                                   >> 319      // previousStepSize      
324                                                   320  
325     G4VParticleChange* pParticleChange = nullp << 321      void      ClearNumberOfInteractionLengthLeft();
326       // The pointer to G4VParticleChange obje << 322      // clear NumberOfInteractionLengthLeft 
327       // which is modified and returned by add << 323      // !!! This method should be at the end of PostStepDoIt()
328       // This pointer should be set in each ph << 324      // !!! and AtRestDoIt
329       // after construction of derived class o << 325 
330                                                << 326  public: // with description
331     G4ParticleChange aParticleChange;          << 327     // These methods indicate which DoIt is enabled
332       // This object is kept for compatibility << 328     // These methods are used by G4ProcessManager to check
333       // May be removed in future              << 329     // that ordering parameters are set properly
334                                                << 330     G4bool isAtRestDoItIsEnabled() const;
335     G4double theNumberOfInteractionLengthLeft  << 331     G4bool isAlongStepDoItIsEnabled() const;
336       // The flight length left for the curren << 332     G4bool isPostStepDoItIsEnabled() const;
337       // in unit of "Interaction length"       << 333   
338                                                << 334  protected: 
339     G4double currentInteractionLength = -1.0;  << 335       G4String theProcessName;
340       // The InteractionLength in the current  << 336       //  The name of the process
341                                                << 
342     G4double theInitialNumberOfInteractionLeng << 
343       // The initial value when ResetNumberOfI << 
344                                                << 
345     G4String theProcessName;                   << 
346       // The name of the process               << 
347                                                   337 
348     G4String thePhysicsTableFileName;          << 338       G4String thePhysicsTableFileName;
349                                                   339 
350     G4ProcessType theProcessType = fNotDefined << 340       G4ProcessType theProcessType;
351       // The type of the process               << 341       //  The type of the process
352                                                   342 
353     G4int theProcessSubType = -1;              << 343       G4int theProcessSubType;
354       // The sub type of the process           << 344       //  The sub type of the process
355                                                   345 
356     G4double thePILfactor = 1.0;               << 346       G4double thePILfactor;
357       // Factor for PhysicsInteractionLength   << 347       // factor for PhysicsInteractionLength 
358       // which is passed to G4SteppingManager     348       // which is passed to G4SteppingManager
359                                                   349  
360     G4int verboseLevel = 0;                    << 350       G4bool enableAtRestDoIt;
361       // Controle flag for output message      << 351       G4bool enableAlongStepDoIt;
362                                                << 352       G4bool enablePostStepDoIt;
363     G4bool enableAtRestDoIt = true;            << 353       
364     G4bool enableAlongStepDoIt = true;         << 354  public: // with description
365     G4bool enablePostStepDoIt = true;          << 355    virtual void  DumpInfo() const;
366                                                << 356    // dump out process information    
367   private:                                     << 357 
368                                                << 358  public: // with description
369     G4VProcess();                              << 359    void  SetVerboseLevel(G4int value);
370       // Hidden default constructor            << 360    G4int GetVerboseLevel() const;
371                                                << 361    // set/get controle flag for output message
372   private:                                     << 362    //  0: Silent
373                                                << 363    //  1: Warning message
374     G4VProcess* masterProcessShadow = nullptr; << 364    //  2: More
375       // For multi-threaded: pointer to the in << 365 
376       // for the master thread                 << 366 
                                                   >> 367  protected:
                                                   >> 368    G4int verboseLevel;
                                                   >> 369    // controle flag for output message
                                                   >> 370     
                                                   >> 371 private:
                                                   >> 372     G4VProcess* masterProcessShadow;
                                                   >> 373     //For multi-threaded: poitner to the instance of this process
                                                   >> 374     // for the master thread
                                                   >> 375 public:
                                                   >> 376     virtual void SetMasterProcess( G4VProcess* masterP);
                                                   >> 377     // Sets the master thread process instance
                                                   >> 378     const G4VProcess* GetMasterProcess() const;
                                                   >> 379     // Returns the master thread process instnace
                                                   >> 380     // Can be used to initialize worker type processes
                                                   >> 381     // instances from master one (e.g. to share a read-only table)
                                                   >> 382     // if ( this != GetMasterProcess() ) { /*worker*/ }
                                                   >> 383     // else { /* master or sequential */ }
377                                                   384 
378     G4ProcessTable* fProcessTable = nullptr;   << 385     virtual void BuildWorkerPhysicsTable(const G4ParticleDefinition& part);
                                                   >> 386     // Messaged by the Particle definition (via the Process manager)
                                                   >> 387     // in worker threads. See BuildWorkerBhyiscsTable method.
                                                   >> 388     // Can be used to share among threads physics tables. Use GetMasterProcess
                                                   >> 389     // to get pointer of master process from worker thread.
                                                   >> 390     // By default this method makes a forward call to
                                                   >> 391     // BuildPhysicsTable
                                                   >> 392     
                                                   >> 393     virtual void PrepareWorkerPhysicsTable(const G4ParticleDefinition&);
                                                   >> 394     // Messaged by the Particle definition (via the Process manager)
                                                   >> 395     // in worker threads. See PreparephysicsTable
                                                   >> 396     // Can be used to share among threads physics tables. Use GetMasterProcess
                                                   >> 397     // to get pointer of master process from worker thread
                                                   >> 398     // By default this method makes a forward call
                                                   >> 399     // to PreparePhysicsTable
379 };                                                400 };
380                                                   401 
381 // -----------------------------------------      402 // -----------------------------------------
382 //  inlined function members implementation       403 //  inlined function members implementation
383 // -----------------------------------------      404 // -----------------------------------------
                                                   >> 405 #include "Randomize.hh"              
384                                                   406 
385 inline                                            407 inline 
386 const G4String& G4VProcess::GetProcessName() c << 408  const G4String& G4VProcess::GetProcessName() const
387 {                                                 409 {
388   return theProcessName;                          410   return theProcessName;
389 }                                                 411 }
390                                                   412 
391 inline                                            413 inline      
392 G4ProcessType G4VProcess::GetProcessType() con << 414  G4ProcessType G4VProcess::GetProcessType() const
393 {                                                 415 {
394   return theProcessType;                          416   return theProcessType;
395 }                                                 417 }
396                                                   418 
397 inline                                            419 inline
398 void G4VProcess::SetProcessType(G4ProcessType  << 420  void G4VProcess::SetProcessType(G4ProcessType aType)
399 {                                                 421 {
400   theProcessType = aType;                         422   theProcessType = aType;
401 }                                                 423 }
402                                                   424 
403 inline                                            425 inline
404  G4int G4VProcess::GetProcessSubType() const      426  G4int G4VProcess::GetProcessSubType() const
405 {                                                 427 {
406   return theProcessSubType;                       428   return theProcessSubType;
407 }                                                 429 }
408                                                   430 
409 inline                                            431 inline
410 void G4VProcess::SetProcessSubType(G4int value << 432  void G4VProcess::SetProcessSubType(G4int value)
411 {                                                 433 {
412   theProcessSubType = value;                   << 434  theProcessSubType = value;
413 }                                                 435 }
414                                                   436 
415 inline                                         << 437 inline  void G4VProcess::SetVerboseLevel(G4int value)
416 void G4VProcess::SetVerboseLevel(G4int value)  << 
417 {                                                 438 {
418   verboseLevel = value;                           439   verboseLevel = value;
419 }                                                 440 }
420                                                   441 
421 inline                                         << 442 inline  G4int G4VProcess::GetVerboseLevel() const
422 G4int G4VProcess::GetVerboseLevel() const      << 
423 {                                                 443 {
424   return  verboseLevel;                           444   return  verboseLevel;
425 }                                                 445 }
426                                                   446 
427 inline                                         << 447 inline void G4VProcess::ClearNumberOfInteractionLengthLeft()
428 void G4VProcess::ClearNumberOfInteractionLengt << 
429 {                                                 448 {
430   theInitialNumberOfInteractionLength = -1.0;     449   theInitialNumberOfInteractionLength = -1.0; 
431   theNumberOfInteractionLengthLeft =  -1.0;       450   theNumberOfInteractionLengthLeft =  -1.0;
432 }                                                 451 }
433                                                   452 
434 inline                                         << 453 inline G4double G4VProcess::GetNumberOfInteractionLengthLeft() const
435 G4double G4VProcess::GetNumberOfInteractionLen << 
436 {                                                 454 {
437   return theNumberOfInteractionLengthLeft;        455   return theNumberOfInteractionLengthLeft;
438 }                                                 456 }
439                                                   457 
440 inline                                         << 458 inline G4double G4VProcess::GetTotalNumberOfInteractionLengthTraversed() const
441 G4double G4VProcess::GetTotalNumberOfInteracti << 
442 {                                                 459 {
443   return theInitialNumberOfInteractionLength - << 460   return theInitialNumberOfInteractionLength - theNumberOfInteractionLengthLeft;}
444 }                                              << 
445                                                   461 
446 inline                                         << 462 inline G4double G4VProcess::GetCurrentInteractionLength() const
447 G4double G4VProcess::GetCurrentInteractionLeng << 
448 {                                                 463 {
449   return currentInteractionLength;                464   return currentInteractionLength;
450 }                                                 465 }
451                                                   466 
452 inline                                         << 467 inline void G4VProcess::SetPILfactor(G4double value)
453 void G4VProcess::SetPILfactor(G4double value)  << 
454 {                                                 468 {
455   if (value>0.) { thePILfactor = value; }      << 469   if (value>0.) {
                                                   >> 470     thePILfactor = value;
                                                   >> 471   }
456 }                                                 472 }
457                                                   473 
458 inline                                         << 474 inline G4double G4VProcess::GetPILfactor() const
459 G4double G4VProcess::GetPILfactor() const      << 
460 {                                                 475 {
461   return thePILfactor;                            476   return thePILfactor;
462 }                                                 477 }
463                                                   478 
464 inline                                         << 479 inline G4double G4VProcess::AlongStepGPIL( const G4Track& track,
465 G4double G4VProcess::AlongStepGPIL( const G4Tr << 480                                      G4double  previousStepSize,
466                                     G4double   << 481                                      G4double  currentMinimumStep,
467                                     G4double   << 482                                      G4double& proposedSafety,
468                                     G4double&  << 483                                      G4GPILSelection* selection     )
469                                     G4GPILSele << 484 {
470 {                                              << 485   G4double value
471   return AlongStepGetPhysicalInteractionLength << 486    =AlongStepGetPhysicalInteractionLength(track, previousStepSize, currentMinimumStep, proposedSafety, selection);
472                              currentMinimumSte << 487   return value;
473 }                                                 488 }
474                                                   489 
475 inline                                         << 490 inline G4double G4VProcess::AtRestGPIL( const G4Track& track,
476 G4double G4VProcess::AtRestGPIL( const G4Track << 
477                                  G4ForceCondit    491                                  G4ForceCondition* condition )
478 {                                                 492 {
479   return thePILfactor * AtRestGetPhysicalInter << 493   G4double value
                                                   >> 494    =AtRestGetPhysicalInteractionLength(track, condition);
                                                   >> 495   return thePILfactor*value;
480 }                                                 496 }
481                                                   497 
482 inline                                         << 498 inline G4double G4VProcess::PostStepGPIL( const G4Track& track,
483 G4double G4VProcess::PostStepGPIL( const G4Tra << 499                                    G4double   previousStepSize,
484                                    G4double pr << 
485                                    G4ForceCond    500                                    G4ForceCondition* condition )
486 {                                                 501 {
487   return thePILfactor *                        << 502   G4double value
488       PostStepGetPhysicalInteractionLength(tra << 503    =PostStepGetPhysicalInteractionLength(track, previousStepSize, condition);
                                                   >> 504   return thePILfactor*value;
489 }                                                 505 }
490                                                   506       
491 inline                                            507 inline 
492 void G4VProcess::SetProcessManager(const G4Pro << 508  void G4VProcess::SetProcessManager(const G4ProcessManager* procMan)
493 {                                                 509 {
494   aProcessManager = procMan;                   << 510    aProcessManager = procMan; 
495 }                                                 511 }
496                                                   512 
497 inline                                            513 inline
498 const G4ProcessManager* G4VProcess::GetProcess << 514  const G4ProcessManager* G4VProcess::GetProcessManager()
499 {                                                 515 {
500   return aProcessManager;                      << 516   return  aProcessManager; 
501 }                                                 517 }
502                                                   518 
503 inline                                            519 inline
504 G4bool G4VProcess::isAtRestDoItIsEnabled() con << 520  G4bool G4VProcess::isAtRestDoItIsEnabled() const
505 {                                                 521 {
506   return enableAtRestDoIt;                        522   return enableAtRestDoIt;
507 }                                                 523 }
508                                                   524 
509 inline                                            525 inline
510 G4bool G4VProcess::isAlongStepDoItIsEnabled()  << 526  G4bool G4VProcess::isAlongStepDoItIsEnabled() const
511 {                                                 527 {
512   return enableAlongStepDoIt;                     528   return enableAlongStepDoIt;
513 }                                                 529 }
514                                                   530 
515 inline                                            531 inline
516 G4bool G4VProcess::isPostStepDoItIsEnabled() c << 532  G4bool G4VProcess::isPostStepDoItIsEnabled() const
517 {                                                 533 {
518   return enablePostStepDoIt;                      534   return enablePostStepDoIt;
519 }                                                 535 }
520                                                   536 
521 inline                                            537 inline
522 const G4VProcess* G4VProcess::GetMasterProcess    538 const G4VProcess* G4VProcess::GetMasterProcess() const
523 {                                                 539 {
524   return masterProcessShadow;                  << 540     return masterProcessShadow;
525 }                                                 541 }
526                                                   542 
527 inline                                            543 inline
528 void G4VProcess::SubtractNumberOfInteractionLe << 544 void G4VProcess::SubtractNumberOfInteractionLengthLeft(
                                                   >> 545                                   G4double previousStepSize )
529 {                                                 546 {
530   if (currentInteractionLength>0.0)            << 547   if (currentInteractionLength>0.0) {
531   {                                            << 548     theNumberOfInteractionLengthLeft -= previousStepSize/currentInteractionLength;
532     theNumberOfInteractionLengthLeft -= prevSt << 549     if(theNumberOfInteractionLengthLeft<0.) {
533     if(theNumberOfInteractionLengthLeft<0.)    << 
534     {                                          << 
535        theNumberOfInteractionLengthLeft=CLHEP:    550        theNumberOfInteractionLengthLeft=CLHEP::perMillion;
536     }                                             551     }
537   }                                            << 552 
538   else                                         << 553   } else {
539   {                                            << 
540 #ifdef G4VERBOSE                                  554 #ifdef G4VERBOSE
541     if (verboseLevel>0)                        << 555     if (verboseLevel>0) {
542     {                                          << 
543       G4cerr << "G4VProcess::SubtractNumberOfI    556       G4cerr << "G4VProcess::SubtractNumberOfInteractionLengthLeft()";
544       G4cerr << " [" << theProcessName << "]"     557       G4cerr << " [" << theProcessName << "]" <<G4endl;
545       G4cerr << " currentInteractionLength = " << 558       G4cerr << " currentInteractionLength = " << currentInteractionLength << " [mm]";
546              << currentInteractionLength << "  << 559       G4cerr << " previousStepSize = " << previousStepSize << " [mm]";
547       G4cerr << " previousStepSize = " << prev << 
548       G4cerr << G4endl;                           560       G4cerr << G4endl;
549     }                                             561     }
550 #endif                                            562 #endif
551     G4String msg = "Negative currentInteractio    563     G4String msg = "Negative currentInteractionLength for ";
552     msg += theProcessName;                     << 564     msg +=      theProcessName;
553     G4Exception("G4VProcess::SubtractNumberOfI    565     G4Exception("G4VProcess::SubtractNumberOfInteractionLengthLeft()",
554                 "ProcMan201", EventMustBeAbort << 566                 "ProcMan201",EventMustBeAborted,
                                                   >> 567                 msg);
555   }                                               568   }
556 }                                                 569 }
557                                                   570 
558 #endif                                            571 #endif
559                                                   572