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: G4UnknownDecay.hh,v 1.2 2004/12/02 07:06:30 kurasige Exp $ >> 25 // GEANT4 tag $Name: geant4-08-00-patch-01 $ 27 // 26 // 28 // 27 // 29 // ------------------------------------------- 28 // ------------------------------------------------------------ 30 // GEANT 4 class header file 29 // GEANT 4 class header file 31 // 30 // 32 // 31 // 33 #ifndef G4UnknownDecay_h 32 #ifndef G4UnknownDecay_h 34 #define G4UnknownDecay_h 1 33 #define G4UnknownDecay_h 1 35 34 36 #include <CLHEP/Units/PhysicalConstants.h> << 37 << 38 #include "G4ios.hh" 35 #include "G4ios.hh" 39 #include "globals.hh" 36 #include "globals.hh" 40 #include "G4VDiscreteProcess.hh" 37 #include "G4VDiscreteProcess.hh" 41 #include "G4ParticleChangeForDecay.hh" 38 #include "G4ParticleChangeForDecay.hh" 42 39 43 class G4UnknownDecay : public G4VDiscreteProce 40 class G4UnknownDecay : public G4VDiscreteProcess 44 { 41 { 45 // Class Description 42 // Class Description 46 // This class is a decay process for "unkno 43 // This class is a decay process for "unknown" particle. 47 44 48 public: 45 public: 49 // Constructors 46 // Constructors 50 G4UnknownDecay(const G4String& processName 47 G4UnknownDecay(const G4String& processName ="UnknownDecay"); 51 48 52 // Destructor 49 // Destructor 53 virtual ~G4UnknownDecay(); 50 virtual ~G4UnknownDecay(); 54 51 55 private: 52 private: 56 // copy constructor 53 // copy constructor 57 G4UnknownDecay(const G4UnknownDecay &rig 54 G4UnknownDecay(const G4UnknownDecay &right); 58 55 59 // Assignment Operation (generated) 56 // Assignment Operation (generated) 60 G4UnknownDecay & operator=(const G4Unkno 57 G4UnknownDecay & operator=(const G4UnknownDecay &right); 61 58 62 public: //With Description 59 public: //With Description 63 60 64 virtual G4VParticleChange *PostStepDoIt( 61 virtual G4VParticleChange *PostStepDoIt( 65 const G4Track& aTrack, 62 const G4Track& aTrack, 66 const G4Step& aSt 63 const G4Step& aStep 67 ) override; << 64 ); 68 65 69 virtual void BuildPhysicsTable(const G4Pa << 66 virtual void BuildPhysicsTable(const G4ParticleDefinition&); 70 // In G4UnknownDecay, thePhysicsTable sto 67 // In G4UnknownDecay, thePhysicsTable stores values of 71 // beta * std::sqrt( 1 - beta*beta) 68 // beta * std::sqrt( 1 - beta*beta) 72 // as a function of normalized kinetic en 69 // as a function of normalized kinetic enregy (=Ekin/mass), 73 // becasuse this table is universal for a 70 // becasuse this table is universal for all particle types, 74 71 75 72 76 virtual G4bool IsApplicable(const G4Partic << 73 virtual G4bool IsApplicable(const G4ParticleDefinition&); 77 // returns "true" if the decay process can 74 // returns "true" if the decay process can be applied to 78 // the particle type. 75 // the particle type. 79 76 80 virtual void ProcessDescription(std::ostre << 81 // << 82 << 83 protected: // With Description 77 protected: // With Description 84 virtual G4VParticleChange* DecayIt( 78 virtual G4VParticleChange* DecayIt( 85 const G4Track& aTrack, 79 const G4Track& aTrack, 86 const G4Step& aStep 80 const G4Step& aStep 87 ) ; << 81 ); 88 // The DecayIt() method returns by pointer 82 // The DecayIt() method returns by pointer a particle-change object, 89 // which has information of daughter parti 83 // which has information of daughter particles. 90 84 91 public: 85 public: 92 86 93 virtual G4double PostStepGetPhysicalIntera 87 virtual G4double PostStepGetPhysicalInteractionLength( 94 const G4Track& tr 88 const G4Track& track, 95 G4double previo 89 G4double previousStepSize, 96 G4ForceCondition* 90 G4ForceCondition* condition 97 ) override; << 91 ); 98 92 99 93 100 protected: // With Description 94 protected: // With Description 101 // GetMeanFreePath returns ctau*beta*gamma 95 // GetMeanFreePath returns ctau*beta*gamma for decay in flight 102 virtual G4double GetMeanFreePath(const G4T 96 virtual G4double GetMeanFreePath(const G4Track& aTrack, 103 G4double previ 97 G4double previousStepSize, 104 G4ForceCondition 98 G4ForceCondition* condition 105 ) override; << 99 ); >> 100 >> 101 public: >> 102 void SetVerboseLevel(G4int value); >> 103 G4int GetVerboseLevel() const; 106 104 107 private: 105 private: 108 G4int verboseLevel; 106 G4int verboseLevel; 109 // controle flag for output message 107 // controle flag for output message 110 // 0: Silent 108 // 0: Silent 111 // 1: Warning message 109 // 1: Warning message 112 // 2: More 110 // 2: More 113 111 114 private: 112 private: 115 // HighestValue. 113 // HighestValue. 116 const G4double HighestValue; 114 const G4double HighestValue; 117 115 118 // ParticleChange for decay process 116 // ParticleChange for decay process 119 G4ParticleChangeForDecay fParticleChangeFo 117 G4ParticleChangeForDecay fParticleChangeForDecay; 120 118 121 }; 119 }; 122 120 123 inline 121 inline 124 G4double G4UnknownDecay::PostStepGetPhysicalI 122 G4double G4UnknownDecay::PostStepGetPhysicalInteractionLength( 125 const G4Track& tr 123 const G4Track& track, 126 G4double /*prev 124 G4double /*previousStepSize*/, 127 G4ForceCondition* 125 G4ForceCondition* condition 128 ) 126 ) 129 { 127 { 130 // pre-assigned UnknownDecay time 128 // pre-assigned UnknownDecay time 131 G4double pTime = track.GetDynamicParticle()- 129 G4double pTime = track.GetDynamicParticle()->GetPreAssignedDecayProperTime(); 132 130 133 if (pTime < 0.) pTime = DBL_MIN; 131 if (pTime < 0.) pTime = DBL_MIN; 134 132 135 // condition is set to "Not Forced" 133 // condition is set to "Not Forced" 136 *condition = NotForced; 134 *condition = NotForced; 137 135 138 // reminder proper time 136 // reminder proper time 139 G4double remainder = pTime - track.GetProper 137 G4double remainder = pTime - track.GetProperTime(); 140 if (remainder <= 0.0) remainder = DBL_MIN; 138 if (remainder <= 0.0) remainder = DBL_MIN; 141 139 142 // use pre-assigned Decay time to determine 140 // use pre-assigned Decay time to determine PIL 143 //return GetMeanFreePath(track, previousStep 141 //return GetMeanFreePath(track, previousStepSize, condition); 144 return remainder*CLHEP::c_light; << 142 return remainder*c_light; 145 143 146 } 144 } >> 145 >> 146 inline >> 147 void G4UnknownDecay::SetVerboseLevel(G4int value){ verboseLevel = value; } >> 148 >> 149 inline >> 150 G4int G4UnknownDecay::GetVerboseLevel() const { return verboseLevel; } 147 151 148 inline 152 inline 149 G4VParticleChange* G4UnknownDecay::PostStepD 153 G4VParticleChange* G4UnknownDecay::PostStepDoIt( 150 const G4Track& aTrack, 154 const G4Track& aTrack, 151 const G4Step& aStep 155 const G4Step& aStep 152 ) 156 ) 153 { 157 { 154 return DecayIt(aTrack, aStep); 158 return DecayIt(aTrack, aStep); 155 } 159 } 156 160 157 #endif 161 #endif 158 162 159 163 160 164 161 165 162 166 163 167 164 168 165 169 166 170 167 171 168 172