Import Geant4 10.5.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2018-06-29 10:58:11 +02:00
parent fe81a77428
commit 6aa23be517
1581 changed files with 124288 additions and 83758 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4GeometryWorkspacePool.cc 103041 2017-03-10 11:47:01Z gcosmo $
// $Id: G4GeometryWorkspacePool.cc 110271 2018-05-17 14:41:15Z gcosmo $
//
//
// Class G4GeometryWorkspacePool - implementation
@@ -41,7 +41,11 @@ namespace
G4Mutex singletonM = G4MUTEX_INITIALIZER;
}
G4ThreadLocal G4GeometryWorkspace* G4GeometryWorkspacePool::fMyWorkspace=0;
G4GeometryWorkspace*& G4GeometryWorkspacePool::fMyWorkspace()
{
G4ThreadLocalStatic G4GeometryWorkspace* _instance = nullptr;
return _instance;
}
G4GeometryWorkspacePool* G4GeometryWorkspacePool::thePool=0;
@@ -60,7 +64,7 @@ G4GeometryWorkspacePool* G4GeometryWorkspacePool::GetInstance()
G4GeometryWorkspace* G4GeometryWorkspacePool::CreateWorkspace()
{
G4GeometryWorkspace* geometryWrk=0;
if( !fMyWorkspace )
if( !fMyWorkspace() )
{
geometryWrk= new G4GeometryWorkspace();
@@ -71,7 +75,7 @@ G4GeometryWorkspace* G4GeometryWorkspacePool::CreateWorkspace()
}
else
{
fMyWorkspace= geometryWrk;
fMyWorkspace()= geometryWrk;
}
}
else
@@ -79,7 +83,7 @@ G4GeometryWorkspace* G4GeometryWorkspacePool::CreateWorkspace()
G4Exception("GeometryWorspacePool::CreateWorkspace", "GeomVol003",
FatalException,
"Cannot create workspace twice for the same thread.");
geometryWrk= fMyWorkspace;
geometryWrk= fMyWorkspace();
}
return geometryWrk;
@@ -98,14 +102,14 @@ void G4GeometryWorkspacePool::CreateAndUseWorkspace()
//
G4GeometryWorkspace* G4GeometryWorkspacePool::FindOrCreateWorkspace()
{
G4GeometryWorkspace* geometryWrk= fMyWorkspace;
G4GeometryWorkspace* geometryWrk= fMyWorkspace();
if( !geometryWrk )
{
geometryWrk= this->CreateWorkspace();
}
geometryWrk->UseWorkspace();
fMyWorkspace= geometryWrk; // assign it for use by this thread.
fMyWorkspace()= geometryWrk; // assign it for use by this thread.
return geometryWrk;
}
@@ -124,11 +128,11 @@ void G4GeometryWorkspacePool::Recycle( G4GeometryWorkspace *geometryWrk )
//
void G4GeometryWorkspacePool::CleanUpAndDestroyAllWorkspaces()
{
if (fMyWorkspace)
if (fMyWorkspace())
{
fMyWorkspace->DestroyWorkspace();
delete fMyWorkspace;
fMyWorkspace=0;
fMyWorkspace()->DestroyWorkspace();
delete fMyWorkspace();
fMyWorkspace()=0;
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4NavigationHistory.cc 102197 2017-01-10 14:25:23Z gcosmo $
// $Id: G4NavigationHistory.cc 110271 2018-05-17 14:41:15Z gcosmo $
//
//
// G4NavigationHistory Implementation
@@ -36,7 +36,11 @@
#include "G4ios.hh"
#include "G4NavigationHistory.hh"
G4ThreadLocal G4Allocator<G4NavigationHistory> *aNavigHistoryAllocator = 0;
G4Allocator<G4NavigationHistory>*& aNavigHistoryAllocator()
{
G4ThreadLocalStatic G4Allocator<G4NavigationHistory>* _instance = nullptr;
return _instance;
}
G4NavigationHistory::G4NavigationHistory()
: fStackDepth(0)
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4NavigationLevel.cc 86527 2014-11-13 15:06:24Z gcosmo $
// $Id: G4NavigationLevel.cc 110271 2018-05-17 14:41:15Z gcosmo $
//
// 30.09.97 J.Apostolakis Initial version.
//
@@ -32,7 +32,11 @@
#include "G4NavigationLevel.hh"
G4ThreadLocal G4Allocator<G4NavigationLevel> *aNavigationLevelAllocator = 0;
G4Allocator<G4NavigationLevel>*& aNavigationLevelAllocator()
{
G4ThreadLocalStatic G4Allocator<G4NavigationLevel>* _instance = nullptr;
return _instance;
}
G4NavigationLevel::G4NavigationLevel( G4VPhysicalVolume* pPhysVol,
const G4AffineTransform& afTransform,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4NavigationLevelRep.cc 85846 2014-11-05 15:45:28Z gcosmo $
// $Id: G4NavigationLevelRep.cc 110271 2018-05-17 14:41:15Z gcosmo $
//
// 1 October 1997 J.Apostolakis Initial version.
//
@@ -32,4 +32,8 @@
#include "G4NavigationLevelRep.hh"
G4ThreadLocal G4Allocator<G4NavigationLevelRep> *aNavigLevelRepAllocator = 0;
G4Allocator<G4NavigationLevelRep>*& aNavigLevelRepAllocator()
{
G4ThreadLocalStatic G4Allocator<G4NavigationLevelRep>* _instance = nullptr;
return _instance;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PVParameterised.cc 73250 2013-08-22 13:22:23Z gcosmo $
// $Id: G4PVParameterised.cc 109823 2018-05-09 10:42:34Z gcosmo $
//
//
// class G4PVParameterised
@@ -236,7 +236,7 @@ G4PVParameterised::CheckOverlaps(G4int res, G4double tol,
{
// Transform each point according to daughter's frame
//
G4ThreeVector md = Td.Inverse().TransformPoint(*pos);
G4ThreeVector md = Td.InverseTransformPoint(*pos);
if (solidB->Inside(md)==kInside)
{
+9 -8
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PVPlacement.cc 85846 2014-11-05 15:45:28Z gcosmo $
// $Id: G4PVPlacement.cc 110402 2018-05-22 11:35:41Z gcosmo $
//
//
// class G4PVPlacement Implementation
@@ -277,7 +277,7 @@ G4bool G4PVPlacement::CheckOverlaps(G4int res, G4double tol,
std::ostringstream message;
message << "Overlap with mother volume !" << G4endl
<< " Overlap is detected for volume "
<< GetName() << G4endl
<< GetName() << ':' << GetCopyNo() << G4endl
<< " with its mother volume "
<< motherLog->GetName() << G4endl
<< " at mother local point " << mp << ", "
@@ -307,7 +307,7 @@ G4bool G4PVPlacement::CheckOverlaps(G4int res, G4double tol,
//
G4AffineTransform Td( daughter->GetRotation(),
daughter->GetTranslation() );
G4ThreeVector md = Td.Inverse().TransformPoint(mp);
G4ThreeVector md = Td.InverseTransformPoint(mp);
G4VSolid* daughterSolid = daughter->GetLogicalVolume()->GetSolid();
if (daughterSolid->Inside(md)==kInside)
@@ -319,8 +319,9 @@ G4bool G4PVPlacement::CheckOverlaps(G4int res, G4double tol,
std::ostringstream message;
message << "Overlap with volume already placed !" << G4endl
<< " Overlap is detected for volume "
<< GetName() << G4endl
<< " with " << daughter->GetName() << " volume's"
<< GetName() << ':' << GetCopyNo() << G4endl
<< " with " << daughter->GetName()
<< ':' << daughter->GetCopyNo() << " volume's"
<< G4endl
<< " local point " << md << ", "
<< "overlapping by at least: "
@@ -351,7 +352,7 @@ G4bool G4PVPlacement::CheckOverlaps(G4int res, G4double tol,
// and finally to current volume's coordinate system
//
G4ThreeVector mp2 = Td.TransformPoint(dPoint);
G4ThreeVector msi = Tm.Inverse().TransformPoint(mp2);
G4ThreeVector msi = Tm.InverseTransformPoint(mp2);
if (solid->Inside(msi)==kInside)
{
@@ -359,9 +360,9 @@ G4bool G4PVPlacement::CheckOverlaps(G4int res, G4double tol,
std::ostringstream message;
message << "Overlap with volume already placed !" << G4endl
<< " Overlap is detected for volume "
<< GetName() << G4endl
<< GetName() << ':' << GetCopyNo() << G4endl
<< " apparently fully encapsulating volume "
<< daughter->GetName() << G4endl
<< daughter->GetName() << ':' << daughter->GetCopyNo()
<< " at the same level !";
G4Exception("G4PVPlacement::CheckOverlaps()",
"GeomVol1002", JustWarning, message);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4TouchableHistory.cc 86527 2014-11-13 15:06:24Z gcosmo $
// $Id: G4TouchableHistory.cc 110271 2018-05-17 14:41:15Z gcosmo $
//
//
// class G4TouchableHistory Implementation
@@ -33,7 +33,11 @@
#include "G4TouchableHistory.hh"
G4ThreadLocal G4Allocator<G4TouchableHistory> *aTouchableHistoryAllocator = 0;
G4Allocator<G4TouchableHistory>*& aTouchableHistoryAllocator()
{
G4ThreadLocalStatic G4Allocator<G4TouchableHistory>* _instance = nullptr;
return _instance;
}
G4TouchableHistory::G4TouchableHistory()
: frot(G4RotationMatrix()),
@@ -46,10 +50,10 @@ G4TouchableHistory::G4TouchableHistory()
G4TouchableHistory::G4TouchableHistory( const G4NavigationHistory &history )
: fhistory(history)
{
G4AffineTransform tf(fhistory.GetTopTransform().Inverse());
ftlate = tf.NetTranslation();
frot = tf.NetRotation();
{
const G4AffineTransform& tf = fhistory.GetTopTransform();
ftlate = tf.InverseNetTranslation();
frot = tf.InverseNetRotation();
}
G4TouchableHistory::~G4TouchableHistory()