Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
+7 -26
View File
@@ -1,35 +1,16 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4digits_hits
# Package: Geant4.src.G4digits_hits
#
# Top level CMakeLists.txt for a Geant4 Global Library
# or collection of sublibraries
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
# Add allocation export symbol for the digits_hits category
add_definitions(-DG4DIGI_ALLOC_EXPORT)
add_subdirectory(detector)
add_subdirectory(digits)
add_subdirectory(hits)
add_subdirectory(scorer)
add_subdirectory(utils)
if(NOT GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GLOBAL_LIBRARY_TARGET(NAME G4digits_hits
COMPONENTS
detector/sources.cmake
digits/sources.cmake
hits/sources.cmake
scorer/sources.cmake
utils/sources.cmake
geant4_global_library_target(NAME G4digits_hits
COMPONENTS
detector/sources.cmake
digits/sources.cmake
hits/sources.cmake
scorer/sources.cmake
utils/sources.cmake
)
endif()
+11
View File
@@ -16,6 +16,17 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 29th, 2020, G. Cosmo (digits_hits-V10-06-02)
- Fixed cases of comparison between int and size_t in templated classes
and some cleanup.
May 2nd, 2020, J. Apostolakis (digits_hits-V10-06-01)
- Added two ComputeSolid method to G4VPrimitiveScorer, to consolidate code.
December 9th, 2019 B. Morgan (digits_hits-V10-06-00)
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
November 19th, 2019 G. Cosmo (digits_hits-V10-05-07)
- Fixed more cases of implicit type conversions.
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4detector
# Package: Geant4.src.G4digits_hits.G4detector
#
# CMakeLists.txt for building a single granular library.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
if(GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
endif()
+3
View File
@@ -15,6 +15,9 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
April 28, 2020 John Apostolakis
- Added ComputeSolid methods to G4VPrimitiveScorer
Febr 26, 2013 Andrea Dotti
- Adding cloning capbailities to SD
@@ -117,7 +117,14 @@ class G4VPrimitiveScorer
{ if(!(filter->Accept(aStep))) return false; }
return ProcessHits(aStep,ROhis);
}
protected:
G4VSolid* ComputeSolid(G4Step* aStep, G4int replicaIdx );
// Get the solid at current depth, ensuring it's correct by
// calling a parameterisation is called if it's that volume type
G4VSolid* ComputeCurrentSolid(G4Step* aStep);
// Same as above -- using stored replica number
protected:
G4int fNi, fNj, fNk; // used for 3D scorers
public:
@@ -125,7 +132,5 @@ class G4VPrimitiveScorer
{ fNi = i; fNj = j; fNk = k; }
};
#endif
+50 -81
View File
@@ -1,92 +1,61 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4detector
# Package: Geant4.src.G4digits_hits.G4detector
#
# Sources description for a library.
# Lists the sources and headers of the code explicitely.
# Lists include paths needed.
# Lists the internal granular and global dependencies of the library.
# Source specific properties should be added at the end.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
# List external includes needed.
include_directories(${CLHEP_INCLUDE_DIRS})
# List internal includes needed.
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/hits/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/biasing/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/navigation/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/volumes/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPGeometry/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPRandom/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/intercoms/include)
include_directories(${CMAKE_SOURCE_DIR}/source/materials/include)
include_directories(${CMAKE_SOURCE_DIR}/source/particles/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/track/include)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4detector
HEADERS
G4CellScoreComposer.hh
G4CellScoreValues.hh
G4CollectionNameVector.hh
G4HCtable.hh
G4MultiFunctionalDetector.hh
G4SDManager.hh
G4SDStructure.hh
G4SDmessenger.hh
G4SensitiveVolumeList.hh
G4SensitiveVolumeList.icc
G4TrackLogger.hh
G4VPrimitiveScorer.hh
G4VReadOutGeometry.hh
G4VSDFilter.hh
G4VSensitiveDetector.hh
G4MultiSensitiveDetector.hh
SOURCES
G4CellScoreComposer.cc
G4HCtable.cc
G4MultiFunctionalDetector.cc
G4SDManager.cc
G4SDStructure.cc
G4SDmessenger.cc
G4SensitiveVolumeList.cc
G4TrackLogger.cc
G4VPrimitiveScorer.cc
G4VReadOutGeometry.cc
G4VSDFilter.cc
G4VSensitiveDetector.cc
G4MultiSensitiveDetector.cc
GRANULAR_DEPENDENCIES
G4geombias
G4geometrymng
G4globman
G4hits
G4intercoms
G4materials
G4navigation
G4partman
G4track
G4volumes
GLOBAL_DEPENDENCIES
G4geometry
G4global
G4intercoms
G4materials
G4particles
G4track
LINK_LIBRARIES
geant4_define_module(NAME G4detector
HEADERS
G4CellScoreComposer.hh
G4CellScoreValues.hh
G4CollectionNameVector.hh
G4HCtable.hh
G4MultiFunctionalDetector.hh
G4SDManager.hh
G4SDStructure.hh
G4SDmessenger.hh
G4SensitiveVolumeList.hh
G4SensitiveVolumeList.icc
G4TrackLogger.hh
G4VPrimitiveScorer.hh
G4VReadOutGeometry.hh
G4VSDFilter.hh
G4VSensitiveDetector.hh
G4MultiSensitiveDetector.hh
SOURCES
G4CellScoreComposer.cc
G4HCtable.cc
G4MultiFunctionalDetector.cc
G4SDManager.cc
G4SDStructure.cc
G4SDmessenger.cc
G4SensitiveVolumeList.cc
G4TrackLogger.cc
G4VPrimitiveScorer.cc
G4VReadOutGeometry.cc
G4VSDFilter.cc
G4VSensitiveDetector.cc
G4MultiSensitiveDetector.cc
GRANULAR_DEPENDENCIES
G4geombias
G4geometrymng
G4globman
G4hits
G4intercoms
G4materials
G4navigation
G4partman
G4track
G4volumes
GLOBAL_DEPENDENCIES
G4geometry
G4global
G4intercoms
G4materials
G4particles
G4track
)
# List any source specific properties here
@@ -32,6 +32,8 @@
#include "G4Step.hh"
#include "G4TouchableHistory.hh"
#include "G4UnitsTable.hh"
#include "G4VSolid.hh"
#include "G4VPVParameterisation.hh"
G4VPrimitiveScorer::G4VPrimitiveScorer(G4String name, G4int depth)
:primitiveName(name),detector(nullptr),filter(nullptr),verboseLevel(0),indexDepth(depth),
@@ -82,3 +84,43 @@ void G4VPrimitiveScorer::CheckAndSetUnit(const G4String& unit,
G4Exception("G4VPrimitiveScorer::CheckAndSetUnit","Det0151",JustWarning,msg);
}
}
G4VSolid* G4VPrimitiveScorer::ComputeSolid(G4Step* aStep, G4int replicaIdx )
{
G4VSolid* solid = nullptr;
G4StepPoint* preStep= aStep->GetPreStepPoint();
auto physVol = preStep->GetPhysicalVolume();
G4VPVParameterisation* physParam = physVol->GetParameterisation();
if(physParam)
{ // for parameterized volume
if(replicaIdx<0)
{
G4ExceptionDescription desc;
desc << "Incorrect replica number --- GetReplicaNumber : " << replicaIdx << G4endl;
G4Exception("G4VPrimitiveScorer::ComputeSolid","DetPS0001",JustWarning,desc);
// replicaIdx= 0; // You must ensure that it's in range !!!
}
solid = physParam->ComputeSolid(replicaIdx, physVol);
solid->ComputeDimensions(physParam,replicaIdx,physVol);
}
else
{ // for ordinary volume
solid = physVol->GetLogicalVolume()->GetSolid();
}
return solid;
}
G4VSolid* G4VPrimitiveScorer::ComputeCurrentSolid(G4Step* aStep )
{
G4StepPoint* preStep= aStep->GetPreStepPoint();
// The only difference: did not know the replica number
G4int replicaIdx = (static_cast<const G4TouchableHistory*>(preStep->GetTouchable()))
->GetReplicaNumber(indexDepth);
return ComputeSolid(aStep, replicaIdx);
}
@@ -110,7 +110,7 @@ G4bool G4VReadOutGeometry::CheckROVolume(G4Step*currentStep,G4TouchableHistory*&
{
ROhist = nullptr;
G4bool incFlg = true;
G4VPhysicalVolume* PV = currentStep->GetPreStepPoint()->GetPhysicalVolume();
auto PV = currentStep->GetPreStepPoint()->GetPhysicalVolume();
if((fexcludeList)&&(fexcludeList->CheckPV(PV)))
{ incFlg = false; }
else if ((fincludeList)&&(fincludeList->CheckPV(PV)))
@@ -162,7 +162,7 @@ G4bool G4VReadOutGeometry::FindROTouchable(G4Step*currentStep)
// at the safety value only.
// checks if volume is sensitive:
G4VPhysicalVolume* currentVolume = touchableHistory->GetVolume();
auto currentVolume = touchableHistory->GetVolume();
// checks first if a physical volume exists here:
if ( currentVolume )
{
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4digits
# Package: Geant4.src.G4digits_hits.G4digits
#
# CMakeLists.txt for building a single granular library.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
if(GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
endif()
+15 -37
View File
@@ -1,48 +1,26 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4digits
# Package: Geant4.src.G4digits_hits.G4digits
#
# Sources description for a library.
# Lists the sources and headers of the code explicitely.
# Lists include paths needed.
# Lists the internal granular and global dependencies of the library.
# Source specific properties should be added at the end.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
# List external includes needed.
include_directories(${CLHEP_INCLUDE_DIRS})
# List internal includes needed.
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPGeometry/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPRandom/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4digits
HEADERS
G4DCofThisEvent.hh
G4TDigiCollection.hh
G4VDigi.hh
G4VDigiCollection.hh
SOURCES
G4DCofThisEvent.cc
G4TDigiCollection.cc
G4VDigi.cc
G4VDigiCollection.cc
GRANULAR_DEPENDENCIES
G4globman
GLOBAL_DEPENDENCIES
G4global
LINK_LIBRARIES
geant4_define_module(NAME G4digits
HEADERS
G4DCofThisEvent.hh
G4TDigiCollection.hh
G4VDigi.hh
G4VDigiCollection.hh
SOURCES
G4DCofThisEvent.cc
G4TDigiCollection.cc
G4VDigi.cc
G4VDigiCollection.cc
GRANULAR_DEPENDENCIES
G4globman
GLOBAL_DEPENDENCIES
G4global
)
# List any source specific properties here
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4hits
# Package: Geant4.src.G4digits_hits.G4hits
#
# CMakeLists.txt for building a single granular library.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
if(GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
endif()
@@ -160,7 +160,7 @@ template <class T> G4THitsCollection<T>::~G4THitsCollection()
if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
std::vector<T*> * theHitsCollection = (std::vector<T*>*)theCollection;
//theHitsCollection->clearAndDestroy();
for(size_t i=0;i<theHitsCollection->size();i++)
for(size_t i=0;i<theHitsCollection->size();++i)
{ delete (*theHitsCollection)[i]; }
theHitsCollection->clear();
delete theHitsCollection;
@@ -177,7 +177,7 @@ template <class T> void G4THitsCollection<T>::DrawAllHits()
if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
std::vector<T*> * theHitsCollection = (std::vector<T*>*)theCollection;
size_t n = theHitsCollection->size();
for(size_t i=0;i<n;i++)
for(size_t i=0;i<n;++i)
{ (*theHitsCollection)[i]->Draw(); }
}
@@ -187,7 +187,7 @@ template <class T> void G4THitsCollection<T>::PrintAllHits()
std::vector<T*> * theHitsCollection
= (std::vector<T*>*)theCollection;
size_t n = theHitsCollection->size();
for(size_t i=0;i<n;i++)
for(size_t i=0;i<n;++i)
{ (*theHitsCollection)[i]->Print(); }
}
+24 -24
View File
@@ -62,13 +62,13 @@ private:
using enable_if_t = typename std::enable_if<_Bp, _Tp>::type;
// ensure fundamental types are initialized to zero
template <typename U = T, enable_if_t<is_fundamental_t(U), int> = 0>
template <typename U = T, enable_if_t<is_fundamental_t(U), G4int> = 0>
T* allocate() const
{ return new T(0.); }
// non-fundamental types should set values to appropriate values
// and avoid issues such as:
// G4StatDouble stat(0.); stat += 1.0; gives n == 2;
template <typename U = T, enable_if_t<! is_fundamental_t(U), int> = 0>
template <typename U = T, enable_if_t<! is_fundamental_t(U), G4int> = 0>
T* allocate() const
{ return new T(); }
@@ -123,11 +123,11 @@ public:
inline typename Map_t::size_type GetIndex(const_iterator itr) const
{ return itr->first; }
template <typename MapU_t = Map_t, enable_if_t< !is_mmap_t(MapU_t), int> = 0>
template <typename MapU_t = Map_t, enable_if_t< !is_mmap_t(MapU_t), G4int> = 0>
inline T* GetObject(G4int idx) const
{ return (GetContainer()->count(idx) != 0) ? (*GetContainer())[idx] : nullptr; }
template <typename MapU_t = Map_t, enable_if_t< is_mmap_t(MapU_t), int> = 0>
template <typename MapU_t = Map_t, enable_if_t< is_mmap_t(MapU_t), G4int> = 0>
inline T* GetObject(G4int idx) const
{
return (GetContainer()->count(idx) != 0) ? GetContainer()->find(idx)->second : nullptr;
@@ -173,7 +173,7 @@ public:
// and += adds to white (not correct)
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<is_same_t(U, T) && ! is_mmap_t(MapU_t), int> = 0>
enable_if_t<is_same_t(U, T) && ! is_mmap_t(MapU_t), G4int> = 0>
size_t add(const G4int& key, U*& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -188,7 +188,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), G4int> = 0>
size_t add(const G4int& key, U*& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -201,7 +201,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), G4int> = 0>
size_t add(const G4int& key, U*& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -220,7 +220,7 @@ public:
// and += adds to white (not correct)
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(is_same_t(U, T) && ! is_mmap_t(MapU_t)), G4int> = 0>
size_t add(const G4int& key, U& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -236,7 +236,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(! is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(! is_same_t(U, T) && ! is_mmap_t(MapU_t)), G4int> = 0>
size_t add(const G4int& key, U& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -250,7 +250,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), G4int> = 0>
size_t add(const G4int& key, U& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -263,7 +263,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), G4int> = 0>
size_t add(const G4int& key, U& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -283,7 +283,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(is_same_t(U, T) && ! is_mmap_t(MapU_t)), G4int> = 0>
inline size_t set(const G4int& key, U*& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -297,7 +297,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), G4int> = 0>
inline size_t set(const G4int& key, U*& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -315,7 +315,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(!is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(!is_same_t(U, T) && ! is_mmap_t(MapU_t)), G4int> = 0>
inline size_t set(const G4int & key, U*& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -332,7 +332,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), G4int> = 0>
inline size_t set(const G4int& key, U*& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -358,7 +358,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(is_same_t(U, T) && ! is_mmap_t(MapU_t)), G4int> = 0>
inline size_t set(const G4int& key, U& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -375,7 +375,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(is_same_t(U, T) && is_mmap_t(MapU_t)), G4int> = 0>
inline size_t set(const G4int& key, U& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -390,7 +390,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(!is_same_t(U, T) && ! is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(!is_same_t(U, T) && ! is_mmap_t(MapU_t)), G4int> = 0>
inline size_t set(const G4int & key, U& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -407,7 +407,7 @@ public:
//------------------------------------------------------------------------//
template <typename U = T,
typename MapU_t = Map_t,
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), int> = 0>
enable_if_t<(!is_same_t(U, T) && is_mmap_t(MapU_t)), G4int> = 0>
inline size_t set(const G4int& key, U& aHit) const
{
map_type* theHitsMap = GetMap();
@@ -428,7 +428,7 @@ public:
// case of a multimap
//------------------------------------------------------------------------//
template <typename MapU_t = Map_t,
enable_if_t<! is_mmap_t(MapU_t), int> = 0>
enable_if_t<! is_mmap_t(MapU_t), G4int> = 0>
T* operator[](G4int key) const
{
map_type* theHitsMap = GetMap();
@@ -438,7 +438,7 @@ public:
}
//------------------------------------------------------------------------//
template <typename MapU_t = Map_t,
enable_if_t<is_mmap_t(MapU_t), int> = 0>
enable_if_t<is_mmap_t(MapU_t), G4int> = 0>
T* operator[](G4int key) const
{
#ifdef G4VERBOSE
@@ -491,7 +491,7 @@ template <typename T, typename Map_t>
G4VTHitsMap<T, Map_t>::~G4VTHitsMap()
{
map_type* theHitsMap = GetMap();
for(iterator itr = theHitsMap->begin(); itr != theHitsMap->end(); itr++)
for(iterator itr = theHitsMap->begin(); itr != theHitsMap->end(); ++itr)
delete itr->second;
delete theHitsMap;
}
@@ -522,7 +522,7 @@ void G4VTHitsMap<T, Map_t>::PrintAllHits()
Map_t * theHitsMap = GetMap();
typename Map_t::iterator itr = theHitsMap->begin();
T sum = 0.;
for(; itr != theHitsMap->end(); itr++) {
for(; itr != theHitsMap->end(); ++itr) {
G4cout << " " << itr->first << " : "
<< *(itr->second) << G4endl;
sum += *(itr->second);
@@ -537,7 +537,7 @@ template <typename T, typename Map_t>
void G4VTHitsMap<T, Map_t>::clear()
{
Map_t * theHitsMap = GetMap();
for(iterator itr = theHitsMap->begin(); itr != theHitsMap->end(); itr++)
for(iterator itr = theHitsMap->begin(); itr != theHitsMap->end(); ++itr)
delete itr->second;
theHitsMap->clear();
}
@@ -111,27 +111,27 @@ public:
inline typename Vector_t::size_type GetIndex(const_iterator itr) const
{ return std::distance(begin(), itr); }
template <typename U = store_type, enable_if_t< (is_pointer_t(U)), int> = 0>
template <typename U = store_type, enable_if_t< (is_pointer_t(U)), G4int> = 0>
inline T* GetObject(G4int idx) const
{ return (idx < GetContainer()->size()) ? (*GetContainer())[idx] : nullptr; }
{ return (idx < (G4int)GetContainer()->size()) ? (*GetContainer())[idx] : nullptr; }
template <typename U = store_type, enable_if_t< (is_pointer_t(U)), int> = 0>
template <typename U = store_type, enable_if_t< (is_pointer_t(U)), G4int> = 0>
inline T* GetObject(iterator itr) const
{ return (*itr); }
template <typename U = store_type, enable_if_t< (is_pointer_t(U)), int> = 0>
template <typename U = store_type, enable_if_t< (is_pointer_t(U)), G4int> = 0>
inline const T* GetObject(const_iterator itr) const
{ return (*itr); }
template <typename U = store_type, enable_if_t< (!is_pointer_t(U)), int> = 0>
template <typename U = store_type, enable_if_t< (!is_pointer_t(U)), G4int> = 0>
inline T* GetObject(G4int idx) const
{ return (idx < GetContainer()->size()) ? &(*GetContainer())[idx] : nullptr; }
{ return (idx < (G4int)GetContainer()->size()) ? &(*GetContainer())[idx] : nullptr; }
template <typename U = store_type, enable_if_t< (!is_pointer_t(U)), int> = 0>
template <typename U = store_type, enable_if_t< (!is_pointer_t(U)), G4int> = 0>
inline T* GetObject(iterator itr) const
{ return &(*itr); }
template <typename U = store_type, enable_if_t< (!is_pointer_t(U)), int> = 0>
template <typename U = store_type, enable_if_t< (!is_pointer_t(U)), G4int> = 0>
inline const T* GetObject(const_iterator itr) const
{ return &(*itr); }
@@ -168,7 +168,7 @@ public:
template <typename U = T,
typename V = store_type,
enable_if_t< (is_fundamental_t(U) &&
is_pointer_t(V)), int> = 0>
is_pointer_t(V)), G4int> = 0>
store_type allocate() const
{ return new T(0.); }
@@ -177,13 +177,13 @@ public:
template <typename U = T,
typename V = store_type,
enable_if_t< (!is_fundamental_t(U) &&
is_pointer_t(V)), int> = 0>
is_pointer_t(V)), G4int> = 0>
store_type allocate() const
{ return new T(); }
// ensure fundamental types are initialized to zero
template <typename U = store_type,
enable_if_t< (is_pointer_t(U)), int> = 0>
enable_if_t< (is_pointer_t(U)), G4int> = 0>
store_type null() const
{ return nullptr; }
@@ -194,7 +194,7 @@ public:
template <typename U = T,
typename V = store_type,
enable_if_t< (is_fundamental_t(U) &&
!is_pointer_t(V)), int> = 0>
!is_pointer_t(V)), G4int> = 0>
store_type allocate() const
{ return T(0.); }
// non-fundamental types should set values to appropriate values
@@ -202,13 +202,13 @@ public:
template <typename U = T,
typename V = store_type,
enable_if_t< (!is_fundamental_t(U) &&
!is_pointer_t(V)), int> = 0>
!is_pointer_t(V)), G4int> = 0>
store_type allocate() const
{ return T(); }
// ensure fundamental types are initialized to zero
template <typename U = store_type,
enable_if_t< (!is_pointer_t(U)), int> = 0>
enable_if_t< (!is_pointer_t(U)), G4int> = 0>
store_type null() const
{ return store_type(); }
@@ -218,7 +218,7 @@ public:
// U and VectorU_t types
//------------------------------------------------------------------------//
template <typename U, typename VectorU_t,
enable_if_t< (is_pointer_t(typename VectorU_t::value_type)), int> = 0>
enable_if_t< (is_pointer_t(typename VectorU_t::value_type)), G4int> = 0>
this_type& operator+=(const G4VTHitsVector<U, VectorU_t>& right) const
{
VectorU_t* aHitsVector = right.GetVector();
@@ -232,7 +232,7 @@ public:
}
//------------------------------------------------------------------------//
template <typename U, typename VectorU_t,
enable_if_t< (!is_pointer_t(typename VectorU_t::value_type)), int> = 0>
enable_if_t< (!is_pointer_t(typename VectorU_t::value_type)), G4int> = 0>
this_type& operator+=(const G4VTHitsVector<U, VectorU_t>& right) const
{
VectorU_t* aHitsVector = right.GetVector();
@@ -245,7 +245,7 @@ public:
}
//------------------------------------------------------------------------//
template <typename U, typename MapU_t,
enable_if_t< (is_pointer_t(typename MapU_t::mapped_type)), int> = 0>
enable_if_t< (is_pointer_t(typename MapU_t::mapped_type)), G4int> = 0>
this_type& operator+=(const G4VTHitsMap<U, MapU_t>& right) const
{
MapU_t* aHitsMap = right.GetMap();
@@ -255,7 +255,7 @@ public:
}
//------------------------------------------------------------------------//
template <typename U, typename MapU_t,
enable_if_t< !(is_pointer_t(typename MapU_t::mapped_type)), int> = 0>
enable_if_t< !(is_pointer_t(typename MapU_t::mapped_type)), G4int> = 0>
this_type& operator+=(const G4VTHitsMap<U, MapU_t>& right) const
{
MapU_t* aHitsMap = right.GetMap();
@@ -274,7 +274,7 @@ public:
// assumes type T has overload of += operator for U
//------------------------------------------------------------------------//
template <typename U = T,
enable_if_t< is_same_t(U, T), int> = 0>
enable_if_t< is_same_t(U, T), G4int> = 0>
std::size_t add(const G4int& key, U*& aHit) const
{
vector_type* theHitsVector = GetVector(key);
@@ -285,7 +285,7 @@ public:
// Overload for different types
//------------------------------------------------------------------------//
template <typename U = T,
enable_if_t< !is_same_t(U, T), int> = 0>
enable_if_t< !is_same_t(U, T), G4int> = 0>
std::size_t add(const G4int& key, U*& aHit) const
{
vector_type* theHitsVector = GetVector(key);
@@ -298,7 +298,7 @@ public:
// Overload for same type
//------------------------------------------------------------------------//
template <typename U = T,
enable_if_t< is_same_t(U, T), int> = 0>
enable_if_t< is_same_t(U, T), G4int> = 0>
std::size_t add(const G4int& key, U& aHit) const
{
vector_type* theHitsVector = GetVector(key);
@@ -309,7 +309,7 @@ public:
// Overload for different types
//------------------------------------------------------------------------//
template <typename U = T,
enable_if_t< !is_same_t(U, T), int> = 0>
enable_if_t< !is_same_t(U, T), G4int> = 0>
std::size_t add(const G4int& key, U& aHit) const
{
vector_type* theHitsVector = GetVector(key);
@@ -326,7 +326,7 @@ public:
// Overload for same type T
//------------------------------------------------------------------------//
template <typename U = T,
enable_if_t< is_same_t(U, T), int> = 0>
enable_if_t< is_same_t(U, T), G4int> = 0>
inline std::size_t set(const G4int& key, U*& aHit) const
{
vector_type* theHitsVector = GetVector(key);
@@ -337,7 +337,7 @@ public:
// Overload for different types
//------------------------------------------------------------------------//
template <typename U = T,
enable_if_t< !is_same_t(U, T), int> = 0>
enable_if_t< !is_same_t(U, T), G4int> = 0>
inline std::size_t set(const G4int & key, U*& aHit) const
{
vector_type* theHitsVector = GetVector(key);
@@ -356,7 +356,7 @@ public:
// Overload for same type T
//------------------------------------------------------------------------//
template <typename U = T,
enable_if_t< is_same_t(U, T), int> = 0>
enable_if_t< is_same_t(U, T), G4int> = 0>
inline std::size_t set(const G4int& key, U& aHit) const
{
vector_type* theHitsVector = GetVector(key);
@@ -367,7 +367,7 @@ public:
// Overload for different types
//------------------------------------------------------------------------//
template <typename U = T,
enable_if_t< !is_same_t(U, T), int> = 0>
enable_if_t< !is_same_t(U, T), G4int> = 0>
inline std::size_t set(const G4int & key, U& aHit) const
{
vector_type* theHitsVector = GetVector(key);
@@ -397,12 +397,12 @@ public:
protected:
template <typename U = store_type,
enable_if_t< (is_pointer_t(U)), int> = 0>
enable_if_t< (is_pointer_t(U)), G4int> = 0>
void resize(vector_type*& theHitsVector,
const G4int& key) const
{
// ensure the proper size
if(key >= theHitsVector->size())
if(key >= (G4int)theHitsVector->size())
theHitsVector->resize(key+1, null());
// if null pointer for vector entry: allocate
@@ -414,12 +414,12 @@ protected:
}
template <typename U = store_type,
enable_if_t< (!is_pointer_t(U)), int> = 0>
enable_if_t< (!is_pointer_t(U)), G4int> = 0>
void resize(vector_type*& theHitsVector,
const G4int& key) const
{
// ensure the proper size
if(key >= theHitsVector->size())
if(key >= (G4int)theHitsVector->size())
theHitsVector->resize(key+1, null());
}
@@ -435,7 +435,7 @@ protected:
// assumes type T has overload of += operator for U
//------------------------------------------------------------------------//
template <typename U = store_type,
enable_if_t< is_pointer_t(U), int> = 0>
enable_if_t< is_pointer_t(U), G4int> = 0>
void _assign(vector_type*& theHitsVector, const G4int& key, T& val) const
{
delete (*theHitsVector)[key];
@@ -443,7 +443,7 @@ protected:
}
template <typename U = store_type,
enable_if_t< is_pointer_t(U), int> = 0>
enable_if_t< is_pointer_t(U), G4int> = 0>
void _assign(vector_type*& theHitsVector, const G4int& key, T*& val) const
{
delete (*theHitsVector)[key];
@@ -451,42 +451,42 @@ protected:
}
template <typename U = store_type,
enable_if_t< is_pointer_t(U), int> = 0>
enable_if_t< is_pointer_t(U), G4int> = 0>
void _add(vector_type*& theHitsVector, const G4int& key, T& val) const
{
*(*theHitsVector)[key] += val;
}
template <typename U = store_type,
enable_if_t< is_pointer_t(U), int> = 0>
enable_if_t< is_pointer_t(U), G4int> = 0>
void _add(vector_type*& theHitsVector, const G4int& key, T*& val) const
{
*(*theHitsVector)[key] += *val;
}
template <typename V, typename U = store_type,
enable_if_t< is_pointer_t(U), int> = 0>
enable_if_t< is_pointer_t(U), G4int> = 0>
void _add(vector_type*& theHitsVector, const G4int& key, V& val) const
{
*(*theHitsVector)[key] += val;
}
template <typename V, typename U = store_type,
enable_if_t< is_pointer_t(U), int> = 0>
enable_if_t< is_pointer_t(U), G4int> = 0>
void _add(vector_type*& theHitsVector, const G4int& key, V*& val) const
{
*(*theHitsVector)[key] += *val;
}
template <typename U = store_type,
enable_if_t< is_pointer_t(U), int> = 0>
enable_if_t< is_pointer_t(U), G4int> = 0>
T& get(U& val) const
{
return *val;
}
template <typename U = store_type,
enable_if_t< is_pointer_t(U), int> = 0>
enable_if_t< is_pointer_t(U), G4int> = 0>
void delete_contents(vector_type*& theHitsVector) const
{
for(iterator itr = theHitsVector->begin(); itr != theHitsVector->end(); ++itr)
@@ -494,7 +494,7 @@ protected:
}
template <typename U = store_type,
enable_if_t< is_pointer_t(U), int> = 0>
enable_if_t< is_pointer_t(U), G4int> = 0>
T& get_reference(U& val) const
{
return *val;
@@ -505,14 +505,14 @@ protected:
// assumes type T has overload of += operator for U
//------------------------------------------------------------------------//
template <typename U = store_type,
enable_if_t< !is_pointer_t(U), int> = 0>
enable_if_t< !is_pointer_t(U), G4int> = 0>
void _assign(vector_type*& theHitsVector, const G4int& key, T& val) const
{
(*theHitsVector)[key] = val;
}
template <typename U = store_type,
enable_if_t< !is_pointer_t(U), int> = 0>
enable_if_t< !is_pointer_t(U), G4int> = 0>
void _assign(vector_type*& theHitsVector, const G4int& key, T*& val) const
{
delete (*theHitsVector)[key];
@@ -520,14 +520,14 @@ protected:
}
template <typename U = store_type,
enable_if_t< !is_pointer_t(U), int> = 0>
enable_if_t< !is_pointer_t(U), G4int> = 0>
void _add(vector_type*& theHitsVector, const G4int& key, T& val) const
{
(*theHitsVector)[key] += val;
}
template <typename U = store_type,
enable_if_t< !is_pointer_t(U), int> = 0>
enable_if_t< !is_pointer_t(U), G4int> = 0>
void _add(vector_type*& theHitsVector, const G4int& key, T*& val) const
{
(*theHitsVector)[key] += *val;
@@ -535,7 +535,7 @@ protected:
template <typename V,
typename U = store_type,
enable_if_t< !is_pointer_t(U), int> = 0>
enable_if_t< !is_pointer_t(U), G4int> = 0>
void _add(vector_type*& theHitsVector, const G4int& key, V& val) const
{
(*theHitsVector)[key] += val;
@@ -543,19 +543,19 @@ protected:
template <typename V,
typename U = store_type,
enable_if_t< !is_pointer_t(U), int> = 0>
enable_if_t< !is_pointer_t(U), G4int> = 0>
void _add(vector_type*& theHitsVector, const G4int& key, V*& val) const
{
(*theHitsVector)[key] += *val;
}
template <typename U = store_type,
enable_if_t< !is_pointer_t(U), int> = 0>
enable_if_t< !is_pointer_t(U), G4int> = 0>
void delete_contents(vector_type*&) const
{ }
template <typename U = store_type,
enable_if_t< !is_pointer_t(U), int> = 0>
enable_if_t< !is_pointer_t(U), G4int> = 0>
T& get_reference(U& val) const
{
return val;
@@ -653,7 +653,7 @@ void G4VTHitsVector<T, Vector_t>::PrintAllHits()
Vector_t * theHitsVector = GetVector();
typename Vector_t::iterator itr = theHitsVector->begin();
T sum = 0.;
for(; itr != theHitsVector->end(); itr++) {
for(; itr != theHitsVector->end(); ++itr) {
G4cout << " " << itr->first << " : "
<< *(itr->second) << G4endl;
sum += *(itr->second);
+17 -39
View File
@@ -1,50 +1,28 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4hits
# Package: Geant4.src.G4digits_hits.G4hits
#
# Sources description for a library.
# Lists the sources and headers of the code explicitely.
# Lists include paths needed.
# Lists the internal granular and global dependencies of the library.
# Source specific properties should be added at the end.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
# List external includes needed.
include_directories(${CLHEP_INCLUDE_DIRS})
# List internal includes needed.
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPGeometry/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPRandom/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4hits
HEADERS
G4HCofThisEvent.hh
G4THitsCollection.hh
G4THitsMap.hh
G4THitsVector.hh
G4VHit.hh
G4VHitsCollection.hh
SOURCES
G4HCofThisEvent.cc
G4THitsCollection.cc
G4VHit.cc
G4VHitsCollection.cc
GRANULAR_DEPENDENCIES
G4globman
GLOBAL_DEPENDENCIES
G4global
LINK_LIBRARIES
geant4_define_module(NAME G4hits
HEADERS
G4HCofThisEvent.hh
G4THitsCollection.hh
G4THitsMap.hh
G4THitsVector.hh
G4VHit.hh
G4VHitsCollection.hh
SOURCES
G4HCofThisEvent.cc
G4THitsCollection.cc
G4VHit.cc
G4VHitsCollection.cc
GRANULAR_DEPENDENCIES
G4globman
GLOBAL_DEPENDENCIES
G4global
)
# List any source specific properties here
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4detscorer
# Package: Geant4.src.G4digits_hits.G4detscorer
#
# CMakeLists.txt for building a single granular library.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
if(GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
endif()
+128 -163
View File
@@ -1,174 +1,139 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4detscorer
# Package: Geant4.src.G4digits_hits.G4detscorer
#
# Sources description for a library.
# Lists the sources and headers of the code explicitely.
# Lists include paths needed.
# Lists the internal granular and global dependencies of the library.
# Source specific properties should be added at the end.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
# List external includes needed.
include_directories(${CLHEP_INCLUDE_DIRS})
include_directories(${USOLIDS_INCLUDE_DIRS})
# List internal includes needed.
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/detector/include)
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/digits/include)
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/hits/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/navigation/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/solids/CSG/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/volumes/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPGeometry/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPRandom/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/graphics_reps/include)
include_directories(${CMAKE_SOURCE_DIR}/source/intercoms/include)
include_directories(${CMAKE_SOURCE_DIR}/source/materials/include)
include_directories(${CMAKE_SOURCE_DIR}/source/particles/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/track/include)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4detscorer
HEADERS
G4PSCellCharge.hh
G4PSCellCharge3D.hh
G4PSCellFlux.hh
G4PSCellFlux3D.hh
G4PSCellFluxForCylinder3D.hh
G4PSCylinderSurfaceCurrent.hh
G4PSCylinderSurfaceCurrent3D.hh
G4PSCylinderSurfaceFlux.hh
G4PSCylinderSurfaceFlux3D.hh
G4PSDirectionFlag.hh
G4PSDoseDeposit.hh
G4PSDoseDeposit3D.hh
G4PSDoseDepositForCylinder3D.hh
G4PSEnergyDeposit.hh
G4PSEnergyDeposit3D.hh
G4PSFlatSurfaceCurrent.hh
G4PSFlatSurfaceCurrent3D.hh
G4PSFlatSurfaceFlux.hh
G4PSFlatSurfaceFlux3D.hh
G4PSMinKinEAtGeneration.hh
G4PSMinKinEAtGeneration3D.hh
G4PSNofCollision.hh
G4PSNofCollision3D.hh
G4PSNofSecondary.hh
G4PSNofSecondary3D.hh
G4PSNofStep.hh
G4PSNofStep3D.hh
G4PSPassageCellCurrent.hh
G4PSPassageCellCurrent3D.hh
G4PSPassageCellFlux.hh
G4PSPassageCellFlux3D.hh
G4PSPassageCellFluxForCylinder3D.hh
G4PSPassageTrackLength.hh
G4PSPassageTrackLength3D.hh
G4PSPopulation.hh
G4PSPopulation3D.hh
G4PSSphereSurfaceCurrent.hh
G4PSSphereSurfaceCurrent3D.hh
G4PSSphereSurfaceFlux.hh
G4PSSphereSurfaceFlux3D.hh
G4PSStepChecker.hh
G4PSStepChecker3D.hh
G4PSTermination.hh
G4PSTermination3D.hh
G4PSTrackCounter.hh
G4PSTrackCounter3D.hh
G4PSTrackLength.hh
G4PSTrackLength3D.hh
G4SDChargedFilter.hh
G4SDKineticEnergyFilter.hh
G4SDNeutralFilter.hh
G4SDParticleFilter.hh
G4SDParticleWithEnergyFilter.hh
SOURCES
G4PSCellCharge.cc
G4PSCellCharge3D.cc
G4PSCellFlux.cc
G4PSCellFlux3D.cc
G4PSCellFluxForCylinder3D.cc
G4PSCylinderSurfaceCurrent.cc
G4PSCylinderSurfaceCurrent3D.cc
G4PSCylinderSurfaceFlux.cc
G4PSCylinderSurfaceFlux3D.cc
G4PSDoseDeposit.cc
G4PSDoseDeposit3D.cc
G4PSDoseDepositForCylinder3D.cc
G4PSEnergyDeposit.cc
G4PSEnergyDeposit3D.cc
G4PSFlatSurfaceCurrent.cc
G4PSFlatSurfaceCurrent3D.cc
G4PSFlatSurfaceFlux.cc
G4PSFlatSurfaceFlux3D.cc
G4PSMinKinEAtGeneration.cc
G4PSMinKinEAtGeneration3D.cc
G4PSNofCollision.cc
G4PSNofCollision3D.cc
G4PSNofSecondary.cc
G4PSNofSecondary3D.cc
G4PSNofStep.cc
G4PSNofStep3D.cc
G4PSPassageCellCurrent.cc
G4PSPassageCellCurrent3D.cc
G4PSPassageCellFlux.cc
G4PSPassageCellFlux3D.cc
G4PSPassageCellFluxForCylinder3D.cc
G4PSPassageTrackLength.cc
G4PSPassageTrackLength3D.cc
G4PSPopulation.cc
G4PSPopulation3D.cc
G4PSSphereSurfaceCurrent.cc
G4PSSphereSurfaceCurrent3D.cc
G4PSSphereSurfaceFlux.cc
G4PSSphereSurfaceFlux3D.cc
G4PSStepChecker.cc
G4PSStepChecker3D.cc
G4PSTermination.cc
G4PSTermination3D.cc
G4PSTrackCounter.cc
G4PSTrackCounter3D.cc
G4PSTrackLength.cc
G4PSTrackLength3D.cc
G4SDChargedFilter.cc
G4SDKineticEnergyFilter.cc
G4SDNeutralFilter.cc
G4SDParticleFilter.cc
G4SDParticleWithEnergyFilter.cc
GRANULAR_DEPENDENCIES
G4csg
G4detector
G4digits
G4geometrymng
G4globman
G4hits
G4intercoms
G4materials
G4navigation
G4partman
G4track
G4volumes
GLOBAL_DEPENDENCIES
G4geometry
G4global
G4intercoms
G4materials
G4particles
G4track
LINK_LIBRARIES
geant4_define_module(NAME G4detscorer
HEADERS
G4PSCellCharge.hh
G4PSCellCharge3D.hh
G4PSCellFlux.hh
G4PSCellFlux3D.hh
G4PSCellFluxForCylinder3D.hh
G4PSCylinderSurfaceCurrent.hh
G4PSCylinderSurfaceCurrent3D.hh
G4PSCylinderSurfaceFlux.hh
G4PSCylinderSurfaceFlux3D.hh
G4PSDirectionFlag.hh
G4PSDoseDeposit.hh
G4PSDoseDeposit3D.hh
G4PSDoseDepositForCylinder3D.hh
G4PSEnergyDeposit.hh
G4PSEnergyDeposit3D.hh
G4PSFlatSurfaceCurrent.hh
G4PSFlatSurfaceCurrent3D.hh
G4PSFlatSurfaceFlux.hh
G4PSFlatSurfaceFlux3D.hh
G4PSMinKinEAtGeneration.hh
G4PSMinKinEAtGeneration3D.hh
G4PSNofCollision.hh
G4PSNofCollision3D.hh
G4PSNofSecondary.hh
G4PSNofSecondary3D.hh
G4PSNofStep.hh
G4PSNofStep3D.hh
G4PSPassageCellCurrent.hh
G4PSPassageCellCurrent3D.hh
G4PSPassageCellFlux.hh
G4PSPassageCellFlux3D.hh
G4PSPassageCellFluxForCylinder3D.hh
G4PSPassageTrackLength.hh
G4PSPassageTrackLength3D.hh
G4PSPopulation.hh
G4PSPopulation3D.hh
G4PSSphereSurfaceCurrent.hh
G4PSSphereSurfaceCurrent3D.hh
G4PSSphereSurfaceFlux.hh
G4PSSphereSurfaceFlux3D.hh
G4PSStepChecker.hh
G4PSStepChecker3D.hh
G4PSTermination.hh
G4PSTermination3D.hh
G4PSTrackCounter.hh
G4PSTrackCounter3D.hh
G4PSTrackLength.hh
G4PSTrackLength3D.hh
G4SDChargedFilter.hh
G4SDKineticEnergyFilter.hh
G4SDNeutralFilter.hh
G4SDParticleFilter.hh
G4SDParticleWithEnergyFilter.hh
SOURCES
G4PSCellCharge.cc
G4PSCellCharge3D.cc
G4PSCellFlux.cc
G4PSCellFlux3D.cc
G4PSCellFluxForCylinder3D.cc
G4PSCylinderSurfaceCurrent.cc
G4PSCylinderSurfaceCurrent3D.cc
G4PSCylinderSurfaceFlux.cc
G4PSCylinderSurfaceFlux3D.cc
G4PSDoseDeposit.cc
G4PSDoseDeposit3D.cc
G4PSDoseDepositForCylinder3D.cc
G4PSEnergyDeposit.cc
G4PSEnergyDeposit3D.cc
G4PSFlatSurfaceCurrent.cc
G4PSFlatSurfaceCurrent3D.cc
G4PSFlatSurfaceFlux.cc
G4PSFlatSurfaceFlux3D.cc
G4PSMinKinEAtGeneration.cc
G4PSMinKinEAtGeneration3D.cc
G4PSNofCollision.cc
G4PSNofCollision3D.cc
G4PSNofSecondary.cc
G4PSNofSecondary3D.cc
G4PSNofStep.cc
G4PSNofStep3D.cc
G4PSPassageCellCurrent.cc
G4PSPassageCellCurrent3D.cc
G4PSPassageCellFlux.cc
G4PSPassageCellFlux3D.cc
G4PSPassageCellFluxForCylinder3D.cc
G4PSPassageTrackLength.cc
G4PSPassageTrackLength3D.cc
G4PSPopulation.cc
G4PSPopulation3D.cc
G4PSSphereSurfaceCurrent.cc
G4PSSphereSurfaceCurrent3D.cc
G4PSSphereSurfaceFlux.cc
G4PSSphereSurfaceFlux3D.cc
G4PSStepChecker.cc
G4PSStepChecker3D.cc
G4PSTermination.cc
G4PSTermination3D.cc
G4PSTrackCounter.cc
G4PSTrackCounter3D.cc
G4PSTrackLength.cc
G4PSTrackLength3D.cc
G4SDChargedFilter.cc
G4SDKineticEnergyFilter.cc
G4SDNeutralFilter.cc
G4SDParticleFilter.cc
G4SDParticleWithEnergyFilter.cc
GRANULAR_DEPENDENCIES
G4csg
G4detector
G4digits
G4geometrymng
G4globman
G4hits
G4intercoms
G4materials
G4navigation
G4partman
G4track
G4volumes
GLOBAL_DEPENDENCIES
G4geometry
G4global
G4intercoms
G4materials
G4particles
G4track
)
# List any source specific properties here
+4 -21
View File
@@ -131,26 +131,9 @@ void G4PSCellFlux::DefineUnitAndCategory(){
new G4UnitDefinition("permeter2","perm2","Per Unit Surface",(1./m2));
}
G4double G4PSCellFlux::ComputeVolume(G4Step* aStep, G4int idx){
G4VPhysicalVolume* physVol = aStep->GetPreStepPoint()->GetPhysicalVolume();
G4VPVParameterisation* physParam = physVol->GetParameterisation();
G4VSolid* solid = 0;
if(physParam)
{ // for parameterized volume
if(idx<0)
{
G4ExceptionDescription ED;
ED << "Incorrect replica number --- GetReplicaNumber : " << idx << G4endl;
G4Exception("G4PSCellFlux::ComputeVolume","DetPS0001",JustWarning,ED);
}
solid = physParam->ComputeSolid(idx, physVol);
solid->ComputeDimensions(physParam,idx,physVol);
}
else
{ // for ordinary volume
solid = physVol->GetLogicalVolume()->GetSolid();
}
G4double G4PSCellFlux::ComputeVolume(G4Step* aStep, G4int idx)
{
G4VSolid* solid = ComputeSolid( aStep, idx );
assert(solid);
return solid->GetCubicVolume();
}
@@ -76,26 +76,13 @@ G4PSCylinderSurfaceCurrent::G4PSCylinderSurfaceCurrent(G4String name,
G4PSCylinderSurfaceCurrent::~G4PSCylinderSurfaceCurrent()
{;}
G4bool G4PSCylinderSurfaceCurrent::ProcessHits(G4Step* aStep,G4TouchableHistory*)
{
G4StepPoint* preStep = aStep->GetPreStepPoint();
G4VPhysicalVolume* physVol = preStep->GetPhysicalVolume();
G4VPVParameterisation* physParam = physVol->GetParameterisation();
G4VSolid * solid = 0;
if(physParam)
{ // for parameterized volume
G4int idx = ((G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable()))
->GetReplicaNumber(indexDepth);
solid = physParam->ComputeSolid(idx, physVol);
solid->ComputeDimensions(physParam,idx,physVol);
}
else
{ // for ordinary volume
solid = physVol->GetLogicalVolume()->GetSolid();
}
G4Tubs* tubsSolid = (G4Tubs*)(solid);
G4StepPoint* preStep = aStep->GetPreStepPoint();
G4VSolid* solid= ComputeCurrentSolid(aStep);
G4Tubs* tubsSolid = static_cast<G4Tubs*>(solid);
G4int dirFlag =IsSelectedSurface(aStep,tubsSolid);
// G4cout << " pos " << preStep->GetPosition() <<" dirFlag " << G4endl;
if ( dirFlag > 0 ) {
@@ -80,23 +80,10 @@ G4PSCylinderSurfaceFlux::~G4PSCylinderSurfaceFlux()
G4bool G4PSCylinderSurfaceFlux::ProcessHits(G4Step* aStep,G4TouchableHistory*)
{
G4StepPoint* preStep = aStep->GetPreStepPoint();
G4VSolid* solid= ComputeCurrentSolid(aStep);
assert( dynamic_cast<G4Tubs*>(solid) );
G4VPhysicalVolume* physVol = preStep->GetPhysicalVolume();
G4VPVParameterisation* physParam = physVol->GetParameterisation();
G4VSolid * solid = 0;
if(physParam)
{ // for parameterized volume
G4int idx = ((G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable()))
->GetReplicaNumber(indexDepth);
solid = physParam->ComputeSolid(idx, physVol);
solid->ComputeDimensions(physParam,idx,physVol);
}
else
{ // for ordinary volume
solid = physVol->GetLogicalVolume()->GetSolid();
}
G4Tubs* tubsSolid = (G4Tubs*)(solid);
G4Tubs* tubsSolid = static_cast<G4Tubs*>(solid);
G4int dirFlag =IsSelectedSurface(aStep,tubsSolid);
@@ -68,7 +68,6 @@ G4bool G4PSDoseDeposit::ProcessHits(G4Step* aStep,G4TouchableHistory*)
->GetReplicaNumber(indexDepth);
G4double cubicVolume = ComputeVolume(aStep, idx);
G4double density = aStep->GetTrack()->GetStep()->GetPreStepPoint()->GetMaterial()->GetDensity();
G4double dose = edep / ( density * cubicVolume );
dose *= aStep->GetPreStepPoint()->GetWeight();
@@ -116,27 +115,9 @@ void G4PSDoseDeposit::SetUnit(const G4String& unit)
CheckAndSetUnit(unit,"Dose");
}
G4double G4PSDoseDeposit::ComputeVolume(G4Step* aStep, G4int idx){
G4VPhysicalVolume* physVol = aStep->GetPreStepPoint()->GetPhysicalVolume();
G4VPVParameterisation* physParam = physVol->GetParameterisation();
G4VSolid* solid = 0;
if(physParam)
{ // for parameterized volume
if(idx<0)
{
G4ExceptionDescription ED;
ED << "Incorrect replica number --- GetReplicaNumber : " << idx << G4endl;
G4Exception("G4PSDoseDeposit::ComputeVolume","DetPS0004",JustWarning,ED);
}
solid = physParam->ComputeSolid(idx, physVol);
solid->ComputeDimensions(physParam,idx,physVol);
}
else
{ // for ordinary volume
solid = physVol->GetLogicalVolume()->GetSolid();
}
G4double G4PSDoseDeposit::ComputeVolume(G4Step* aStep, G4int idx)
{
G4VSolid* solid = ComputeSolid(aStep, idx);
return solid->GetCubicVolume();
}
@@ -165,27 +165,7 @@ void G4PSPassageCellFlux::DefineUnitAndCategory(){
new G4UnitDefinition("permeter2","perm2","Per Unit Surface",(1./m2));
}
G4double G4PSPassageCellFlux::ComputeVolume(G4Step* aStep, G4int idx){
G4VPhysicalVolume* physVol = aStep->GetPreStepPoint()->GetPhysicalVolume();
G4VPVParameterisation* physParam = physVol->GetParameterisation();
G4VSolid* solid = 0;
if(physParam)
{ // for parameterized volume
if(idx<0)
{
G4ExceptionDescription ED;
ED << "Incorrect replica number --- GetReplicaNumber : " << idx << G4endl;
G4Exception("G4PSPassageCellFlux::ComputeVolume","DetPS0013",JustWarning,ED);
}
solid = physParam->ComputeSolid(idx, physVol);
solid->ComputeDimensions(physParam,idx,physVol);
}
else
{ // for ordinary volume
solid = physVol->GetLogicalVolume()->GetSolid();
}
return solid->GetCubicVolume();
G4double G4PSPassageCellFlux::ComputeVolume(G4Step* aStep, G4int idx )
{
return ComputeSolid(aStep, idx)->GetCubicVolume();
}
@@ -78,23 +78,11 @@ G4PSSphereSurfaceCurrent::~G4PSSphereSurfaceCurrent()
G4bool G4PSSphereSurfaceCurrent::ProcessHits(G4Step* aStep,G4TouchableHistory*)
{
G4StepPoint* preStep = aStep->GetPreStepPoint();
G4VPhysicalVolume* physVol = preStep->GetPhysicalVolume();
G4VPVParameterisation* physParam = physVol->GetParameterisation();
G4VSolid * solid = 0;
if(physParam)
{ // for parameterized volume
G4int idx = ((G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable()))
->GetReplicaNumber(indexDepth);
solid = physParam->ComputeSolid(idx, physVol);
solid->ComputeDimensions(physParam,idx,physVol);
}
else
{ // for ordinary volume
solid = physVol->GetLogicalVolume()->GetSolid();
}
G4Sphere* sphereSolid = (G4Sphere*)(solid);
G4VSolid * solid= ComputeCurrentSolid(aStep);
assert( dynamic_cast<G4Sphere*>(solid) != nullptr );
G4Sphere* sphereSolid = static_cast<G4Sphere*>(solid);
G4int dirFlag =IsSelectedSurface(aStep,sphereSolid);
if ( dirFlag > 0 ) {
if ( fDirection == fCurrent_InOut || fDirection == dirFlag ){
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4detutils
# Package: Geant4.src.G4digits_hits.G4detutils
#
# CMakeLists.txt for building a single granular library.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
if(GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
endif()
+23 -5
View File
@@ -16,12 +16,30 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
February 12th, 2020 T.Aso (detutils-V10-05-06)
- In G4ScoreQuantityMessenger, changed SetDefaultUnit() in trackLength
scorer to SetDefaultValue() to support various unit category.
Addressing problem report #2216.
April 29th, 2020 M.Asai (detutils-V10-06-07)
- G4ScoringProbe.cc : Minor cosmetic changes.
December 29th, 2019 M.Asai (detutils-V10-05-05)
April 22nd, 2020 M.Asai (detutils-V10-06-06)
- Introducing G4VPrimitivePlotter.hh that enables the user to extend
a primitive scorer and directly fill 1D histogram.
April 13th, 2020 M.Asai (detutils-V10-06-05)
- Introducing Probe mesh.
April 7th, 2020 M.Asai (detutils-V10-06-04)
- G4VScoringMesh.hh, .cc : further extension for Proble scoring mesh.
April 2nd, 2020 M.Asai (detutils-V10-06-03)
- G4ScoringMessenger.cc: Fix Coverity error.
March 31st, 2020 M.Asai (detutils-V10-06-02)
- G4VScoringMesh.hh: Add a new enum entry for future extension.
Feburary 13th, 2020 T.Aso (detutils-V10-06-01)
- G4ScoreQuantityMessengerQCmd.cc: default parameter for unit
in trackLength scorer was changed.
December 29th, 2019 M.Asai (detutils-V10-06-00)
- G4ScoringManager, G4VScoreWriter, G4ScoringMessenger:
Add missing setter/getter functions.
@@ -91,6 +91,7 @@ class G4ScoringMessenger: public G4UImessenger
G4UIcmdWithAString* meshCylinderCreateCmd;
// G4UIcmdWithAString* meshSphereCreateCmd;
G4UIcommand* meshRWLogVolCreateCmd;
G4UIcommand* probeCreateCmd;
//
// Mesh commands
G4UIdirectory* meshDir;
@@ -117,6 +118,11 @@ class G4ScoringMessenger: public G4UImessenger
G4UIcmdWithADoubleAndUnit* mRotYCmd;
G4UIcmdWithADoubleAndUnit* mRotZCmd;
//
// Probe commands
G4UIdirectory* probeDir;
G4UIcmdWithAString* probeMatCmd;
G4UIcmdWith3VectorAndUnit* probeLocateCmd;
//
// Draw Command
G4UIcommand * drawCmd;
G4UIcommand * drawColumnCmd;
@@ -0,0 +1,86 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
#ifndef G4ScoringProbe_h
#define G4ScoringProbe_h 1
#include "globals.hh"
#include "G4VScoringMesh.hh"
class G4VPhysicalVolume;
class G4Material;
#include <vector>
class G4ScoringProbe : public G4VScoringMesh
{
public:
G4ScoringProbe(G4String lvName,G4double half_size,G4bool checkOverlap=false);
~G4ScoringProbe();
protected:
// construct scoring volume
virtual void SetupGeometry(G4VPhysicalVolume* );
protected:
G4String logVolName;
std::vector<G4ThreeVector> posVec;
G4double probeSize;
G4bool chkOverlap;
G4String layeredMaterialName;
G4Material* layeredMaterial;
G4String regName;
public:
void LocateProbe(G4ThreeVector pos)
{
posVec.push_back(pos);
G4int nbin[] = {static_cast<G4int>(posVec.size()),1,1};
SetNumberOfSegments(nbin);
}
G4int GetNumberOfProbes() const
{ return posVec.size(); }
void SetProbeSize(G4double val)
{ probeSize = val; }
G4double GetProbeSize() const
{ return probeSize; }
G4bool SetMaterial(G4String val);
public:
virtual void List() const;
public:
//++++++++++ visualization method not yet implemented
virtual void Draw(RunScore * /*map*/, G4VScoreColorMap* /*colorMap*/, G4int /*axflg=111*/)
{;}
virtual void DrawColumn(RunScore * /*map*/, G4VScoreColorMap* /*colorMap*/,
G4int /*idxProj*/, G4int /*idxColumn*/)
{;}
};
#endif
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
#ifndef G4VPrimitivePlotter_H
#define G4VPrimitivePlotter_H 1
#include "G4VPrimitiveScorer.hh"
#include <map>
class G4VPrimitivePlotter : public G4VPrimitiveScorer
{
public: // with description
G4VPrimitivePlotter(G4String name, G4int depth=0)
:G4VPrimitiveScorer(name,depth)
{;}
virtual ~G4VPrimitivePlotter()
{;}
public:
void Plot(G4int copyNo,G4int histID)
{ hitIDMap[copyNo] = histID; }
protected:
std::map<G4int,G4int> hitIDMap;
public:
G4int GetNumberOfHist() const
{ return hitIDMap.size(); }
};
#endif
@@ -53,7 +53,7 @@ class G4ParallelWorldProcess;
class G4VScoringMesh
{
public:
enum class MeshShape { box, cylinder, sphere, realWorldLogVol, undefined = -1};
enum class MeshShape { box, cylinder, sphere, realWorldLogVol, probe, undefined = -1};
using EventScore = G4THitsMap< G4double >;
using RunScore = G4THitsMap< G4StatDouble >;
using MeshScoreMap = std::map< G4String, RunScore* >;
@@ -174,7 +174,7 @@ public: // with description
inline G4bool ReadyForQuantity() const
{ return (sizeIsSet && nMeshIsSet); }
protected:
//protected:
// get registered primitive socrer by the name
G4VPrimitiveScorer * GetPrimitiveScorer(const G4String & name);
@@ -235,6 +235,15 @@ public:
{ copyNumberLevel = val; }
inline G4int GetCopyNumberLevel() const
{ return copyNumberLevel; }
protected:
// This flag may be set to true for Probe scoring mesh.
// There is no public set method for this boolean flag, but it should be set to true
// through SetMaterial() method of Probe scoring mesh.
G4bool layeredMassFlg;
public:
G4bool LayeredMassFlg()
{ return layeredMassFlg; }
};
#endif
+59 -93
View File
@@ -1,104 +1,70 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4detutils
# Package: Geant4.src.G4digits_hits.G4detutils
#
# Sources description for a library.
# Lists the sources and headers of the code explicitely.
# Lists include paths needed.
# Lists the internal granular and global dependencies of the library.
# Source specific properties should be added at the end.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
# List external includes needed.
include_directories(${CLHEP_INCLUDE_DIRS})
# List internal includes needed.
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/detector/include)
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/digits/include)
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/hits/include)
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/scorer/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/divisions/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/navigation/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/solids/CSG/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/volumes/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPGeometry/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPRandom/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPNumerics/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/graphics_reps/include)
include_directories(${CMAKE_SOURCE_DIR}/source/intercoms/include)
include_directories(${CMAKE_SOURCE_DIR}/source/materials/include)
include_directories(${CMAKE_SOURCE_DIR}/source/particles/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/track/include)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4detutils
HEADERS
G4DefaultLinearColorMap.hh
G4ScoreLogColorMap.hh
G4VScoreNtupleWriter.hh
G4TScoreNtupleWriter.hh
G4TScoreNtupleWriter.icc
G4TScoreNtupleWriterMessenger.hh
G4TScoreNtupleWriterMessenger.icc
G4ScoreQuantityMessenger.hh
G4ScoringBox.hh
G4ScoringCylinder.hh
G4ScoringManager.hh
G4ScoringMessenger.hh
G4ScoringRealWorld.hh
G4VScoreColorMap.hh
G4VScoreWriter.hh
G4VScoringMesh.hh
SOURCES
G4DefaultLinearColorMap.cc
G4ScoreLogColorMap.cc
G4VScoreNtupleWriter.cc
G4ScoreQuantityMessenger.cc
G4ScoreQuantityMessengerQCmd.cc
G4ScoringBox.cc
G4ScoringCylinder.cc
G4ScoringManager.cc
G4ScoringMessenger.cc
G4ScoringRealWorld.cc
G4VScoreColorMap.cc
G4VScoreWriter.cc
G4VScoringMesh.cc
GRANULAR_DEPENDENCIES
G4csg
G4detector
G4detscorer
G4digits
G4geomdivision
G4geometrymng
G4globman
G4graphics_reps
G4hits
G4intercoms
G4materials
G4navigation
G4partman
G4track
G4volumes
GLOBAL_DEPENDENCIES
G4geometry
G4global
G4graphics_reps
G4intercoms
G4materials
G4particles
G4track
LINK_LIBRARIES
geant4_define_module(NAME G4detutils
HEADERS
G4DefaultLinearColorMap.hh
G4ScoreLogColorMap.hh
G4VPrimitivePlotter.hh
G4VScoreNtupleWriter.hh
G4TScoreNtupleWriter.hh
G4TScoreNtupleWriter.icc
G4TScoreNtupleWriterMessenger.hh
G4TScoreNtupleWriterMessenger.icc
G4ScoreQuantityMessenger.hh
G4ScoringBox.hh
G4ScoringCylinder.hh
G4ScoringManager.hh
G4ScoringMessenger.hh
G4ScoringRealWorld.hh
G4ScoringProbe.hh
G4VScoreColorMap.hh
G4VScoreWriter.hh
G4VScoringMesh.hh
SOURCES
G4DefaultLinearColorMap.cc
G4ScoreLogColorMap.cc
G4VScoreNtupleWriter.cc
G4ScoreQuantityMessenger.cc
G4ScoreQuantityMessengerQCmd.cc
G4ScoringBox.cc
G4ScoringCylinder.cc
G4ScoringManager.cc
G4ScoringMessenger.cc
G4ScoringRealWorld.cc
G4ScoringProbe.cc
G4VScoreColorMap.cc
G4VScoreWriter.cc
G4VScoringMesh.cc
GRANULAR_DEPENDENCIES
G4csg
G4detector
G4detscorer
G4digits
G4geomdivision
G4geometrymng
G4globman
G4graphics_reps
G4hits
G4intercoms
G4materials
G4navigation
G4partman
G4track
G4volumes
GLOBAL_DEPENDENCIES
G4geometry
G4global
G4graphics_reps
G4intercoms
G4materials
G4particles
G4track
)
# List any source specific properties here
@@ -269,7 +269,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qCellChgCmd) {
if ( CheckMeshPS(mesh,token[0],command) ){
G4PSCellCharge* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSCellCharge(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSCellCharge3D(token[0]); }
@@ -293,6 +293,8 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
ed<<"Cell flux for real world volume is not yet supported. Command ignored.";
command->CommandFailed(ed);
return;
} else if(shape==MeshShape::probe) {
ps = new G4PSCellFlux(token[0]);
}
ps->SetUnit(token[1]);
mesh->SetPrimitiveScorer(ps);
@@ -314,6 +316,8 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
ed<<"Passing cell flux for real world volume is not yet supported. Command ignored.";
command->CommandFailed(ed);
return;
} else if(shape==MeshShape::probe) {
ps = new G4PSPassageCellFlux(token[0]);
}
ps->SetUnit(token[1]);
mesh->SetPrimitiveScorer(ps);
@@ -321,7 +325,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command==qeDepCmd) {
if ( CheckMeshPS(mesh,token[0],command) ){
G4PSEnergyDeposit* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps =new G4PSEnergyDeposit(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps =new G4PSEnergyDeposit3D(token[0]); }
@@ -342,7 +346,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
mesh->GetNumberOfSegments(nSeg);
pps->SetNumberOfSegments(nSeg);
ps = pps;
} else if(shape==MeshShape::realWorldLogVol) {
} else if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe) {
ps = new G4PSDoseDeposit(token[0],mesh->GetCopyNumberLevel());
}
ps->SetUnit(token[1]);
@@ -351,7 +355,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qnOfStepCmd) {
if ( CheckMeshPS(mesh,token[0],command) ){
G4PSNofStep* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSNofStep(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSNofStep3D(token[0]); }
@@ -361,7 +365,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qnOfSecondaryCmd) {
if ( CheckMeshPS(mesh,token[0],command) ){
G4PSNofSecondary* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSNofSecondary(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSNofSecondary3D(token[0]); }
@@ -370,7 +374,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qTrackLengthCmd) {
if ( CheckMeshPS(mesh,token[0],command) ){
G4PSTrackLength* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSTrackLength(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSTrackLength3D(token[0]); }
@@ -383,7 +387,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qPassCellCurrCmd){
if( CheckMeshPS(mesh,token[0],command) ) {
G4PSPassageCellCurrent* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSPassageCellCurrent(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSPassageCellCurrent3D(token[0]); }
@@ -393,7 +397,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qPassTrackLengthCmd){
if( CheckMeshPS(mesh,token[0],command) ) {
G4PSPassageTrackLength* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSPassageTrackLength(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSPassageTrackLength3D(token[0]); }
@@ -404,7 +408,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qFlatSurfCurrCmd){
if( CheckMeshPS(mesh,token[0],command)) {
G4PSFlatSurfaceCurrent* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSFlatSurfaceCurrent(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSFlatSurfaceCurrent3D(token[0],StoI(token[1])); }
@@ -420,7 +424,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qFlatSurfFluxCmd){
if( CheckMeshPS(mesh, token[0],command )) {
G4PSFlatSurfaceFlux* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSFlatSurfaceFlux(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSFlatSurfaceFlux3D(token[0],StoI(token[1])); }
@@ -487,7 +491,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qNofCollisionCmd){
if( CheckMeshPS(mesh,token[0],command)) {
G4PSNofCollision* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSNofCollision3D(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSNofCollision3D(token[0]); }
@@ -497,7 +501,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qPopulationCmd){
if( CheckMeshPS(mesh,token[0],command) ) {
G4PSPopulation* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSPopulation(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSPopulation3D(token[0]); }
@@ -507,7 +511,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qTrackCountCmd){
if( CheckMeshPS(mesh,token[0],command)) {
G4PSTrackCounter* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSTrackCounter(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSTrackCounter3D(token[0],StoI(token[1])); }
@@ -517,7 +521,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qTerminationCmd){
if( CheckMeshPS(mesh,token[0],command)) {
G4PSTermination* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSTermination(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSTermination3D(token[0]); }
@@ -528,7 +532,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qMinKinEAtGeneCmd){
if( CheckMeshPS(mesh,token[0],command) ){
G4PSMinKinEAtGeneration* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSMinKinEAtGeneration(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSMinKinEAtGeneration3D(token[0]); }
@@ -538,7 +542,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal
} else if(command== qStepCheckerCmd){
if( CheckMeshPS(mesh,token[0],command) ){
G4PSStepChecker* ps = nullptr;
if(shape==MeshShape::realWorldLogVol)
if(shape==MeshShape::realWorldLogVol || shape==MeshShape::probe)
{ ps = new G4PSStepChecker(token[0],mesh->GetCopyNumberLevel()); }
else
{ ps = new G4PSStepChecker3D(token[0]); }
@@ -33,6 +33,7 @@
#include "G4ScoringBox.hh"
#include "G4ScoringCylinder.hh"
#include "G4ScoringRealWorld.hh"
#include "G4ScoringProbe.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithoutParameter.hh"
@@ -66,9 +67,6 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
verboseCmd->SetGuidance(" 0) errors or warnings,");
verboseCmd->SetGuidance(" 1) information with 0)");
meshDir = new G4UIdirectory("/score/mesh/");
meshDir->SetGuidance(" Mesh processing commands.");
meshCreateDir = new G4UIdirectory("/score/create/");
meshCreateDir->SetGuidance(" Mesh creation commands.");
//
@@ -98,6 +96,20 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
param->SetDefaultValue(0);
meshRWLogVolCreateCmd->SetParameter(param);
//
probeCreateCmd = new G4UIcommand("/score/create/probe",this);
probeCreateCmd->SetGuidance("Define scoring probe.");
probeCreateCmd->SetGuidance(" halfSize defines the half-width of the probing cube.");
param = new G4UIparameter("pname",'s',false);
probeCreateCmd->SetParameter(param);
param = new G4UIparameter("halfSize",'d',false);
probeCreateCmd->SetParameter(param);
param = new G4UIparameter("unit",'s',true);
param->SetDefaultUnit("mm");
probeCreateCmd->SetParameter(param);
param = new G4UIparameter("checkOverlap",'b',true);
param->SetDefaultValue(false);
probeCreateCmd->SetParameter(param);
//
meshOpnCmd = new G4UIcmdWithAString("/score/open",this);
meshOpnCmd->SetGuidance("Open scoring mesh.");
meshOpnCmd->SetParameterName("MeshName",false);
@@ -108,6 +120,9 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
// meshActCmd = new G4UIcmdWithABool("/score/mesh/activate",this);
// meshActCmd->SetGuidance("Activate scoring mesh.");
// meshActCmd->SetParameterName("MeshName",false);
//
meshDir = new G4UIdirectory("/score/mesh/");
meshDir->SetGuidance(" Mesh processing commands.");
//
mBoxSizeCmd = new G4UIcmdWith3VectorAndUnit("/score/mesh/boxSize",this);
mBoxSizeCmd->SetGuidance("Define size of the scoring mesh.");
@@ -192,6 +207,23 @@ G4ScoringMessenger::G4ScoringMessenger(G4ScoringManager* SManager)
mRotZCmd->SetParameterName("Rz",false);
mRotZCmd->SetDefaultUnit("deg");
//
probeDir = new G4UIdirectory("/score/probe/");
probeDir->SetGuidance("Probe commands");
probeMatCmd = new G4UIcmdWithAString("/score/probe/material",this);
probeMatCmd->SetGuidance("Specify a material to the probe cube.");
probeMatCmd->SetGuidance("Material name has to be taken from G4NistManager.");
probeMatCmd->SetGuidance("Once this command is used, the specified material overlays the material in the mass geometry");
probeMatCmd->SetGuidance("with \"Layered Mass Geometry\" mechanism so that physics quantities such as energy deposition");
probeMatCmd->SetGuidance("or dose will be calculated with this material.");
probeMatCmd->SetGuidance("To switch-off this overlaying, use \"none\".");
probeMatCmd->SetParameterName("matName",true);
probeMatCmd->SetDefaultValue("none");
probeLocateCmd = new G4UIcmdWith3VectorAndUnit("/score/probe/locate",this);
probeLocateCmd->SetGuidance("Locate a probe in the global coordinate system.");
probeLocateCmd->SetParameterName("x","y","z",false);
probeLocateCmd->SetDefaultUnit("mm");
// Draw Scoring result
drawCmd = new G4UIcommand("/score/drawProjection",this);
@@ -335,10 +367,11 @@ G4ScoringMessenger::~G4ScoringMessenger()
delete listCmd;
delete verboseCmd;
//
delete meshCreateDir;
delete meshBoxCreateCmd;
delete meshCylinderCreateCmd;
delete meshRWLogVolCreateCmd;
delete probeCreateCmd;
delete meshCreateDir;
// delete meshSphereCreateCmd;
//
delete meshOpnCmd;
@@ -362,6 +395,10 @@ G4ScoringMessenger::~G4ScoringMessenger()
delete mRotZCmd;
delete mRotDir;
//
delete probeLocateCmd;
delete probeMatCmd;
delete probeDir;
//
//delete chartCmd;
delete dumpCmd;
delete drawCmd;
@@ -370,10 +407,10 @@ G4ScoringMessenger::~G4ScoringMessenger()
delete floatMinMaxCmd;
delete colorMapMinMaxCmd;
delete colorMapDir;
delete dumpQtyToFileCmd;
delete dumpQtyWithFactorCmd;
delete dumpQtyWithFactorCmd;
delete dumpAllQtsToFileCmd;
delete dumpAllQtsWithFactorCmd;
delete dumpAllQtsWithFactorCmd;
//
delete scoreDir;
}
@@ -545,7 +582,70 @@ void G4ScoringMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
command->CommandFailed(ed);
}
}
} else if(command==probeCreateCmd) {
auto mesh = fSMan->GetCurrentMesh();
if ( mesh ){
G4ExceptionDescription ed;
ed << "ERROR[" << meshRWLogVolCreateCmd->GetCommandPath()
<< "] : Mesh <" << mesh->GetWorldName()
<< "> is still open. Close it first. Command ignored.";
command->CommandFailed(ed);
}
else
{
G4Tokenizer next(newVal);
G4String qname = next();
G4double halfSize = StoD(next());
halfSize *= G4UIcommand::ValueOf(next());
G4bool checkOverlap = StoB(next());
mesh = fSMan->FindMesh(qname);
if(!mesh)
{
mesh = new G4ScoringProbe(qname,halfSize,checkOverlap);
fSMan->RegisterScoringMesh(mesh);
}
else
{
G4ExceptionDescription ed;
ed << "ERROR[" << probeCreateCmd->GetCommandPath()
<< "] : Mesh name <" << qname << "> already exists. Use another name.";
command->CommandFailed(ed);
}
}
} else if(command==probeMatCmd || command==probeLocateCmd) {
auto mesh = fSMan->GetCurrentMesh();
if(!mesh)
{
G4ExceptionDescription ed;
ed << "ERROR : No mesh is currently open. Open/create a mesh first. Command ignored.";
command->CommandFailed(ed);
return;
}
if(mesh->GetShape() != MeshShape::probe)
{
G4ExceptionDescription ed;
ed << "ERROR : Inconsistent mesh type. Close current mesh and open Scoring Probe.";
command->CommandFailed(ed);
return;
}
if(command==probeMatCmd)
{
G4bool succ = static_cast<G4ScoringProbe*>(mesh)->SetMaterial(newVal);
if(!succ)
{
G4ExceptionDescription ed;
ed << "Material <" << newVal << "> is not defind in G4NistManager. Command is ignored.\n"
<< "Use /material/nist/listMaterials command to see the available materials.";
command->CommandFailed(ed);
return;
}
}
else if(command==probeLocateCmd)
{
G4ThreeVector loc = probeLocateCmd->GetNew3VectorValue(newVal);
static_cast<G4ScoringProbe*>(mesh)->LocateProbe(loc);
}
} else if(command==listColorMapCmd) {
fSMan->ListScoreColorMaps();
} else if(command==floatMinMaxCmd) {
@@ -0,0 +1,140 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
#include "G4ScoringProbe.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4Region.hh"
#include "G4RegionStore.hh"
#include "G4Threading.hh"
#include "G4Material.hh"
#include "G4NistManager.hh"
#include "G4MultiFunctionalDetector.hh"
#include "G4SDParticleFilter.hh"
#include "G4VPrimitiveScorer.hh"
#include "G4ScoringManager.hh"
#include "G4StatDouble.hh"
#include "G4SystemOfUnits.hh"
#include "G4VisAttributes.hh"
G4ScoringProbe::G4ScoringProbe(G4String lvName, G4double half_size, G4bool checkOverlap)
:G4VScoringMesh(lvName), chkOverlap(checkOverlap),
layeredMaterialName("none"), layeredMaterial(nullptr)
{
fShape = MeshShape::probe;
logVolName = lvName;
probeSize = half_size;
G4double hs[] = {half_size,half_size,half_size};
SetSize(hs);
G4int nBin[] = {1,1,1};
SetNumberOfSegments(nBin);
regName = lvName + "_region";
if(G4Threading::IsMasterThread())
{ new G4Region(regName); }
}
G4ScoringProbe::~G4ScoringProbe()
{
}
void G4ScoringProbe::List() const
{
G4cout << "G4ScoringProbe : " << logVolName << G4endl;
G4int np = posVec.size();
for(G4int i=0;i<np;i++)
{ G4cout << " >> probe #" << i << " at " << posVec[i] << G4endl; }
G4VScoringMesh::List();
}
#include "G4AutoLock.hh"
namespace { G4Mutex logvolmutex = G4MUTEX_INITIALIZER; }
void G4ScoringProbe::SetupGeometry(G4VPhysicalVolume* worldPhys)
{
if(G4Threading::IsMasterThread())
{
auto worldLog = worldPhys->GetLogicalVolume();
auto region = G4RegionStore::GetInstance()->GetRegion(regName);
assert(region!=nullptr);
region->AddRootLogicalVolume(worldLog);
region->SetWorld(worldPhys);
auto boxSolid = new G4Box(logVolName+"_solid",probeSize,probeSize,probeSize);
fMeshElementLogical = new G4LogicalVolume(boxSolid,layeredMaterial,logVolName+"_log");
G4int np = posVec.size();
for(G4int i=0;i<np;i++)
{ new G4PVPlacement(0,posVec[i],fMeshElementLogical,logVolName+"_phy",worldLog,false,i,chkOverlap); }
G4VisAttributes* wisatt = new G4VisAttributes(G4Colour(.5,.5,.5));
wisatt->SetVisibility(false);
worldLog->SetVisAttributes(wisatt);
G4VisAttributes* visatt = new G4VisAttributes(G4Colour(.5,.5,.5));
visatt->SetVisibility(true);
fMeshElementLogical->SetVisAttributes(visatt);
}
else
{
G4AutoLock l(&logvolmutex);
fMeshElementLogical = G4LogicalVolumeStore::GetInstance()->GetVolume(logVolName,false);
assert(fMeshElementLogical!=nullptr);
l.unlock();
}
fMeshElementLogical->SetSensitiveDetector(fMFD);
}
G4bool G4ScoringProbe::SetMaterial(G4String val)
{
if(val == "none")
{
layeredMaterialName = val;
layeredMassFlg = false;
layeredMaterial = nullptr;
}
else
{
auto mat = G4NistManager::Instance()->FindOrBuildMaterial(val);
if(!mat)
{ return false; }
layeredMaterialName = val;
layeredMassFlg = true;
layeredMaterial = mat;
}
auto region = G4RegionStore::GetInstance()->GetRegion(regName);
assert(region!=nullptr);
region->UpdateMaterialList();
return true;
}
@@ -61,8 +61,11 @@ void G4ScoringRealWorld::List() const
G4VScoringMesh::List();
}
#include "G4AutoLock.hh"
namespace { G4Mutex logvolmutex = G4MUTEX_INITIALIZER; }
void G4ScoringRealWorld::SetupGeometry(G4VPhysicalVolume* )
{
G4AutoLock l(&logvolmutex);
auto store = G4LogicalVolumeStore::GetInstance();
auto itr = store->begin();
for(;itr!=store->end();itr++)
@@ -49,7 +49,7 @@ G4VScoringMesh::G4VScoringMesh(const G4String& wName)
verboseLevel(0),sizeIsSet(false),nMeshIsSet(false),
fDrawUnit(""), fDrawUnitValue(1.), fMeshElementLogical(nullptr),
fParallelWorldProcess(nullptr), fGeometryHasBeenDestroyed(false),
copyNumberLevel(0)
copyNumberLevel(0), layeredMassFlg(false)
{
G4SDManager::GetSDMpointer()->AddNewDetector(fMFD);
@@ -76,7 +76,7 @@ void G4VScoringMesh::SetSize(G4double size[3]) {
for(int i = 0; i < 3; i++) fSize[i] = size[i];
sizeIsSet = true;
}else{
G4String message = " The size of scoring mesh can not be changed.";
G4String message = " The size of scoring mesh is updated.";
G4Exception("G4VScoringMesh::SetSize()",
"DigiHitsUtilsScoreVScoringMesh000", JustWarning,
message);
@@ -92,7 +92,7 @@ void G4VScoringMesh::SetCenterPosition(G4double centerPosition[3]) {
fCenterPosition = G4ThreeVector(centerPosition[0], centerPosition[1], centerPosition[2]);
}
void G4VScoringMesh::SetNumberOfSegments(G4int nSegment[3]) {
if ( !nMeshIsSet || fShape==MeshShape::realWorldLogVol ){
if ( !nMeshIsSet || fShape==MeshShape::realWorldLogVol || fShape==MeshShape::probe ){
for(int i = 0; i < 3; i++) fNSegment[i] = nSegment[i];
nMeshIsSet = true;
} else {