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 // 23 // >> 24 // $Id: G4Decay.hh,v 1.6.2.2 2001/06/28 20:19:17 gunter Exp $ >> 25 // GEANT4 tag $Name: $ 27 // 26 // 28 // 27 // 29 // ------------------------------------------- 28 // ------------------------------------------------------------ 30 // GEANT 4 class header file 29 // GEANT 4 class header file 31 // 30 // 32 // History: first implementation, based o 31 // History: first implementation, based on object model of 33 // 7 July 1996 H.Kurashige 32 // 7 July 1996 H.Kurashige 34 // ------------------------------------------- 33 // ------------------------------------------------------------ 35 // New Physics scheme 18 Jan. 1997 34 // New Physics scheme 18 Jan. 1997 H.Kurahige 36 // ------------------------------------------- 35 // ------------------------------------------------------------ 37 // modified 4 Feb. 1997 36 // modified 4 Feb. 1997 H.Kurahige 38 // modified 8 Sep. 1997 37 // modified 8 Sep. 1997 H.Kurahige 39 // remove BuildPhysicsTable() 27 Nov. 1997 38 // remove BuildPhysicsTable() 27 Nov. 1997 H.Kurashige 40 // modified for new ParticleChange 12 Mar. 1 39 // modified for new ParticleChange 12 Mar. 1998 H.Kurashige 41 // added aPhysicsTable 2 Aug. 1998 40 // added aPhysicsTable 2 Aug. 1998 H.Kurashige 42 // PreAssignedDecayTime 18 Jan. 2001 41 // PreAssignedDecayTime 18 Jan. 2001 H.Kurashige 43 // Add External Decayer 23 Feb. 2001 42 // Add External Decayer 23 Feb. 2001 H.Kurashige 44 // Remove PhysicsTable 12 Feb. 2002 << 43 // 45 // Fixed bug in PostStepGPIL << 46 // in case of stopping during AlongStepDoIt << 47 // Add GetRemainderLifeTime 10 Aug/2004 H.K << 48 // Add DaughterPolarization 23 July 2008 << 49 << 50 << 51 #ifndef G4Decay_h 44 #ifndef G4Decay_h 52 #define G4Decay_h 1 45 #define G4Decay_h 1 53 46 54 #include "G4ios.hh" 47 #include "G4ios.hh" 55 #include "globals.hh" 48 #include "globals.hh" 56 #include "G4VRestDiscreteProcess.hh" 49 #include "G4VRestDiscreteProcess.hh" 57 #include "G4ParticleChangeForDecay.hh" 50 #include "G4ParticleChangeForDecay.hh" 58 #include "G4DecayProcessType.hh" << 59 << 60 class G4VExtDecayer; 51 class G4VExtDecayer; 61 52 62 class G4Decay : public G4VRestDiscreteProcess 53 class G4Decay : public G4VRestDiscreteProcess 63 { 54 { 64 // Class Description 55 // Class Description 65 // This class is a decay process 56 // This class is a decay process 66 57 67 public: 58 public: 68 // Constructors 59 // Constructors 69 G4Decay(const G4String& processName ="Deca 60 G4Decay(const G4String& processName ="Decay"); 70 61 71 // Destructor 62 // Destructor 72 virtual ~G4Decay(); 63 virtual ~G4Decay(); 73 64 74 private: 65 private: 75 // copy constructor 66 // copy constructor 76 G4Decay(const G4Decay &right); 67 G4Decay(const G4Decay &right); 77 68 78 // Assignment Operation (generated) 69 // Assignment Operation (generated) 79 G4Decay & operator=(const G4Decay &right 70 G4Decay & operator=(const G4Decay &right); 80 71 81 public: //With Description 72 public: //With Description 82 // G4Decay Process has both 73 // G4Decay Process has both 83 // PostStepDoIt (for decay in flight) 74 // PostStepDoIt (for decay in flight) 84 // and 75 // and 85 // AtRestDoIt (for decay at rest) 76 // AtRestDoIt (for decay at rest) 86 77 87 virtual G4VParticleChange *PostStepDoIt( 78 virtual G4VParticleChange *PostStepDoIt( 88 const G4Track& aTrack, 79 const G4Track& aTrack, 89 const G4Step& aSt 80 const G4Step& aStep 90 ) override; << 81 ); 91 82 92 virtual G4VParticleChange* AtRestDoIt( 83 virtual G4VParticleChange* AtRestDoIt( 93 const G4Track& aTrack, 84 const G4Track& aTrack, 94 const G4Step& aStep 85 const G4Step& aStep 95 ) override; << 86 ); 96 87 97 virtual void BuildPhysicsTable(const G4Pa << 88 virtual void BuildPhysicsTable(const G4ParticleDefinition&); 98 // In G4Decay, thePhysicsTable stores val 89 // In G4Decay, thePhysicsTable stores values of 99 // beta * std::sqrt( 1 - beta*beta) << 90 // beta * sqrt( 1 - beta*beta) 100 // as a function of normalized kinetic en 91 // as a function of normalized kinetic enregy (=Ekin/mass), 101 // becasuse this table is universal for a 92 // becasuse this table is universal for all particle types, 102 93 103 94 104 virtual G4bool IsApplicable(const G4Partic << 95 virtual G4bool IsApplicable(const G4ParticleDefinition&); 105 // returns "true" if the decay process can 96 // returns "true" if the decay process can be applied to 106 // the particle type. 97 // the particle type. 107 98 108 protected: // With Description 99 protected: // With Description 109 virtual G4VParticleChange* DecayIt( 100 virtual G4VParticleChange* DecayIt( 110 const G4Track& aTrack, 101 const G4Track& aTrack, 111 const G4Step& aStep 102 const G4Step& aStep 112 ); 103 ); 113 // The DecayIt() method returns by pointer 104 // The DecayIt() method returns by pointer a particle-change object, 114 // which has information of daughter parti 105 // which has information of daughter particles. 115 106 116 // Set daughter polarization << 107 public: 117 // NO OPERATION in the base class of G4De << 118 virtual void DaughterPolarization(const G4 << 119 G4DecayProducts* products); << 120 << 121 public: << 122 virtual G4double AtRestGetPhysicalInteract 108 virtual G4double AtRestGetPhysicalInteractionLength( 123 const G4Track& tr 109 const G4Track& track, 124 G4ForceCondition* 110 G4ForceCondition* condition 125 ) override; << 111 ); 126 112 127 virtual G4double PostStepGetPhysicalIntera 113 virtual G4double PostStepGetPhysicalInteractionLength( 128 const G4Track& tr 114 const G4Track& track, 129 G4double previo 115 G4double previousStepSize, 130 G4ForceCondition* 116 G4ForceCondition* condition 131 ) override; << 117 ); >> 118 132 119 133 protected: // With Description 120 protected: // With Description 134 // GetMeanFreePath returns ctau*beta*gamma 121 // GetMeanFreePath returns ctau*beta*gamma for decay in flight 135 // GetMeanLifeTime returns ctau for decay 122 // GetMeanLifeTime returns ctau for decay at rest 136 virtual G4double GetMeanFreePath(const G4T 123 virtual G4double GetMeanFreePath(const G4Track& aTrack, 137 G4double previ 124 G4double previousStepSize, 138 G4ForceCondition 125 G4ForceCondition* condition 139 ) override; << 126 ); 140 127 141 virtual G4double GetMeanLifeTime(const G4T 128 virtual G4double GetMeanLifeTime(const G4Track& aTrack, 142 G4ForceCondition 129 G4ForceCondition* condition 143 ) override; << 130 ); 144 << 145 public: //With Description << 146 virtual void StartTracking(G4Track*) over << 147 virtual void EndTracking() override; << 148 // inform Start/End of tracking for each << 149 131 150 public: //With Description << 132 public: //With Description 151 void SetExtDecayer(G4VExtDecayer*); 133 void SetExtDecayer(G4VExtDecayer*); 152 const G4VExtDecayer* GetExtDecayer() cons 134 const G4VExtDecayer* GetExtDecayer() const; 153 // Set/Get External Decayer 135 // Set/Get External Decayer 154 << 136 155 G4double GetRemainderLifeTime() const; << 137 public: 156 //Get Remainder of life time at rest decay << 138 void SetVerboseLevel(G4int value); 157 << 139 G4int GetVerboseLevel() const; 158 virtual void ProcessDescription(std::ostre << 159 // << 160 140 161 protected: << 141 private: 162 G4int verboseLevel; 142 G4int verboseLevel; 163 // controle flag for output message 143 // controle flag for output message 164 // 0: Silent 144 // 0: Silent 165 // 1: Warning message 145 // 1: Warning message 166 // 2: More 146 // 2: More 167 147 168 protected: << 148 private: 169 // HighestValue. << 149 // In G4Decay, thePhysicsTable stores values of 170 const G4double HighestValue; << 150 // beta * sqrt( 1 - beta*beta) >> 151 // as a function of normalized kinetic enregy (=Ekin/mass) >> 152 // TotBin = number of bins in thePhysicsTable >> 153 // The PhysicsTable is created for the range of >> 154 // from LowestBinValue to HighestBinValue. >> 155 const G4double LowestBinValue; >> 156 const G4double HighestBinValue; >> 157 const G4int TotBin; >> 158 >> 159 G4PhysicsTable* aPhysicsTable; 171 160 172 // Remainder of life time at rest 161 // Remainder of life time at rest 173 G4double fRemainderLifeTim 162 G4double fRemainderLifeTime; 174 << 163 175 // ParticleChange for decay process 164 // ParticleChange for decay process 176 G4ParticleChangeForDecay fParticleChangeFo 165 G4ParticleChangeForDecay fParticleChangeForDecay; 177 166 178 // External Decayer 167 // External Decayer 179 G4VExtDecayer* pExtDecayer; 168 G4VExtDecayer* pExtDecayer; 180 }; 169 }; 181 170 >> 171 inline G4double G4Decay::PostStepGetPhysicalInteractionLength( >> 172 const G4Track& track, >> 173 G4double previousStepSize, >> 174 G4ForceCondition* condition >> 175 ) >> 176 { >> 177 // pre-assigned Decay time >> 178 G4double pTime = track.GetDynamicParticle()->GetPreAssignedDecayProperTime(); >> 179 >> 180 if (pTime < 0.) { >> 181 // normal case >> 182 return G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength(track, previousStepSize, condition); >> 183 } >> 184 >> 185 // condition is set to "Not Forced" >> 186 *condition = NotForced; >> 187 >> 188 // reminder proper time >> 189 fRemainderLifeTime = pTime - track.GetProperTime(); >> 190 if (fRemainderLifeTime <= 0.0) fRemainderLifeTime = DBL_MIN; >> 191 >> 192 // use pre-assigned Decay time to determine PIL >> 193 G4double tau = track.GetDefinition()->GetPDGLifeTime(); >> 194 return (fRemainderLifeTime/tau)*GetMeanFreePath(track, previousStepSize, condition); >> 195 >> 196 } >> 197 inline >> 198 G4double G4Decay::AtRestGetPhysicalInteractionLength( >> 199 const G4Track& track, >> 200 G4ForceCondition* condition >> 201 ) >> 202 { >> 203 G4double pTime = track.GetDynamicParticle()->GetPreAssignedDecayProperTime(); >> 204 if (pTime >= 0.) { >> 205 fRemainderLifeTime = pTime - track.GetProperTime(); >> 206 if (fRemainderLifeTime <= 0.0) fRemainderLifeTime = DBL_MIN; >> 207 } else { >> 208 fRemainderLifeTime = >> 209 G4VRestDiscreteProcess::AtRestGetPhysicalInteractionLength(track, condition ); >> 210 } >> 211 return fRemainderLifeTime; >> 212 } >> 213 >> 214 inline >> 215 void G4Decay::SetVerboseLevel(G4int value){ verboseLevel = value; } >> 216 >> 217 inline >> 218 G4int G4Decay::GetVerboseLevel() const { return verboseLevel; } >> 219 182 inline 220 inline 183 G4VParticleChange* G4Decay::AtRestDoIt( 221 G4VParticleChange* G4Decay::AtRestDoIt( 184 const G4Track& aTrack, 222 const G4Track& aTrack, 185 const G4Step& aStep 223 const G4Step& aStep 186 ) 224 ) 187 { 225 { 188 return DecayIt(aTrack, aStep); 226 return DecayIt(aTrack, aStep); 189 } 227 } 190 228 >> 229 inline >> 230 G4VParticleChange* G4Decay::PostStepDoIt( >> 231 const G4Track& aTrack, >> 232 const G4Step& aStep >> 233 ) >> 234 { >> 235 return DecayIt(aTrack, aStep); >> 236 } 191 237 192 inline 238 inline 193 const G4VExtDecayer* G4Decay::GetExtDecayer() << 239 void G4Decay::SetExtDecayer(G4VExtDecayer* val) 194 { 240 { 195 return pExtDecayer; << 241 pExtDecayer = val; 196 } 242 } 197 243 198 inline 244 inline 199 G4double G4Decay::GetRemainderLifeTime() cons << 245 const G4VExtDecayer* G4Decay::GetExtDecayer() const 200 { 246 { 201 return fRemainderLifeTime; << 247 return pExtDecayer; 202 } 248 } 203 249 204 #endif 250 #endif 205 251 206 252 207 253 208 254 209 255 210 256 211 257 212 258 213 259 214 260 215 261