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: G4StepPoint.hh,v 1.4 1999/11/07 16:32:02 kurasige Exp $ 7 // * conditions of the Geant4 Software License << 9 // GEANT4 tag $Name: geant4-01-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 // 12 // * institutes,nor the agencies providing fin << 14 // G4StepPoint.hh 13 // * work make any representation or warran << 15 // 14 // * regarding this software system or assum << 16 // Class Description: 15 // * use. Please see the license in the file << 17 // This class represents information associated with the 16 // * for the full disclaimer and the limitatio << 18 // each end of a Step like the space/time data of the 17 // * << 19 // particle. 18 // * This code implementation is the result << 20 // 19 // * technical work of the GEANT4 collaboratio << 21 // Contact: 20 // * By using, copying, modifying or distri << 22 // Questions and comments to this code should be sent to 21 // * any work based on the software) you ag << 23 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp) 22 // * use in resulting scientific publicati << 24 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp) 23 // * acceptance of all terms of the Geant4 Sof << 25 // 24 // ******************************************* << 26 // --------------------------------------------------------------- 25 // << 27 26 // G4StepPoint << 28 #ifndef G4StepPoint_h 27 // << 29 #define G4StepPoint_h 1 28 // Class description: << 30 29 // << 31 #include "globals.hh" // Include from 'global' 30 // This class represents information associate << 32 #include "G4Allocator.hh" // Include from 'global' 31 // of a Step like the space/time data of the p << 33 #include "G4ThreeVector.hh" // Include from 'geometry' 32 << 34 #include "G4VPhysicalVolume.hh" // Include from 'geometry' 33 // Author: Hisaya Kurashige, 16 February 2000 << 35 class G4VProcess; 34 // ------------------------------------------- << 35 #ifndef G4StepPoint_hh << 36 #define G4StepPoint_hh 1 << 37 << 38 #include <cmath> // Include from 'system' << 39 #include <CLHEP/Units/PhysicalConstants.h> << 40 << 41 #include "globals.hh" // Include fr << 42 #include "G4Allocator.hh" // Include fr << 43 #include "G4ThreeVector.hh" // Include fr << 44 #include "G4VPhysicalVolume.hh" // Include fr << 45 #include "G4SteppingControl.hh" 36 #include "G4SteppingControl.hh" 46 #include "G4StepStatus.hh" // Include fr << 37 #include "G4StepStatus.hh" // Include from 'track' 47 #include "G4TouchableHandle.hh" // Include fr << 38 #include "G4VTouchable.hh" // Include from 'geometry' 48 #include "G4Material.hh" 39 #include "G4Material.hh" 49 #include "G4LogicalVolume.hh" 40 #include "G4LogicalVolume.hh" 50 41 51 class G4VProcess; << 42 ///////////////// 52 class G4MaterialCutsCouple; << 53 class G4VSensitiveDetector; << 54 << 55 class G4StepPoint 43 class G4StepPoint >> 44 ///////////////// 56 { 45 { 57 public: << 58 << 59 G4StepPoint() = default; << 60 ~G4StepPoint()= default; << 61 // Constructor/Destructor << 62 << 63 G4StepPoint(const G4StepPoint&) = default; << 64 G4StepPoint& operator=(const G4StepPoint&) << 65 // Copy Constructor and assignment opera << 66 << 67 inline const G4ThreeVector& GetPosition() << 68 inline void SetPosition(const G4ThreeVecto << 69 inline void AddPosition(const G4ThreeVecto << 70 // Position << 71 << 72 inline G4double GetLocalTime() const; << 73 inline void SetLocalTime(const G4double aV << 74 inline void AddLocalTime(const G4double aV << 75 // Time since the track is created << 76 << 77 inline G4double GetGlobalTime() const; << 78 inline void SetGlobalTime(const G4double a << 79 inline void AddGlobalTime(const G4double a << 80 // Time since the event in which the tra << 81 << 82 inline G4double GetProperTime() const; << 83 inline void SetProperTime(const G4double a << 84 inline void AddProperTime(const G4double a << 85 // Proper time of the particle << 86 << 87 inline const G4ThreeVector& GetMomentumDir << 88 inline void SetMomentumDirection(const G4T << 89 inline void AddMomentumDirection(const G4T << 90 // Direction of momentum (should be an << 91 46 92 inline G4ThreeVector GetMomentum() const; << 47 //-------- 93 // Total momentum of the track << 48 public: 94 49 95 inline G4double GetTotalEnergy() const; << 96 // Total energy of the track << 97 50 98 inline G4double GetKineticEnergy() const; << 51 // Constructor/Destructor 99 inline void SetKineticEnergy(const G4doubl << 52 G4StepPoint(); 100 inline void AddKineticEnergy(const G4doubl << 53 ~G4StepPoint(); 101 // Kinetic Energy of the track << 54 102 << 55 //-------- 103 inline G4double GetVelocity() const; << 56 public: // with description 104 inline void SetVelocity(G4double v); << 57 105 // Velocity << 58 // Get/Set functions 106 << 59 inline const G4ThreeVector& GetPosition() const 107 inline G4double GetBeta() const; << 60 { return fPosition; } 108 // Velocity of the track in unit of c(li << 61 inline void SetPosition(const G4ThreeVector& aValue) 109 << 62 { fPosition = aValue; } 110 inline G4double GetGamma() const; << 63 inline void AddPosition(const G4ThreeVector& aValue) 111 // Gamma factor (1/sqrt[1-beta*beta]) of << 64 { fPosition += aValue; } 112 << 65 // Position where the track locates 113 inline G4VPhysicalVolume* GetPhysicalVolum << 66 114 << 67 inline G4double GetLocalTime() const 115 inline const G4VTouchable* GetTouchable() << 68 { return fLocalTime; } 116 inline const G4TouchableHandle& GetTouchab << 69 inline void SetLocalTime(const G4double aValue) 117 inline void SetTouchableHandle(const G4Tou << 70 { fLocalTime = aValue; } 118 << 71 inline void AddLocalTime(const G4double aValue) 119 inline G4Material* GetMaterial() const; << 72 { fLocalTime += aValue; } 120 inline void SetMaterial(G4Material*); << 73 // Time since the track is created. 121 << 74 122 inline const G4MaterialCutsCouple* GetMate << 75 inline G4double GetGlobalTime() const 123 inline void SetMaterialCutsCouple(const G4 << 76 { return fGlobalTime; } 124 << 77 inline void SetGlobalTime(const G4double aValue) 125 inline G4VSensitiveDetector* GetSensitiveD << 78 { fGlobalTime = aValue; } 126 inline void SetSensitiveDetector(G4VSensit << 79 inline void AddGlobalTime(const G4double aValue) 127 << 80 { fGlobalTime += aValue; } 128 inline G4double GetSafety() const; << 81 // Time since the event in which the track belongs is created. 129 inline void SetSafety(const G4double aValu << 82 130 << 83 inline G4double GetProperTime() const 131 inline const G4ThreeVector& GetPolarizatio << 84 { return fProperTime; } 132 inline void SetPolarization(const G4ThreeV << 85 inline void SetProperTime(const G4double aValue) 133 inline void AddPolarization(const G4ThreeV << 86 { fProperTime = aValue; } 134 << 87 inline void AddProperTime(const G4double aValue) 135 inline G4StepStatus GetStepStatus() const; << 88 { fProperTime += aValue; } 136 inline void SetStepStatus(const G4StepStat << 89 // Proper time of the particle. 137 << 90 138 inline const G4VProcess* GetProcessDefined << 91 inline const G4ThreeVector& GetMomentumDirection() const 139 // If the pointer is 0, this means the S << 92 { return fMomentumDirection; } 140 // by the user defined limit in the curr << 93 inline void SetMomentumDirection(const G4ThreeVector& aValue) 141 inline void SetProcessDefinedStep(const G4 << 94 { fMomentumDirection = aValue; 142 << 95 } 143 inline G4double GetMass() const; << 96 inline void AddMomentumDirection(const G4ThreeVector& aValue) 144 inline void SetMass(G4double value); << 97 { fMomentumDirection += aValue; 145 << 98 } 146 inline G4double GetCharge() const; << 99 // Direction of momentum (should be an unit vector) 147 inline void SetCharge(G4double value); << 100 148 << 101 inline G4ThreeVector GetMomentum() const 149 inline G4double GetMagneticMoment() const; << 102 { 150 inline void SetMagneticMoment(G4double val << 103 G4double tMomentum = sqrt(fKineticEnergy*fKineticEnergy + 151 << 104 2*fKineticEnergy*fMass); 152 inline void SetWeight(G4double aValue); << 105 return G4ThreeVector(fMomentumDirection.x()*tMomentum, 153 inline G4double GetWeight() const; << 106 fMomentumDirection.y()*tMomentum, 154 << 107 fMomentumDirection.z()*tMomentum); 155 private: << 108 } 156 << 109 // Total momentum of the track 157 G4ThreeVector fPosition; << 110 158 G4double fGlobalTime = 0.0; << 111 inline G4double GetTotalEnergy() const >> 112 { >> 113 return fKineticEnergy + fMass; >> 114 } >> 115 // Total energy of the track >> 116 >> 117 inline G4double GetKineticEnergy() const >> 118 { return fKineticEnergy; } >> 119 inline void SetKineticEnergy(const G4double aValue) >> 120 { fKineticEnergy = aValue; } >> 121 inline void AddKineticEnergy(const G4double aValue) >> 122 { fKineticEnergy += aValue; } >> 123 // Kinetic Energy of the track >> 124 >> 125 inline G4double GetVelocity() const >> 126 { >> 127 if(fMass==0.){ >> 128 return c_light; >> 129 } >> 130 else{ >> 131 G4double tMomentum = sqrt(fKineticEnergy*fKineticEnergy + >> 132 2.0*fKineticEnergy*fMass); >> 133 G4double tTotalEnergy = fKineticEnergy + fMass; >> 134 return tMomentum/tTotalEnergy*c_light; >> 135 } >> 136 } >> 137 // This velocity is the velocity as if in vacuum. >> 138 // (So it is not corrected for the refraction index >> 139 // in the case of photons - optical or X-rays.) >> 140 // In order to get the velocity in the material, use >> 141 // GetVelocity of G4Track. >> 142 // >> 143 >> 144 inline G4double GetBeta() const >> 145 { return (fMass==0.) ? >> 146 1.0 : >> 147 sqrt(fKineticEnergy*fKineticEnergy + 2.0*fKineticEnergy*fMass) >> 148 /(fKineticEnergy+fMass); } >> 149 // Velocity of the track in unit of c(light velocity) >> 150 >> 151 inline G4double GetGamma() const >> 152 { return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; } >> 153 // Gamma factor (1/sqrt[1-beta*beta]) of the track >> 154 >> 155 inline G4VPhysicalVolume* GetPhysicalVolume() >> 156 { return fpTouchable->GetVolume(); } >> 157 >> 158 inline G4VTouchable* GetTouchable() const >> 159 { return fpTouchable; } >> 160 inline void SetTouchable(G4VTouchable* apValue) >> 161 { fpTouchable = apValue; } >> 162 >> 163 inline G4double GetSafety() const >> 164 { return fSafety; } >> 165 inline void SetSafety(const G4double aValue) >> 166 { fSafety = aValue; } >> 167 >> 168 inline const G4ThreeVector& GetPolarization() const >> 169 { return fPolarization; } >> 170 inline void SetPolarization(const G4ThreeVector& aValue) >> 171 { fPolarization = aValue; } >> 172 inline void AddPolarization(const G4ThreeVector& aValue) >> 173 { fPolarization += aValue; } >> 174 >> 175 inline G4StepStatus GetStepStatus() const >> 176 { return fStepStatus; } >> 177 inline void SetStepStatus(const G4StepStatus aValue) >> 178 { fStepStatus = aValue; } >> 179 >> 180 inline const G4VProcess* GetProcessDefinedStep() const >> 181 { return fpProcessDefinedStep; } >> 182 // If the pointer is 0, this means the Step is defined >> 183 // by the user defined limit in the current volume. >> 184 inline void SetProcessDefinedStep(G4VProcess* aValue) >> 185 { fpProcessDefinedStep = aValue; } >> 186 >> 187 inline G4double GetMass() const >> 188 { return fMass; } >> 189 inline void SetMass(G4double value) >> 190 { fMass = value; } >> 191 >> 192 inline G4double GetCharge() const >> 193 { return fCharge; } >> 194 inline void SetCharge(G4double value) >> 195 { fCharge = value; } >> 196 >> 197 inline G4Material* GetMaterial() >> 198 { return fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial(); } >> 199 >> 200 inline void SetWeight(G4double aValue) >> 201 { fWeight = aValue; } >> 202 inline G4double GetWeight() const >> 203 { return fWeight; } >> 204 >> 205 >> 206 >> 207 //--------- >> 208 private: >> 209 //--------- >> 210 >> 211 // Member data >> 212 G4ThreeVector fPosition; >> 213 G4double fGlobalTime; 159 // Time since event is created 214 // Time since event is created 160 G4double fLocalTime = 0.0; << 215 G4double fLocalTime; 161 // Time since track is created 216 // Time since track is created 162 G4double fProperTime = 0.0; << 217 G4double fProperTime; 163 // Time since track is created (in rest 218 // Time since track is created (in rest frame of particle) 164 G4ThreeVector fMomentumDirection; << 219 G4ThreeVector fMomentumDirection; 165 G4double fKineticEnergy = 0.0; << 220 G4double fKineticEnergy; 166 G4double fVelocity = 0.0; << 221 G4VTouchable* fpTouchable; 167 // Momentum,energy and velocity << 222 G4double fSafety; 168 G4TouchableHandle fpTouchable; << 223 G4ThreeVector fPolarization; 169 // Touchable Handle << 224 G4StepStatus fStepStatus; 170 G4Material* fpMaterial = nullptr; << 171 // Material of the volmue << 172 const G4MaterialCutsCouple* fpMaterialCuts << 173 // MaterialCutsCouple of the volmue << 174 G4VSensitiveDetector* fpSensitiveDetector << 175 G4double fSafety = 0.0; << 176 G4ThreeVector fPolarization; << 177 G4StepStatus fStepStatus = fUndefined; << 178 // DoIt type which defined the current S 225 // DoIt type which defined the current Step. 179 const G4VProcess* fpProcessDefinedStep = n << 226 G4VProcess* fpProcessDefinedStep; 180 // Process which defined the current Ste 227 // Process which defined the current Step. 181 G4double fMass = 0.0; << 228 G4double fMass; 182 // Dynamical mass of the particle 229 // Dynamical mass of the particle 183 G4double fCharge = 0.0; << 230 G4double fCharge; 184 // Dynamical Charge of the particle 231 // Dynamical Charge of the particle 185 G4double fMagneticMoment = 0.0; << 232 G4double fWeight; 186 // Dynamical MagneticMoment of the parti << 187 G4double fWeight = 0.0; << 188 // Track Weight << 189 }; 233 }; 190 234 191 #include "G4StepPoint.icc" << 192 235 193 #endif 236 #endif >> 237 194 238