Changeset 1196 for trunk/source/track
- Timestamp:
- Nov 25, 2009, 5:13:58 PM (15 years ago)
- Location:
- trunk/source/track
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/track/History
r921 r1196 1 $Id: History,v 1.10 2 2008/10/24 08:22:20 kurasige Exp $1 $Id: History,v 1.107 2009/10/19 09:37:00 kurasige Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 Oct. 19, 2009 Hisaya Kurashige (track-V09-02-04) 20 added a string prooperty to indicate type of UserTrackInformation 21 22 23 June 18, 2009 Hisaya Kurashige (track-V09-02-03) 24 added SetLowEnergyLimit method (Vladimir) 25 26 27 May. 27, 2009 Hisaya Kurashige (track-V09-02-02) 28 - Add lowEnergyLimit = 1 eV in lowEnergyLimit = 1 eV (Vladimir) 29 30 Apr. 2, 2009 Hisaya Kurashige (track-V09-02-01) 31 - Add protection for the case mass==0 and T==0 in GetVelocity 32 33 Apr. 2, 2009 Hisaya Kurashige (track-V09-02-00) 34 - Modify GetVelocity to improve performance 35 19 36 Oct. 24, 2008 Hisaya Kurashige (track-V09-01-02) 20 37 - change fpCreatorProcess and fpLCAtVertex in G4Track to 'const' pointer -
trunk/source/track/include/G4ParticleChangeForLoss.hh
r1058 r1196 25 25 // 26 26 // 27 // $Id: G4ParticleChangeForLoss.hh,v 1.2 0 2008/01/11 19:57:12vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-0 2-ref-02$27 // $Id: G4ParticleChangeForLoss.hh,v 1.22 2009/06/17 17:25:57 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 42 42 // and ProposeWeight for PostStep 43 43 // 07.06.06 V.Ivanchenko RemoveProposedMomentumDirection from AlongStep 44 // 28.08.06 V.Ivanchenko Add access to current track and polarizaion 44 // 28.08.06 V.Ivanchenko Added access to current track and polarizaion 45 // 17.06.09 V.Ivanchenko Added SetLowEnergyLimit method 45 46 // 46 47 // ------------------------------------------------------------ … … 108 109 const G4Track* GetCurrentTrack() const; 109 110 111 void SetLowEnergyLimit(G4double elimit); 112 110 113 virtual void DumpInfo() const; 111 114 … … 125 128 G4double proposedKinEnergy; 126 129 // The final kinetic energy of the current particle. 130 131 G4double lowEnergyLimit; 132 // The limit kinetic energy below which particle is stopped 127 133 128 134 G4double currentCharge; … … 263 269 264 270 // update kinetic energy and charge 265 if (kinEnergy < DBL_MIN) {271 if (kinEnergy < lowEnergyLimit) { 266 272 theLocalEnergyDeposit += kinEnergy; 267 273 kinEnergy = 0.0; … … 311 317 } 312 318 319 inline void G4ParticleChangeForLoss::SetLowEnergyLimit(G4double elimit) 320 { 321 lowEnergyLimit = elimit; 322 } 323 313 324 #endif 314 325 -
trunk/source/track/include/G4VUserTrackInformation.hh
r1058 r1196 25 25 // 26 26 // 27 // $Id: G4VUserTrackInformation.hh,v 1. 6 2006/06/29 21:14:59 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 2-ref-02$27 // $Id: G4VUserTrackInformation.hh,v 1.8 2009/10/19 17:11:43 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 57 57 #define G4VUserTrackInformation_H 1 58 58 59 #include "globals.hh" 60 59 61 class G4VUserTrackInformation 60 { 61 public: 62 { 63 public: // With Description 62 64 G4VUserTrackInformation(); 65 G4VUserTrackInformation(const G4String& infoType); 66 // String is provided to indicate Type of UserTrackInfo class 67 // User is recommended to set the type of his/her class 68 63 69 virtual ~G4VUserTrackInformation(); 64 70 65 public:66 71 virtual void Print() const = 0; 72 73 const G4String& GetType() const; 74 // get Type of this UserTrackInfo 75 76 protected: 77 G4String fType; 67 78 }; 68 79 80 inline 81 const G4String& G4VUserTrackInformation::GetType() const 82 { 83 return fType; 84 } 85 69 86 #endif 70 87 -
trunk/source/track/src/G4ParticleChange.cc
r1058 r1196 25 25 // 26 26 // 27 // $Id: G4ParticleChange.cc,v 1.3 0 2007/03/30 01:03:53kurasige Exp $28 // GEANT4 tag $Name: geant4-09-0 2-ref-02$27 // $Id: G4ParticleChange.cc,v 1.31 2009/04/02 02:22:30 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 454 454 G4bool itsOKforMomentum = true; 455 455 if ( theEnergyChange >0.) { 456 accuracy = std:: abs(theMomentumDirectionChange.mag2()-1.0);456 accuracy = std::fabs(theMomentumDirectionChange.mag2()-1.0); 457 457 if (accuracy > accuracyForWarning) { 458 458 #ifdef G4VERBOSE -
trunk/source/track/src/G4ParticleChangeForLoss.cc
r1058 r1196 25 25 // 26 26 // 27 // $Id: G4ParticleChangeForLoss.cc,v 1.1 6 2006/08/28 16:10:29vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-0 2-ref-02$27 // $Id: G4ParticleChangeForLoss.cc,v 1.17 2009/05/26 13:19:41 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 49 49 #include "G4ExceptionSeverity.hh" 50 50 51 G4ParticleChangeForLoss::G4ParticleChangeForLoss():G4VParticleChange() 51 G4ParticleChangeForLoss::G4ParticleChangeForLoss() 52 :G4VParticleChange(), lowEnergyLimit(1.0*eV) 52 53 { 53 54 theSteppingControlFlag = NormalCondition; -
trunk/source/track/src/G4ParticleChangeForMSC.cc
r1058 r1196 25 25 // 26 26 // 27 // $Id: G4ParticleChangeForMSC.cc,v 1.1 3 2006/06/29 21:15:09 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 2-ref-02$27 // $Id: G4ParticleChangeForMSC.cc,v 1.14 2009/04/02 02:22:30 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 165 165 166 166 // MomentumDirection should be unit vector 167 accuracy = std:: abs(theMomentumDirection.mag2()-1.0);167 accuracy = std::fabs(theMomentumDirection.mag2()-1.0); 168 168 if (accuracy > accuracyForWarning) { 169 169 #ifdef G4VERBOSE -
trunk/source/track/src/G4Track.cc
r1058 r1196 25 25 // 26 26 // 27 // $Id: G4Track.cc,v 1.3 0 2007/10/02 00:46:21kurasige Exp $28 // GEANT4 tag $Name: geant4-09-0 2-ref-02$27 // $Id: G4Track.cc,v 1.32 2009/04/08 08:07:24 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 38 38 // Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek// 39 39 // Fix GetVelocity (bug report #741) Horton-Smith Apr 14 2005 40 // Remove massless check in GetVelocity 02 Apr. 09 H.Kurashige 40 41 41 42 #include "G4Track.hh" … … 170 171 G4double mass = fpDynamicParticle->GetMass(); 171 172 172 // mass less particle 173 if( mass == 0. ){ 174 velocity = c_light ; 175 176 // special case for photons 177 if ( (fOpticalPhoton !=0) && 178 (fpDynamicParticle->GetDefinition()==fOpticalPhoton) ){ 179 180 G4Material* mat=0; 181 G4bool update_groupvel = false; 182 if ( this->GetStep() ){ 183 mat= this->GetMaterial(); // Fix for repeated volumes 184 }else{ 185 if (fpTouchable!=0){ 186 mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial(); 187 } 188 } 189 // check if previous step is in the same volume 190 // and get new GROUPVELOVITY table if necessary 191 if ((mat != prev_mat)||(groupvel==0)) { 192 groupvel = 0; 193 if(mat->GetMaterialPropertiesTable() != 0) 194 groupvel = mat->GetMaterialPropertiesTable()->GetProperty("GROUPVEL"); 195 update_groupvel = true; 196 } 197 prev_mat = mat; 198 199 if (groupvel != 0 ) { 200 // light velocity = c/(rindex+d(rindex)/d(log(E_phot))) 201 // values stored in GROUPVEL material properties vector 202 velocity = prev_velocity; 173 velocity = c_light ; 174 175 // special case for photons 176 if ( (fOpticalPhoton !=0) && 177 (fpDynamicParticle->GetDefinition()==fOpticalPhoton) ){ 178 179 G4Material* mat=0; 180 G4bool update_groupvel = false; 181 if ( this->GetStep() ){ 182 mat= this->GetMaterial(); // Fix for repeated volumes 183 }else{ 184 if (fpTouchable!=0){ 185 mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial(); 186 } 187 } 188 // check if previous step is in the same volume 189 // and get new GROUPVELOVITY table if necessary 190 if ((mat != prev_mat)||(groupvel==0)) { 191 groupvel = 0; 192 if(mat->GetMaterialPropertiesTable() != 0) 193 groupvel = mat->GetMaterialPropertiesTable()->GetProperty("GROUPVEL"); 194 update_groupvel = true; 195 } 196 prev_mat = mat; 197 198 if (groupvel != 0 ) { 199 // light velocity = c/(rindex+d(rindex)/d(log(E_phot))) 200 // values stored in GROUPVEL material properties vector 201 velocity = prev_velocity; 203 202 204 205 206 207 208 203 // check if momentum is same as in the previous step 204 // and calculate group velocity if necessary 205 if( update_groupvel || (fpDynamicParticle->GetTotalMomentum() != prev_momentum) ) { 206 velocity = 207 groupvel->GetProperty(fpDynamicParticle->GetTotalMomentum()); 209 208 prev_velocity = velocity; 210 prev_momentum = fpDynamicParticle->GetTotalMomentum(); 211 } 212 } 213 } 209 prev_momentum = fpDynamicParticle->GetTotalMomentum(); 210 } 211 } 214 212 215 213 } else { 216 G4double T = fpDynamicParticle->GetKineticEnergy(); 217 velocity = c_light*std::sqrt(T*(T+2.*mass))/(T+mass); 214 if (mass<DBL_MIN) { 215 velocity = c_light; 216 } else { 217 G4double T = fpDynamicParticle->GetKineticEnergy(); 218 velocity = c_light*std::sqrt(T*(T+2.*mass))/(T+mass); 219 } 218 220 } 219 221 -
trunk/source/track/src/G4VParticleChange.cc
r1058 r1196 25 25 // 26 26 // 27 // $Id: G4VParticleChange.cc,v 1.2 0 2007/03/25 22:54:52kurasige Exp $28 // GEANT4 tag $Name: geant4-09-0 2-ref-02$27 // $Id: G4VParticleChange.cc,v 1.21 2009/04/02 02:22:30 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 288 288 // MomentumDirection should be unit vector 289 289 G4bool itsOKforMomentum = true; 290 accuracy = std:: abs((aTrack.GetMomentumDirection()).mag2()-1.0);290 accuracy = std::fabs((aTrack.GetMomentumDirection()).mag2()-1.0); 291 291 if (accuracy > accuracyForWarning) { 292 292 #ifdef G4VERBOSE -
trunk/source/track/src/G4VUserTrackInformation.cc
r1058 r1196 25 25 // 26 26 // 27 // $Id: G4VUserTrackInformation.cc,v 1. 2 2006/06/29 21:15:21 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 2-ref-02$27 // $Id: G4VUserTrackInformation.cc,v 1.3 2009/10/19 09:37:00 kurasige Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 34 34 35 35 G4VUserTrackInformation::G4VUserTrackInformation() 36 : fType("NONE") 36 37 {;} 38 39 G4VUserTrackInformation::G4VUserTrackInformation(const G4String& infoType) 40 : fType(infoType) 41 {;} 42 37 43 G4VUserTrackInformation::~G4VUserTrackInformation() 38 44 {;}
Note: See TracChangeset
for help on using the changeset viewer.