Import Geant4 5.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:28:22 +02:00
parent fbd4999cf7
commit 4aea781e80
5454 changed files with 223141 additions and 67347 deletions
+5 -7
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ExceptionHandler.cc,v 1.2 2002/12/04 21:52:40 asaim Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4ExceptionHandler.cc,v 1.3 2003/05/21 21:06:01 asaim Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// ------------------------------------------------------------
@@ -47,15 +47,13 @@ G4ExceptionHandler::~G4ExceptionHandler()
{
}
G4ExceptionHandler::G4ExceptionHandler(const G4ExceptionHandler &right)
G4ExceptionHandler::G4ExceptionHandler(const G4ExceptionHandler &)
:G4VExceptionHandler()
{
*this = right;
}
G4ExceptionHandler& G4ExceptionHandler::operator=(const G4ExceptionHandler &right)
G4ExceptionHandler& G4ExceptionHandler::operator=(const G4ExceptionHandler &)
{
if (&right == this) return *this;
*this = right;
return *this;
}
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Run.cc,v 1.5 2003/04/23 17:54:31 asaim Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4Run.hh"
+56 -39
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4RunManager.cc,v 1.75 2003/04/24 17:42:06 asaim Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4RunManager.cc,v 1.81 2003/06/19 13:05:13 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
//
@@ -41,6 +41,7 @@
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4GeometryManager.hh"
#include "G4SDManager.hh"
#include "G4Navigator.hh"
#include "G4TransportationManager.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
@@ -59,7 +60,7 @@
#include "G4Material.hh"
#include "G4ExceptionHandler.hh"
#include "G4ios.hh"
#include "g4std/strstream"
#include <strstream>
G4RunManager* G4RunManager::fRunManager = 0;
@@ -99,13 +100,13 @@ G4RunManager::G4RunManager()
eventManager = new G4EventManager();
timer = new G4Timer();
runMessenger = new G4RunMessenger(this);
previousEvents = new G4std::vector<G4Event*>;
previousEvents = new std::vector<G4Event*>;
defaultRegion = new G4Region("DefaultRegionForTheWorld");
defaultRegion->SetProductionCuts(G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
G4ParticleTable::GetParticleTable()->CreateMessenger();
G4ProcessTable::GetProcessTable()->CreateMessenger();
randomNumberStatusDir = "./";
versionString = " Geant4 version $Name: geant4-05-01 $\n (30-Apr-2003)";
versionString = " Geant4 version $Name: geant4-05-02 $\n (27-June-2003)";
G4cout
<< "**********************************************" << G4endl
<< versionString << G4endl
@@ -329,8 +330,8 @@ G4Event* G4RunManager::GenerateEvent(G4int i_event)
void G4RunManager::AnalyzeEvent(G4Event* anEvent)
{
G4VPersistencyManager* fPersM = G4VPersistencyManager::GetPersistencyManager();
if(fPersM) fPersM->Store(currentEvent);
currentRun->RecordEvent(currentEvent);
if(fPersM) fPersM->Store(anEvent);
currentRun->RecordEvent(anEvent);
}
void G4RunManager::RunTermination()
@@ -395,7 +396,7 @@ void G4RunManager::InitializeGeometry()
}
if(verboseLevel>1) G4cout << "userDetector->Construct() start." << G4endl;
DefineWorldVolume(userDetector->Construct());
DefineWorldVolume(userDetector->Construct(),false);
geometryInitialized = true;
}
@@ -485,11 +486,10 @@ void G4RunManager::AbortEvent()
}
}
void G4RunManager::DefineWorldVolume(G4VPhysicalVolume* worldVol)
void G4RunManager::DefineWorldVolume(G4VPhysicalVolume* worldVol,
G4bool topologyIsChanged)
{
// check if this is different from previous
//////if(currentWorld==worldVol) return;
// The world volume MUST NOT have a region defined by the user.
// The world volume MUST NOT have a region defined by the user
if(worldVol->GetLogicalVolume()->GetRegion())
{
if(worldVol->GetLogicalVolume()->GetRegion()!=defaultRegion)
@@ -503,29 +503,41 @@ void G4RunManager::DefineWorldVolume(G4VPhysicalVolume* worldVol)
"World would have a default region assigned by RunManager.");
}
}
else
// Remove old world logical volume from the default region, if exist
if(defaultRegion->GetNumberOfRootVolumes())
{
// set the default region to the world
G4LogicalVolume* worldLog = worldVol->GetLogicalVolume();
worldLog->SetRegion(defaultRegion);
defaultRegion->AddRootLogicalVolume(worldLog);
if(defaultRegion->GetNumberOfRootVolumes()>size_t(1))
{
G4Exception("G4RunManager::DefineWorldVolume",
"RUN:DefaultRegionHasMoreThanOneVolume",
FatalException,
"Default world region should have a unique logical volume.");
}
std::vector<G4LogicalVolume*>::iterator lvItr
= defaultRegion->GetRootLogicalVolumeIterator();
defaultRegion->RemoveRootLogicalVolume(*lvItr);
if(verboseLevel>1) G4cout << (*lvItr)->GetName()
<< " is removed from the default region." << G4endl;
}
// Set the default region to the world
G4LogicalVolume* worldLog = worldVol->GetLogicalVolume();
worldLog->SetRegion(defaultRegion);
defaultRegion->AddRootLogicalVolume(worldLog);
if(verboseLevel>1) G4cout << worldLog->GetName()
<< " is registered to the default region." << G4endl;
// Set the world volume, notify the Navigator and reset its state
currentWorld = worldVol;
//geometryNeedsToBeClosed = true;
GeometryHasBeenModified();
// set the world volume to the Navigator
//ResetNavigator();
G4TransportationManager::GetTransportationManager()
->GetNavigatorForTracking()
->SetWorldVolume(worldVol);
//ResetNavigator();
->GetNavigatorForTracking()
->SetWorldVolume(worldVol);
if (topologyIsChanged) ResetNavigator();
// Let VisManager know it
// Notify the VisManager as well
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager) pVVisManager->GeometryHasChanged();
}
void G4RunManager::ResetNavigator() const
@@ -542,12 +554,20 @@ void G4RunManager::ResetNavigator() const
return;
}
// We have to tweak the navigator's state in case a geometry has been modified between runs
// By the following call we ensure that navigator's state is reset properly
// We have to tweak the navigator's state in case a geometry has been
// modified between runs. By the following calls we ensure that navigator's
// state is reset properly. It is required the geometry to be closed
// and previous optimisations to be cleared.
G4GeometryManager* geomManager = G4GeometryManager::GetInstance();
if(verboseLevel>1) G4cout << "Start closing geometry." << G4endl;
geomManager->OpenGeometry();
geomManager->CloseGeometry(geometryToBeOptimized, verboseLevel>1);
G4ThreeVector center(0,0,0);
G4TransportationManager::GetTransportationManager()
->GetNavigatorForTracking()
->LocateGlobalPointAndSetup(center,0,false);
G4Navigator* navigator =
G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
navigator->LocateGlobalPointAndSetup(center,0,false);
}
void G4RunManager::rndmSaveThisRun()
@@ -563,7 +583,7 @@ void G4RunManager::rndmSaveThisRun()
G4String fileIn = randomNumberStatusDir + "currentRun.rndm";
G4std::ostrstream os;
std::ostrstream os;
os << "run" << runNumber << ".rndm" << '\0';
G4String fileOut = randomNumberStatusDir + os.str();
@@ -583,7 +603,7 @@ void G4RunManager::rndmSaveThisEvent()
G4String fileIn = randomNumberStatusDir + "currentEvent.rndm";
G4std::ostrstream os;
std::ostrstream os;
os << "run" << currentRun->GetRunID() << "evt" << currentEvent->GetEventID()
<< ".rndm" << '\0';
G4String fileOut = randomNumberStatusDir + os.str();
@@ -596,7 +616,7 @@ void G4RunManager::rndmSaveThisEvent()
void G4RunManager::RestoreRandomNumberStatus(G4String fileN)
{
G4String fileNameWithDirectory;
if(fileN.index("/")==G4std::string::npos)
if(fileN.index("/")==std::string::npos)
{ fileNameWithDirectory = randomNumberStatusDir+fileN; }
else
{ fileNameWithDirectory = fileN; }
@@ -624,7 +644,7 @@ void G4RunManager::DumpRegion(G4Region* region) const
{
G4cout << "Region " << region->GetName() << G4endl;
G4cout << " Materials : ";
G4std::vector<G4Material*>::const_iterator mItr = region->GetMaterialIterator();
std::vector<G4Material*>::const_iterator mItr = region->GetMaterialIterator();
size_t nMaterial = region->GetNumberOfMaterials();
for(size_t iMate=0;iMate<nMaterial;iMate++)
{
@@ -640,6 +660,3 @@ void G4RunManager::DumpRegion(G4Region* region) const
<< G4endl;
}
}
+4 -4
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4RunMessenger.cc,v 1.17 2003/04/03 18:43:32 asaim Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4RunMessenger.cc,v 1.18 2003/06/16 17:12:52 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4RunMessenger.hh"
@@ -37,7 +37,7 @@
#include "G4UImanager.hh"
#include "G4ProductionCutsTable.hh"
#include "G4ios.hh"
#include "g4std/strstream"
#include <strstream>
G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
:runManager(runMgr)
@@ -237,7 +237,7 @@ void G4RunMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
G4int nev;
G4int ns;
const char* nv = (const char*)newValue;
G4std::istrstream is((char*)nv);
std::istrstream is((char*)nv);
is >> nev >> macroFileName >> ns;
if(macroFileName=="***NULL***")
{ runManager->BeamOn(nev); }
+3 -3
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4UserPhysicsListMessenger.cc,v 1.22 2003/04/28 22:54:37 asaim Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4UserPhysicsListMessenger.cc,v 1.23 2003/06/16 17:12:53 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
//
//---------------------------------------------------------------
@@ -209,7 +209,7 @@ void G4UserPhysicsListMessenger::SetNewValue(G4UIcommand * command,G4String newV
//G4String cValue = G4String(next())+" "+G4String(next());
//G4double newCut = setCutCmd->GetNewDoubleValue(cValue);
//thePhysicsList->SetCutsForRegion(newCut,rName);
G4std::istrstream is(newValue);
std::istrstream is(newValue);
char regName[50];
G4double cVal;
char uniName[10];
+4 -4
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4UserRunAction.cc,v 1.5 2003/03/10 01:50:21 asaim Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4UserRunAction.cc,v 1.6 2003/05/21 21:06:01 asaim Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4UserRunAction.hh"
@@ -36,9 +36,9 @@ G4UserRunAction::~G4UserRunAction()
G4Run* G4UserRunAction::GenerateRun()
{ return 0; }
void G4UserRunAction::BeginOfRunAction(const G4Run* aRun)
void G4UserRunAction::BeginOfRunAction(const G4Run*)
{;}
void G4UserRunAction::EndOfRunAction(const G4Run* aRun)
void G4UserRunAction::EndOfRunAction(const G4Run*)
{;}
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VModularPhysicsList.cc,v 1.2 2002/05/29 12:11:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// ------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VPersistencyManager.cc,v 1.4 2001/07/13 15:57:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4VPersistencyManager.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4VUserDetectorConstruction.cc,v 1.3 2001/07/11 10:08:34 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4VUserDetectorConstruction.hh"
+22 -27
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VUserPhysicsList.cc,v 1.41 2003/04/25 13:28:31 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4VUserPhysicsList.cc,v 1.45 2003/06/19 13:20:28 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
//
// ------------------------------------------------------------
@@ -30,18 +30,15 @@
//
// ------------------------------------------------------------
// History
// first version 09 Jan. 1998 by H.Kurashige
// modified 24 Jan. 1998 by H.Kurashige
// modified 06 June 1998 by H.Kurashige
// add G4ParticleWithCuts::SetEnergyRange
// 18 June 1998 by H.Kurashige
// modifeid for short lived particles 27 June 1998 by H.Kurashige
// G4BestUnit on output 12 nov. 1998 mma
// Added RemoveProcessManager 9 Feb. 1999 by H.Kurashige
// Fixed RemoveProcessManager 15 Apr. 1999 by H.Kurashige
// Removed ConstructAllParticles() 15 Apr. 1999 by H.Kurashige
// modified 08, Mar 2001 by H.Kurashige
// modified for CUTS per REGION 10, Oct 2002 by H.Kurashige
// first version 09 Jan 1998 by H.Kurashige
// Added SetEnergyRange 18 Jun 1998 by H.Kurashige
// Change for short lived particles 27 Jun 1998 by H.Kurashige
// G4BestUnit on output 12 nov 1998 by M.Maire
// Added RemoveProcessManager 9 Feb 1999 by H.Kurashige
// Fixed RemoveProcessManager 15 Apr 1999 by H.Kurashige
// Removed ConstructAllParticles() 15 Apr 1999 by H.Kurashige
// Modified for CUTS per REGION 10 Oct 2002 by H.Kurashige
// Check if particle IsShortLived 18 Jun 2003 by V.Ivanchenko
// ------------------------------------------------------------
#include "globals.hh"
@@ -61,8 +58,8 @@
#include "G4MaterialCutsCouple.hh"
#include "G4ios.hh"
#include "g4std/iomanip"
#include "g4std/fstream"
#include <iomanip>
#include <fstream>
////////////////////////////////////////////////////////
G4VUserPhysicsList::G4VUserPhysicsList()
@@ -151,7 +148,7 @@ void G4VUserPhysicsList::AddProcessManager(G4ParticleDefinition* newParticle,
newParticle->SetProcessManager(newManager);
#ifdef G4VERBOSE
if (verboseLevel >2){
if (verboseLevel >2){
G4cout << "G4VUserPhysicsList::AddProcessManager: ";
G4cout << "adds ProcessManager to ";
G4cout << newParticle->GetParticleName() << G4endl;
@@ -402,21 +399,19 @@ void G4VUserPhysicsList::BuildPhysicsTable(G4ParticleDefinition* particle)
G4cout << " for " << particle->GetParticleName() << G4endl;
}
#endif
G4int j;
// Rebuild the physics tables for every process for this particle type
G4ProcessVector* pVector = (particle->GetProcessManager())->GetProcessList();
for ( j=0; j < pVector->size(); ++j) {
(*pVector)[j]->BuildPhysicsTable(*particle);
}
for ( j=0; j < pVector->size(); ++j) {
// temporary addition to make the integral schema
BuildIntegralPhysicsTable((*pVector)[j], particle);
// if particle is not ShortLived
if(!particle->IsShortLived()) {
G4ProcessVector* pVector = particle->GetProcessManager()->GetProcessList();
for (G4int j=0; j < pVector->size(); ++j) {
(*pVector)[j]->BuildPhysicsTable(*particle);
}
}
}
///////////////////////////////////////////////////////////////
void G4VUserPhysicsList::BuildIntegralPhysicsTable(G4VProcess* process,
G4ParticleDefinition* particle)
G4ParticleDefinition* particle)
{
//*********************************************************************
// temporary addition to make the integral schema of electromagnetic
@@ -431,7 +426,7 @@ void G4VUserPhysicsList::BuildIntegralPhysicsTable(G4VProcess* process,
(process->GetProcessName() == "IMuIoni") ||
(process->GetProcessName() == "IMuBrems") ||
(process->GetProcessName() == "IMuPairProd") ) {
#ifdef G4VERBOSE
#ifdef G4VERBOSE
if (verboseLevel>2){
G4cout << "G4VUserPhysicsList::BuildIntegralPhysicsTable ";
G4cout << " BuildPhysicsTable is invoked for ";
@@ -22,7 +22,7 @@
//
//
// $Id: G4VUserPrimaryGeneratorAction.cc,v 1.3 2001/07/11 10:08:34 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4VUserPrimaryGeneratorAction.hh"