00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 // ------------------------------------------------------------ 00031 // GEANT 4 class header file 00032 // 00033 // Class Description 00034 // 00035 // This class is the virtual class for wrapper process objects. 00036 00037 // ------------------------------------------------------------ 00038 // New Physics scheme 18 Dec. 1996 H.Kurahige 00039 // ------------------------------------------------------------ 00040 00041 #ifndef G4WrapperProcess_h 00042 #define G4WrapperProcess_h 1 00043 00044 #include "globals.hh" 00045 #include "G4ios.hh" 00046 #include "G4VProcess.hh" 00047 00048 class G4WrapperProcess : public G4VProcess 00049 { 00050 // A virtual class for wrapper process objects. 00051 00052 private: 00053 // hide default constructor and assignment operator as private 00054 // do not hide default constructor for alpha version 00055 inline G4WrapperProcess & operator=(const G4WrapperProcess &right); 00056 00057 public: // with description 00058 // constructor requires the process name and type 00059 G4WrapperProcess(const G4String& aName = "Wrapped", 00060 G4ProcessType aType = fNotDefined ); 00061 00062 // copy constructor copys the name but does not copy the 00063 // physics table (0 pointer is assigned) 00064 G4WrapperProcess(const G4WrapperProcess &right); 00065 00066 public: 00067 // destructor 00068 virtual ~G4WrapperProcess(); 00069 00070 // equality opperators 00071 inline G4int operator==(const G4WrapperProcess &right) const; 00072 inline G4int operator!=(const G4WrapperProcess &right) const; 00073 00074 public: // with description 00075 virtual void RegisterProcess(G4VProcess*); 00076 virtual const G4VProcess* GetRegisteredProcess() const; 00077 00078 protected: 00079 G4VProcess* pRegProcess; 00080 00081 public: // with description 00083 // DoIt ///////////////// 00085 virtual G4VParticleChange* PostStepDoIt( 00086 const G4Track& track, 00087 const G4Step& stepData 00088 ); 00089 00090 virtual G4VParticleChange* AlongStepDoIt( 00091 const G4Track& track, 00092 const G4Step& stepData 00093 ); 00094 virtual G4VParticleChange* AtRestDoIt( 00095 const G4Track& track, 00096 const G4Step& stepData 00097 ); 00099 // GPIL ////////////// 00101 virtual G4double AlongStepGetPhysicalInteractionLength( 00102 const G4Track& track, 00103 G4double previousStepSize, 00104 G4double currentMinimumStep, 00105 G4double& proposedSafety, 00106 G4GPILSelection* selection); 00107 00108 virtual G4double AtRestGetPhysicalInteractionLength( 00109 const G4Track& track, 00110 G4ForceCondition* condition 00111 ); 00112 00113 virtual G4double PostStepGetPhysicalInteractionLength( 00114 const G4Track& track, 00115 G4double previousStepSize, 00116 G4ForceCondition* condition 00117 ) ; 00118 00120 virtual G4bool IsApplicable(const G4ParticleDefinition&); 00121 // Returns true if this process object is applicable to 00122 // the particle type 00123 // Process will not be registered to a particle if IsApplicable is false 00124 00125 virtual void BuildPhysicsTable(const G4ParticleDefinition&); 00126 // Messaged by the Particle definition (via the Process manager) 00127 // whenever cross section tables have to be rebuilt (i.e. if new 00128 // materials have been defined). 00129 // It is overloaded by individual processes when they need physics 00130 // tables. 00131 00132 // Processes which Build (for example in their 00133 // constructors) physics tables independent of cuts 00134 // should preferably use a 00135 // private void BuildThePhysicsTable() 00136 // function. Not another BuildPhysicsTable, please. 00137 00138 virtual void PreparePhysicsTable(const G4ParticleDefinition&); 00139 // Messaged by the Particle definition (via the Process manager) 00140 // whenever cross section tables have to be prepare for rebuilt 00141 // (i.e. if new materials have been defined). 00142 // It is overloaded by individual processes when they need physics 00143 // tables. 00144 00145 // Processes which Build physics tables independent of cuts 00146 // (for example in their constructors) 00147 // should preferably use private 00148 // void BuildThePhysicsTable() and void PreparePhysicsTable(). 00149 // Not another BuildPhysicsTable, please. 00150 00151 00152 virtual G4bool StorePhysicsTable(const G4ParticleDefinition* , 00153 const G4String& directory, 00154 G4bool ascii = false); 00155 // Store PhysicsTable in a file. 00156 // (return false in case of failure at I/O ) 00157 00158 virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* , 00159 const G4String& directory, 00160 G4bool ascii = false); 00161 // Retrieve Physics from a file. 00162 // (return true if the Physics Table can be build by using file) 00163 // (return false if the process has no functionality or in case of failure) 00164 // File name should be defined by each process 00165 // and the file should be placed under the directory specifed by the argument. 00167 virtual void StartTracking(G4Track*); 00168 virtual void EndTracking(); 00169 // inform Start/End of tracking for each track to the physics process 00170 00171 public: 00172 virtual void SetProcessManager(const G4ProcessManager*); 00173 // A process manager set its own pointer when the process is registered 00174 // the process Manager 00175 virtual const G4ProcessManager* GetProcessManager(); 00176 // Get the process manager which the process belongs to 00177 00178 public: 00179 virtual void ResetNumberOfInteractionLengthLeft(); 00180 // reset (determine the value of)NumberOfInteractionLengthLeft 00181 00182 }; 00183 00184 inline 00185 G4WrapperProcess & G4WrapperProcess::operator=(const G4WrapperProcess &) 00186 { 00187 G4Exception("G4WrapperProcess::operator=","Illegal operation", 00188 JustWarning,"Assignment operator is called"); 00189 return *this; 00190 } 00191 00192 inline 00193 G4int G4WrapperProcess::operator==(const G4WrapperProcess &right) const 00194 { 00195 return (this == &right); 00196 } 00197 00198 inline 00199 G4int G4WrapperProcess::operator!=(const G4WrapperProcess &right) const 00200 { 00201 return (this != &right); 00202 } 00203 00204 #endif