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