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 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/G4WrapperProcess.hh (Version 11.3.0) and /processes/management/include/G4WrapperProcess.hh (Version 11.2.2)


  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 // G4WrapperProcess                                26 // G4WrapperProcess
 27 //                                                 27 //
 28 // Class description:                              28 // Class description:
 29 //                                                 29 //
 30 // Virtual class for wrapper process objects.      30 // Virtual class for wrapper process objects. 
 31                                                    31 
 32 // Author: H.Kurahige, 18 December 1996            32 // Author: H.Kurahige, 18 December 1996
 33 // -------------------------------------------     33 // --------------------------------------------------------------------
 34 #ifndef G4WrapperProcess_hh                        34 #ifndef G4WrapperProcess_hh 
 35 #define G4WrapperProcess_hh 1                      35 #define G4WrapperProcess_hh 1
 36                                                    36 
 37 #include "globals.hh"                              37 #include "globals.hh"
 38 #include "G4ios.hh"                                38 #include "G4ios.hh"
 39 #include "G4VProcess.hh"                           39 #include "G4VProcess.hh"
 40                                                    40 
 41 class G4WrapperProcess : public G4VProcess         41 class G4WrapperProcess : public G4VProcess
 42 {                                                  42 {
 43   public:                                          43   public:
 44                                                    44 
 45     G4WrapperProcess(const G4String& aName =       45     G4WrapperProcess(const G4String& aName =  "Wrapped",
 46                      G4ProcessType aType = fNo     46                      G4ProcessType aType = fNotDefined);
 47       // Constructor requires the process name     47       // Constructor requires the process name and type
 48                                                    48 
 49     G4WrapperProcess(const G4WrapperProcess& r     49     G4WrapperProcess(const G4WrapperProcess& right);
 50       // Copy constructor copies the name but      50       // Copy constructor copies the name but does not copy the 
 51       // physics table (null pointer is assign     51       // physics table (null pointer is assigned)
 52                                                    52 
 53     virtual ~G4WrapperProcess();                   53     virtual ~G4WrapperProcess();
 54       // Destructor                                54       // Destructor 
 55                                                    55 
 56     G4WrapperProcess& operator=(const G4Wrappe     56     G4WrapperProcess& operator=(const G4WrapperProcess&) = delete;
 57                                                    57 
 58     inline G4bool operator==(const G4WrapperPr     58     inline G4bool operator==(const G4WrapperProcess& right) const;
 59     inline G4bool operator!=(const G4WrapperPr     59     inline G4bool operator!=(const G4WrapperProcess& right) const;
 60       // Equality operators                        60       // Equality operators
 61                                                    61 
 62     virtual void RegisterProcess(G4VProcess*);     62     virtual void RegisterProcess(G4VProcess*);
 63     virtual const G4VProcess* GetRegisteredPro     63     virtual const G4VProcess* GetRegisteredProcess() const;
 64                                                    64 
 65     ////////////////////////////                   65     ////////////////////////////
 66     // DoIt    /////////////////                   66     // DoIt    /////////////////
 67     ///////////////////////////                    67     ///////////////////////////
 68                                                    68 
 69     virtual G4VParticleChange* PostStepDoIt(       69     virtual G4VParticleChange* PostStepDoIt(
 70                              const G4Track& tr     70                              const G4Track& track,
 71                              const G4Step&  st     71                              const G4Step&  stepData
 72                             );                     72                             );
 73                                                    73 
 74     virtual G4VParticleChange* AlongStepDoIt(      74     virtual G4VParticleChange* AlongStepDoIt(
 75                              const G4Track& tr     75                              const G4Track& track,
 76                              const G4Step& ste     76                              const G4Step& stepData
 77                             );                     77                             );
 78     virtual G4VParticleChange* AtRestDoIt(         78     virtual G4VParticleChange* AtRestDoIt(
 79                              const G4Track& tr     79                              const G4Track& track,
 80                              const G4Step& ste     80                              const G4Step& stepData
 81                             );                     81                             );
 82                                                    82 
 83     //////////////////////////                     83     //////////////////////////
 84     // GPIL    //////////////                      84     // GPIL    //////////////
 85     /////////////////////////                      85     /////////////////////////  
 86                                                    86 
 87     virtual G4double AlongStepGetPhysicalInter     87     virtual G4double AlongStepGetPhysicalInteractionLength(
 88                              const G4Track& tr     88                              const G4Track& track,
 89                              G4double  previou     89                              G4double  previousStepSize,
 90                              G4double  current     90                              G4double  currentMinimumStep,
 91                              G4double& propose     91                              G4double& proposedSafety,
 92                              G4GPILSelection*      92                              G4GPILSelection* selection);
 93                                                    93 
 94     virtual G4double AtRestGetPhysicalInteract     94     virtual G4double AtRestGetPhysicalInteractionLength(
 95                              const G4Track& tr     95                              const G4Track& track,
 96                              G4ForceCondition*     96                              G4ForceCondition* condition
 97                             );                     97                             );
 98                                                    98 
 99     virtual G4double PostStepGetPhysicalIntera     99     virtual G4double PostStepGetPhysicalInteractionLength(
100                              const G4Track& tr    100                              const G4Track& track,
101                              G4double   previo    101                              G4double   previousStepSize,
102                              G4ForceCondition*    102                              G4ForceCondition* condition
103                             );                    103                             );
104                                                   104   
105     virtual G4bool IsApplicable(const G4Partic    105     virtual G4bool IsApplicable(const G4ParticleDefinition&);
106       // Returns true if this process object i    106       // Returns true if this process object is applicable to
107       // the particle type                        107       // the particle type
108       // Process will not be registered to a p    108       // Process will not be registered to a particle if IsApplicable is false   
109                                                   109 
110     virtual void BuildPhysicsTable(const G4Par    110     virtual void BuildPhysicsTable(const G4ParticleDefinition&);
111       // Messaged by the Particle definition (    111       // Messaged by the Particle definition (via the Process manager)
112       // whenever cross-section tables have to    112       // whenever cross-section tables have to be rebuilt (i.e. if new
113       // materials have been defined).            113       // materials have been defined). 
114       // It is overloaded by individual proces    114       // It is overloaded by individual processes when they need physics
115       // tables                                   115       // tables
116                                                   116 
117     // Processes which build (for example in t    117     // Processes which build (for example in their constructors)
118     // physics tables independent of cuts shou    118     // physics tables independent of cuts should preferably use a private
119     // void BuildThePhysicsTable() function.      119     // void BuildThePhysicsTable() function.
120     // **Not** another BuildPhysicsTable().       120     // **Not** another BuildPhysicsTable().
121                                                   121  
122     virtual void PreparePhysicsTable(const G4P    122     virtual void PreparePhysicsTable(const G4ParticleDefinition&);
123       // Messaged by the Particle definition (    123       // Messaged by the Particle definition (via the Process manager)
124       // whenever cross-section tables have to    124       // whenever cross-section tables have to be prepare for rebuilt 
125       // (i.e. if new materials have been defi    125       // (i.e. if new materials have been defined). 
126       // It is overloaded by individual proces    126       // It is overloaded by individual processes when they need physics
127       // tables                                   127       // tables
128                                                   128 
129                                                   129 
130     virtual G4bool StorePhysicsTable(const G4P    130     virtual G4bool StorePhysicsTable(const G4ParticleDefinition* ,
131                                      const G4S    131                                      const G4String& directory, 
132                                      G4bool as    132                                      G4bool ascii = false); 
133       // Store PhysicsTable in a file.            133       // Store PhysicsTable in a file. 
134       // Return false in case of failure at I/    134       // Return false in case of failure at I/O 
135                                                   135  
136     virtual G4bool RetrievePhysicsTable( const    136     virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* ,
137                                          const    137                                          const G4String& directory, 
138                                          G4boo    138                                          G4bool ascii = false);
139       // Retrieve Physics from a file.            139       // Retrieve Physics from a file. 
140       // Return true if the Physics Table can     140       // Return true if the Physics Table can be build by using file.
141       // Return false if the process has no fu    141       // Return false if the process has no functionality or in case of failure.
142       // File name should be defined by each p    142       // File name should be defined by each process and the file should be
143       // placed under the directory specified     143       // placed under the directory specified by the argument
144                                                   144 
145     virtual void StartTracking(G4Track*);         145     virtual void StartTracking(G4Track*);
146     virtual void EndTracking();                   146     virtual void EndTracking();
147       // inform Start/End of tracking for each    147       // inform Start/End of tracking for each track to the physics process 
148                                                   148  
149     virtual void SetProcessManager(const G4Pro    149     virtual void SetProcessManager(const G4ProcessManager*); 
150       // A process manager sets its own pointe    150       // A process manager sets its own pointer when the process is registered
151       // in the process Manager                   151       // in the process Manager
152     virtual  const G4ProcessManager* GetProces    152     virtual  const G4ProcessManager* GetProcessManager(); 
153       // Get the process manager which the pro    153       // Get the process manager which the process belongs to
154                                                   154   
155     virtual void ResetNumberOfInteractionLengt    155     virtual void ResetNumberOfInteractionLengthLeft();
156       // Reset (determine the value of) Number    156       // Reset (determine the value of) NumberOfInteractionLengthLeft
157     virtual void SetMasterProcess(G4VProcess*     157     virtual void SetMasterProcess(G4VProcess* masterP);
158       // Needed for MT, forward call to underl    158       // Needed for MT, forward call to underlying process 
159                                                   159 
160   protected:                                      160   protected:
161                                                   161 
162     G4VProcess* pRegProcess = nullptr;            162     G4VProcess* pRegProcess = nullptr;
163 };                                                163 };
164                                                   164 
165 // ------------------------                       165 // ------------------------
166 // Inline operators                               166 // Inline operators
167 // ------------------------                       167 // ------------------------
168                                                   168 
169 inline                                            169 inline
170 G4bool G4WrapperProcess::operator==(const G4Wr    170 G4bool G4WrapperProcess::operator==(const G4WrapperProcess& right) const
171 {                                                 171 {
172   return (this == &right);                        172   return (this == &right);
173 }                                                 173 }
174                                                   174 
175 inline                                            175 inline
176 G4bool G4WrapperProcess::operator!=(const G4Wr    176 G4bool G4WrapperProcess::operator!=(const G4WrapperProcess& right) const
177 {                                                 177 {
178   return (this != &right);                        178   return (this != &right);
179 }                                                 179 }
180                                                   180 
181 #endif                                            181 #endif
182                                                   182