Import Geant4 10.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 12:08:39 +02:00
parent 286caacf06
commit c9b32a6c0a
5770 changed files with 1050949 additions and 367105 deletions
+17 -5
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4FieldTrackUpdator.cc 68795 2013-04-05 13:24:46Z gcosmo $
// $Id: G4FieldTrackUpdator.cc 81134 2014-05-21 13:12:24Z gcosmo $
//
// M. Asai - first implementation Apr/28/2006
//
@@ -59,20 +59,32 @@ G4FieldTrack* G4FieldTrackUpdator::CreateFieldTrack(const G4Track* trk)
void G4FieldTrackUpdator::Update(G4FieldTrack* ftrk,const G4Track* trk)
{
const G4DynamicParticle* ptDynamicParticle= trk->GetDynamicParticle();
// The following properties must be updated ONCE for each new track (at least)
ftrk->SetRestMass(ptDynamicParticle->GetMass());
ftrk->UpdateState(
trk->GetPosition(),
trk->GetGlobalTime(),
trk->GetMomentumDirection(),
trk->GetKineticEnergy()
);
const G4DynamicParticle* ptDynamicParticle= trk->GetDynamicParticle();
#ifdef G4CHECK
if( ( trk->GetMomentum() - ftrk->GetMomentum()).mag2() > 1.e-16 * trk->GetMomentum().mag2() ){
G4cerr << "ERROR> G4FieldTrackUpdator sees *Disagreement* in momentum " << G4endl;
G4cout << " FTupdator: Tracking Momentum= " << trk->GetMomentum() << G4endl;
G4cout << " FTupdator: FldTrack Momentum= " << ftrk->GetMomentum() << G4endl;
G4cout << " FTupdator: FldTrack-Tracking= " << ftrk->GetMomentum() - trk->GetMomentum() << G4endl;
}
#endif
ftrk->SetProperTimeOfFlight(trk->GetProperTime());
ftrk->SetChargeAndMoments( ptDynamicParticle->GetCharge() );
// The charge can change during tracking
ftrk->SetSpin( ptDynamicParticle->GetPolarization() );
// The following properties must be updated ONCE for each new track (at least)
ftrk->SetRestMass(ptDynamicParticle->GetMass());
}
+8 -2
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleChangeForDecay.cc 68795 2013-04-05 13:24:46Z gcosmo $
// $Id: G4ParticleChangeForDecay.cc 78546 2014-01-07 09:35:55Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -185,8 +185,12 @@ void G4ParticleChangeForDecay::DumpInfo() const
G4VParticleChange::DumpInfo();
G4int oldprc = G4cout.precision(3);
G4cout << " Time (ns) : "
G4cout << " proposed local Time (ns) : "
<< std::setw(20) << theTimeChange/ns << G4endl;
G4cout << " initial local Time (ns) : "
<< std::setw(20) << theLocalTime0/ns << G4endl;
G4cout << " initial global Time (ns) : "
<< std::setw(20) << theGlobalTime0/ns << G4endl;
G4cout.precision(oldprc);
}
@@ -206,6 +210,8 @@ G4bool G4ParticleChangeForDecay::CheckIt(const G4Track& aTrack)
G4cout << " G4ParticleChangeForDecay::CheckIt : ";
G4cout << "the local time goes back !!"
<< " Difference: " << accuracy << "[ns] " <<G4endl;
G4cout << "initial local time "<< theLocalTime0/ns << "[ns] "
<< "initial global time "<< theGlobalTime0/ns << "[ns] " <<G4endl;
G4cout << aTrack.GetDefinition()->GetParticleName()
<< " E=" << aTrack.GetKineticEnergy()/MeV
<< " pos=" << aTrack.GetPosition().x()/m
+7 -1
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VParticleChange.cc 68795 2013-04-05 13:24:46Z gcosmo $
// $Id: G4VParticleChange.cc 78546 2014-01-07 09:35:55Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -494,6 +494,12 @@ G4bool G4VParticleChange::CheckSecondary(G4Track& aTrack)
if (!itsOKforEnergy) {
aTrack.SetKineticEnergy(0.0);
}
if (!itsOK) {
this->DumpInfo();
}
return itsOK;
}