Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user