Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // G4VRestContinuousProcess << 27 // 23 // 28 // Class description: << 24 // $Id: G4VRestContinuousProcess.hh,v 1.5 2001/07/11 10:08:18 gunter Exp $ >> 25 // GEANT4 tag $Name: geant4-05-00 $ 29 // 26 // 30 // Abstract class which defines the public beh << 27 // 31 // discrete physics interactions. << 28 // ------------------------------------------------------------ >> 29 // GEANT 4 class header file >> 30 // >> 31 // >> 32 // Class Description >> 33 // Abstract class which defines the public behavior of >> 34 // discrete physics interactions. >> 35 // >> 36 // ------------------------------------------------------------ >> 37 // New Physics scheme 8 Mar. 1997 H.Kurahige >> 38 // ------------------------------------------------------------ >> 39 // modified 26 Mar. 1997 H.Kurahige >> 40 // modified 16 Apr. 1997 L.Urban >> 41 // modified 18 Sep. 1997 H.Kurashige >> 42 // modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige >> 43 // fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige >> 44 // modified for new ParticleChange 12 Mar. 1998 H.Kurashige 32 45 33 // Authors: << 46 #ifndef G4VRestContinuousProcess_h 34 // - 2 December 1995, G.Cosmo - First implemen << 47 #define G4VRestContinuousProcess_h 1 35 // - 8 January 1997, H.Kurashige - New Physics << 36 // ------------------------------------------- << 37 #ifndef G4VRestContinuousProcess_hh << 38 #define G4VRestContinuousProcess_hh 1 << 39 48 40 #include "globals.hh" 49 #include "globals.hh" 41 #include "G4ios.hh" 50 #include "G4ios.hh" 42 51 43 #include "G4VProcess.hh" 52 #include "G4VProcess.hh" 44 53 45 class G4VRestContinuousProcess : public G4VPro 54 class G4VRestContinuousProcess : public G4VProcess 46 { 55 { >> 56 // Abstract class which defines the public behavior of >> 57 // discrete physics interactions. 47 public: 58 public: 48 59 49 G4VRestContinuousProcess(const G4String& , << 60 G4VRestContinuousProcess(const G4String& , 50 G4ProcessType aTy << 61 G4ProcessType aType = fNotDefined ); 51 G4VRestContinuousProcess(G4VRestContinuous << 62 G4VRestContinuousProcess(G4VRestContinuousProcess &); 52 63 53 virtual ~G4VRestContinuousProcess(); << 64 virtual ~G4VRestContinuousProcess(); 54 65 55 G4VRestContinuousProcess& operator=(const << 66 public: // with description 56 67 57 virtual G4double AtRestGetPhysicalInteract << 68 virtual G4double AtRestGetPhysicalInteractionLength( 58 const G4Track& , 69 const G4Track& , 59 G4ForceCondition* << 70 G4ForceCondition* 60 ); << 71 ); 61 72 62 virtual G4VParticleChange* AtRestDoIt( << 73 virtual G4VParticleChange* AtRestDoIt( 63 const G4Track& , << 74 const G4Track& , 64 const G4Step& << 75 const G4Step& 65 ); << 76 ); 66 77 67 virtual G4double AlongStepGetPhysicalInter << 78 virtual G4double AlongStepGetPhysicalInteractionLength( 68 const G4Track& tr 79 const G4Track& track, 69 G4double previous << 80 G4double previousStepSize, 70 G4double currentM << 81 G4double currentMinimumStep, 71 G4double& current << 82 G4double& currentSafety, 72 G4GPILSelection* 83 G4GPILSelection* selection 73 ); << 84 ); 74 85 75 virtual G4VParticleChange* AlongStepDoIt( << 86 virtual G4VParticleChange* AlongStepDoIt( 76 const G4Track& , << 87 const G4Track& , 77 const G4Step& << 88 const G4Step& 78 ); << 89 ); 79 90 80 virtual G4double PostStepGetPhysicalIntera << 91 // no operation in PostStepDoIt >> 92 virtual G4double PostStepGetPhysicalInteractionLength( 81 const G4Track& , 93 const G4Track& , 82 G4double , << 94 G4double , 83 G4ForceCondition* << 95 G4ForceCondition* 84 ) { return -1.0; } << 96 ){ return -1.0; }; 85 // No operation in PostStepDoIt << 97 >> 98 // no operation in PostStepDoIt >> 99 virtual G4VParticleChange* PostStepDoIt( >> 100 const G4Track& , >> 101 const G4Step& >> 102 ) {return 0;}; 86 103 87 virtual G4VParticleChange* PostStepDoIt( << 104 protected: // with description 88 const G4Track& , << 105 virtual G4double GetContinuousStepLimit(const G4Track& aTrack, 89 const G4Step& << 106 G4double previousStepSize, 90 ) { return 0; } << 107 G4double currentMinimumStep, 91 // No operation in PostStepDoIt << 108 G4double& currentSafety >> 109 )=0; >> 110 // This pure virtual function is used to calculate step limit >> 111 // for AlongStep in the derived processes 92 112 93 protected: << 113 private: >> 114 // this is the returnd value of G4GPILSelection in >> 115 // the arguments of AlongStepGPIL() >> 116 G4GPILSelection valueGPILSelection; >> 117 >> 118 protected:// with description >> 119 // these two methods are set/get methods for valueGPILSelection >> 120 void SetGPILSelection(G4GPILSelection selection) >> 121 { valueGPILSelection = selection;}; >> 122 >> 123 G4GPILSelection GetGPILSelection() const{return valueGPILSelection;}; >> 124 >> 125 protected: // with description >> 126 >> 127 virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0; >> 128 // Calculates the mean life-time (i.e. for decays) of the >> 129 // particle at rest due to the occurence of the given process, >> 130 // or converts the probability of interaction (i.e. for >> 131 // annihilation) into the life-time of the particle for the >> 132 // occurence of the given process. 94 133 95 virtual G4double GetContinuousStepLimit(co << 134 private: 96 G4 << 135 // hide default constructor and assignment operator as private 97 G4 << 136 G4VRestContinuousProcess(); 98 G4 << 137 G4VRestContinuousProcess & operator=(const G4VRestContinuousProcess &right); 99 // This pure virtual function is used to << 100 // for AlongStep in the derived processe << 101 << 102 virtual G4double GetMeanLifeTime(const G4T << 103 G4ForceCo << 104 // Calculates the mean life-time (i.e. f << 105 // particle at rest due to the occurrenc << 106 // converts the probability of interacti << 107 // the life-time of the particle for the << 108 138 109 inline void SetGPILSelection(G4GPILSelecti << 139 }; 110 { valueGPILSelection = selection; } << 111 140 112 inline G4GPILSelection GetGPILSelection() << 141 // ----------------------------------------- 113 { return valueGPILSelection; } << 142 // inlined function members implementation >> 143 // ----------------------------------------- >> 144 #include "G4Step.hh" >> 145 #include "G4Track.hh" >> 146 #include "G4MaterialTable.hh" >> 147 #include "G4VParticleChange.hh" >> 148 inline G4double G4VRestContinuousProcess::AlongStepGetPhysicalInteractionLength( >> 149 const G4Track& track, >> 150 G4double previousStepSize, >> 151 G4double currentMinimumStep, >> 152 G4double& currentSafety, >> 153 G4GPILSelection* selection >> 154 ) >> 155 { >> 156 // GPILSelection is set to defaule value of CandidateForSelection >> 157 valueGPILSelection = CandidateForSelection; 114 158 >> 159 // get Step limit proposed by the process >> 160 G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety); 115 161 116 private: << 162 // set return value for G4GPILSelection >> 163 *selection = valueGPILSelection; >> 164 #ifdef G4VERBOSE >> 165 if (verboseLevel>1){ >> 166 G4cout << "G4VRestContinuousProcess::AlongStepGetPhysicalInteractionLength "; >> 167 G4cout << "[ " << GetProcessName() << "]" <<G4endl; >> 168 track.GetDynamicParticle()->DumpInfo(); >> 169 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; >> 170 G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<G4endl; >> 171 } >> 172 #endif >> 173 return steplength ; >> 174 } 117 175 118 G4VRestContinuousProcess(); << 176 inline G4double G4VRestContinuousProcess::AtRestGetPhysicalInteractionLength( 119 // Hidden default constructor << 177 const G4Track& track, >> 178 G4ForceCondition* condition >> 179 ) >> 180 { >> 181 // beggining of tracking >> 182 ResetNumberOfInteractionLengthLeft(); 120 183 121 G4GPILSelection valueGPILSelection = Candi << 184 // condition is set to "Not Forced" 122 // This is the returned value of G4GPIL << 185 *condition = NotForced; 123 // the arguments of AlongStepGPIL() << 186 124 }; << 187 // get mean life time >> 188 currentInteractionLength = GetMeanLifeTime(track, condition); 125 189 >> 190 #ifdef G4VERBOSE >> 191 if ((currentInteractionLength <0.0) || (verboseLevel>2)){ >> 192 G4cout << "G4VRestContinuousProcess::AtRestGetPhysicalInteractionLength "; >> 193 G4cout << "[ " << GetProcessName() << "]" <<G4endl; >> 194 track.GetDynamicParticle()->DumpInfo(); >> 195 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; >> 196 G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl; >> 197 } 126 #endif 198 #endif >> 199 >> 200 return theNumberOfInteractionLengthLeft * currentInteractionLength; >> 201 } >> 202 >> 203 >> 204 inline G4VParticleChange* G4VRestContinuousProcess::AtRestDoIt( >> 205 const G4Track&, >> 206 const G4Step& >> 207 ) >> 208 { >> 209 // clear NumberOfInteractionLengthLeft >> 210 ClearNumberOfInteractionLengthLeft(); >> 211 >> 212 return pParticleChange; >> 213 } >> 214 >> 215 inline G4VParticleChange* G4VRestContinuousProcess::AlongStepDoIt( >> 216 const G4Track& , >> 217 const G4Step& >> 218 ) >> 219 { >> 220 return pParticleChange; >> 221 } >> 222 >> 223 #endif >> 224 >> 225 >> 226 >> 227 >> 228 >> 229 127 230