Import Geant4 10.5.1 source tree

This commit is contained in:
Gabriele Cosmo
2019-04-17 10:39:02 +02:00
parent a7fdc52004
commit 28a70706e0
661 changed files with 55791 additions and 106984 deletions
+3
View File
@@ -15,6 +15,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
19 December 2018 - G.Cosmo (ascii-V10-04-00)
- Fixed shadowing compilation warning in G4tgbGeometryDumper and G4tgbVolume.
11 April 2014 - P.Arce (ascii-V10-00-01)
- G4tgbGeometryDumper: G4Para use G4ThreeVector methods for SymAxis
@@ -36,7 +36,6 @@
#include "G4tgrMessenger.hh"
#include "G4SystemOfUnits.hh"
#include "G4UIcommand.hh"
#include "G4Material.hh"
#include "G4Element.hh"
@@ -73,6 +72,7 @@
#include "G4PhysicalVolumeStore.hh"
#include "G4GeometryTolerance.hh"
#include "G4VPVParameterisation.hh"
#include "G4SystemOfUnits.hh"
#include <iomanip>
//------------------------------------------------------------------------
+3 -2
View File
@@ -34,8 +34,6 @@
#include "G4tgbVolume.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4tgbVolumeMgr.hh"
#include "G4tgbMaterialMgr.hh"
#include "G4tgbRotationMatrixMgr.hh"
@@ -104,6 +102,9 @@
#include "G4UIcommand.hh"
#include "G4GeometryTolerance.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
//-------------------------------------------------------------------
G4tgbVolume::G4tgbVolume()
: theTgrVolume(0), theG4AssemblyVolume(0)
+16
View File
@@ -16,6 +16,22 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
12 April 2019 Witek Pokorski (gdml-V10-04-06)
- Fixes to BorderSurface and OpticalSurface writer provided by Binbin Qi.
Addressing problem reports #2143 and #2142.
2 April 2019 Gabriele Cosmo (gdml-V10-04-05)
- Added more protections for workers also for writing modules and read.
1 April 2019 Gabriele Cosmo
- Added protection to G4GDMLParser::Write() to dump geometry only through
the master thread. Addressing problem report #2156.
4 March 2019 Gabriele Cosmo
- Fix in G4GDMLReadStructure::PhysvolRead() to allow correct import of
recursive assembly structures. Thanks to B.Qi for the suggested fix.
Addressing problem report #2141.
5 October 2018 Gabriele Cosmo (gdml-V10-04-04)
- Added stripping of invalid characters for names generation in writer classes
to prevent invalid NCName strings in exported GDML files. Adopt properly
@@ -47,7 +47,7 @@
#include "G4TransportationManager.hh"
#include "G4Navigator.hh"
#include "G4Threading.hh"
#define G4GDML_DEFAULT_SCHEMALOCATION G4String("http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd")
@@ -33,15 +33,21 @@
inline
void G4GDMLParser::Read(const G4String& filename, G4bool validate)
{
reader->Read(filename,validate,false,strip);
ImportRegions();
if ( G4Threading::IsMasterThread() )
{
reader->Read(filename,validate,false,strip);
ImportRegions();
}
}
inline
void G4GDMLParser::ReadModule(const G4String& filename, G4bool validate)
{
reader->Read(filename,validate,true);
ImportRegions();
if ( G4Threading::IsMasterThread() )
{
reader->Read(filename,validate,true);
ImportRegions();
}
}
inline
@@ -49,22 +55,25 @@ void G4GDMLParser::Write(const G4String& filename,
const G4VPhysicalVolume* pvol,
G4bool refs,
const G4String& schemaLocation)
{
const G4int depth = 0;
G4LogicalVolume* lvol = 0;
if (!pvol)
{
if ( G4Threading::IsMasterThread() )
{
lvol = G4TransportationManager::GetTransportationManager()->
GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume();
}
else
{
lvol = pvol->GetLogicalVolume();
}
const G4int depth = 0;
G4LogicalVolume* lvol = 0;
if (rexp) { ExportRegions(refs); }
writer->Write(filename,lvol,schemaLocation,depth,refs);
if (!pvol)
{
lvol = G4TransportationManager::GetTransportationManager()->
GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume();
}
else
{
lvol = pvol->GetLogicalVolume();
}
if (rexp) { ExportRegions(refs); }
writer->Write(filename,lvol,schemaLocation,depth,refs);
}
}
inline
@@ -73,15 +82,18 @@ void G4GDMLParser::Write(const G4String& filename,
G4bool refs,
const G4String& schemaLocation)
{
const G4int depth = 0;
if (!lvol)
if ( G4Threading::IsMasterThread() )
{
lvol = G4TransportationManager::GetTransportationManager()->
GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume();
const G4int depth = 0;
if (!lvol)
{
lvol = G4TransportationManager::GetTransportationManager()->
GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume();
}
if (rexp) { ExportRegions(refs); }
writer->Write(filename,lvol,schemaLocation,depth,refs);
}
if (rexp) { ExportRegions(refs); }
writer->Write(filename,lvol,schemaLocation,depth,refs);
}
inline
@@ -89,8 +101,15 @@ G4LogicalVolume* G4GDMLParser::ParseST(const G4String& filename,
G4Material* medium,
G4Material* solid)
{
G4STRead STreader;
return STreader.Read(filename, medium, solid);
if ( G4Threading::IsMasterThread() )
{
G4STRead STreader;
return STreader.Read(filename, medium, solid);
}
else
{
return 0;
}
}
//
@@ -81,6 +81,7 @@ class G4GDMLWriteMaterials : public G4GDMLWriteDefine
std::vector<const G4Isotope*> isotopeList;
std::vector<const G4Element*> elementList;
std::vector<const G4Material*> materialList;
std::vector<const G4PhysicsOrderedFreeVector*> propertyList;
xercesc::DOMElement* materialsElement;
};
@@ -373,6 +373,10 @@ PhysvolRead(const xercesc::DOMElement* const physvolElement,
if (pAssembly) // Fill assembly structure
{
if (assembly) // Case of recursive assemblies
{
pAssembly->AddPlacedAssembly(assembly, transform);
}
if (!logvol) { return; }
pAssembly->AddPlacedVolume(logvol, transform);
}
@@ -209,6 +209,12 @@ void G4GDMLWriteMaterials::MaterialWrite(const G4Material* const materialPtr)
void G4GDMLWriteMaterials::PropertyVectorWrite(const G4String& key,
const G4PhysicsOrderedFreeVector* const pvec)
{
for (size_t i=0; i<propertyList.size(); i++) // Check if property is
{ // already in the list!
if (propertyList[i] == pvec) { return; }
}
propertyList.push_back(pvec);
const G4String matrixref = GenerateName(key, pvec);
xercesc::DOMElement* matrixElement = NewElement("matrix");
matrixElement->setAttributeNode(NewAttribute("name", matrixref));
@@ -292,6 +298,7 @@ void G4GDMLWriteMaterials::MaterialsWrite(xercesc::DOMElement* element)
isotopeList.clear();
elementList.clear();
materialList.clear();
propertyList.clear();
}
void G4GDMLWriteMaterials::AddIsotope(const G4Isotope* const isotopePtr)
@@ -353,8 +353,9 @@ G4GDMLWriteStructure::GetBorderSurface(const G4VPhysicalVolume* const pvol)
for (pos = btable->begin(); pos != btable->end(); pos++)
{
if (pvol == (*pos)->GetVolume1()) // just the first in the couple
{ // is enough
surf = *pos; break;
{ // could be enough?
surf = *pos; // break;
BorderSurfaceCache(surf);
}
}
}
@@ -542,7 +543,8 @@ TraverseVolumeTree(const G4LogicalVolume* const volumePtr, const G4int depth)
PhysvolWrite(volumeElement,physvol,invR*P*daughterR,ModuleName);
}
BorderSurfaceCache(GetBorderSurface(physvol));
// BorderSurfaceCache(GetBorderSurface(physvol));
GetBorderSurface(physvol);
}
if (cexport) { ExportEnergyCuts(volumePtr); }