Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4FastSimulationManager.cc,v 1.6 2001/10/26 14:43:36 mverderi Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4FastSimulationManager.cc,v 1.8 2002/11/15 11:41:56 stesting Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//---------------------------------------------------------------
//
@@ -118,6 +118,39 @@ G4FastSimulationManager::InActivateFastSimulationModel(const G4String& aName)
return false;
}
G4VFastSimulationModel*
G4FastSimulationManager::GetFastSimulationModel(const G4String& modelName,
const G4VFastSimulationModel* previousFound,
bool &foundPrevious) const
{
G4VFastSimulationModel* model = 0;
for (size_t iModel=0; iModel<ModelList.size(); iModel++)
{
if(ModelList[iModel]->GetName() == modelName)
{
if (previousFound == 0)
{
model = ModelList[iModel];
break;
}
else
{
if (ModelList[iModel] == previousFound)
{
foundPrevious = true;
continue;
}
if (foundPrevious)
{
model = ModelList[iModel];
break;
}
}
}
}
return model;
}
//----------------------------------------
// Methods to add/remove GhostPlacements
//----------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4FastSimulationManagerProcess.cc,v 1.7 2001/10/26 14:43:36 mverderi Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//---------------------------------------------------------------
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4FastSimulationMessenger.cc,v 1.4 2001/07/11 10:08:24 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4FastSimulationMessenger.cc,v 1.5 2002/12/04 21:29:50 asaim Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "G4FastSimulationMessenger.hh"
@@ -45,7 +45,7 @@ G4FastSimulationMessenger(G4GlobalFastSimulationManager* theGFSM)
fListEnvelopesCmd->SetDefaultValue("all");
fListEnvelopesCmd->SetGuidance("List all the envelope names for a given Particle");
fListEnvelopesCmd->SetGuidance("(or for all particles if without parameters).");
fListEnvelopesCmd->AvailableForStates(PreInit,Idle);
fListEnvelopesCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fListModelsCmd =
new G4UIcmdWithAString("/param/listModels", this);
@@ -53,7 +53,7 @@ G4FastSimulationMessenger(G4GlobalFastSimulationManager* theGFSM)
fListModelsCmd->SetDefaultValue("all");
fListModelsCmd->SetGuidance("List all the Model names for a given Envelope");
fListModelsCmd->SetGuidance("(or for all envelopes if without parameters).");
fListModelsCmd->AvailableForStates(PreInit,Idle);
fListModelsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fListIsApplicableCmd =
new G4UIcmdWithAString("/param/listIsApplicable", this);
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4FastStep.cc,v 1.9 2001/10/26 14:43:36 mverderi Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4FastStep.cc,v 1.10 2002/11/20 17:05:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//---------------------------------------------------------------
//
@@ -455,28 +455,28 @@ G4bool G4FastStep::CheckIt(const G4Track& aTrack)
// Energy should not be larger than the initial value
accuracy = ( theEnergyChange - aTrack.GetKineticEnergy())/MeV;
if (accuracy > accuracyForWarning) {
if (accuracy > GetAccuracyForWarning()) {
G4cout << " G4FastStep::CheckIt : ";
G4cout << "the energy becomes larger than the initial value !!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
if (accuracy > GetAccuracyForException()) exitWithError = true;
}
G4bool itsOKforMomentum = true;
if ( theEnergyChange >0.) {
accuracy = abs(theMomentumChange.mag2()-1.0);
if (accuracy > accuracyForWarning) {
if (accuracy > GetAccuracyForWarning()) {
G4cout << " G4FastStep::CheckIt : ";
G4cout << "the Momentum Change is not unit vector !!"
<< " Difference: " << accuracy << G4endl;
itsOK = itsOKforMomentum = false;
if (accuracy > accuracyForException) exitWithError = true;
if (accuracy > GetAccuracyForException()) exitWithError = true;
}
}
accuracy = (aTrack.GetGlobalTime()- theTimeChange)/ns;
if (accuracy > accuracyForWarning) {
if (accuracy > GetAccuracyForWarning()) {
G4cout << " G4FastStep::CheckIt : ";
G4cout << "the global time goes back !!"
<< " Difference: " << accuracy << "[ns] " <<G4endl;
@@ -22,7 +22,7 @@
//
//
// $Id: G4FastTrack.cc,v 1.6 2001/10/26 14:43:37 mverderi Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//---------------------------------------------------------------
//
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4GlobalFastSimulationManager.cc,v 1.8 2001/10/26 14:43:37 mverderi Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4GlobalFastSimulationManager.cc,v 1.12 2002/12/04 21:29:50 asaim Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//---------------------------------------------------------------
@@ -62,7 +62,7 @@ G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()
if(!fGlobalFastSimulationManager)
{
fGlobalFastSimulationManager = new G4GlobalFastSimulationManager;
fpConcreteInstance = fGlobalFastSimulationManager;
SetConcreteInstance(fGlobalFastSimulationManager);
}
return fGlobalFastSimulationManager;
}
@@ -246,9 +246,24 @@ G4bool
G4GlobalFastSimulationManager::Notify(G4ApplicationState requestedState)
{
G4StateManager * stateManager = G4StateManager::GetStateManager();
if((stateManager->GetPreviousState()==Idle) &&
(requestedState==GeomClosed) &&
if((stateManager->GetPreviousState()==G4State_Idle) &&
(requestedState==G4State_GeomClosed) &&
(!fClosed))
G4Exception("G4GlobalFastSimulationManager fatal error : \n1) you are using ghost volumes;\n2) In this case the G4GlobalFastSimulationManager MUST be closed BEFORE\n closing the geometry;\n3) To do this put in your code the call \n G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->\n CloseFastSimulation();\n just before closing the geometry.");
return true;
}
G4VFastSimulationModel*
G4GlobalFastSimulationManager::GetFastSimulationModel(const G4String& modelName,
const G4VFastSimulationModel* previousFound) const
{
G4VFastSimulationModel* model = 0;
// -- flag used to navigate accross the various managers;
bool foundPrevious(false);
for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
{
model = ManagedManagers[ifsm]->GetFastSimulationModel(modelName, previousFound, foundPrevious);
if (model) break;
}
return model;
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4VFastSimulationModel.cc,v 1.5 2001/07/11 10:08:25 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//---------------------------------------------------------------
//