Import Geant4 10.4.2 source tree

This commit is contained in:
Gabriele Cosmo
2018-05-25 16:18:53 +02:00
parent fe04dcb406
commit fe81a77428
233 changed files with 44301 additions and 105671 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History 108496 2018-02-15 15:28:32Z gcosmo $
$Id: History 110108 2018-05-15 11:46:54Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
15 March 2018 Gabriele Cosmo (gdml-V10-03-11)
- Protect printout of progress in reading/writing by G4VERBOSE.
07 February 2018 Daren Sawkey (gdml-V10-03-10)
- Updates to changes in G4Material[Const]PropertiesTable (fix bug #2030) in
G4GDMLWriteSolids and G4GDMLWriteMaterials.
+7 -3
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLRead.cc 89819 2015-04-30 14:53:35Z gcosmo $
// $Id: G4GDMLRead.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLRead Implementation
//
@@ -321,8 +321,9 @@ AuxiliaryRead(const xercesc::DOMElement* const auxiliaryElement)
void G4GDMLRead::UserinfoRead(const xercesc::DOMElement* const userinfoElement)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Reading userinfo..." << G4endl;
#endif
for (xercesc::DOMNode* iter = userinfoElement->getFirstChild();
iter != 0; iter = iter->getNextSibling())
{
@@ -364,6 +365,7 @@ void G4GDMLRead::Read(const G4String& fileName,
G4bool strip)
{
dostrip = strip;
#ifdef G4VERBOSE
if (isModule)
{
G4cout << "G4GDML: Reading module '" << fileName << "'..." << G4endl;
@@ -372,7 +374,7 @@ void G4GDMLRead::Read(const G4String& fileName,
{
G4cout << "G4GDML: Reading '" << fileName << "'..." << G4endl;
}
#endif
inLoop = 0;
validate = validation;
@@ -458,7 +460,9 @@ void G4GDMLRead::Read(const G4String& fileName,
if (isModule)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Reading module '" << fileName << "' done!" << G4endl;
#endif
}
else
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLReadDefine.cc 96190 2016-03-29 08:07:36Z gcosmo $
// $Id: G4GDMLReadDefine.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLReadDefine Implementation
//
@@ -466,8 +466,9 @@ void G4GDMLReadDefine::QuantityRead(const xercesc::DOMElement* const element)
void
G4GDMLReadDefine::DefineRead(const xercesc::DOMElement* const defineElement)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Reading definitions..." << G4endl;
#endif
for (xercesc::DOMNode* iter = defineElement->getFirstChild();
iter != 0;iter = iter->getNextSibling())
{
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLReadMaterials.cc 96190 2016-03-29 08:07:36Z gcosmo $
// $Id: G4GDMLReadMaterials.cc 110108 2018-05-15 11:46:54Z gcosmo $
// GEANT4 tag $ Name:$
//
// class G4GDMLReadMaterials Implementation
@@ -697,8 +697,9 @@ PropertyRead(const xercesc::DOMElement* const propertyElement,
void G4GDMLReadMaterials::
MaterialsRead(const xercesc::DOMElement* const materialsElement)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Reading materials..." << G4endl;
#endif
for (xercesc::DOMNode* iter = materialsElement->getFirstChild();
iter != 0; iter = iter->getNextSibling())
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLReadSetup.cc 88207 2015-02-03 13:47:36Z gcosmo $
// $Id: G4GDMLReadSetup.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLReadSetup Implementation
//
@@ -64,8 +64,9 @@ G4String G4GDMLReadSetup::GetSetup(const G4String& ref)
void G4GDMLReadSetup::SetupRead(const xercesc::DOMElement* const element)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Reading setup..." << G4endl;
#endif
G4String name;
const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLReadSolids.cc 105857 2017-08-24 07:52:24Z gcosmo $
// $Id: G4GDMLReadSolids.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLReadSolids Implementation
//
@@ -2689,8 +2689,9 @@ OpticalSurfaceRead(const xercesc::DOMElement* const opticalsurfaceElement)
void G4GDMLReadSolids::SolidsRead(const xercesc::DOMElement* const solidsElement)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Reading solids..." << G4endl;
#endif
for (xercesc::DOMNode* iter = solidsElement->getFirstChild();
iter != 0; iter = iter->getNextSibling())
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLReadStructure.cc 101687 2016-11-21 09:43:18Z gcosmo $
// $Id: G4GDMLReadStructure.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLReadStructure Implementation
//
@@ -794,8 +794,9 @@ Volume_contentRead(const xercesc::DOMElement* const volumeElement)
void G4GDMLReadStructure::
StructureRead(const xercesc::DOMElement* const structureElement)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Reading structure..." << G4endl;
#endif
for (xercesc::DOMNode* iter = structureElement->getFirstChild();
iter != 0; iter = iter->getNextSibling())
{
+7 -4
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWrite.cc 96170 2016-03-22 09:17:29Z gcosmo $
// $Id: G4GDMLWrite.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLWrite Implementation
//
@@ -112,8 +112,9 @@ void G4GDMLWrite::UserinfoWrite(xercesc::DOMElement* gdmlElement)
{
if(auxList.size()>0)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Writing userinfo..." << G4endl;
#endif
userinfoElement = NewElement("userinfo");
gdmlElement->appendChild(userinfoElement);
AddAuxInfo(&auxList, userinfoElement);
@@ -171,10 +172,10 @@ G4Transform3D G4GDMLWrite::Write(const G4String& fname,
{
SchemaLocation = setSchemaLocation;
addPointerToName = refs;
#ifdef G4VERBOSE
if (depth==0) { G4cout << "G4GDML: Writing '" << fname << "'..." << G4endl; }
else { G4cout << "G4GDML: Writing module '" << fname << "'..." << G4endl; }
#endif
if (FileExists(fname))
{
G4String ErrorMessage = "File '"+fname+"' already exists!";
@@ -272,7 +273,9 @@ G4Transform3D G4GDMLWrite::Write(const G4String& fname,
}
else
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Writing module '" << fname << "' done !" << G4endl;
#endif
}
return R;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteDefine.cc 93077 2015-10-02 14:38:25Z gcosmo $
// $Id: G4GDMLWriteDefine.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLWriteDefine Implementation
//
@@ -130,8 +130,9 @@ Position_vectorWrite(xercesc::DOMElement* element, const G4String& tag,
void G4GDMLWriteDefine::DefineWrite(xercesc::DOMElement* element)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Writing definitions..." << G4endl;
#endif
defineElement = NewElement("define");
element->appendChild(defineElement);
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteMaterials.cc 108496 2018-02-15 15:28:32Z gcosmo $
// $Id: G4GDMLWriteMaterials.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLWriteMaterials Implementation
//
@@ -284,8 +284,9 @@ void G4GDMLWriteMaterials::PropertyWrite(xercesc::DOMElement* matElement,
void G4GDMLWriteMaterials::MaterialsWrite(xercesc::DOMElement* element)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Writing materials..." << G4endl;
#endif
materialsElement = NewElement("materials");
element->appendChild(materialsElement);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteSetup.cc 68053 2013-03-13 14:39:51Z gcosmo $
// $Id: G4GDMLWriteSetup.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLWriteSetup Implementation
//
@@ -47,8 +47,9 @@ G4GDMLWriteSetup::~G4GDMLWriteSetup()
void G4GDMLWriteSetup::SetupWrite(xercesc::DOMElement* gdmlElement,
const G4LogicalVolume* const logvol)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Writing setup..." << G4endl;
#endif
const G4String worldref = GenerateName(logvol->GetName(),logvol);
xercesc::DOMElement* setupElement = NewElement("setup");
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteSolids.cc 108496 2018-02-15 15:28:32Z gcosmo $
// $Id: G4GDMLWriteSolids.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLWriteSolids Implementation
//
@@ -555,7 +555,6 @@ GenericPolyconeWrite(xercesc::DOMElement* solElement,
const G4double z_point=polycone->GetCorner(i).z;
RZPointWrite(polyconeElement,r_point,z_point);
}
}
void G4GDMLWriteSolids::
@@ -563,56 +562,60 @@ PolyhedraWrite(xercesc::DOMElement* solElement,
const G4Polyhedra* const polyhedra)
{
const G4String& name = GenerateName(polyhedra->GetName(),polyhedra);
if(polyhedra->IsGeneric() == false){
xercesc::DOMElement* polyhedraElement = NewElement("polyhedra");
polyhedraElement->setAttributeNode(NewAttribute("name",name));
polyhedraElement->setAttributeNode(NewAttribute("startphi",
if(polyhedra->IsGeneric() == false)
{
xercesc::DOMElement* polyhedraElement = NewElement("polyhedra");
polyhedraElement->setAttributeNode(NewAttribute("name",name));
polyhedraElement->setAttributeNode(NewAttribute("startphi",
polyhedra->GetOriginalParameters()->Start_angle/degree));
polyhedraElement->setAttributeNode(NewAttribute("deltaphi",
polyhedraElement->setAttributeNode(NewAttribute("deltaphi",
polyhedra->GetOriginalParameters()->Opening_angle/degree));
polyhedraElement->setAttributeNode(NewAttribute("numsides",
polyhedraElement->setAttributeNode(NewAttribute("numsides",
polyhedra->GetOriginalParameters()->numSide));
polyhedraElement->setAttributeNode(NewAttribute("aunit","deg"));
polyhedraElement->setAttributeNode(NewAttribute("lunit","mm"));
solElement->appendChild(polyhedraElement);
polyhedraElement->setAttributeNode(NewAttribute("aunit","deg"));
polyhedraElement->setAttributeNode(NewAttribute("lunit","mm"));
solElement->appendChild(polyhedraElement);
const size_t num_zplanes = polyhedra->GetOriginalParameters()->Num_z_planes;
const G4double* z_array = polyhedra->GetOriginalParameters()->Z_values;
const G4double* rmin_array = polyhedra->GetOriginalParameters()->Rmin;
const G4double* rmax_array = polyhedra->GetOriginalParameters()->Rmax;
const size_t num_zplanes =
polyhedra->GetOriginalParameters()->Num_z_planes;
const G4double* z_array =
polyhedra->GetOriginalParameters()->Z_values;
const G4double* rmin_array = polyhedra->GetOriginalParameters()->Rmin;
const G4double* rmax_array = polyhedra->GetOriginalParameters()->Rmax;
const G4double convertRad =
std::cos(0.5*polyhedra->GetOriginalParameters()->Opening_angle
/ polyhedra->GetOriginalParameters()->numSide);
const G4double convertRad =
std::cos(0.5*polyhedra->GetOriginalParameters()->Opening_angle
/ polyhedra->GetOriginalParameters()->numSide);
for (size_t i=0;i<num_zplanes;i++)
{
ZplaneWrite(polyhedraElement,z_array[i],
rmin_array[i]*convertRad, rmax_array[i]*convertRad);
}
}else{//generic polyhedra
xercesc::DOMElement* polyhedraElement = NewElement("genericPolyhedra");
polyhedraElement->setAttributeNode(NewAttribute("name",name));
polyhedraElement->setAttributeNode(NewAttribute("startphi",
for (size_t i=0;i<num_zplanes;i++)
{
ZplaneWrite(polyhedraElement,z_array[i],
rmin_array[i]*convertRad, rmax_array[i]*convertRad);
}
}
else // generic polyhedra
{
xercesc::DOMElement* polyhedraElement = NewElement("genericPolyhedra");
polyhedraElement->setAttributeNode(NewAttribute("name",name));
polyhedraElement->setAttributeNode(NewAttribute("startphi",
polyhedra->GetOriginalParameters()->Start_angle/degree));
polyhedraElement->setAttributeNode(NewAttribute("deltaphi",
polyhedraElement->setAttributeNode(NewAttribute("deltaphi",
polyhedra->GetOriginalParameters()->Opening_angle/degree));
polyhedraElement->setAttributeNode(NewAttribute("numsides",
polyhedraElement->setAttributeNode(NewAttribute("numsides",
polyhedra->GetOriginalParameters()->numSide));
polyhedraElement->setAttributeNode(NewAttribute("aunit","deg"));
polyhedraElement->setAttributeNode(NewAttribute("lunit","mm"));
solElement->appendChild(polyhedraElement);
polyhedraElement->setAttributeNode(NewAttribute("aunit","deg"));
polyhedraElement->setAttributeNode(NewAttribute("lunit","mm"));
solElement->appendChild(polyhedraElement);
const size_t num_rzpoints = polyhedra->GetNumRZCorner();
const size_t num_rzpoints = polyhedra->GetNumRZCorner();
for (size_t i=0;i<num_rzpoints;i++)
{
const G4double r_point = polyhedra->GetCorner(i).r;
const G4double z_point = polyhedra->GetCorner(i).z;
RZPointWrite(polyhedraElement,r_point,z_point);
}
}
for (size_t i=0;i<num_rzpoints;i++)
{
const G4double r_point = polyhedra->GetCorner(i).r;
const G4double z_point = polyhedra->GetCorner(i).z;
RZPointWrite(polyhedraElement,r_point,z_point);
}
}
}
void G4GDMLWriteSolids::
@@ -1106,8 +1109,9 @@ void G4GDMLWriteSolids::PropertyWrite(xercesc::DOMElement* optElement,
void G4GDMLWriteSolids::SolidsWrite(xercesc::DOMElement* gdmlElement)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Writing solids..." << G4endl;
#endif
solidsElement = NewElement("solids");
gdmlElement->appendChild(solidsElement);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteStructure.cc 106390 2017-10-09 09:42:18Z gcosmo $
// $Id: G4GDMLWriteStructure.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4GDMLWriteStructure Implementation
//
@@ -362,8 +362,9 @@ G4GDMLWriteStructure::GetBorderSurface(const G4VPhysicalVolume* const pvol)
void G4GDMLWriteStructure::SurfacesWrite()
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Writing surfaces..." << G4endl;
#endif
std::vector<xercesc::DOMElement*>::const_iterator pos;
for (pos = skinElementVec.begin(); pos != skinElementVec.end(); pos++)
{
@@ -377,8 +378,9 @@ void G4GDMLWriteStructure::SurfacesWrite()
void G4GDMLWriteStructure::StructureWrite(xercesc::DOMElement* gdmlElement)
{
#ifdef G4VERBOSE
G4cout << "G4GDML: Writing structure..." << G4endl;
#endif
structureElement = NewElement("structure");
gdmlElement->appendChild(structureElement);
}
+7 -3
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4STRead.cc 68053 2013-03-13 14:39:51Z gcosmo $
// $Id: G4STRead.cc 110108 2018-05-15 11:46:54Z gcosmo $
//
// class G4STRead Implementation
//
@@ -63,7 +63,9 @@ void G4STRead::TessellatedRead(const std::string& line)
new G4LogicalVolume(tessellated, solid_material, name+"_LV" , 0, 0, 0);
tessellatedList.push_back(tessellated);
#ifdef G4VERBOSE
G4cout << "G4STRead: Reading solid: " << name << G4endl;
#endif
}
void G4STRead::FacetRead(const std::string& line)
@@ -197,8 +199,9 @@ void G4STRead::PhysvolRead(const std::string& line)
void G4STRead::ReadGeom(const G4String& name)
{
#ifdef G4VERBOSE
G4cout << "G4STRead: Reading '" << name << "'..." << G4endl;
#endif
std::ifstream GeomFile(name);
if (!GeomFile)
@@ -228,8 +231,9 @@ void G4STRead::ReadGeom(const G4String& name)
void G4STRead::ReadTree(const G4String& name)
{
#ifdef G4VERBOSE
G4cout << "G4STRead: Reading '" << name << "'..." << G4endl;
#endif
std::ifstream TreeFile(name);
if (!TreeFile)