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 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.14 2001/10/26 15:27:06 mverderi Exp $
$Id: History,v 1.16 2002/11/20 17:05:46 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,26 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Nov 20, 2002 G. Cosmo - param-V04-01-02
o Patched access to public static data in G4FastStep.cc
and G4GlobalFastSimulationManager.cc to allow porting on
Windows DLLs.
Nov 15, 2002 S. Sadilov - param-V04-01-01
o Fixed compilation problems on Windows in
G4FastSimulationManager.cc and G4GlobalFastSimulationManager.cc
Nov 02, 2002 M. Verderi - param-V04-01-00
o Add method to retrieve G4VFastSimulationModel by name.
The user's method is in G4GlobalFastSimulationManager:
GetFastSimulationModel();
it is accompagnied by same methods name in
G4FastSimulationManager class.
o Add "test" directory, used to test above feature.
Oct 26, 2001 M. Verderi - param-V03-02-00
Fixes to clear warnings produced with gcc-2.95.2:
- loop index, where comparison with method "size()" of
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4FastSimulationManager.hh,v 1.7 2001/07/11 10:08:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4FastSimulationManager.hh,v 1.8 2002/11/02 00:10:34 mverderi Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//---------------------------------------------------------------
@@ -146,6 +146,13 @@ public: // without description
void ListModels(const G4String& aName) const;
const G4Envelope* GetEnvelope() const;
G4VFastSimulationModel* GetFastSimulationModel(const G4String& modelName,
const G4VFastSimulationModel* previousFound,
bool &foundPrevious) const;
//
//----------------------------------------------
// Interface methods for the G4GlobalFastSimulationManager
@@ -22,7 +22,7 @@
//
//
// $Id: G4FastSimulationManagerProcess.hh,v 1.8 2001/07/11 10:08:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//---------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4FastSimulationMessenger.hh,v 1.4 2001/07/11 10:08:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// GEANT 4 class header file
@@ -22,7 +22,7 @@
//
//
// $Id: G4FastStep.hh,v 1.6 2001/07/11 10:08:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//---------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4FastStep.icc,v 1.3 2001/07/11 10:08:24 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// $id: G4ParticleChange.icc,v 1.6 1998/04/14 02:25:54 kurasige Exp $
@@ -22,7 +22,7 @@
//
//
// $Id: G4FastTrack.hh,v 1.5 2001/07/11 10:08:24 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// $Id:
//---------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4FlavoredParallelWorld.hh,v 1.5 2001/07/11 10:08:24 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//---------------------------------------------------------------
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4GlobalFastSimulationManager.hh,v 1.8 2001/07/11 10:08:24 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4GlobalFastSimulationManager.hh,v 1.9 2002/11/02 00:10:34 mverderi Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//---------------------------------------------------------------
@@ -88,6 +88,32 @@ public: // With description
static G4GlobalFastSimulationManager* GetGlobalFastSimulationManager();
// Provides a global access to the GlobalFastSimulationManager
G4VFastSimulationModel* GetFastSimulationModel(const G4String& modelName,
const G4VFastSimulationModel* previousFound = 0) const;
// Fetch G4VFastSimulationModel by name:
//
// o returns the G4VFastSimulationModel* of model with name modelName;
// o returns 0 if no model found;
//
// - usage:
//
// myModel = gblManager->GetFastSimulationModel("MyModel");
//
// o note for the case of several models having the same name:
// - to get the first "MyModel" model:
//
// myModel1 = gblManager->GetFastSimulationModel("MyModel", 0);
//
// - to get the next one:
//
// myModel2 = gblManager->GetFastSimulationModel("MyModel", myModel1);
//
// - and so on.
//
// - When gblManager->GetFastSimulationModel("MyModel", myModel_n)
// returns a null pointer, no extra model with name "MyModel" exist.
public: // Without description
@@ -101,6 +127,7 @@ public: // Without description
void AddFastSimulationManager(G4FastSimulationManager*);
void RemoveFastSimulationManager(G4FastSimulationManager*);
// Flag that the Parameterisation must be closed.
void FastSimulationNeedsToBeClosed();
@@ -22,7 +22,7 @@
//
//
// $Id: G4VFastSimulationModel.hh,v 1.4 2001/07/11 10:08:24 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//---------------------------------------------------------------
@@ -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 $
//
//---------------------------------------------------------------
//