Import Geant4 11.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2022-12-09 14:43:28 +01:00
parent c07cea1fe0
commit 9f34590941
3810 changed files with 200490 additions and 182326 deletions
@@ -80,7 +80,7 @@ void G4GDMLEvaluator::DefineVariable(const G4String& name, G4double value)
void G4GDMLEvaluator::DefineMatrix(const G4String& name, G4int coldim,
std::vector<G4double> valueList)
{
const G4int size = valueList.size();
const G4int size = (G4int)valueList.size();
if(size == 0)
{
@@ -676,7 +676,7 @@ void G4GDMLReadMaterials::MaterialRead(
}
else
{
material = new G4Material(Strip(name), D, nComponents, state, T, P);
material = new G4Material(Strip(name), D, (G4int)nComponents, state, T, P);
MixtureRead(materialElement, material);
}
if(MEE != -1) // ionisation potential (mean excitation energy)
@@ -987,8 +987,8 @@ void G4GDMLReadParamvol::Polycone_dimensionsRead(
}
}
G4int numZPlanes = zplaneList.size();
for(G4int i = 0; i < numZPlanes; ++i)
std::size_t numZPlanes = zplaneList.size();
for(std::size_t i = 0; i < numZPlanes; ++i)
{
parameter.dimension[3 + i * 3] = zplaneList[i].rmin * lunit;
parameter.dimension[4 + i * 3] = zplaneList[i].rmax * lunit;
@@ -1069,8 +1069,8 @@ void G4GDMLReadParamvol::Polyhedra_dimensionsRead(
parameter.dimension[0] *= aunit;
parameter.dimension[1] *= aunit;
for(xercesc::DOMNode* iter = element->getFirstChild(); iter != nullptr;
iter = iter->getNextSibling())
for(auto iter = element->getFirstChild(); iter != nullptr;
iter = iter->getNextSibling())
{
if(iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)
{
@@ -1093,8 +1093,8 @@ void G4GDMLReadParamvol::Polyhedra_dimensionsRead(
}
}
G4int numZPlanes = zplaneList.size();
for(G4int i = 0; i < numZPlanes; ++i)
std::size_t numZPlanes = zplaneList.size();
for(std::size_t i = 0; i < numZPlanes; ++i)
{
parameter.dimension[4 + i * 3] = zplaneList[i].rmin * lunit;
parameter.dimension[5 + i * 3] = zplaneList[i].rmax * lunit;
+16 -16
View File
@@ -1259,21 +1259,21 @@ void G4GDMLReadSolids::PolyconeRead(
}
}
G4int numZPlanes = zplaneList.size();
std::size_t numZPlanes = zplaneList.size();
G4double* rmin_array = new G4double[numZPlanes];
G4double* rmax_array = new G4double[numZPlanes];
G4double* z_array = new G4double[numZPlanes];
for(G4int i = 0; i < numZPlanes; ++i)
for(std::size_t i = 0; i < numZPlanes; ++i)
{
rmin_array[i] = zplaneList[i].rmin * lunit;
rmax_array[i] = zplaneList[i].rmax * lunit;
z_array[i] = zplaneList[i].z * lunit;
}
new G4Polycone(name, startphi, deltaphi, numZPlanes, z_array, rmin_array,
rmax_array);
new G4Polycone(name, startphi, deltaphi, (G4int)numZPlanes, z_array,
rmin_array, rmax_array);
delete[] rmin_array;
delete[] rmax_array;
@@ -1376,18 +1376,18 @@ void G4GDMLReadSolids::GenericPolyconeRead(
}
}
G4int numRZPoints = rzPointList.size();
std::size_t numRZPoints = rzPointList.size();
G4double* r_array = new G4double[numRZPoints];
G4double* z_array = new G4double[numRZPoints];
for(G4int i = 0; i < numRZPoints; ++i)
for(std::size_t i = 0; i < numRZPoints; ++i)
{
r_array[i] = rzPointList[i].r * lunit;
z_array[i] = rzPointList[i].z * lunit;
}
new G4GenericPolycone(name, startphi, deltaphi, numRZPoints, r_array,
z_array);
new G4GenericPolycone(name, startphi, deltaphi, (G4int)numRZPoints,
r_array, z_array);
delete[] r_array;
delete[] z_array;
}
@@ -1493,21 +1493,21 @@ void G4GDMLReadSolids::PolyhedraRead(
}
}
G4int numZPlanes = zplaneList.size();
std::size_t numZPlanes = zplaneList.size();
G4double* rmin_array = new G4double[numZPlanes];
G4double* rmax_array = new G4double[numZPlanes];
G4double* z_array = new G4double[numZPlanes];
for(G4int i = 0; i < numZPlanes; ++i)
for(std::size_t i = 0; i < numZPlanes; ++i)
{
rmin_array[i] = zplaneList[i].rmin * lunit;
rmax_array[i] = zplaneList[i].rmax * lunit;
z_array[i] = zplaneList[i].z * lunit;
}
new G4Polyhedra(name, startphi, deltaphi, numsides, numZPlanes, z_array,
rmin_array, rmax_array);
new G4Polyhedra(name, startphi, deltaphi, numsides, (G4int)numZPlanes,
z_array, rmin_array, rmax_array);
delete[] rmin_array;
delete[] rmax_array;
@@ -1615,19 +1615,19 @@ void G4GDMLReadSolids::GenericPolyhedraRead(
}
}
G4int numRZPoints = rzpointList.size();
std::size_t numRZPoints = rzpointList.size();
G4double* r_array = new G4double[numRZPoints];
G4double* z_array = new G4double[numRZPoints];
for(G4int i = 0; i < numRZPoints; ++i)
for(std::size_t i = 0; i < numRZPoints; ++i)
{
r_array[i] = rzpointList[i].r * lunit;
z_array[i] = rzpointList[i].z * lunit;
}
new G4Polyhedra(name, startphi, deltaphi, numsides, numRZPoints, r_array,
z_array);
new G4Polyhedra(name, startphi, deltaphi, numsides, (G4int)numRZPoints,
r_array, z_array);
delete[] r_array;
delete[] z_array;
@@ -120,13 +120,13 @@ void G4GDMLWriteMaterials::ElementWrite(const G4Element* const elementPtr)
xercesc::DOMElement* elementElement = NewElement("element");
elementElement->setAttributeNode(NewAttribute("name", name));
const std::size_t NumberOfIsotopes = elementPtr->GetNumberOfIsotopes();
const G4int NumberOfIsotopes = (G4int)elementPtr->GetNumberOfIsotopes();
if(NumberOfIsotopes > 0)
{
const G4double* RelativeAbundanceVector
= elementPtr->GetRelativeAbundanceVector();
for(std::size_t i = 0; i < NumberOfIsotopes; ++i)
for(G4int i = 0; i < NumberOfIsotopes; ++i)
{
G4String fractionref = GenerateName(elementPtr->GetIsotope(i)->GetName(),
elementPtr->GetIsotope(i));
@@ -195,7 +195,7 @@ void G4GDMLWriteMaterials::MaterialWrite(const G4Material* const materialPtr)
DWrite(materialElement, materialPtr->GetDensity());
const std::size_t NumberOfElements = materialPtr->GetNumberOfElements();
const G4int NumberOfElements = (G4int)materialPtr->GetNumberOfElements();
if((NumberOfElements > 1) ||
(materialPtr->GetElement(0) != nullptr &&
@@ -203,7 +203,7 @@ void G4GDMLWriteMaterials::MaterialWrite(const G4Material* const materialPtr)
{
const G4double* MassFractionVector = materialPtr->GetFractionVector();
for(std::size_t i = 0; i < NumberOfElements; ++i)
for(G4int i = 0; i < NumberOfElements; ++i)
{
const G4String fractionref = GenerateName(
materialPtr->GetElement(i)->GetName(), materialPtr->GetElement(i));
@@ -559,8 +559,8 @@ void G4GDMLWriteSolids::GenericPolyconeWrite(
polyconeElement->setAttributeNode(NewAttribute("lunit", "mm"));
solElement->appendChild(polyconeElement);
const std::size_t num_rzpoints = polycone->GetNumRZCorner();
for(std::size_t i = 0; i < num_rzpoints; ++i)
const G4int num_rzpoints = (G4int)polycone->GetNumRZCorner();
for(G4int i = 0; i < num_rzpoints; ++i)
{
const G4double r_point = polycone->GetCorner(i).r;
const G4double z_point = polycone->GetCorner(i).z;
@@ -617,9 +617,9 @@ void G4GDMLWriteSolids::PolyhedraWrite(xercesc::DOMElement* solElement,
polyhedraElement->setAttributeNode(NewAttribute("lunit", "mm"));
solElement->appendChild(polyhedraElement);
const std::size_t num_rzpoints = polyhedra->GetNumRZCorner();
const G4int num_rzpoints = (G4int)polyhedra->GetNumRZCorner();
for(std::size_t i = 0; i < num_rzpoints; ++i)
for(G4int i = 0; i < num_rzpoints; ++i)
{
const G4double r_point = polyhedra->GetCorner(i).r;
const G4double z_point = polyhedra->GetCorner(i).z;
@@ -669,11 +669,11 @@ void G4GDMLWriteSolids::TessellatedWrite(
std::map<G4ThreeVector, G4String, G4ThreeVectorCompare> vertexMap;
const std::size_t NumFacets = tessellated->GetNumberOfFacets();
std::size_t NumVertex = 0;
std::size_t NumVertex = 0;
for(std::size_t i = 0; i < NumFacets; ++i)
{
const G4VFacet* facet = tessellated->GetFacet(i);
const G4VFacet* facet = tessellated->GetFacet((G4int)i);
const size_t NumVertexPerFacet = facet->GetNumberOfVertices();
G4String FacetTag;
@@ -712,7 +712,7 @@ void G4GDMLWriteSolids::TessellatedWrite(
// cache it in the local map and add it as position in the
// "define" section of the GDML file.
const G4ThreeVector& vertex = facet->GetVertex(j);
const G4ThreeVector& vertex = facet->GetVertex((G4int)j);
if(vertexMap.find(vertex) != vertexMap.cend()) // Vertex is cached
{
@@ -432,7 +432,7 @@ const G4LogicalSkinSurface* G4GDMLWriteStructure::GetSkinSurface(
const G4LogicalVolume* const lvol)
{
G4LogicalSkinSurface* surf = 0;
G4int nsurf = G4LogicalSkinSurface::GetNumberOfSkinSurfaces();
std::size_t nsurf = G4LogicalSkinSurface::GetNumberOfSkinSurfaces();
if(nsurf)
{
const G4LogicalSkinSurfaceTable* stable =
@@ -454,7 +454,7 @@ const G4LogicalBorderSurface* G4GDMLWriteStructure::GetBorderSurface(
const G4VPhysicalVolume* const pvol)
{
G4LogicalBorderSurface* surf = nullptr;
G4int nsurf = G4LogicalBorderSurface::GetNumberOfBorderSurfaces();
std::size_t nsurf = G4LogicalBorderSurface::GetNumberOfBorderSurfaces();
if(nsurf)
{
const G4LogicalBorderSurfaceTable* btable =
@@ -611,7 +611,7 @@ G4Transform3D G4GDMLWriteStructure::TraverseVolumeTree(
solidrefElement->setAttributeNode(NewAttribute("ref", solidref));
volumeElement->appendChild(solidrefElement);
G4int daughterCount = volumePtr->GetNoDaughters();
std::size_t daughterCount = volumePtr->GetNoDaughters();
if(levelNo == maxLevel) // Stop exporting if reached levels limit
{
@@ -620,7 +620,7 @@ G4Transform3D G4GDMLWriteStructure::TraverseVolumeTree(
std::map<G4int, std::vector<G4int> > assemblyIDToAddedImprints;
for(G4int i = 0; i < daughterCount; ++i) // Traverse all the children!
for(std::size_t i = 0; i < daughterCount; ++i) // Traverse all the children!
{
const G4VPhysicalVolume* const physvol = volumePtr->GetDaughter(i);
const G4String ModuleName = Modularize(physvol, depth);