Geant4 Cross Reference |
>> 1 // This code implementation is the intellectual property of >> 2 // the GEANT4 collaboration. 1 // 3 // 2 // ******************************************* << 4 // By copying, distributing or modifying the Program (or any work 3 // * License and Disclaimer << 5 // based on the Program) you indicate your acceptance of this statement, 4 // * << 6 // and all its terms. 5 // * The Geant4 software is copyright of th << 7 // 6 // * the Geant4 Collaboration. It is provided << 8 // $Id: G4VRestDiscreteProcess.hh,v 1.4 1999/12/15 14:53:42 gunter Exp $ 7 // * conditions of the Geant4 Software License << 9 // GEANT4 tag $Name: geant4-02-00 $ 8 // * LICENSE and available at http://cern.ch/ << 10 // 9 // * include a list of copyright holders. << 11 // 10 // * << 12 // ------------------------------------------------------------ 11 // * Neither the authors of this software syst << 13 // GEANT 4 class header file 12 // * institutes,nor the agencies providing fin << 14 // 13 // * work make any representation or warran << 15 // For information related to this code contact: 14 // * regarding this software system or assum << 16 // CERN, CN Division, ASD group 15 // * use. Please see the license in the file << 17 // 16 // * for the full disclaimer and the limitatio << 18 // Class Description 17 // * << 19 // Abstract class which defines the public behavior of 18 // * This code implementation is the result << 20 // rest + discrete physics interactions. 19 // * technical work of the GEANT4 collaboratio << 21 // 20 // * By using, copying, modifying or distri << 22 // ------------------------------------------------------------ 21 // * any work based on the software) you ag << 23 // New Physics scheme 8 Mar. 1997 H.Kurahige 22 // * use in resulting scientific publicati << 24 // ------------------------------------------------------------ 23 // * acceptance of all terms of the Geant4 Sof << 25 // modified 26 Mar. 1997 H.Kurahige 24 // ******************************************* << 26 // modified 16 Apr. 1997 L.Urban 25 // << 27 // modified 16 Dec. 1997 L.Urban 26 // G4VRestDiscreteProcess << 28 // modified for new ParticleChange 12 Mar. 1998 H.Kurashige 27 // << 29 28 // Class description: << 30 29 // << 31 #ifndef G4VRestDiscreteProcess_h 30 // Abstract class which defines the public beh << 32 #define G4VRestDiscreteProcess_h 1 31 // rest + discrete physics interactions. << 32 << 33 // Authors: << 34 // - 2 December 1995, G.Cosmo - First implemen << 35 // - 8 January 1997, H.Kurashige - New Physics << 36 // ------------------------------------------- << 37 #ifndef G4VRestDiscreteProcess_hh << 38 #define G4VRestDiscreteProcess_hh 1 << 39 33 40 #include "globals.hh" 34 #include "globals.hh" 41 #include "G4ios.hh" 35 #include "G4ios.hh" 42 36 43 #include "G4VProcess.hh" 37 #include "G4VProcess.hh" 44 38 >> 39 45 class G4VRestDiscreteProcess : public G4VProce 40 class G4VRestDiscreteProcess : public G4VProcess 46 { 41 { >> 42 // Abstract class which defines the public behavior of >> 43 // rest + discrete physics interactions. 47 public: 44 public: 48 45 49 G4VRestDiscreteProcess(const G4String& , << 46 G4VRestDiscreteProcess(const G4String& , 50 G4ProcessType aType = fNotDefined); << 47 G4ProcessType aType = fNotDefined ); 51 G4VRestDiscreteProcess(G4VRestDiscreteProc << 48 G4VRestDiscreteProcess(G4VRestDiscreteProcess &); 52 49 53 virtual ~G4VRestDiscreteProcess(); << 50 virtual ~G4VRestDiscreteProcess(); 54 51 55 G4VRestDiscreteProcess& operator=(const G4 << 52 public :// with description 56 << 53 virtual G4double PostStepGetPhysicalInteractionLength( 57 virtual G4double PostStepGetPhysicalIntera << 58 const G4Track& tr 54 const G4Track& track, 59 G4double previousStepSize, << 55 G4double previousStepSize, 60 G4ForceCondition* condition 56 G4ForceCondition* condition 61 ); 57 ); 62 58 63 virtual G4VParticleChange* PostStepDoIt( << 59 virtual G4VParticleChange* PostStepDoIt( 64 const G4Track& , 60 const G4Track& , 65 const G4Step& 61 const G4Step& 66 ); 62 ); 67 63 68 virtual G4double AtRestGetPhysicalInteract << 64 virtual G4double AtRestGetPhysicalInteractionLength( 69 const G4Track& , 65 const G4Track& , 70 G4ForceCondition* 66 G4ForceCondition* 71 ); 67 ); 72 68 73 virtual G4VParticleChange* AtRestDoIt( << 69 virtual G4VParticleChange* AtRestDoIt( 74 const G4Track& , 70 const G4Track& , 75 const G4Step& 71 const G4Step& 76 ); 72 ); 77 73 78 virtual G4double AlongStepGetPhysicalInter << 74 // no operation in AlongStepDoIt >> 75 virtual G4double AlongStepGetPhysicalInteractionLength( 79 const G4Track&, 76 const G4Track&, 80 G4double , 77 G4double , 81 G4double , 78 G4double , 82 G4double& , 79 G4double& , 83 G4GPILSelection* 80 G4GPILSelection* 84 ) { return -1.0; } << 81 ){ return -1.0; }; 85 // No operation in AlongStepDoIt << 86 82 87 virtual G4VParticleChange* AlongStepDoIt( << 83 // no operation in AlongStepDoIt >> 84 virtual G4VParticleChange* AlongStepDoIt( 88 const G4Track& , 85 const G4Track& , 89 const G4Step& 86 const G4Step& 90 ) { return 0; } << 87 ) {return 0;}; 91 // No operation in AlongStepDoIt << 92 88 93 protected: << 89 protected:// with description 94 << 90 virtual G4double GetMeanFreePath(const G4Track& aTrack, 95 virtual G4double GetMeanFreePath(const G4T << 91 G4double previousStepSize, 96 G4double << 92 G4ForceCondition* condition 97 G4ForceCo << 93 )=0; 98 // Calculates from the macroscopic cross << 94 // Calculates from the macroscopic cross section a mean 99 // free path, the value is returned in u << 95 // free path, the value is returned in units of distance. 100 << 96 101 virtual G4double GetMeanLifeTime(const G4T << 97 virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0; 102 G4ForceCo << 98 // Calculates the mean life-time (i.e. for decays) of the 103 // Calculates the mean life-time (i.e. f << 99 // particle at rest due to the occurence of the given process, 104 // particle at rest due to the occurrenc << 100 // or converts the probability of interaction (i.e. for 105 // or converts the probability of intera << 101 // annihilation) into the life-time of the particle for the 106 // annihilation) into the life-time of t << 102 // occurence of the given process. 107 // occurrence of the given process << 108 103 109 private: 104 private: >> 105 // hide default constructor and assignment operator as private >> 106 G4VRestDiscreteProcess(); >> 107 G4VRestDiscreteProcess & operator=(const G4VRestDiscreteProcess &right); 110 108 111 G4VRestDiscreteProcess(); << 112 // Hidden default constructor << 113 }; 109 }; 114 110 >> 111 // ----------------------------------------- >> 112 // inlined function members implementation >> 113 // ----------------------------------------- >> 114 #include "Randomize.hh" >> 115 #include "G4Step.hh" >> 116 #include "G4Track.hh" >> 117 #include "G4MaterialTable.hh" >> 118 #include "G4VParticleChange.hh" >> 119 >> 120 inline >> 121 G4double G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength( >> 122 const G4Track& track, >> 123 G4double previousStepSize, >> 124 G4ForceCondition* condition >> 125 ) >> 126 { >> 127 if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) { >> 128 // beggining of tracking (or just after DoIt of this process) >> 129 ResetNumberOfInteractionLengthLeft(); >> 130 } else { >> 131 // subtract NumberOfInteractionLengthLeft >> 132 SubtractNumberOfInteractionLengthLeft(previousStepSize); >> 133 if(theNumberOfInteractionLengthLeft<perMillion) >> 134 theNumberOfInteractionLengthLeft=0.; >> 135 } >> 136 >> 137 // condition is set to "Not Forced" >> 138 *condition = NotForced; >> 139 >> 140 // get mean free path >> 141 currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition); >> 142 >> 143 #ifdef G4VERBOSE >> 144 if ((currentInteractionLength <=0.0) || (verboseLevel>2)){ >> 145 G4cout << "G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength "; >> 146 G4cout << "[ " << GetProcessName() << "]" <<G4endl; >> 147 track.GetDynamicParticle()->DumpInfo(); >> 148 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; >> 149 G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]" <<G4endl; >> 150 } >> 151 #endif >> 152 >> 153 G4double value = theNumberOfInteractionLengthLeft * currentInteractionLength; >> 154 #ifdef G4VERBOSE >> 155 if (verboseLevel>1){ >> 156 G4cout << "G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength "; >> 157 G4cout << "[ " << GetProcessName() << "]" <<G4endl; >> 158 track.GetDynamicParticle()->DumpInfo(); >> 159 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; >> 160 G4cout << "InteractionLength= " << value/cm <<"[cm] " <<G4endl; >> 161 } 115 #endif 162 #endif >> 163 return value; >> 164 } >> 165 >> 166 inline G4VParticleChange* G4VRestDiscreteProcess::PostStepDoIt( >> 167 const G4Track& , >> 168 const G4Step& >> 169 ) >> 170 { >> 171 // reset NumberOfInteractionLengthLeft >> 172 ClearNumberOfInteractionLengthLeft(); >> 173 >> 174 return pParticleChange; >> 175 } >> 176 >> 177 inline G4double G4VRestDiscreteProcess::AtRestGetPhysicalInteractionLength( >> 178 const G4Track& track, >> 179 G4ForceCondition* condition >> 180 ) >> 181 { >> 182 // beggining of tracking >> 183 ResetNumberOfInteractionLengthLeft(); >> 184 >> 185 // condition is set to "Not Forced" >> 186 *condition = NotForced; >> 187 >> 188 // get mean life time >> 189 currentInteractionLength = GetMeanLifeTime(track, condition); >> 190 >> 191 #ifdef G4VERBOSE >> 192 if ((currentInteractionLength <0.0) || (verboseLevel>2)){ >> 193 G4cout << "G4VRestDiscreteProcess::AtRestGetPhysicalInteractionLength "; >> 194 G4cout << "[ " << GetProcessName() << "]" <<G4endl; >> 195 track.GetDynamicParticle()->DumpInfo(); >> 196 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; >> 197 G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl; >> 198 } >> 199 #endif >> 200 >> 201 return theNumberOfInteractionLengthLeft * currentInteractionLength; >> 202 } >> 203 >> 204 >> 205 inline G4VParticleChange* G4VRestDiscreteProcess::AtRestDoIt( >> 206 const G4Track&, >> 207 const G4Step& >> 208 ) >> 209 { >> 210 // clear NumberOfInteractionLengthLeft >> 211 ClearNumberOfInteractionLengthLeft(); >> 212 >> 213 return pParticleChange; >> 214 } >> 215 >> 216 >> 217 >> 218 #endif >> 219 116 220