[819] | 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: G4IVContinuousDiscreteProcess.hh,v 1.8 2006/06/29 21:07:14 gunter Exp $ |
---|
| 28 | // GEANT4 tag $Name: $ |
---|
| 29 | // |
---|
| 30 | // $Id: |
---|
| 31 | // ------------------------------------------------------------ |
---|
| 32 | // GEANT 4 class header file |
---|
| 33 | // |
---|
| 34 | // |
---|
| 35 | // Class Description |
---|
| 36 | // Abstract class which defines the public behavior of |
---|
| 37 | // discrete physics interactions using integral approach |
---|
| 38 | // |
---|
| 39 | // ------------------------------------------------------------ |
---|
| 40 | // New Physics scheme 8 Mar. 1997 H.Kurahige |
---|
| 41 | // ------------------------------------------------------------ |
---|
| 42 | // modified 26 Mar. 1997 H.Kurashige |
---|
| 43 | // modified 16 Apr. 1997 L.Urban |
---|
| 44 | // modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige |
---|
| 45 | // fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige |
---|
| 46 | // modified for new ParticleChange 12 Mar. 1998 H.Kurashige |
---|
| 47 | |
---|
| 48 | #ifndef G4IVContinuousDiscreteProcess_h |
---|
| 49 | #define G4IVContinuousDiscreteProcess_h 1 |
---|
| 50 | |
---|
| 51 | #include "globals.hh" |
---|
| 52 | #include "G4ios.hh" |
---|
| 53 | |
---|
| 54 | #include "G4VProcess.hh" |
---|
| 55 | |
---|
| 56 | class G4IVContinuousDiscreteProcess : public G4VProcess |
---|
| 57 | { |
---|
| 58 | // Abstract class which defines the public behavior of |
---|
| 59 | // discrete physics interactions. |
---|
| 60 | public: |
---|
| 61 | |
---|
| 62 | G4IVContinuousDiscreteProcess(const G4String& , |
---|
| 63 | G4ProcessType aType = fNotDefined ); |
---|
| 64 | G4IVContinuousDiscreteProcess(G4IVContinuousDiscreteProcess &); |
---|
| 65 | |
---|
| 66 | virtual ~G4IVContinuousDiscreteProcess(); |
---|
| 67 | |
---|
| 68 | public: // with description |
---|
| 69 | virtual G4double PostStepGetPhysicalInteractionLength( |
---|
| 70 | const G4Track& track, |
---|
| 71 | G4double previousStepSize, |
---|
| 72 | G4ForceCondition* condition |
---|
| 73 | ); |
---|
| 74 | |
---|
| 75 | virtual G4VParticleChange* PostStepDoIt( |
---|
| 76 | const G4Track& , |
---|
| 77 | const G4Step& |
---|
| 78 | ); |
---|
| 79 | |
---|
| 80 | virtual G4double AlongStepGetPhysicalInteractionLength( |
---|
| 81 | const G4Track&, |
---|
| 82 | G4double previousStepSize, |
---|
| 83 | G4double currentMinimumStep, |
---|
| 84 | G4double& currentSafety, |
---|
| 85 | G4GPILSelection* selection |
---|
| 86 | ) ; |
---|
| 87 | |
---|
| 88 | virtual G4VParticleChange* AlongStepDoIt( |
---|
| 89 | const G4Track& , |
---|
| 90 | const G4Step& |
---|
| 91 | ); |
---|
| 92 | |
---|
| 93 | // no operation in AtRestDoIt |
---|
| 94 | virtual G4double AtRestGetPhysicalInteractionLength( |
---|
| 95 | const G4Track& , |
---|
| 96 | G4ForceCondition* |
---|
| 97 | ) { return -1.0; }; |
---|
| 98 | |
---|
| 99 | // no operation in AtRestDoIt |
---|
| 100 | virtual G4VParticleChange* AtRestDoIt( |
---|
| 101 | const G4Track& , |
---|
| 102 | const G4Step& |
---|
| 103 | ) {return 0;}; |
---|
| 104 | |
---|
| 105 | protected: // with description |
---|
| 106 | virtual G4double GetContinuousStepLimit(const G4Track& aTrack, |
---|
| 107 | G4double previousStepSize, |
---|
| 108 | G4double currentMinimumStep, |
---|
| 109 | G4double& currentSafety |
---|
| 110 | )=0; |
---|
| 111 | private: |
---|
| 112 | // this is the returnd value of G4GPILSelection in |
---|
| 113 | // the arguments of AlongStepGPIL() |
---|
| 114 | G4GPILSelection valueGPILSelection; |
---|
| 115 | |
---|
| 116 | protected: // with description |
---|
| 117 | //------------------------------------------------------ |
---|
| 118 | virtual void SubtractNumberOfInteractionLengthLeft( |
---|
| 119 | G4double previousStepSize) ; |
---|
| 120 | |
---|
| 121 | // these two methods are set/get methods for valueGPILSelection |
---|
| 122 | void SetGPILSelection(G4GPILSelection selection) |
---|
| 123 | { valueGPILSelection = selection;}; |
---|
| 124 | |
---|
| 125 | G4GPILSelection GetGPILSelection() const{return valueGPILSelection;}; |
---|
| 126 | |
---|
| 127 | private: |
---|
| 128 | // hide default constructor and assignment operator as private |
---|
| 129 | G4IVContinuousDiscreteProcess(); |
---|
| 130 | G4IVContinuousDiscreteProcess & operator=(const G4IVContinuousDiscreteProcess &right); |
---|
| 131 | |
---|
| 132 | protected: |
---|
| 133 | G4PhysicsTable* theNlambdaTable ; |
---|
| 134 | G4PhysicsTable* theInverseNlambdaTable ; |
---|
| 135 | const G4double BIGSTEP ; |
---|
| 136 | }; |
---|
| 137 | // ----------------------------------------- |
---|
| 138 | // inlined function members implementation |
---|
| 139 | // ----------------------------------------- |
---|
| 140 | #include "G4Track.hh" |
---|
| 141 | #include "G4Step.hh" |
---|
| 142 | #include "G4MaterialTable.hh" |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | inline void G4IVContinuousDiscreteProcess:: |
---|
| 146 | SubtractNumberOfInteractionLengthLeft( |
---|
| 147 | G4double |
---|
| 148 | ) |
---|
| 149 | { |
---|
| 150 | // dummy routine |
---|
| 151 | ; |
---|
| 152 | } |
---|
| 153 | |
---|
| 154 | |
---|
| 155 | inline G4VParticleChange* G4IVContinuousDiscreteProcess::PostStepDoIt( |
---|
| 156 | const G4Track& , |
---|
| 157 | const G4Step& |
---|
| 158 | ) |
---|
| 159 | { |
---|
| 160 | // clear NumberOfInteractionLengthLeft |
---|
| 161 | ClearNumberOfInteractionLengthLeft(); |
---|
| 162 | return pParticleChange; |
---|
| 163 | } |
---|
| 164 | |
---|
| 165 | inline G4VParticleChange* G4IVContinuousDiscreteProcess::AlongStepDoIt( |
---|
| 166 | const G4Track& , |
---|
| 167 | const G4Step& |
---|
| 168 | ) |
---|
| 169 | { |
---|
| 170 | // clear NumberOfInteractionLengthLeft |
---|
| 171 | ClearNumberOfInteractionLengthLeft(); |
---|
| 172 | return pParticleChange; |
---|
| 173 | } |
---|
| 174 | |
---|
| 175 | inline G4double G4IVContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength( |
---|
| 176 | const G4Track& track, |
---|
| 177 | G4double previousStepSize, |
---|
| 178 | G4double currentMinimumStep, |
---|
| 179 | G4double& currentSafety, |
---|
| 180 | G4GPILSelection* selection |
---|
| 181 | ) |
---|
| 182 | { |
---|
| 183 | // GPILSelection is set to defaule value of CandidateForSelection |
---|
| 184 | valueGPILSelection = CandidateForSelection; |
---|
| 185 | |
---|
| 186 | // get Step limit proposed by the process |
---|
| 187 | G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety); |
---|
| 188 | |
---|
| 189 | // set return value for G4GPILSelection |
---|
| 190 | *selection = valueGPILSelection; |
---|
| 191 | |
---|
| 192 | if (verboseLevel>1){ |
---|
| 193 | G4cout << "G4IVContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength "; |
---|
| 194 | G4cout << "[ " << GetProcessName() << "]" <<G4endl; |
---|
| 195 | track.GetDynamicParticle()->DumpInfo(); |
---|
| 196 | G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; |
---|
| 197 | G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<G4endl; |
---|
| 198 | } |
---|
| 199 | return steplength ; |
---|
| 200 | } |
---|
| 201 | |
---|
| 202 | #endif |
---|
| 203 | |
---|
| 204 | |
---|
| 205 | |
---|
| 206 | |
---|
| 207 | |
---|
| 208 | |
---|