| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: G4WrapperProcess.hh,v 1.9 2007/12/12 10:09:49 gcosmo Exp $
|
|---|
| 28 | // GEANT4 tag $Name: $
|
|---|
| 29 | //
|
|---|
| 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 | // ------------------------------------------------------------
|
|---|
| 41 |
|
|---|
| 42 | #ifndef G4WrapperProcess_h
|
|---|
| 43 | #define G4WrapperProcess_h 1
|
|---|
| 44 |
|
|---|
| 45 | #include "globals.hh"
|
|---|
| 46 | #include "G4ios.hh"
|
|---|
| 47 | #include "G4VProcess.hh"
|
|---|
| 48 |
|
|---|
| 49 | class G4WrapperProcess : public G4VProcess
|
|---|
| 50 | {
|
|---|
| 51 | // A virtual class for wrapper process objects.
|
|---|
| 52 |
|
|---|
| 53 | private:
|
|---|
| 54 | // hide default constructor and assignment operator as private
|
|---|
| 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;
|
|---|
| 74 |
|
|---|
| 75 | public: // with description
|
|---|
| 76 | virtual void RegisterProcess(G4VProcess*);
|
|---|
| 77 | virtual const G4VProcess* GetRegisteredProcess() const;
|
|---|
| 78 |
|
|---|
| 79 | protected:
|
|---|
| 80 | G4VProcess* pRegProcess;
|
|---|
| 81 |
|
|---|
| 82 | public: // with description
|
|---|
| 83 | ////////////////////////////
|
|---|
| 84 | // DoIt /////////////////
|
|---|
| 85 | ///////////////////////////
|
|---|
| 86 | virtual G4VParticleChange* PostStepDoIt(
|
|---|
| 87 | const G4Track& track,
|
|---|
| 88 | const G4Step& stepData
|
|---|
| 89 | );
|
|---|
| 90 |
|
|---|
| 91 | virtual G4VParticleChange* AlongStepDoIt(
|
|---|
| 92 | const G4Track& track,
|
|---|
| 93 | const G4Step& stepData
|
|---|
| 94 | );
|
|---|
| 95 | virtual G4VParticleChange* AtRestDoIt(
|
|---|
| 96 | const G4Track& track,
|
|---|
| 97 | const G4Step& stepData
|
|---|
| 98 | );
|
|---|
| 99 | //////////////////////////
|
|---|
| 100 | // GPIL //////////////
|
|---|
| 101 | /////////////////////////
|
|---|
| 102 | virtual G4double AlongStepGetPhysicalInteractionLength(
|
|---|
| 103 | const G4Track& track,
|
|---|
| 104 | G4double previousStepSize,
|
|---|
| 105 | G4double currentMinimumStep,
|
|---|
| 106 | G4double& proposedSafety,
|
|---|
| 107 | G4GPILSelection* selection);
|
|---|
| 108 |
|
|---|
| 109 | virtual G4double AtRestGetPhysicalInteractionLength(
|
|---|
| 110 | const G4Track& track,
|
|---|
| 111 | G4ForceCondition* condition
|
|---|
| 112 | );
|
|---|
| 113 |
|
|---|
| 114 | virtual G4double PostStepGetPhysicalInteractionLength(
|
|---|
| 115 | const G4Track& track,
|
|---|
| 116 | G4double previousStepSize,
|
|---|
| 117 | G4ForceCondition* condition
|
|---|
| 118 | ) ;
|
|---|
| 119 |
|
|---|
| 120 | //////////////////////
|
|---|
| 121 | virtual G4bool IsApplicable(const G4ParticleDefinition&);
|
|---|
| 122 | // Returns true if this process object is applicable to
|
|---|
| 123 | // the particle type
|
|---|
| 124 | // Process will not be registered to a particle if IsApplicable is false
|
|---|
| 125 |
|
|---|
| 126 | virtual void BuildPhysicsTable(const G4ParticleDefinition&);
|
|---|
| 127 | // Messaged by the Particle definition (via the Process manager)
|
|---|
| 128 | // whenever cross section tables have to be rebuilt (i.e. if new
|
|---|
| 129 | // materials have been defined).
|
|---|
| 130 | // It is overloaded by individual processes when they need physics
|
|---|
| 131 | // tables.
|
|---|
| 132 |
|
|---|
| 133 | // Processes which Build (for example in their
|
|---|
| 134 | // constructors) physics tables independent of cuts
|
|---|
| 135 | // should preferably use a
|
|---|
| 136 | // private void BuildThePhysicsTable()
|
|---|
| 137 | // function. Not another BuildPhysicsTable, please.
|
|---|
| 138 |
|
|---|
| 139 | virtual void PreparePhysicsTable(const G4ParticleDefinition&);
|
|---|
| 140 | // Messaged by the Particle definition (via the Process manager)
|
|---|
| 141 | // whenever cross section tables have to be prepare for rebuilt
|
|---|
| 142 | // (i.e. if new materials have been defined).
|
|---|
| 143 | // It is overloaded by individual processes when they need physics
|
|---|
| 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.
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 | virtual G4bool StorePhysicsTable(const G4ParticleDefinition* ,
|
|---|
| 154 | const G4String& directory,
|
|---|
| 155 | G4bool ascii = false);
|
|---|
| 156 | // Store PhysicsTable in a file.
|
|---|
| 157 | // (return false in case of failure at I/O )
|
|---|
| 158 |
|
|---|
| 159 | virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* ,
|
|---|
| 160 | const G4String& directory,
|
|---|
| 161 | G4bool ascii = false);
|
|---|
| 162 | // Retrieve Physics from a file.
|
|---|
| 163 | // (return true if the Physics Table can be build by using file)
|
|---|
| 164 | // (return false if the process has no functionality or in case of failure)
|
|---|
| 165 | // File name should be defined by each process
|
|---|
| 166 | // and the file should be placed under the directory specifed by the argument.
|
|---|
| 167 | ////////////////////////////
|
|---|
| 168 | virtual void StartTracking(G4Track*);
|
|---|
| 169 | virtual void EndTracking();
|
|---|
| 170 | // inform Start/End of tracking for each track to the physics process
|
|---|
| 171 |
|
|---|
| 172 | public:
|
|---|
| 173 | virtual void SetProcessManager(const G4ProcessManager*);
|
|---|
| 174 | // A process manager set its own pointer when the process is registered
|
|---|
| 175 | // the process Manager
|
|---|
| 176 | virtual const G4ProcessManager* GetProcessManager();
|
|---|
| 177 | // Get the process manager which the process belongs to
|
|---|
| 178 |
|
|---|
| 179 | public:
|
|---|
| 180 | virtual void ResetNumberOfInteractionLengthLeft();
|
|---|
| 181 | // reset (determine the value of)NumberOfInteractionLengthLeft
|
|---|
| 182 |
|
|---|
| 183 | };
|
|---|
| 184 |
|
|---|
| 185 | inline
|
|---|
| 186 | G4WrapperProcess & G4WrapperProcess::operator=(const G4WrapperProcess &)
|
|---|
| 187 | {
|
|---|
| 188 | G4Exception("G4WrapperProcess::operator=","Illegal operation",
|
|---|
| 189 | JustWarning,"Assignment operator is called");
|
|---|
| 190 | return *this;
|
|---|
| 191 | }
|
|---|
| 192 |
|
|---|
| 193 | inline
|
|---|
| 194 | G4int G4WrapperProcess::operator==(const G4WrapperProcess &right) const
|
|---|
| 195 | {
|
|---|
| 196 | return (this == &right);
|
|---|
| 197 | }
|
|---|
| 198 |
|
|---|
| 199 | inline
|
|---|
| 200 | G4int G4WrapperProcess::operator!=(const G4WrapperProcess &right) const
|
|---|
| 201 | {
|
|---|
| 202 | return (this != &right);
|
|---|
| 203 | }
|
|---|
| 204 |
|
|---|
| 205 | #endif
|
|---|