Import Geant4 10.4.1 source tree

This commit is contained in:
Gabriele Cosmo
2018-03-02 09:34:30 +01:00
parent fc6af9e721
commit fe04dcb406
341 changed files with 18389 additions and 24522 deletions
+9 -1
View File
@@ -1,4 +1,4 @@
$Id: History 106390 2017-10-09 09:42:18Z gcosmo $
$Id: History 108496 2018-02-15 15:28:32Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,14 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
07 February 2018 Daren Sawkey (gdml-V10-03-10)
- Updates to changes in G4Material[Const]PropertiesTable (fix bug #2030) in
G4GDMLWriteSolids and G4GDMLWriteMaterials.
19 December 2017 Gabriele Cosmo
- Fixed self-consistency in G4GDMLAuxStructType header (missing #include).
Thanks to Raphael Isemann for reporting this.
02 October 2017 Witek Pokorski (gdml-V10-03-09)
- Added handling of null pointer to material in case of parallel geometries
@@ -37,6 +37,7 @@
#define _G4GDMLAUXSTRUCTTYPE_INCLUDED_
#include <vector>
#include "G4String.hh"
struct G4GDMLAuxStructType
{
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteMaterials.cc 106194 2017-09-19 04:05:34Z gcosmo $
// $Id: G4GDMLWriteMaterials.cc 108496 2018-02-15 15:28:32Z gcosmo $
//
// class G4GDMLWriteMaterials Implementation
//
@@ -231,33 +231,35 @@ void G4GDMLWriteMaterials::PropertyWrite(xercesc::DOMElement* matElement,
xercesc::DOMElement* propElement;
G4MaterialPropertiesTable* ptable = mat->GetMaterialPropertiesTable();
const std::map< G4MPindex, G4PhysicsOrderedFreeVector*,
std::less<G4MPindex> >* pmap = ptable->GetPropertyMap();
const std::map< G4MCPindex, G4double,
std::less<G4MCPindex> >* cmap = ptable->GetConstPropertyMap();
std::map< G4MPindex, G4PhysicsOrderedFreeVector*,
std::less<G4MPindex> >::const_iterator mpos;
std::map< G4MCPindex, G4double,
std::less<G4MCPindex> >::const_iterator cpos;
const std::map< G4int, G4PhysicsOrderedFreeVector*,
std::less<G4int> >* pmap = ptable->GetPropertyMap();
const std::map< G4int, G4double,
std::less<G4int> >* cmap = ptable->GetConstPropertyMap();
std::map< G4int, G4PhysicsOrderedFreeVector*,
std::less<G4int> >::const_iterator mpos;
std::map< G4int, G4double,
std::less<G4int> >::const_iterator cpos;
for (mpos=pmap->begin(); mpos!=pmap->end(); mpos++)
{
propElement = NewElement("property");
propElement->setAttributeNode(NewAttribute("name",
G4MaterialPropertyName[mpos->first]));
ptable->GetMaterialPropertyNames()[mpos->first]));
propElement->setAttributeNode(NewAttribute("ref",
GenerateName(G4MaterialPropertyName[mpos->first], mpos->second)));
GenerateName(ptable->GetMaterialPropertyNames()[mpos->first],
mpos->second)));
if (mpos->second)
{
PropertyVectorWrite(G4MaterialPropertyName[mpos->first], mpos->second);
PropertyVectorWrite(ptable->GetMaterialPropertyNames()[mpos->first],
mpos->second);
matElement->appendChild(propElement);
}
else
{
G4String warn_message = "Null pointer for material property -"
+ G4MaterialPropertyName[mpos->first] + "- of material -"
+ mat->GetName() + "- !";
+ ptable->GetMaterialPropertyNames()[mpos->first] + "- of material -"
+ mat->GetName() + "- !";
G4Exception("G4GDMLWriteMaterials::PropertyWrite()", "NullPointer",
JustWarning, warn_message);
continue;
@@ -268,12 +270,12 @@ void G4GDMLWriteMaterials::PropertyWrite(xercesc::DOMElement* matElement,
{
propElement = NewElement("property");
propElement->setAttributeNode(NewAttribute("name",
G4MaterialConstPropertyName[cpos->first]));
ptable->GetMaterialConstPropertyNames()[cpos->first]));
propElement->setAttributeNode(NewAttribute("ref",
G4MaterialConstPropertyName[cpos->first]));
ptable->GetMaterialConstPropertyNames()[cpos->first]));
xercesc::DOMElement* constElement = NewElement("constant");
constElement->setAttributeNode(NewAttribute("name",
G4MaterialConstPropertyName[cpos->first]));
ptable->GetMaterialConstPropertyNames()[cpos->first]));
constElement->setAttributeNode(NewAttribute("value", cpos->second));
defineElement->appendChild(constElement);
matElement->appendChild(propElement);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GDMLWriteSolids.cc 106194 2017-09-19 04:05:34Z gcosmo $
// $Id: G4GDMLWriteSolids.cc 108496 2018-02-15 15:28:32Z gcosmo $
//
// class G4GDMLWriteSolids Implementation
//
@@ -1056,31 +1056,32 @@ void G4GDMLWriteSolids::PropertyWrite(xercesc::DOMElement* optElement,
{
xercesc::DOMElement* propElement;
G4MaterialPropertiesTable* ptable = surf->GetMaterialPropertiesTable();
const std::map< G4MPindex, G4PhysicsOrderedFreeVector*,
std::less<G4MPindex> >* pmap = ptable->GetPropertyMap();
const std::map< G4MCPindex, G4double,
std::less<G4MCPindex> >* cmap = ptable->GetConstPropertyMap();
std::map< G4MPindex, G4PhysicsOrderedFreeVector*,
std::less<G4MPindex> >::const_iterator mpos;
std::map< G4MCPindex, G4double,
std::less<G4MCPindex> >::const_iterator cpos;
const std::map< G4int, G4PhysicsOrderedFreeVector*,
std::less<G4int> >* pmap = ptable->GetPropertyMap();
const std::map< G4int, G4double,
std::less<G4int> >* cmap = ptable->GetConstPropertyMap();
std::map< G4int, G4PhysicsOrderedFreeVector*,
std::less<G4int> >::const_iterator mpos;
std::map< G4int, G4double,
std::less<G4int> >::const_iterator cpos;
for (mpos=pmap->begin(); mpos!=pmap->end(); mpos++)
{
propElement = NewElement("property");
propElement->setAttributeNode(NewAttribute("name",
G4MaterialPropertyName[mpos->first]));
ptable->GetMaterialPropertyNames()[mpos->first]));
propElement->setAttributeNode(NewAttribute("ref",
GenerateName(G4MaterialPropertyName[mpos->first],
GenerateName(ptable->GetMaterialPropertyNames()[mpos->first],
mpos->second)));
if (mpos->second)
{
PropertyVectorWrite(G4MaterialPropertyName[mpos->first], mpos->second);
PropertyVectorWrite(ptable->GetMaterialPropertyNames()[mpos->first],
mpos->second);
optElement->appendChild(propElement);
}
else
{
G4String warn_message = "Null pointer for material property -"
+ G4MaterialPropertyName[mpos->first]
+ ptable->GetMaterialPropertyNames()[mpos->first]
+ "- of optical surface -" + surf->GetName() + "- !";
G4Exception("G4GDMLWriteSolids::PropertyWrite()", "NullPointer",
JustWarning, warn_message);
@@ -1091,12 +1092,12 @@ void G4GDMLWriteSolids::PropertyWrite(xercesc::DOMElement* optElement,
{
propElement = NewElement("property");
propElement->setAttributeNode(NewAttribute("name",
G4MaterialConstPropertyName[cpos->first]));
ptable->GetMaterialConstPropertyNames()[cpos->first]));
propElement->setAttributeNode(NewAttribute("ref",
G4MaterialConstPropertyName[cpos->first]));
ptable->GetMaterialConstPropertyNames()[cpos->first]));
xercesc::DOMElement* constElement = NewElement("constant");
constElement->setAttributeNode(NewAttribute("name",
G4MaterialConstPropertyName[cpos->first]));
ptable->GetMaterialConstPropertyNames()[cpos->first]));
constElement->setAttributeNode(NewAttribute("value", cpos->second));
defineElement->appendChild(constElement);
optElement->appendChild(propElement);