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
@@ -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;
};