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 << 6 // * the Geant4 Collaboration. It is provided << 7 // * conditions of the Geant4 Software License << 8 // * LICENSE and available at http://cern.ch/ << 9 // * include a list of copyright holders. << 10 // * << 11 // * Neither the authors of this software syst << 12 // * institutes,nor the agencies providing fin << 13 // * work make any representation or warran << 14 // * regarding this software system or assum << 15 // * use. Please see the license in the file << 16 // * for the full disclaimer and the limitatio << 17 // * << 18 // * This code implementation is the result << 19 // * technical work of the GEANT4 collaboratio << 20 // * By using, copying, modifying or distri << 21 // * any work based on the software) you ag << 22 // * use in resulting scientific publicati << 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* << 25 // << 26 // 7 // >> 8 // $Id: G4Decay.hh,v 1.2.8.1 1999/12/07 20:50:16 gunter Exp $ >> 9 // GEANT4 tag $Name: geant4-01-01 $ 27 // 10 // 28 // 11 // 29 // ------------------------------------------- 12 // ------------------------------------------------------------ 30 // GEANT 4 class header file 13 // GEANT 4 class header file 31 // 14 // >> 15 // For information related to this code contact: >> 16 // CERN, CN Division, ASD group 32 // History: first implementation, based o 17 // History: first implementation, based on object model of 33 // 7 July 1996 H.Kurashige 18 // 7 July 1996 H.Kurashige 34 // ------------------------------------------- 19 // ------------------------------------------------------------ 35 // New Physics scheme 18 Jan. 1997 20 // New Physics scheme 18 Jan. 1997 H.Kurahige 36 // ------------------------------------------- 21 // ------------------------------------------------------------ 37 // modified 4 Feb. 1997 22 // modified 4 Feb. 1997 H.Kurahige 38 // modified 8 Sep. 1997 23 // modified 8 Sep. 1997 H.Kurahige 39 // remove BuildPhysicsTable() 27 Nov. 1997 24 // remove BuildPhysicsTable() 27 Nov. 1997 H.Kurashige 40 // modified for new ParticleChange 12 Mar. 1 25 // modified for new ParticleChange 12 Mar. 1998 H.Kurashige 41 // added aPhysicsTable 2 Aug. 1998 26 // added aPhysicsTable 2 Aug. 1998 H.Kurashige 42 // PreAssignedDecayTime 18 Jan. 2001 << 43 // Add External Decayer 23 Feb. 2001 << 44 // Remove PhysicsTable 12 Feb. 2002 << 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 27 51 #ifndef G4Decay_h 28 #ifndef G4Decay_h 52 #define G4Decay_h 1 29 #define G4Decay_h 1 53 30 54 #include "G4ios.hh" 31 #include "G4ios.hh" 55 #include "globals.hh" 32 #include "globals.hh" 56 #include "G4VRestDiscreteProcess.hh" 33 #include "G4VRestDiscreteProcess.hh" 57 #include "G4ParticleChangeForDecay.hh" 34 #include "G4ParticleChangeForDecay.hh" 58 #include "G4DecayProcessType.hh" << 59 << 60 class G4VExtDecayer; << 61 35 62 class G4Decay : public G4VRestDiscreteProcess 36 class G4Decay : public G4VRestDiscreteProcess 63 { 37 { 64 // Class Description << 65 // This class is a decay process << 66 << 67 public: 38 public: 68 // Constructors 39 // Constructors 69 G4Decay(const G4String& processName ="Deca 40 G4Decay(const G4String& processName ="Decay"); 70 41 71 // Destructor 42 // Destructor 72 virtual ~G4Decay(); 43 virtual ~G4Decay(); 73 44 74 private: 45 private: 75 // copy constructor 46 // copy constructor 76 G4Decay(const G4Decay &right); 47 G4Decay(const G4Decay &right); 77 48 78 // Assignment Operation (generated) 49 // Assignment Operation (generated) 79 G4Decay & operator=(const G4Decay &right 50 G4Decay & operator=(const G4Decay &right); 80 51 81 public: //With Description << 52 public: 82 // G4Decay Process has both 53 // G4Decay Process has both 83 // PostStepDoIt (for decay in flight) 54 // PostStepDoIt (for decay in flight) 84 // and 55 // and 85 // AtRestDoIt (for decay at rest) 56 // AtRestDoIt (for decay at rest) 86 57 87 virtual G4VParticleChange *PostStepDoIt( 58 virtual G4VParticleChange *PostStepDoIt( 88 const G4Track& aTrack, 59 const G4Track& aTrack, 89 const G4Step& aSt 60 const G4Step& aStep 90 ) override; << 61 ); 91 62 92 virtual G4VParticleChange* AtRestDoIt( 63 virtual G4VParticleChange* AtRestDoIt( 93 const G4Track& aTrack, 64 const G4Track& aTrack, 94 const G4Step& aStep 65 const G4Step& aStep 95 ) override; << 66 ); 96 67 97 virtual void BuildPhysicsTable(const G4Pa << 68 virtual void BuildPhysicsTable(const G4ParticleDefinition&); 98 // In G4Decay, thePhysicsTable stores val 69 // In G4Decay, thePhysicsTable stores values of 99 // beta * std::sqrt( 1 - beta*beta) << 70 // beta * sqrt( 1 - beta*beta) 100 // as a function of normalized kinetic en 71 // as a function of normalized kinetic enregy (=Ekin/mass), 101 // becasuse this table is universal for a 72 // becasuse this table is universal for all particle types, 102 73 103 74 104 virtual G4bool IsApplicable(const G4Partic << 75 virtual G4bool IsApplicable(const G4ParticleDefinition&); 105 // returns "true" if the decay process can 76 // returns "true" if the decay process can be applied to 106 // the particle type. 77 // the particle type. 107 78 108 protected: // With Description << 79 protected: 109 virtual G4VParticleChange* DecayIt( 80 virtual G4VParticleChange* DecayIt( 110 const G4Track& aTrack, 81 const G4Track& aTrack, 111 const G4Step& aStep 82 const G4Step& aStep 112 ); 83 ); 113 // The DecayIt() method returns by pointer 84 // The DecayIt() method returns by pointer a particle-change object, 114 // which has information of daughter parti 85 // which has information of daughter particles. 115 86 116 // Set daughter polarization << 87 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 88 virtual G4double AtRestGetPhysicalInteractionLength( 123 const G4Track& tr 89 const G4Track& track, 124 G4ForceCondition* 90 G4ForceCondition* condition 125 ) override; << 91 ); 126 << 127 virtual G4double PostStepGetPhysicalIntera << 128 const G4Track& tr << 129 G4double previo << 130 G4ForceCondition* << 131 ) override; << 132 92 133 protected: // With Description << 93 protected: 134 // GetMeanFreePath returns ctau*beta*gamma 94 // GetMeanFreePath returns ctau*beta*gamma for decay in flight 135 // GetMeanLifeTime returns ctau for decay 95 // GetMeanLifeTime returns ctau for decay at rest 136 virtual G4double GetMeanFreePath(const G4T 96 virtual G4double GetMeanFreePath(const G4Track& aTrack, 137 G4double previ 97 G4double previousStepSize, 138 G4ForceCondition 98 G4ForceCondition* condition 139 ) override; << 99 ); 140 100 141 virtual G4double GetMeanLifeTime(const G4T 101 virtual G4double GetMeanLifeTime(const G4Track& aTrack, 142 G4ForceCondition 102 G4ForceCondition* condition 143 ) override; << 103 ); 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 << 150 public: //With Description << 151 void SetExtDecayer(G4VExtDecayer*); << 152 const G4VExtDecayer* GetExtDecayer() cons << 153 // Set/Get External Decayer << 154 << 155 G4double GetRemainderLifeTime() const; << 156 //Get Remainder of life time at rest decay << 157 104 158 virtual void ProcessDescription(std::ostre << 105 public: 159 // << 106 void SetVerboseLevel(G4int value); >> 107 G4int GetVerboseLevel() const; 160 108 161 protected: << 109 private: 162 G4int verboseLevel; 110 G4int verboseLevel; 163 // controle flag for output message 111 // controle flag for output message 164 // 0: Silent 112 // 0: Silent 165 // 1: Warning message 113 // 1: Warning message 166 // 2: More 114 // 2: More 167 115 168 protected: << 116 private: 169 // HighestValue. << 117 // In G4Decay, thePhysicsTable stores values of 170 const G4double HighestValue; << 118 // beta * sqrt( 1 - beta*beta) >> 119 // as a function of normalized kinetic enregy (=Ekin/mass) >> 120 // TotBin = number of bins in thePhysicsTable >> 121 // The PhysicsTable is created for the range of >> 122 // from LowestBinValue to HighestBinValue. >> 123 const G4double LowestBinValue; >> 124 const G4double HighestBinValue; >> 125 const G4int TotBin; >> 126 >> 127 G4PhysicsTable* aPhysicsTable; 171 128 172 // Remainder of life time at rest 129 // Remainder of life time at rest 173 G4double fRemainderLifeTim 130 G4double fRemainderLifeTime; 174 << 131 175 // ParticleChange for decay process 132 // ParticleChange for decay process 176 G4ParticleChangeForDecay fParticleChangeFo 133 G4ParticleChangeForDecay fParticleChangeForDecay; 177 << 178 // External Decayer << 179 G4VExtDecayer* pExtDecayer; << 180 }; 134 }; 181 135 >> 136 inline >> 137 G4double G4Decay::AtRestGetPhysicalInteractionLength( >> 138 const G4Track& track, >> 139 G4ForceCondition* condition >> 140 ) >> 141 { >> 142 fRemainderLifeTime = >> 143 G4VRestDiscreteProcess::AtRestGetPhysicalInteractionLength( >> 144 track, condition ); >> 145 return fRemainderLifeTime; >> 146 } >> 147 >> 148 inline >> 149 void G4Decay::SetVerboseLevel(G4int value){ verboseLevel = value; } >> 150 >> 151 inline >> 152 G4int G4Decay::GetVerboseLevel() const { return verboseLevel; } >> 153 182 inline 154 inline 183 G4VParticleChange* G4Decay::AtRestDoIt( 155 G4VParticleChange* G4Decay::AtRestDoIt( 184 const G4Track& aTrack, 156 const G4Track& aTrack, 185 const G4Step& aStep 157 const G4Step& aStep 186 ) 158 ) 187 { 159 { 188 return DecayIt(aTrack, aStep); 160 return DecayIt(aTrack, aStep); 189 } 161 } 190 162 191 << 163 inline 192 inline << 164 G4VParticleChange* G4Decay::PostStepDoIt( 193 const G4VExtDecayer* G4Decay::GetExtDecayer() << 165 const G4Track& aTrack, >> 166 const G4Step& aStep >> 167 ) 194 { 168 { 195 return pExtDecayer; << 169 return DecayIt(aTrack, aStep); 196 } 170 } 197 171 198 inline << 199 G4double G4Decay::GetRemainderLifeTime() cons << 200 { << 201 return fRemainderLifeTime; << 202 } << 203 172 204 #endif 173 #endif 205 174 206 175 207 176 208 177 209 178 210 179 211 180 212 181 213 182 214 183 215 184