Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MCCIndexConversionTable.cc 70369 2013-05-29 14:59:24Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4MaterialCutsCouple.cc 70369 2013-05-29 14:59:24Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -40,8 +39,8 @@
G4MaterialCutsCouple::G4MaterialCutsCouple() :
isMaterialModified(false),
fMaterial(0),
fCuts(0),
fMaterial(nullptr),
fCuts(nullptr),
indexNumber(-1),
isUsedInGeometry(false)
{
@@ -59,7 +58,7 @@ G4MaterialCutsCouple::G4MaterialCutsCouple(const G4Material* material,
G4MaterialCutsCouple::G4MaterialCutsCouple(const G4MaterialCutsCouple& right)
:fMaterial(0), fCuts(0)
:fMaterial(nullptr), fCuts(nullptr)
{
*this = right;
}
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhysicsTableHelper.cc 70369 2013-05-29 14:59:24Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -66,11 +65,11 @@ G4PhysicsTable* G4PhysicsTableHelper::PreparePhysicsTable(G4PhysicsTable* physTa
G4ProductionCutsTable* cutTable = G4ProductionCutsTable::GetProductionCutsTable();
size_t numberOfMCC = cutTable->GetTableSize();
if ( physTable !=0) {
if ( physTable != nullptr) {
// compare size of physics table and number of material-cuts-couple
if ( physTable->size() < numberOfMCC) {
// enlarge physcis table
physTable->resize(numberOfMCC, (G4PhysicsVector*)(0));
physTable->resize(numberOfMCC, nullptr);
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cerr << "G4PhysicsTableHelper::PreparePhysicsTable ";
@@ -96,8 +95,8 @@ G4PhysicsTable* G4PhysicsTableHelper::PreparePhysicsTable(G4PhysicsTable* physTa
} else {
// create PhysicsTable is given poitner is null
physTable = new G4PhysicsTable(numberOfMCC);
if (physTable!=0) {
physTable->resize(numberOfMCC, (G4PhysicsVector*)(0));
if (physTable != nullptr) {
physTable->resize(numberOfMCC, nullptr);
} else {
G4Exception( "G4PhysicsTableHelper::PreparePhysicsTable()",
"ProcCuts002", FatalException,
@@ -107,7 +106,7 @@ G4PhysicsTable* G4PhysicsTableHelper::PreparePhysicsTable(G4PhysicsTable* physTa
#ifdef G4VERBOSE
if (verboseLevel>2) {
if ( physTable !=0) {
if ( physTable != nullptr) {
G4cerr << "Physics Table size "<< physTable->size();
} else {
G4cerr << "Physics Table does not exist ";
@@ -138,7 +137,7 @@ G4bool G4PhysicsTableHelper::RetrievePhysicsTable(G4PhysicsTable* physTable,
const G4String& fileName,
G4bool ascii )
{
if (physTable == 0) return false;
if (physTable == nullptr ) return false;
// retrieve physics table from the given file
G4PhysicsTable* tempTable = new G4PhysicsTable();
@@ -184,7 +183,7 @@ G4bool G4PhysicsTableHelper::RetrievePhysicsTable(G4PhysicsTable* physTable,
if (converter->GetIndex(idx)<0) continue;
size_t i = converter->GetIndex(idx);
G4PhysicsVector* vec = (*physTable)[i];
if (vec !=0 ) delete vec;
if (vec != nullptr ) delete vec;
(*physTable)[i] = (*tempTable)[idx];
physTable->ClearFlag(i);
}
@@ -200,7 +199,7 @@ void G4PhysicsTableHelper::SetPhysicsVector(G4PhysicsTable* physTable,
size_t idx,
G4PhysicsVector* vec)
{
if ( physTable ==0) { return; }
if ( physTable == nullptr) { return; }
if ( physTable->size() <= idx) {
#ifdef G4VERBOSE
+8 -10
View File
@@ -24,8 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ProductionCuts.cc 73044 2013-08-15 09:44:11Z gcosmo $
// GEANT4 tag $Name: geant4-09-04-ref-00 $
//
//
// --------------------------------------------------------------
@@ -37,10 +35,10 @@
#include "G4ProductionCutsTable.hh"
#include <iomanip>
G4ThreadLocal G4ParticleDefinition* G4ProductionCuts::gammaDef = 0;
G4ThreadLocal G4ParticleDefinition* G4ProductionCuts::electDef = 0;
G4ThreadLocal G4ParticleDefinition* G4ProductionCuts::positDef = 0;
G4ThreadLocal G4ParticleDefinition* G4ProductionCuts::protonDef = 0;
G4ThreadLocal G4ParticleDefinition* G4ProductionCuts::gammaDef = nullptr;
G4ThreadLocal G4ParticleDefinition* G4ProductionCuts::electDef = nullptr;
G4ThreadLocal G4ParticleDefinition* G4ProductionCuts::positDef = nullptr;
G4ThreadLocal G4ParticleDefinition* G4ProductionCuts::protonDef = nullptr;
G4ProductionCuts::G4ProductionCuts() :
isModified(true)
@@ -111,10 +109,10 @@ G4int G4ProductionCuts::GetIndex(const G4ParticleDefinition* ptcl)
{
if(!ptcl) return -1;
// In the first call, pointers are set
if(gammaDef==0 && ptcl->GetParticleName()=="gamma") { gammaDef = (G4ParticleDefinition*) ptcl; }
if(electDef==0 && ptcl->GetParticleName()=="e-") { electDef = (G4ParticleDefinition*) ptcl; }
if(positDef==0 && ptcl->GetParticleName()=="e+") { positDef = (G4ParticleDefinition*) ptcl; }
if(protonDef==0 && ptcl->GetParticleName()=="proton") { protonDef = (G4ParticleDefinition*) ptcl; }
if(gammaDef==nullptr && ptcl->GetParticleName()=="gamma") { gammaDef = (G4ParticleDefinition*) ptcl; }
if(electDef==nullptr && ptcl->GetParticleName()=="e-") { electDef = (G4ParticleDefinition*) ptcl; }
if(positDef==nullptr && ptcl->GetParticleName()=="e+") { positDef = (G4ParticleDefinition*) ptcl; }
if(protonDef==nullptr && ptcl->GetParticleName()=="proton") { protonDef = (G4ParticleDefinition*) ptcl; }
G4int index;
if(ptcl==(const G4ParticleDefinition*) gammaDef) { index = 0; }
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ProductionCutsTable.cc 78776 2014-01-23 11:26:01Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -71,15 +70,15 @@ G4ProductionCutsTable* G4ProductionCutsTable::GetProductionCutsTable()
/////////////////////////////////////////////////////////////
G4ProductionCutsTable::G4ProductionCutsTable()
: firstUse(true),verboseLevel(1),fMessenger(0)
: firstUse(true),verboseLevel(1),fMessenger(nullptr)
{
for(size_t i=0;i< NumberOfG4CutIndex;i++)
{
rangeCutTable.push_back(new G4CutVectorForAParticle);
energyCutTable.push_back(new G4CutVectorForAParticle);
rangeDoubleVector[i] = 0;
energyDoubleVector[i] = 0;
converters[i] = 0;
rangeDoubleVector[i] = nullptr;
energyDoubleVector[i] = nullptr;
converters[i] = nullptr;
}
fG4RegionStore = G4RegionStore::GetInstance();
defaultProductionCuts = new G4ProductionCuts();
@@ -91,17 +90,17 @@ G4ProductionCutsTable::G4ProductionCutsTable()
/////////////////////////////////////////////////////////////
G4ProductionCutsTable::G4ProductionCutsTable(const G4ProductionCutsTable& )
{
fMessenger=0;
defaultProductionCuts=0;
fG4RegionStore =0;
fMessenger = nullptr;
defaultProductionCuts = nullptr;
fG4RegionStore = nullptr;
}
/////////////////////////////////////////////////////////////
G4ProductionCutsTable::~G4ProductionCutsTable()
{
if (defaultProductionCuts !=0) {
if (defaultProductionCuts != nullptr) {
delete defaultProductionCuts;
defaultProductionCuts =0;
defaultProductionCuts =nullptr;
}
for(CoupleTableIterator itr=coupleTable.begin();itr!=coupleTable.end();itr++){
@@ -113,13 +112,18 @@ G4ProductionCutsTable::~G4ProductionCutsTable()
delete rangeCutTable[i];
delete energyCutTable[i];
delete converters[i];
if(rangeDoubleVector[i]!=0) delete [] rangeDoubleVector[i];
if(energyDoubleVector[i]!=0) delete [] energyDoubleVector[i];
if(rangeDoubleVector[i] != nullptr) delete [] rangeDoubleVector[i];
if(energyDoubleVector[i] != nullptr) delete [] energyDoubleVector[i];
rangeCutTable[i] = nullptr;
energyCutTable[i] = nullptr;
converters[i] = nullptr;
rangeDoubleVector[i] = nullptr;
energyDoubleVector[i] = nullptr;
}
fG4ProductionCutsTable =0;
fG4ProductionCutsTable = nullptr;
if (fMessenger !=0) delete fMessenger;
fMessenger = 0;
if (fMessenger != nullptr) delete fMessenger;
fMessenger = nullptr;
}
void G4ProductionCutsTable::UpdateCoupleTable(G4VPhysicalVolume* /*currentWorld*/)
@@ -293,7 +297,7 @@ G4double G4ProductionCutsTable::ConvertRangeToEnergy(
{
// This method gives energy corresponding to range value
// check material
if (material ==0) return -1.0;
if (material ==nullptr) return -1.0;
// check range
if (range ==0.0) return 0.0;
@@ -350,7 +354,7 @@ void G4ProductionCutsTable::ScanAndSetCouple(G4LogicalVolume* aLV,
G4Region* aRegion)
{
//Check whether or not this logical volume belongs to the same region
if((aRegion!=0) && aLV->GetRegion()!=aRegion) return;
if((aRegion!=nullptr) && aLV->GetRegion()!=aRegion) return;
//Check if this particular volume has a material matched to the couple
if(aLV->GetMaterial()==aCouple->GetMaterial()) {
@@ -684,7 +688,7 @@ G4bool G4ProductionCutsTable::CheckMaterialInfo(const G4String& directory,
}
G4Material* aMaterial = G4Material::GetMaterial(name);
if (aMaterial ==0 ) continue;
if (aMaterial == nullptr ) continue;
G4double ratio = std::fabs(density/aMaterial->GetDensity() );
if ((0.999>ratio) || (ratio>1.001) ){
@@ -949,7 +953,7 @@ G4ProductionCutsTable::CheckMaterialCutsCoupleInfo(const G4String& directory,
// Loop over all couples
CoupleTableIterator cItr;
G4bool fOK = false;
G4MaterialCutsCouple* aCouple =0;
G4MaterialCutsCouple* aCouple = nullptr;
for (cItr=coupleTable.begin();cItr!=coupleTable.end();cItr++){
aCouple = (*cItr);
// check material name
@@ -976,17 +980,17 @@ G4ProductionCutsTable::CheckMaterialCutsCoupleInfo(const G4String& directory,
// debug information
if (verboseLevel >1) {
G4String regionname(region_name);
G4Region* fRegion = 0;
G4Region* fRegion = nullptr;
if ( regionname != "NONE" ) {
fRegion = fG4RegionStore->GetRegion(region_name);
if (fRegion==0) {
if (fRegion == nullptr) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << "Region " << regionname << " is not found ";
G4cout << index << ": in " << fileName << G4endl;
}
}
if ( ( (regionname == "NONE") && (aCouple->IsUsed()) ) ||
( (fRegion !=0) && !IsCoupleUsedInTheRegion(aCouple, fRegion) ) ) {
( (fRegion != nullptr) && !IsCoupleUsedInTheRegion(aCouple, fRegion) ) ) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << "A Couple is used differnt region in the current setup ";
G4cout << index << ": in " << fileName << G4endl;
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4ProductionCutsTableMessenger.cc 70369 2013-05-29 14:59:24Z gcosmo $
//
//
//---------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4RToEConvForElectron.cc 70745 2013-06-05 10:54:00Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4RToEConvForGamma.cc 70745 2013-06-05 10:54:00Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4RToEConvForPositron.cc 70745 2013-06-05 10:54:00Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4RToEConvForProton.cc 70745 2013-06-05 10:54:00Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4VRangeToEnergyConverter.cc 93090 2015-10-05 13:14:43Z gcosmo $
//
//
// --------------------------------------------------------------