[1197] | 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 | // $Id: G4AdjointProcessEquivalentToDirectProcess.hh,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $ |
---|
[1228] | 27 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[1197] | 28 | // |
---|
| 29 | ///////////////////////////////////////////////////////////////////////////////// |
---|
| 30 | // Class: G4AdjointProcessEquivalentToDirectProcess |
---|
| 31 | // Author: L. Desorgher |
---|
| 32 | // Organisation: SpaceIT GmbH |
---|
| 33 | // Contract: ESA contract 21435/08/NL/AT |
---|
| 34 | // Customer: ESA/ESTEC |
---|
| 35 | ///////////////////////////////////////////////////////////////////////////////// |
---|
| 36 | // |
---|
| 37 | // CHANGE HISTORY |
---|
| 38 | // -------------- |
---|
| 39 | // ChangeHistory: |
---|
| 40 | // 25 Sept. 2009 Created by L.Desorgher. Inspired from G4WrapperProcess |
---|
| 41 | // |
---|
| 42 | //------------------------------------------------------------- |
---|
| 43 | // Documentation: |
---|
| 44 | // Adjoint process equivalent to direct process, used for some multiple scattering |
---|
| 45 | // |
---|
| 46 | // |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | #ifndef G4AdjointProcessEquivalentToDirectProcess_h |
---|
| 50 | #define G4AdjointProcessEquivalentToDirectProcess_h 1 |
---|
| 51 | |
---|
| 52 | #include "globals.hh" |
---|
| 53 | #include "G4ios.hh" |
---|
| 54 | #include "G4VProcess.hh" |
---|
| 55 | |
---|
| 56 | class G4AdjointProcessEquivalentToDirectProcess : public G4VProcess |
---|
| 57 | { |
---|
| 58 | // A virtual class for wrapper process objects. |
---|
| 59 | |
---|
| 60 | public: // with description |
---|
| 61 | // constructor requires the process name and type |
---|
| 62 | G4AdjointProcessEquivalentToDirectProcess(const G4String& aName, G4VProcess* aProcess,G4ParticleDefinition* fwd_particle_def); |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | public: |
---|
| 67 | // destructor |
---|
| 68 | virtual ~G4AdjointProcessEquivalentToDirectProcess(); |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | public: // with description |
---|
| 72 | //////////////////////////// |
---|
| 73 | // DoIt ///////////////// |
---|
| 74 | /////////////////////////// |
---|
| 75 | virtual G4VParticleChange* PostStepDoIt( |
---|
| 76 | const G4Track& track, |
---|
| 77 | const G4Step& stepData |
---|
| 78 | ); |
---|
| 79 | |
---|
| 80 | virtual G4VParticleChange* AlongStepDoIt( |
---|
| 81 | const G4Track& track, |
---|
| 82 | const G4Step& stepData |
---|
| 83 | ); |
---|
| 84 | virtual G4VParticleChange* AtRestDoIt( |
---|
| 85 | const G4Track& track, |
---|
| 86 | const G4Step& stepData |
---|
| 87 | ); |
---|
| 88 | ////////////////////////// |
---|
| 89 | // GPIL ////////////// |
---|
| 90 | ///////////////////////// |
---|
| 91 | virtual G4double AlongStepGetPhysicalInteractionLength( |
---|
| 92 | const G4Track& track, |
---|
| 93 | G4double previousStepSize, |
---|
| 94 | G4double currentMinimumStep, |
---|
| 95 | G4double& proposedSafety, |
---|
| 96 | G4GPILSelection* selection); |
---|
| 97 | |
---|
| 98 | virtual G4double AtRestGetPhysicalInteractionLength( |
---|
| 99 | const G4Track& track, |
---|
| 100 | G4ForceCondition* condition |
---|
| 101 | ); |
---|
| 102 | |
---|
| 103 | virtual G4double PostStepGetPhysicalInteractionLength( |
---|
| 104 | const G4Track& track, |
---|
| 105 | G4double previousStepSize, |
---|
| 106 | G4ForceCondition* condition |
---|
| 107 | ) ; |
---|
| 108 | |
---|
| 109 | ////////////////////// |
---|
| 110 | virtual G4bool IsApplicable(const G4ParticleDefinition&); |
---|
| 111 | // Returns true if this process object is applicable to |
---|
| 112 | // the particle type |
---|
| 113 | // Process will not be registered to a particle if IsApplicable is false |
---|
| 114 | |
---|
| 115 | virtual void BuildPhysicsTable(const G4ParticleDefinition&); |
---|
| 116 | // Messaged by the Particle definition (via the Process manager) |
---|
| 117 | // whenever cross section tables have to be rebuilt (i.e. if new |
---|
| 118 | // materials have been defined). |
---|
| 119 | // It is overloaded by individual processes when they need physics |
---|
| 120 | // tables. |
---|
| 121 | |
---|
| 122 | // Processes which Build (for example in their |
---|
| 123 | // constructors) physics tables independent of cuts |
---|
| 124 | // should preferably use a |
---|
| 125 | // private void BuildThePhysicsTable() |
---|
| 126 | // function. Not another BuildPhysicsTable, please. |
---|
| 127 | |
---|
| 128 | virtual void PreparePhysicsTable(const G4ParticleDefinition&); |
---|
| 129 | // Messaged by the Particle definition (via the Process manager) |
---|
| 130 | // whenever cross section tables have to be prepare for rebuilt |
---|
| 131 | // (i.e. if new materials have been defined). |
---|
| 132 | // It is overloaded by individual processes when they need physics |
---|
| 133 | // tables. |
---|
| 134 | |
---|
| 135 | // Processes which Build physics tables independent of cuts |
---|
| 136 | // (for example in their constructors) |
---|
| 137 | // should preferably use private |
---|
| 138 | // void BuildThePhysicsTable() and void PreparePhysicsTable(). |
---|
| 139 | // Not another BuildPhysicsTable, please. |
---|
| 140 | |
---|
| 141 | |
---|
| 142 | virtual G4bool StorePhysicsTable(const G4ParticleDefinition* , |
---|
| 143 | const G4String& directory, |
---|
| 144 | G4bool ascii = false); |
---|
| 145 | // Store PhysicsTable in a file. |
---|
| 146 | // (return false in case of failure at I/O ) |
---|
| 147 | |
---|
| 148 | virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* , |
---|
| 149 | const G4String& directory, |
---|
| 150 | G4bool ascii = false); |
---|
| 151 | // Retrieve Physics from a file. |
---|
| 152 | // (return true if the Physics Table can be build by using file) |
---|
| 153 | // (return false if the process has no functionality or in case of failure) |
---|
| 154 | // File name should be defined by each process |
---|
| 155 | // and the file should be placed under the directory specifed by the argument. |
---|
| 156 | //////////////////////////// |
---|
| 157 | virtual void StartTracking(G4Track*); |
---|
| 158 | virtual void EndTracking(); |
---|
| 159 | // inform Start/End of tracking for each track to the physics process |
---|
| 160 | |
---|
| 161 | |
---|
| 162 | |
---|
| 163 | public: |
---|
| 164 | virtual void ResetNumberOfInteractionLengthLeft(); |
---|
| 165 | // reset (determine the value of)NumberOfInteractionLengthLeft |
---|
| 166 | private: |
---|
| 167 | G4ParticleDefinition* theFwdParticleDef; |
---|
| 168 | G4VProcess* theDirectProcess; |
---|
| 169 | |
---|
| 170 | }; |
---|
| 171 | |
---|
| 172 | |
---|
| 173 | #endif |
---|