Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -13,6 +13,27 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
16-Nov-2007 Gunter Folger had-binary-V09-00-05
- Correction in G4BinaryCascade for memory leak.
16-Nov-2007 Gunter Folger had-binary-V09-00-04
- remove one line of left over debug printing
05-Nov-2007 Gunter Folger had-binary-V09-00-03
- deactivate general debug printout in G4BinaryCascade
05-Nov-2007 Gunter Folger had-binary-V09-00-02
- Fixes for propagate: particles can decay outside nucleus, correct counting
for late particles
31-Oct-2007 Gunter Folger had-binary-V09-00-01
- G4BinaryLightIon... adapt to changes in BIC
- Work around problem with very low energy pion (Coulomb barrier, nuclear mass
difference)
18-Oct-2007 Gunter Folger had-binary-V09-00-00
- Collect many changes for propagate interface.
Fix for pion incident at low energy: cannot go to deexitation directly
18-May-2007 Gunter Folger had-binary-V08-03-00
- G4BinaryLightIonReaction: Protect against divide by 0 when energy momentum
@@ -0,0 +1,81 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4BCLateParticle_h
#define G4BCLateParticle_h 1
#include "G4BCAction.hh"
#include "G4CollisionInitialState.hh"
#include "G4KineticTrack.hh"
#include "G4KineticTrackVector.hh"
#include <vector>
//#define debug_BCLateParticle 1
class G4BCLateParticle : public G4BCAction
{
public:
G4BCLateParticle(){}
virtual ~G4BCLateParticle(){}
virtual const std::vector<G4CollisionInitialState *> &
GetCollisions(G4KineticTrack * aProjectile,
std::vector<G4KineticTrack *> & ,
G4double theCurrentTime)
{
theColl.clear();
G4double ctime=std::max(0.,aProjectile->GetFormationTime()) + theCurrentTime;
G4KineticTrackVector noTarget;
G4CollisionInitialState * aLate =
new G4CollisionInitialState(ctime,
aProjectile, noTarget, this);
theColl.push_back(aLate);
#ifdef debug_BCLateParticle
G4cout << "Particle starting late " << aProjectile << " "
<< aProjectile->GetDefinition()->GetParticleName() << " "
<< 1/MeV*aProjectile->Get4Momentum() << " "
<< 1/fermi*aProjectile->GetPosition() << " "
<< aProjectile->GetFormationTime()
<< G4endl;
#endif
return theColl;
}
virtual G4KineticTrackVector * GetFinalState(G4KineticTrack * aProjectile,
std::vector<G4KineticTrack *> & )
{
G4KineticTrackVector * result = new G4KineticTrackVector;
G4KineticTrack * lateParticle=new G4KineticTrack(*aProjectile);
result->push_back(lateParticle);
return result;
}
private:
std::vector<G4CollisionInitialState *> theColl;
};
#endif
@@ -52,6 +52,7 @@
#include "G4LorentzRotation.hh"
#include "G4BCDecay.hh"
#include "G4BCLateParticle.hh"
#include "G4BCAction.hh"
class G4CollisionManager;
@@ -75,8 +76,8 @@ public:
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& theNucleus);
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector * secondaries,
G4V3DNucleus * nucleus);
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector *,
G4V3DNucleus *);
private:
@@ -92,14 +93,15 @@ private:
}
void PrintWelcomeMessage();
void BuildTargetList();
void FindCollisions(G4KineticTrackVector * secondaries);
void FindDecayCollision(G4KineticTrack * secondary);
G4bool ApplyCollision(G4CollisionInitialState * collision);
void FindCollisions(G4KineticTrackVector *);
void FindDecayCollision(G4KineticTrack *);
void FindLateParticleCollision(G4KineticTrack *);
G4bool ApplyCollision(G4CollisionInitialState *);
G4bool Capture(G4bool verbose=false);
G4bool Absorb();
G4bool CheckPauliPrinciple(G4KineticTrackVector * products);
G4bool CheckPauliPrinciple(G4KineticTrackVector *);
G4double GetExcitationEnergy();
G4bool CheckDecay(G4KineticTrackVector * products);
G4bool CheckDecay(G4KineticTrackVector *);
void CorrectFinalPandE();
void UpdateTracksAndCollisions(G4KineticTrackVector * oldSecondaries,
G4KineticTrackVector * oldTarget,
@@ -111,8 +113,8 @@ private:
void StepParticlesOut();
G4LorentzVector GetFinal4Momentum();
G4LorentzVector GetFinalNucleusMomentum();
G4ReactionProductVector * Propagate1H1(G4KineticTrackVector * secondaries,
G4V3DNucleus * nucleus);
G4ReactionProductVector * Propagate1H1(G4KineticTrackVector *,
G4V3DNucleus *);
G4double GetIonMass(G4int Z, G4int A);
// utility methods
@@ -122,7 +124,9 @@ private:
// for debugging purpose
void PrintKTVector(G4KineticTrackVector * ktv, std::string comment=std::string(""));
void PrintKTVector(G4KineticTrack* kt, std::string comment=std::string(""));
void DebugApplyCollision(G4CollisionInitialState * collision,
G4KineticTrackVector *products);
private:
G4KineticTrackVector theProjectileList;
G4KineticTrackVector theTargetList;
@@ -135,6 +139,7 @@ private:
std::vector<G4BCAction *> theImR;
G4BCDecay * theDecay;
G4BCLateParticle * theLateParticle;
G4VFieldPropagation * thePropagator;
G4double theCurrentTime;
G4double theBCminP;
File diff suppressed because it is too large Load Diff
@@ -195,14 +195,18 @@
result=theModel.Propagate(initalState, fancyNucleus);
debug.push_back("################# Result size");
debug.push_back(result->size());
if (result) {
debug.push_back(result->size());
} else {
debug.push_back(" -none-");
}
debug.dump();
std::for_each(initalState->begin(), initalState->end(), Delete<G4KineticTrack>());
delete initalState;
// std::for_each(initalState->begin(), initalState->end(), Delete<G4KineticTrack>());
// delete initalState;
if(result->size()==0)
if(! result || result->size()==0)
{
delete result; result=0;
if (result) {delete result; result=0;}
delete fancyNucleus;
delete projectile;
if (++tryCount > 200)
@@ -287,11 +287,12 @@ void G4RKPropagation::Transport(G4KineticTrackVector & active,
#endif
// if the particle is already outside nucleus go to next @@GF should never happen? check!
if(t_leave < 0)
{
throw G4HadronicException(__FILE__, __LINE__, "G4RKPropagation:: Attempt to track particle past a nucleus");
continue;
}
// does happen for particles added as late....
// if(t_leave < 0 )
// {
// throw G4HadronicException(__FILE__, __LINE__, "G4RKPropagation:: Attempt to track particle past a nucleus");
// continue;
// }
// Apply a straight line propagation for particle types
// not included in the model
@@ -334,6 +335,10 @@ void G4RKPropagation::Transport(G4KineticTrackVector & active,
// for the moment take it past the nucleus, so we'll not worry next time..
FreeTransport(kt, 1.1*t_leave); // take past nucleus
kt->SetState(G4KineticTrack::miss_nucleus);
// G4cout << "G4RKPropagation: Warning particle cannot enter Nucleus :" << G4endl;
// G4cout << " enter nucleus, E out/in: " << kt->GetTrackingMomentum().e() << " / " << newE <<G4endl;
// G4cout << " the Field "<< currentField->GetField(kt->GetPosition()) << " "<< kt->GetPosition()<<G4endl;
// G4cout << " the particle "<<kt->GetDefinition()->GetParticleName()<<G4endl;
continue;
}
//
@@ -380,8 +385,8 @@ void G4RKPropagation::Transport(G4KineticTrackVector & active,
G4ThreeVector posold=kt->GetPosition();
// if (currentField->GetField(kt->GetPosition()) > kt->GetProjectilePotential() ||
if ( currTimeStep > 0 &&
! FieldTransport(kt, currTimeStep)) {
if (currTimeStep > 0 &&
! FieldTransport(kt, currTimeStep)) {
FreeTransport(kt,currTimeStep);
}