Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
+31 -13
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AdjointStackingAction.cc 76257 2013-11-08 11:31:00Z gcosmo $
// $Id: G4AdjointStackingAction.cc 98744 2016-08-09 13:21:26Z gcosmo $
//
/////////////////////////////////////////////////////////////////////////////
// Class Name: G4AdjointCrossSurfChecker
@@ -34,15 +34,19 @@
/////////////////////////////////////////////////////////////////////////////
#include "G4AdjointStackingAction.hh"
#include "G4AdjointTrackingAction.hh"
#include "G4Event.hh"
#include "G4Track.hh"
#include "G4ios.hh"
#include "G4StackManager.hh"
G4AdjointStackingAction::G4AdjointStackingAction()
: kill_tracks(true), adjoint_mode(true)
G4AdjointStackingAction::G4AdjointStackingAction(G4AdjointTrackingAction* anAction)
: reclassification_stage (false)
{
theFwdStackingAction =0;
theUserAdjointStackingAction =0;
theAdjointTrackingAction = anAction;
}
////////////////////////////////////////////////////////////////////////////////
//
@@ -51,24 +55,38 @@ G4AdjointStackingAction::~G4AdjointStackingAction()
////////////////////////////////////////////////////////////////////////////////
//
G4ClassificationOfNewTrack G4AdjointStackingAction::ClassifyNewTrack(const G4Track * aTrack)
{ G4ClassificationOfNewTrack classification = fUrgent;
if ( kill_tracks) classification=fKill;
else if (!adjoint_mode && theFwdStackingAction) classification = theFwdStackingAction->ClassifyNewTrack(aTrack);
else if (adjoint_mode && theUserAdjointStackingAction) classification = theUserAdjointStackingAction->ClassifyNewTrack(aTrack);
{
G4ClassificationOfNewTrack classification = fUrgent;
G4String partType = aTrack->GetParticleDefinition()->GetParticleType();
adjoint_mode = partType.contains(G4String("adjoint"));
if (!adjoint_mode ){
if (!reclassification_stage) classification = fWaiting;
else { //need to check if forwrad tracking can be continued use of
if (theAdjointTrackingAction->GetNbOfAdointTracksReachingTheExternalSurface()>0) {
if (theFwdStackingAction) classification = theFwdStackingAction->ClassifyNewTrack(aTrack);
}
else classification = fKill;
}
}
else if (theUserAdjointStackingAction) classification = theUserAdjointStackingAction->ClassifyNewTrack(aTrack);
return classification;
}
////////////////////////////////////////////////////////////////////////////////
//
void G4AdjointStackingAction::NewStage()
{
if ( !adjoint_mode && theFwdStackingAction) theFwdStackingAction->NewStage();
else if (adjoint_mode && theUserAdjointStackingAction) theUserAdjointStackingAction->NewStage();
{ reclassification_stage =true;
if (first_reclassification_stage){
if (theUserAdjointStackingAction) theUserAdjointStackingAction->NewStage();
stackManager->ReClassify();
}
else if (theFwdStackingAction) theFwdStackingAction->NewStage();
first_reclassification_stage =false;
}
////////////////////////////////////////////////////////////////////////////////
//
void G4AdjointStackingAction::PrepareNewEvent()
{
if ( !adjoint_mode && theFwdStackingAction) theFwdStackingAction->PrepareNewEvent();
else if (adjoint_mode && theUserAdjointStackingAction) theUserAdjointStackingAction->PrepareNewEvent();
{ reclassification_stage =false;
first_reclassification_stage =true;
if (theUserAdjointStackingAction) theUserAdjointStackingAction->PrepareNewEvent();
}
+10 -2
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Event.cc 94950 2016-01-07 11:53:14Z gcosmo $
// $Id: G4Event.cc 99158 2016-09-07 08:10:46Z gcosmo $
//
// G4Event
@@ -63,7 +63,15 @@ G4Event::G4Event(G4int evID)
G4Event::~G4Event()
{
delete thePrimaryVertex;
G4PrimaryVertex* nextVertex = thePrimaryVertex;
while(nextVertex)
{
G4PrimaryVertex* thisVertex = nextVertex;
nextVertex = thisVertex->GetNext();
thisVertex->ClearNext();
delete thisVertex;
}
thePrimaryVertex = nullptr;
delete HC;
delete DC;
if(trajectoryContainer)
+28 -12
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleGunMessenger.cc 78841 2014-01-28 08:52:40Z gcosmo $
// $Id: G4ParticleGunMessenger.cc 98744 2016-08-09 13:21:26Z gcosmo $
//
#include "G4ParticleGunMessenger.hh"
@@ -46,7 +46,8 @@
G4ParticleGunMessenger::G4ParticleGunMessenger(G4ParticleGun * fPtclGun)
:fParticleGun(fPtclGun),fShootIon(false),
fAtomicNumber(0),fAtomicMass(0),fIonCharge(0),fIonExciteEnergy(0.0),fIonEnergyLevel(0)
fAtomicNumber(0),fAtomicMass(0),fIonCharge(0),fIonExciteEnergy(0.0),
fIonFloatingLevelBase('\0'),fIonEnergyLevel(0)
{
particleTable = G4ParticleTable::GetParticleTable();
@@ -130,11 +131,12 @@ G4ParticleGunMessenger::G4ParticleGunMessenger(G4ParticleGun * fPtclGun)
ionCmd = new G4UIcommand("/gun/ion",this);
ionCmd->SetGuidance("Set properties of ion to be generated.");
ionCmd->SetGuidance("[usage] /gun/ion Z A Q");
ionCmd->SetGuidance("[usage] /gun/ion Z A [Q E flb]");
ionCmd->SetGuidance(" Z:(int) AtomicNumber");
ionCmd->SetGuidance(" A:(int) AtomicMass");
ionCmd->SetGuidance(" Q:(int) Charge of Ion (in unit of e)");
ionCmd->SetGuidance(" E:(double) Excitation energy (in keV)");
ionCmd->SetGuidance(" flb:(char) Floating level base");
G4UIparameter* param;
param = new G4UIparameter("Z",'i',false);
@@ -147,10 +149,14 @@ G4ParticleGunMessenger::G4ParticleGunMessenger(G4ParticleGun * fPtclGun)
param = new G4UIparameter("E",'d',true);
param->SetDefaultValue(0.0);
ionCmd->SetParameter(param);
param = new G4UIparameter("flb",'c',true);
param->SetDefaultValue("noFloat");
param->SetParameterCandidates("noFloat X Y Z U V W R S T A B C D E");
ionCmd->SetParameter(param);
ionLvlCmd = new G4UIcommand("/gun/ionL",this);
ionLvlCmd->SetGuidance("Set properties of ion to be generated.");
ionLvlCmd->SetGuidance("[usage] /gun/ion Z A Q I");
ionLvlCmd->SetGuidance("[usage] /gun/ionL Z A [Q I]");
ionLvlCmd->SetGuidance(" Z:(int) AtomicNumber");
ionLvlCmd->SetGuidance(" A:(int) AtomicMass");
ionLvlCmd->SetGuidance(" Q:(int) Charge of Ion (in unit of e)");
@@ -321,20 +327,30 @@ void G4ParticleGunMessenger::IonCommand(G4String newValues)
// check argument
fAtomicNumber = StoI(next());
fAtomicMass = StoI(next());
fIonCharge = fAtomicNumber;
fIonExciteEnergy = 0.0;
fIonFloatingLevelBase = '\0';
G4String sQ = next();
if (sQ.isNull() || StoI(sQ)<0) {
fIonCharge = fAtomicNumber;
} else {
fIonCharge = StoI(sQ);
if (!(sQ.isNull()))
{
if (StoI(sQ)>=0)
fIonCharge = StoI(sQ);
sQ = next();
if (sQ.isNull()) {
fIonExciteEnergy = 0.0;
} else {
if (!(sQ.isNull()))
{
fIonExciteEnergy = StoD(sQ) * keV;
sQ = next();
if (sQ.isNull()||sQ=="noFloat")
{ fIonFloatingLevelBase = '\0'; }
else
{ fIonFloatingLevelBase = sQ[(size_t)0]; }
}
}
G4ParticleDefinition* ion = 0;
ion = G4IonTable::GetIonTable()->GetIon( fAtomicNumber, fAtomicMass, fIonExciteEnergy);
ion = G4IonTable::GetIonTable()->GetIon( fAtomicNumber, fAtomicMass,
fIonExciteEnergy, fIonFloatingLevelBase);
if (ion==0) {
G4cout << "Ion with Z=" << fAtomicNumber;
G4cout << " A=" << fAtomicMass << "is not defined" << G4endl;
+2 -1
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PrimaryTransformer.cc 94950 2016-01-07 11:53:14Z gcosmo $
// $Id: G4PrimaryTransformer.cc 101916 2016-12-08 08:04:03Z gcosmo $
//
#include "G4PrimaryTransformer.hh"
@@ -280,6 +280,7 @@ void G4PrimaryTransformer::SetDecayProducts
G4double pmas = daughter->GetMass();
if(pmas>=0.)
{ DP->SetMass(pmas); }
DP->SetPolarization(daughter->GetPolX(),daughter->GetPolY(),daughter->GetPolZ());
decayProducts->PushProducts(DP);
SetDecayProducts(daughter,DP);
// Check the particle is properly constructed