Import Geant4 10.4.0.beta source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IStore.cc 88801 2015-03-10 14:38:27Z gcosmo $
|
||||
// $Id: G4IStore.cc 102994 2017-03-07 16:31:28Z gcosmo $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -40,6 +40,10 @@
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4Mutex G4IStore::IStoreMutex = G4MUTEX_INITIALIZER;
|
||||
#endif
|
||||
|
||||
// ***************************************************************************
|
||||
// Static class variable: ptr to single instance of class
|
||||
// ***************************************************************************
|
||||
@@ -149,18 +153,29 @@ void G4IStore::ChangeImportance(G4double importance,
|
||||
G4double G4IStore::GetImportance(const G4VPhysicalVolume &aVolume,
|
||||
G4int aRepNum) const
|
||||
{
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&G4IStore::IStoreMutex);
|
||||
#endif
|
||||
SetInternalIterator(G4GeometryCell(aVolume, aRepNum));
|
||||
G4GeometryCellImportance::const_iterator gCellIterator = fCurrentIterator;
|
||||
if (gCellIterator==fGeometryCelli.end()) {
|
||||
Error("GetImportance() - Region does not exist!");
|
||||
return 0.;
|
||||
}
|
||||
return (*fCurrentIterator).second;
|
||||
G4double importance_value = (*fCurrentIterator).second;
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXUNLOCK(&G4IStore::IStoreMutex);
|
||||
#endif
|
||||
return importance_value;
|
||||
// return (*fCurrentIterator).second;
|
||||
}
|
||||
|
||||
|
||||
G4double G4IStore::GetImportance(const G4GeometryCell &gCell) const
|
||||
{
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&G4IStore::IStoreMutex);
|
||||
#endif
|
||||
SetInternalIterator(gCell);
|
||||
G4GeometryCellImportance::const_iterator gCellIterator = fCurrentIterator;
|
||||
if (gCellIterator==fGeometryCelli.end()) {
|
||||
@@ -171,16 +186,27 @@ G4double G4IStore::GetImportance(const G4GeometryCell &gCell) const
|
||||
Error(err_mess.str());
|
||||
return 0.;
|
||||
}
|
||||
return (*fCurrentIterator).second;
|
||||
G4double importance_value = (*fCurrentIterator).second;
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXUNLOCK(&G4IStore::IStoreMutex);
|
||||
#endif
|
||||
return importance_value;
|
||||
// return (*fCurrentIterator).second;
|
||||
}
|
||||
|
||||
G4bool G4IStore::IsKnown(const G4GeometryCell &gCell) const {
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&G4IStore::IStoreMutex);
|
||||
#endif
|
||||
G4bool inWorldKnown(IsInWorld(gCell.GetPhysicalVolume()));
|
||||
|
||||
if ( inWorldKnown ) {
|
||||
SetInternalIterator(gCell);
|
||||
inWorldKnown = (fCurrentIterator!=fGeometryCelli.end());
|
||||
}
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXUNLOCK(&G4IStore::IStoreMutex);
|
||||
#endif
|
||||
return inWorldKnown;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ImportanceAlgorithm.cc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
// $Id: G4ImportanceAlgorithm.cc 102994 2017-03-07 16:31:28Z gcosmo $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -36,9 +36,14 @@
|
||||
#include "G4Types.hh"
|
||||
#include <sstream>
|
||||
#include "Randomize.hh"
|
||||
#include "G4Threading.hh"
|
||||
|
||||
#include "G4ImportanceAlgorithm.hh"
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4Mutex G4ImportanceAlgorithm::ImportanceMutex = G4MUTEX_INITIALIZER;
|
||||
#endif
|
||||
|
||||
G4ImportanceAlgorithm::G4ImportanceAlgorithm(): fWorned(false)
|
||||
{
|
||||
}
|
||||
@@ -52,6 +57,11 @@ G4ImportanceAlgorithm::Calculate(G4double ipre,
|
||||
G4double ipost,
|
||||
G4double init_w) const
|
||||
{
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&G4ImportanceAlgorithm::ImportanceMutex);
|
||||
#endif
|
||||
|
||||
G4Nsplit_Weight nw = {0,0};
|
||||
if (ipost>0.){
|
||||
if (!(ipre>0.)){
|
||||
@@ -109,6 +119,9 @@ G4ImportanceAlgorithm::Calculate(G4double ipre,
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXUNLOCK(&G4ImportanceAlgorithm::ImportanceMutex);
|
||||
#endif
|
||||
return nw;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user