Changeset 1196 for trunk/source/track/src
- Timestamp:
- Nov 25, 2009, 5:13:58 PM (16 years ago)
- Location:
- trunk/source/track/src
- Files:
-
- 6 edited
-
G4ParticleChange.cc (modified) (2 diffs)
-
G4ParticleChangeForLoss.cc (modified) (2 diffs)
-
G4ParticleChangeForMSC.cc (modified) (2 diffs)
-
G4Track.cc (modified) (3 diffs)
-
G4VParticleChange.cc (modified) (2 diffs)
-
G4VUserTrackInformation.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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 // check if momentum is same as in the previous step205 // and calculate group velocity if necessary206 if( update_groupvel || (fpDynamicParticle->GetTotalMomentum() != prev_momentum) ) {207 velocity =208 groupvel->GetProperty(fpDynamicParticle->GetTotalMomentum());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.
