Changeset 1340 for trunk/source/track/src
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- Location:
- trunk/source/track/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/track/src/CVS/Entries
r1337 r1340 1 /G4FieldTrackUpdator.cc/1.2/Thu Sep 30 06:16:10 2010//T geant4-09-04-beta-012 /G4 ParticleChange.cc/1.31/Thu Sep 30 06:16:10 2010//Tgeant4-09-04-beta-013 /G4ParticleChange ForDecay.cc/1.11/Thu Sep 30 06:16:10 2010//Tgeant4-09-04-beta-014 /G4ParticleChangeFor Gamma.cc/1.3/Thu Sep 30 06:16:10 2010//Tgeant4-09-04-beta-015 /G4ParticleChangeFor Loss.cc/1.17/Thu Sep 30 06:16:10 2010//Tgeant4-09-04-beta-016 /G4ParticleChangeFor MSC.cc/1.14/Thu Sep 30 06:16:10 2010//Tgeant4-09-04-beta-017 /G4ParticleChangeFor Transport.cc/1.19/Thu Sep 30 06:16:10 2010//Tgeant4-09-04-beta-018 /G4 Step.cc/1.7/Thu Sep 30 06:16:10 2010//Tgeant4-09-04-beta-019 /G4Step Point.cc/1.13/Thu Sep 30 06:16:10 2010//Tgeant4-09-04-beta-0110 /G4 Track.cc/1.32/Thu Sep 30 06:16:10 2010//Tgeant4-09-04-beta-0111 /G4 VParticleChange.cc/1.21/Thu Sep 30 06:16:11 2010//Tgeant4-09-04-beta-0112 /G4V UserTrackInformation.cc/1.4/Thu Sep 30 06:16:11 2010//Tgeant4-09-04-beta-011 /G4FieldTrackUpdator.cc/1.2/Thu Sep 30 06:16:10 2010//Ttrack-V09-03-09 2 /G4VUserTrackInformation.cc/1.4/Thu Sep 30 06:16:11 2010//Ttrack-V09-03-09 3 /G4ParticleChange.cc/1.32/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 4 /G4ParticleChangeForDecay.cc/1.12/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 5 /G4ParticleChangeForGamma.cc/1.4/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 6 /G4ParticleChangeForLoss.cc/1.18/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 7 /G4ParticleChangeForMSC.cc/1.15/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 8 /G4ParticleChangeForTransport.cc/1.20/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 9 /G4Step.cc/1.11/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 10 /G4StepPoint.cc/1.15/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 11 /G4Track.cc/1.35/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 12 /G4VParticleChange.cc/1.22/Fri Nov 5 10:05:20 2010//Ttrack-V09-03-09 13 13 D -
trunk/source/track/src/CVS/Tag
r1331 r1340 1 N geant4-09-04-beta-011 Ntrack-V09-03-09 -
trunk/source/track/src/G4ParticleChange.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ParticleChange.cc,v 1.3 1 2009/04/02 02:22:30 kurasigeExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ParticleChange.cc,v 1.32 2010/07/21 09:30:15 gcosmo Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 51 51 #include "G4ExceptionSeverity.hh" 52 52 53 54 G4ParticleChange::G4ParticleChange():G4VParticleChange() 53 G4ParticleChange::G4ParticleChange() 54 : G4VParticleChange(), theEnergyChange(0.), theTimeChange(0.), 55 theProperTimeChange(0.), theMassChange(0.), theChargeChange(0.), 56 theMagneticMomentChange(0.), theCurrentTrack(0) 55 57 { 56 58 G4VParticleChange::SetSecondaryWeightByProcess(false); 57 59 G4VParticleChange::SetParentWeightByProcess(false); 58 59 60 } 60 61 … … 389 390 G4VParticleChange::DumpInfo(); 390 391 391 G4 cout.precision(3);392 G4int oldprc = G4cout.precision(3); 392 393 393 394 G4cout << " Mass (GeV) : " … … 439 440 << std::setw(20) << thePolarizationChange.z() 440 441 << G4endl; 442 G4cout.precision(oldprc); 441 443 } 442 444 -
trunk/source/track/src/G4ParticleChangeForDecay.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ParticleChangeForDecay.cc,v 1.1 1 2006/06/29 21:15:03 gunterExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ParticleChangeForDecay.cc,v 1.12 2010/07/21 09:30:15 gcosmo Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 46 46 #include "G4ExceptionSeverity.hh" 47 47 48 G4ParticleChangeForDecay::G4ParticleChangeForDecay():G4VParticleChange() 48 G4ParticleChangeForDecay::G4ParticleChangeForDecay() 49 : G4VParticleChange(), theTimeChange(0.) 49 50 { 50 51 #ifdef G4VERBOSE … … 159 160 G4VParticleChange::DumpInfo(); 160 161 161 G4 cout.precision(3);162 G4int oldprc = G4cout.precision(3); 162 163 G4cout << " Time (ns) : " 163 << std::setw(20) << theTimeChange/ns164 << G4endl;164 << std::setw(20) << theTimeChange/ns << G4endl; 165 G4cout.precision(oldprc); 165 166 } 166 167 -
trunk/source/track/src/G4ParticleChangeForGamma.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ParticleChangeForGamma.cc,v 1. 3 2006/08/28 16:10:29 vnivanchExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ParticleChangeForGamma.cc,v 1.4 2010/07/21 09:30:15 gcosmo Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 47 47 #include "G4ExceptionSeverity.hh" 48 48 49 G4ParticleChangeForGamma::G4ParticleChangeForGamma():G4VParticleChange() 49 G4ParticleChangeForGamma::G4ParticleChangeForGamma() 50 : G4VParticleChange(), currentTrack(0), proposedKinEnergy(0.) 50 51 { 51 52 theSteppingControlFlag = NormalCondition; … … 112 113 G4VParticleChange::DumpInfo(); 113 114 114 G4 cout.precision(3);115 G4int oldprc = G4cout.precision(3); 115 116 G4cout << " Kinetic Energy (MeV): " 116 117 << std::setw(20) << proposedKinEnergy/MeV … … 122 123 << std::setw(20) << proposedPolarization 123 124 << G4endl; 125 G4cout.precision(oldprc); 124 126 } 125 127 -
trunk/source/track/src/G4ParticleChangeForLoss.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ParticleChangeForLoss.cc,v 1.1 7 2009/05/26 13:19:41 vnivanchExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ParticleChangeForLoss.cc,v 1.18 2010/07/21 09:30:15 gcosmo Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 50 50 51 51 G4ParticleChangeForLoss::G4ParticleChangeForLoss() 52 :G4VParticleChange(), lowEnergyLimit(1.0*eV) 52 : G4VParticleChange(), currentTrack(0), proposedKinEnergy(0.), 53 lowEnergyLimit(1.0*eV), currentCharge(0.) 53 54 { 54 55 theSteppingControlFlag = NormalCondition; … … 70 71 } 71 72 72 G4ParticleChangeForLoss::G4ParticleChangeForLoss( 73 const G4ParticleChangeForLoss &right): G4VParticleChange(right) 73 G4ParticleChangeForLoss:: 74 G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right) 75 : G4VParticleChange(right) 74 76 { 75 77 if (verboseLevel>1) { … … 78 80 currentTrack = right.currentTrack; 79 81 proposedKinEnergy = right.proposedKinEnergy; 82 lowEnergyLimit = right.lowEnergyLimit; 80 83 currentCharge = right.currentCharge; 81 84 proposedMomentumDirection = right.proposedMomentumDirection; … … 115 118 G4VParticleChange::DumpInfo(); 116 119 117 G4 cout.precision(3);120 G4int oldprc = G4cout.precision(3); 118 121 G4cout << " Charge (eplus) : " 119 122 << std::setw(20) << currentCharge/eplus … … 131 134 << std::setw(20) << proposedMomentumDirection.z() 132 135 << G4endl; 136 G4cout.precision(oldprc); 133 137 } 134 138 -
trunk/source/track/src/G4ParticleChangeForMSC.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ParticleChangeForMSC.cc,v 1.1 4 2009/04/02 02:22:30 kurasigeExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ParticleChangeForMSC.cc,v 1.15 2010/07/21 09:30:15 gcosmo Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 45 45 #include "G4ExceptionSeverity.hh" 46 46 47 G4ParticleChangeForMSC::G4ParticleChangeForMSC():G4VParticleChange() 47 G4ParticleChangeForMSC::G4ParticleChangeForMSC() 48 : G4VParticleChange() 48 49 { 49 50 #ifdef G4VERBOSE … … 63 64 } 64 65 65 G4ParticleChangeForMSC::G4ParticleChangeForMSC( 66 const G4ParticleChangeForMSC &right): G4VParticleChange(right) 66 G4ParticleChangeForMSC:: 67 G4ParticleChangeForMSC(const G4ParticleChangeForMSC &right) 68 : G4VParticleChange(right) 67 69 { 68 70 if (verboseLevel>1) { … … 133 135 G4VParticleChange::DumpInfo(); 134 136 135 G4 cout.precision(3);137 G4int oldprc = G4cout.precision(3); 136 138 G4cout << " Position - x (mm) : " 137 139 << std::setw(20) << thePosition.x()/mm … … 152 154 << std::setw(20) << theMomentumDirection.z() 153 155 << G4endl; 156 G4cout.precision(oldprc); 154 157 } 155 158 -
trunk/source/track/src/G4ParticleChangeForTransport.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ParticleChangeForTransport.cc,v 1. 19 2006/11/03 17:45:04 japostExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ParticleChangeForTransport.cc,v 1.20 2010/07/21 09:30:15 gcosmo Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 47 47 #include "G4DynamicParticle.hh" 48 48 49 G4ParticleChangeForTransport::G4ParticleChangeForTransport():G4ParticleChange() 49 G4ParticleChangeForTransport::G4ParticleChangeForTransport() 50 : G4ParticleChange(), isMomentumChanged(false), theMaterialChange(0), 51 theMaterialCutsCoupleChange(0), theSensitiveDetectorChange(0) 50 52 { 51 53 if (verboseLevel>2) { 52 G4cout << "G4ParticleChangeForTransport::G4ParticleChangeForTransport() " << G4endl; 54 G4cout << "G4ParticleChangeForTransport::G4ParticleChangeForTransport() " 55 << G4endl; 53 56 } 54 57 } … … 57 60 { 58 61 if (verboseLevel>2) { 59 G4cout << "G4ParticleChangeForTransport::~G4ParticleChangeForTransport() " << G4endl; 60 } 61 } 62 63 64 G4ParticleChangeForTransport::G4ParticleChangeForTransport(const G4ParticleChangeForTransport &right):G4ParticleChange(right) 62 G4cout << "G4ParticleChangeForTransport::~G4ParticleChangeForTransport() " 63 << G4endl; 64 } 65 } 66 67 G4ParticleChangeForTransport:: 68 G4ParticleChangeForTransport(const G4ParticleChangeForTransport &r) 69 : G4ParticleChange(r) 65 70 { 66 71 if (verboseLevel>0) { 67 G4cout << "G4ParticleChangeForTransport:: copy constructor is called " << G4endl; 68 } 69 theTouchableHandle = right.theTouchableHandle; 72 G4cout << "G4ParticleChangeForTransport:: copy constructor is called " 73 << G4endl; 74 } 75 theTouchableHandle = r.theTouchableHandle; 76 isMomentumChanged = r.isMomentumChanged; 77 theMaterialChange = r.theMaterialChange; 78 theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange; 79 theSensitiveDetectorChange = r.theSensitiveDetectorChange; 70 80 } 71 81 72 82 // assignemnt operator 73 G4ParticleChangeForTransport & G4ParticleChangeForTransport::operator=(const G4ParticleChangeForTransport &right) 83 G4ParticleChangeForTransport & 84 G4ParticleChangeForTransport::operator=(const G4ParticleChangeForTransport &r) 74 85 { 75 86 if (verboseLevel>1) { 76 G4cout << "G4ParticleChangeForTransport:: assignment operator is called " << G4endl; 87 G4cout << "G4ParticleChangeForTransport:: assignment operator is called " 88 << G4endl; 77 89 } 78 if (this != &r ight)90 if (this != &r) 79 91 { 80 theListOfSecondaries = r ight.theListOfSecondaries;81 theSizeOftheListOfSecondaries = r ight.theSizeOftheListOfSecondaries;82 theNumberOfSecondaries = r ight.theNumberOfSecondaries;83 theStatusChange = r ight.theStatusChange;84 theTouchableHandle = r ight.theTouchableHandle;85 theMaterialChange = r ight.theMaterialChange;86 theMaterialCutsCoupleChange = r ight.theMaterialCutsCoupleChange;87 theSensitiveDetectorChange = r ight.theSensitiveDetectorChange;88 theMomentumDirectionChange = r ight.theMomentumDirectionChange;89 thePolarizationChange = r ight.thePolarizationChange;90 thePositionChange = r ight.thePositionChange;91 theTimeChange = r ight.theTimeChange;92 theEnergyChange = r ight.theEnergyChange;93 theTrueStepLength = r ight.theTrueStepLength;94 theLocalEnergyDeposit = r ight.theLocalEnergyDeposit;95 theSteppingControlFlag = r ight.theSteppingControlFlag;92 theListOfSecondaries = r.theListOfSecondaries; 93 theSizeOftheListOfSecondaries = r.theSizeOftheListOfSecondaries; 94 theNumberOfSecondaries = r.theNumberOfSecondaries; 95 theStatusChange = r.theStatusChange; 96 theTouchableHandle = r.theTouchableHandle; 97 theMaterialChange = r.theMaterialChange; 98 theMaterialCutsCoupleChange = r.theMaterialCutsCoupleChange; 99 theSensitiveDetectorChange = r.theSensitiveDetectorChange; 100 theMomentumDirectionChange = r.theMomentumDirectionChange; 101 thePolarizationChange = r.thePolarizationChange; 102 thePositionChange = r.thePositionChange; 103 theTimeChange = r.theTimeChange; 104 theEnergyChange = r.theEnergyChange; 105 theTrueStepLength = r.theTrueStepLength; 106 theLocalEnergyDeposit = r.theLocalEnergyDeposit; 107 theSteppingControlFlag = r.theSteppingControlFlag; 96 108 } 97 109 return *this; … … 106 118 // Nothing happens for AtRestDoIt 107 119 if (verboseLevel>0) { 108 G4cout << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called" << G4endl; 120 G4cout << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called" 121 << G4endl; 109 122 G4cout << " Nothing happens for this method " << G4endl; 110 123 } … … 236 249 G4ParticleChange::DumpInfo(); 237 250 238 G4 cout.precision(3);251 G4int oldprc = G4cout.precision(3); 239 252 G4cout << " Touchable (pointer) : " 240 << std::setw(20) << theTouchableHandle() 241 << G4endl; 242 } 243 244 245 246 247 248 249 250 253 << std::setw(20) << theTouchableHandle() << G4endl; 254 G4cout.precision(oldprc); 255 } -
trunk/source/track/src/G4Step.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4Step.cc,v 1. 7 2006/10/30 09:50:13kurasige Exp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4Step.cc,v 1.11 2010/10/30 07:49:08 kurasige Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 54 54 G4Step::G4Step() 55 55 //////////////// 56 : fTotalEnergyDeposit(0.0),fNonIonizingEnergyDeposit(0.0), 57 fStepLength(0.), fpTrack(0), 58 fpSteppingControlFlag(NormalCondition),fSecondary(0), 59 fpVectorOfAuxiliaryPointsPointer(0) 56 60 { 57 61 fpPreStepPoint = new G4StepPoint(); … … 69 73 delete fpPostStepPoint; 70 74 } 75 76 77 ///////////////// 78 G4ThreeVector G4Step::GetDeltaMomentum() const 79 ///////////////// 80 { 81 static G4bool isFirstTime = true; 82 if (isFirstTime) { 83 isFirstTime = false; 84 #ifdef G4VERBOSE 85 G4Exception( "G4Step::GetDeltaMomentum()","Warning", JustWarning, 86 "This method is obsolete and will be removed soon"); 87 #endif 88 } 89 90 return fpPostStepPoint->GetMomentum() 91 - fpPreStepPoint->GetMomentum(); 92 } 93 94 ///////////////// 95 G4double G4Step::GetDeltaEnergy() const 96 ///////////////// 97 { 98 static G4bool isFirstTime = true; 99 if (isFirstTime) { 100 isFirstTime = false; 101 #ifdef G4VERBOSE 102 G4Exception( "G4Step::GetDeltaEnergy()","Warning", JustWarning, 103 "This method is obsolete and will be removed soon"); 104 #endif 105 } 106 107 return fpPostStepPoint->GetKineticEnergy() 108 - fpPreStepPoint->GetKineticEnergy(); 109 } -
trunk/source/track/src/G4StepPoint.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4StepPoint.cc,v 1.1 3 2007/03/11 07:19:06kurasige Exp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4StepPoint.cc,v 1.15 2010/10/30 07:49:09 kurasige Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 47 47 48 48 ////////////////////////// 49 G4StepPoint::G4StepPoint() :49 G4StepPoint::G4StepPoint() 50 50 ////////////////////////// 51 fpTouchable(0), fpMaterial(0), fpMaterialCutsCouple(0), fpSensitiveDetector(0), 52 fpProcessDefinedStep(0), fCharge(0.) 51 : fGlobalTime(0.), fLocalTime(0.), fProperTime(0.), 52 fKineticEnergy(0.), fVelocity(0.), fpTouchable(0), fpMaterial(0), 53 fpMaterialCutsCouple(0), fpSensitiveDetector(0), fSafety(0.), 54 fStepStatus(fUndefined),fpProcessDefinedStep(0), 55 fMass(0.), fCharge(0.), fMagneticMoment(0.), 56 fWeight(0.) 53 57 { 54 58 } -
trunk/source/track/src/G4Track.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4Track.cc,v 1.3 2 2009/04/08 08:07:24kurasige Exp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4Track.cc,v 1.35 2010/09/21 00:33:05 kurasige Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 41 41 42 42 #include "G4Track.hh" 43 #include "G4ParticleTable.hh" 43 44 44 45 G4Allocator<G4Track> aTrackAllocator; 46 47 G4PhysicsLogVector* G4Track::velTable = 0; 48 49 const G4double G4Track::maxT = 100.0; 50 const G4double G4Track::minT = 0.0001; 45 51 46 52 /////////////////////////////////////////////////////////// … … 60 66 fVtxKineticEnergy(0.0), 61 67 fpLVAtVertex(0), fpCreatorProcess(0), 62 fpUserInformation(0) 68 fpUserInformation(0), 69 prev_mat(0), groupvel(0), 70 prev_velocity(0.0), prev_momentum(0.0), 71 is_OpticalPhoton(false) 63 72 { 73 static G4bool isFirstTime = true; 74 static G4ParticleDefinition* fOpticalPhoton =0; 75 if ( isFirstTime ) { 76 isFirstTime = false; 77 // set fOpticalPhoton 78 fOpticalPhoton = G4ParticleTable::GetParticleTable()->FindParticle("opticalphoton"); 79 } 80 // check if the particle type is Optical Photon 81 is_OpticalPhoton = (fpDynamicParticle->GetDefinition() == fOpticalPhoton); 82 83 if (velTable==0) PrepareVelocityTable(); 64 84 } 65 85 … … 78 98 fVtxKineticEnergy(0.0), 79 99 fpLVAtVertex(0), fpCreatorProcess(0), 80 fpUserInformation(0) 100 fpUserInformation(0), 101 prev_mat(0), groupvel(0), 102 prev_velocity(0.0), prev_momentum(0.0), 103 is_OpticalPhoton(false) 81 104 { 82 105 } … … 84 107 G4Track::G4Track(const G4Track& right) 85 108 ////////////////// 109 : fCurrentStepNumber(0), 110 fGlobalTime(0), fLocalTime(0.), 111 fTrackLength(0.), 112 fParentID(0), fTrackID(0), 113 fpDynamicParticle(0), 114 fTrackStatus(fAlive), 115 fBelowThreshold(false), fGoodForTracking(false), 116 fStepLength(0.0), fWeight(1.0), 117 fpStep(0), 118 fVtxKineticEnergy(0.0), 119 fpLVAtVertex(0), fpCreatorProcess(0), 120 fpUserInformation(0), 121 prev_mat(0), groupvel(0), 122 prev_velocity(0.0), prev_momentum(0.0), 123 is_OpticalPhoton(false) 86 124 { 87 125 *this = right; … … 136 174 fpCreatorProcess = 0; 137 175 fpUserInformation = 0; 176 177 prev_mat = right.prev_mat; 178 groupvel = right.groupvel; 179 prev_velocity = right.prev_velocity; 180 prev_momentum = right.prev_momentum; 181 182 is_OpticalPhoton = right.is_OpticalPhoton; 183 138 184 } 139 185 return *this; … … 147 193 } 148 194 149 #include "G4ParticleTable.hh"150 195 /////////////////// 151 196 G4double G4Track::GetVelocity() const 152 197 /////////////////// 153 198 { 154 static G4bool isFirstTime = true; 155 static G4ParticleDefinition* fOpticalPhoton =0; 156 157 static G4Material* prev_mat =0; 158 static G4MaterialPropertyVector* groupvel =0; 159 static G4double prev_velocity =0; 160 static G4double prev_momentum =0; 161 162 163 if ( isFirstTime ) { 164 isFirstTime = false; 165 // set fOpticalPhoton 166 fOpticalPhoton = G4ParticleTable::GetParticleTable()->FindParticle("opticalphoton"); 167 } 168 169 G4double velocity ; 199 200 G4double velocity = c_light ; 170 201 171 202 G4double mass = fpDynamicParticle->GetMass(); 172 203 173 velocity = c_light ;174 175 204 // special case for photons 176 if ( (fOpticalPhoton !=0) && 177 (fpDynamicParticle->GetDefinition()==fOpticalPhoton) ){ 205 if ( is_OpticalPhoton ) { 178 206 179 207 G4Material* mat=0; … … 187 215 } 188 216 // check if previous step is in the same volume 189 // and get new GROUPVELO VITY table if necessary190 if ((mat != prev_mat)||(groupvel==0)) {217 // and get new GROUPVELOCITY table if necessary 218 if ((mat != 0) && ((mat != prev_mat)||(groupvel==0))) { 191 219 groupvel = 0; 192 220 if(mat->GetMaterialPropertiesTable() != 0) … … 203 231 // check if momentum is same as in the previous step 204 232 // and calculate group velocity if necessary 205 if( update_groupvel || (fpDynamicParticle->GetTotalMomentum() != prev_momentum) ) { 233 G4double current_momentum = fpDynamicParticle->GetTotalMomentum(); 234 if( update_groupvel || (current_momentum != prev_momentum) ) { 206 235 velocity = 207 groupvel->GetProperty( fpDynamicParticle->GetTotalMomentum());208 209 prev_momentum = fpDynamicParticle->GetTotalMomentum();236 groupvel->GetProperty(current_momentum); 237 prev_velocity = velocity; 238 prev_momentum = current_momentum; 210 239 } 211 240 } 212 241 213 242 } else { 243 // particles other than optical photon 214 244 if (mass<DBL_MIN) { 245 // Zero Mass 215 246 velocity = c_light; 216 247 } else { 217 G4double T = fpDynamicParticle->GetKineticEnergy(); 218 velocity = c_light*std::sqrt(T*(T+2.*mass))/(T+mass); 219 } 248 G4double T = (fpDynamicParticle->GetKineticEnergy())/mass; 249 if (T > maxT) { 250 velocity = c_light; 251 } else if (T<DBL_MIN) { 252 velocity =0.; 253 } else if (T<minT) { 254 velocity = c_light*std::sqrt(T*(T+2.))/(T+1.0); 255 } else { 256 velocity = velTable->Value(T); 257 } 258 } 259 220 260 } 221 261 222 262 return velocity ; 223 263 } 264 265 /////////////////// 266 void G4Track::PrepareVelocityTable() 267 /////////////////// 268 { 269 const G4int NBIN=300; 270 velTable = new G4PhysicsLogVector(minT, maxT, NBIN); 271 for (G4int i=0; i<=NBIN; i++){ 272 G4double T = velTable->Energy(i); 273 velTable->PutValue(i, c_light*std::sqrt(T*(T+2.))/(T+1.0) ); 274 } 275 return; 276 } -
trunk/source/track/src/G4VParticleChange.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4VParticleChange.cc,v 1.2 1 2009/04/02 02:22:30 kurasigeExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4VParticleChange.cc,v 1.22 2010/07/21 09:30:15 gcosmo Exp $ 28 // GEANT4 tag $Name: track-V09-03-09 $ 29 29 // 30 30 // … … 53 53 theLocalEnergyDeposit(0.0), 54 54 theNonIonizingEnergyDeposit(0.0), 55 theTrueStepLength(0.0), 55 56 theFirstStepInVolume(false), 56 57 theLastStepInVolume(false), … … 163 164 164 165 // Show header 165 G4 cout.precision(3);166 G4int olprc = G4cout.precision(3); 166 167 G4cout << " -----------------------------------------------" 167 168 << G4endl; … … 220 221 G4cout << " Last Step In the voulme : " << G4endl; 221 222 } 223 G4cout.precision(olprc); 222 224 } 223 225
Note: See TracChangeset
for help on using the changeset viewer.