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
+25 -44
View File
@@ -1,56 +1,37 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4geometry
# Package: Geant4.src.G4geometry
#
# Top level CMakeLists.txt for a Geant4 Global Library
# or collection of sublibraries
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
# Add allocation export symbol for the geometry category
add_definitions(-DG4GEOM_ALLOC_EXPORT)
add_subdirectory(biasing)
add_subdirectory(divisions)
add_subdirectory(magneticfield)
add_subdirectory(management)
add_subdirectory(navigation)
add_subdirectory(solids)
add_subdirectory(volumes)
geant4_global_library_target(NAME G4geometry
COMPONENTS
biasing/sources.cmake
divisions/sources.cmake
magneticfield/sources.cmake
management/sources.cmake
navigation/sources.cmake
solids/Boolean/sources.cmake
solids/CSG/sources.cmake
solids/specific/sources.cmake
volumes/sources.cmake
)
if(NOT GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GLOBAL_LIBRARY_TARGET(NAME G4geometry
COMPONENTS
biasing/sources.cmake
divisions/sources.cmake
magneticfield/sources.cmake
management/sources.cmake
navigation/sources.cmake
solids/Boolean/sources.cmake
solids/CSG/sources.cmake
solids/specific/sources.cmake
volumes/sources.cmake
# Temp hack to get "G4GeomConfig.hh" generated header in include
# path for dependent targets
# TODO: Remove once migration to new module/library system in place.
# This will automatically set include paths
if(TARGET G4geometry)
target_include_directories(G4geometry PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
)
# Temp hack to get "G4GeomConfig.hh" generated header in include
# path for dependent targets
# TODO: Remove once migration to new module/library system in place.
# This will automatically set include paths
if(TARGET G4geometry)
target_include_directories(G4geometry PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
)
endif()
if(TARGET G4geometry-static)
target_include_directories(G4geometry-static PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
)
endif()
endif()
if(TARGET G4geometry-static)
target_include_directories(G4geometry-static PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
)
endif()
+5
View File
@@ -16,6 +16,11 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
December 10, 2019 Ben Morgan geometry-V10-06-00
----------------------------
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
June 5, 2019 J.Apostolakis geometry-V10-05-01
---------------------------
- Change CMakeLists.txt in test directories to allow optional use
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4geombias
# Package: Geant4.src.G4geometry.G4geombias
#
# 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()
+4
View File
@@ -16,6 +16,10 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
December 10th, 2019 B.Morgan (geombias-V10-06-00)
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
September 19th, 2019 G.Cosmo (geombias-V10-05-00)
- Implemented minor c++11 revision and code cleanup.
+50 -79
View File
@@ -1,90 +1,61 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4geombias
# Package: Geant4.src.G4geometry.G4geombias
#
# 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/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)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4geombias
HEADERS
G4GeometryCell.hh
G4GeometryCellComp.hh
G4GeometryCellImportance.hh
G4GeometryCellStep.hh
G4GeometryCellStepStream.hh
G4GeometryCellWeight.hh
G4IStore.hh
G4ImportanceAlgorithm.hh
G4Nsplit_Weight.hh
G4VGCellFinder.hh
G4VIStore.hh
G4VImportanceAlgorithm.hh
G4VImportanceSplitExaminer.hh
G4VWeightWindowAlgorithm.hh
G4VWeightWindowStore.hh
G4WeightWindowAlgorithm.hh
G4WeightWindowStore.hh
SOURCES
G4GeometryCell.cc
G4GeometryCellComp.cc
G4GeometryCellImportance.cc
G4GeometryCellStep.cc
G4GeometryCellStepStream.cc
G4IStore.cc
G4ImportanceAlgorithm.cc
G4Nsplit_Weight.cc
G4VGCellFinder.cc
G4VIStore.cc
G4VImportanceAlgorithm.cc
G4VImportanceSplitExaminer.cc
G4VWeightWindowAlgorithm.cc
G4VWeightWindowStore.cc
G4WeightWindowAlgorithm.cc
G4WeightWindowStore.cc
GRANULAR_DEPENDENCIES
G4csg
G4geometrymng
G4globman
G4graphics_reps
G4intercoms
G4materials
G4navigation
G4volumes
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
G4materials
LINK_LIBRARIES
geant4_define_module(NAME G4geombias
HEADERS
G4GeometryCell.hh
G4GeometryCellComp.hh
G4GeometryCellImportance.hh
G4GeometryCellStep.hh
G4GeometryCellStepStream.hh
G4GeometryCellWeight.hh
G4IStore.hh
G4ImportanceAlgorithm.hh
G4Nsplit_Weight.hh
G4VGCellFinder.hh
G4VIStore.hh
G4VImportanceAlgorithm.hh
G4VImportanceSplitExaminer.hh
G4VWeightWindowAlgorithm.hh
G4VWeightWindowStore.hh
G4WeightWindowAlgorithm.hh
G4WeightWindowStore.hh
SOURCES
G4GeometryCell.cc
G4GeometryCellComp.cc
G4GeometryCellImportance.cc
G4GeometryCellStep.cc
G4GeometryCellStepStream.cc
G4IStore.cc
G4ImportanceAlgorithm.cc
G4Nsplit_Weight.cc
G4VGCellFinder.cc
G4VIStore.cc
G4VImportanceAlgorithm.cc
G4VImportanceSplitExaminer.cc
G4VWeightWindowAlgorithm.cc
G4VWeightWindowStore.cc
G4WeightWindowAlgorithm.cc
G4WeightWindowStore.cc
GRANULAR_DEPENDENCIES
G4csg
G4geometrymng
G4globman
G4graphics_reps
G4intercoms
G4materials
G4navigation
G4volumes
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
G4materials
)
# List any source specific properties here
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4geomdivision
# Package: Geant4.src.G4geometry.G4geomdivision
#
# 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()
+4
View File
@@ -16,6 +16,10 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
December 10th, 2019 B.Morgan (geomdiv-V10-06-00)
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
October 23rd, 2019 J.Apostolakis (geomdiv-V10-05-02)
- Added new virtual VolumeType() method in Physical Volume types.
Requires and coworks with geommng-V10-05-11 and geomvol-V10-05-05.
+33 -58
View File
@@ -1,69 +1,44 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4geomdivision
# Package: Geant4.src.G4geometry.G4geomdivision
#
# 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/geometry/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/solids/CSG/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/solids/specific/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPGeometry/include)
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/graphics_reps/include)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4geomdivision
HEADERS
G4PVDivision.hh
G4PVDivisionFactory.hh
G4ParameterisationBox.hh
G4ParameterisationCons.hh
G4ParameterisationPara.hh
G4ParameterisationPolycone.hh
G4ParameterisationPolyhedra.hh
G4ParameterisationTrd.hh
G4ParameterisationTubs.hh
G4ReplicatedSlice.hh
G4VDivisionParameterisation.hh
G4VDivisionParameterisation.icc
SOURCES
G4PVDivision.cc
G4PVDivisionFactory.cc
G4ParameterisationBox.cc
G4ParameterisationCons.cc
G4ParameterisationPara.cc
G4ParameterisationPolycone.cc
G4ParameterisationPolyhedra.cc
G4ParameterisationTrd.cc
G4ParameterisationTubs.cc
G4ReplicatedSlice.cc
G4VDivisionParameterisation.cc
GRANULAR_DEPENDENCIES
G4csg
G4geometrymng
G4globman
G4specsolids
GLOBAL_DEPENDENCIES
G4global
LINK_LIBRARIES
geant4_define_module(NAME G4geomdivision
HEADERS
G4PVDivision.hh
G4PVDivisionFactory.hh
G4ParameterisationBox.hh
G4ParameterisationCons.hh
G4ParameterisationPara.hh
G4ParameterisationPolycone.hh
G4ParameterisationPolyhedra.hh
G4ParameterisationTrd.hh
G4ParameterisationTubs.hh
G4ReplicatedSlice.hh
G4VDivisionParameterisation.hh
G4VDivisionParameterisation.icc
SOURCES
G4PVDivision.cc
G4PVDivisionFactory.cc
G4ParameterisationBox.cc
G4ParameterisationCons.cc
G4ParameterisationPara.cc
G4ParameterisationPolycone.cc
G4ParameterisationPolyhedra.cc
G4ParameterisationTrd.cc
G4ParameterisationTubs.cc
G4ReplicatedSlice.cc
G4VDivisionParameterisation.cc
GRANULAR_DEPENDENCIES
G4csg
G4geometrymng
G4globman
G4specsolids
GLOBAL_DEPENDENCIES
G4global
)
# List any source specific properties here
@@ -1,20 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4magneticfield
# Package: Geant4.src.G4geometry.G4magneticfield
#
# 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()
#if(GEANT4_ENABLE_TESTING)
# add_subdirectory(test)
#endif()
+33 -1
View File
@@ -16,11 +16,43 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
January 13, 2020 G.Cosmo - field-V10-05-18
June 15, 2020 G.Cosmo - field-V10-06-05
---------------------
- Implemented move constructor and operator for G4FieldTrack.
March 24, 2020 J.Apostolakis - field-V10-06-04
----------------------------
- New class G4DriverReporter to print progress of drivers.
Used for debugging differences between Old & fixed MagIntDriver
- Revisions in testing CMake config file and stepper/driver test
for magnetic field.
March 13, 2020 J.Apostolakis - field-V10-06-03
----------------------------
- G4VIntegrationDriver & dependent driver classes:
Added new virtual StreamInfo() method,
& used it to implement operator << for G4VIntegrationDriver
Made (virtual) DoesReIntegrate() const.
- G4MagInt_Driver: Fixed max iterations & clarified that its
ComputeNewStepSize does NOT (yet) respect maximum reduction factor (0.1).
( Done to enable comparisons with new G4IntegrationDriver<> implementation.)
- G4OldMagIntDriver maintains all old behaviour of G4MagInt_Driver.
January 22, 2020 G.Cosmo - field-V10-06-02
------------------------
- Fixed compilation errors and configuration for field07 unit test.
January 13, 2020 G.Cosmo - field-V10-06-01
------------------------
- Turn off verbosity flags by default in G4IntegratorDriver,
G4InterpolationDriver and G4MagIntegratorDriver.
December 10, 2019 B.Morgan - field-V10-06-00
--------------------------
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
November 14, 2019 J.Apostolakis - field-V10-05-17
-------------------------------
- Added method / attribute to G4VIntegrationDriver DoesReIntegrate()
@@ -57,13 +57,13 @@ class G4BFieldIntegrationDriver : public G4VIntegrationDriver
virtual G4bool AccurateAdvance(G4FieldTrack& track,
G4double hstep,
G4double eps,
G4double eps,
G4double hinitial = 0) override
{
return fCurrDriver->AccurateAdvance(track, hstep, eps, hinitial);
}
virtual G4bool DoesReIntegrate() override
virtual G4bool DoesReIntegrate() const override
{
return fCurrDriver->DoesReIntegrate();
}
@@ -130,6 +130,15 @@ class G4BFieldIntegrationDriver : public G4VIntegrationDriver
fLargeStepDriver->OnStartTracking();
}
virtual void StreamInfo( std::ostream& os ) const override
{
os << "Small Step Driver Info: " << std::endl;
fSmallStepDriver->StreamInfo(os);
os << "Large Step Driver Info: " << std::endl;
fLargeStepDriver->StreamInfo(os);
}
// Write out the parameters / state of the driver
void PrintStatistics() const;
private:
@@ -72,7 +72,7 @@ class G4IntegrationDriver<G4BulirschStoer>:
virtual void OnComputeStep() override {};
virtual G4bool DoesReIntegrate() override { return false; } /// ????
virtual G4bool DoesReIntegrate() const override { return false; } /// ????
virtual G4bool AccurateAdvance( G4FieldTrack& track,
G4double stepLen,
@@ -114,6 +114,9 @@ class G4IntegrationDriver<G4BulirschStoer>:
virtual const G4MagIntegratorStepper* GetStepper() const override;
virtual G4MagIntegratorStepper* GetStepper() override;
virtual void StreamInfo( std::ostream& os ) const override;
// Write out the parameters / state of the driver
private:
G4int GetNumberOfVarialbles() const;
@@ -425,3 +425,10 @@ G4IntegrationDriver<G4BulirschStoer>::GetStepper()
{
return nullptr;
}
void
G4IntegrationDriver<G4BulirschStoer>::StreamInfo( std::ostream& os ) const
{
os << "State of G4IntegrationDriver<G4BulirschStoer>: " << std::endl;
os << " Method is implemented, but gives no information. " << std::endl;
}
@@ -115,6 +115,9 @@ class G4ChordFinder
void OnComputeStep();
friend std::ostream&
operator<<( std::ostream& os, const G4ChordFinder& cf);
protected: // .........................................................
void PrintDchordTrial(G4int noTrials,
@@ -74,6 +74,9 @@ class G4ChordFinderDelegate
G4double GetLastStepEstimateUnc();
void SetLastStepEstimateUnc(G4double stepEst);
void StreamDelegateInfo( std::ostream& os ) const;
// Write out the parameters / state of the driver
private:
Driver& GetDriver();
@@ -392,3 +392,23 @@ void G4ChordFinderDelegate<T>::TestChordPrint(G4int noTrials,
G4cout << " nextStepTrial = " << std::setw(10) << nextStepTrial << G4endl;
G4cout.precision(oldprec);
}
template <class T>
void G4ChordFinderDelegate<T>::StreamDelegateInfo( std::ostream& os ) const
{
// Write out the parameters / state of the driver
os << "State of G4ChordFinderDelegate: " << std::endl;
os << "--Parameters: " << std::endl;
os << " First Fraction = " << fFirstFraction << std::endl;
os << " Last Fraction = " << fFractionLast << std::endl;
os << " Fract Next est = " << fFractionNextEstimate << std::endl;
os << "--State (fungible): " << std::endl;
os << " Maximum No Trials (seen) = " << fmaxTrials << std::endl;
os << " LastStepEstimate (Unconstrained) = " << fLastStepEstimate_Unconstrained
<< std::endl;
// os << " Statistics NOT printed. " << std::endl;
os << "--Statistics: trials= " << fTotalNoTrials
<< " calls= " << fNoCalls << std::endl;
}
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4DriverReporter
//
// Class description:
//
// Auxiliary class to print information from integration drivers
// Can be used by different types of drivers.
// Authors: J.Apostolakis - January/March 2020
// -------------------------------------------------------------------
#ifndef G4DRIVERREPORTER_HH
#define G4DRIVERREPORTER_HH
#include "G4FieldTrack.hh"
class G4DriverReporter
{
public:
static void PrintStatus(const G4double* StartArr,
G4double xstart,
const G4double* CurrentArr,
G4double xcurrent,
G4double requestStep,
unsigned int subStepNo,
unsigned int noIntegrationVariables);
static void PrintStatus(const G4FieldTrack& StartFT,
const G4FieldTrack& CurrentFT,
G4double requestStep,
unsigned int subStepNo);
static void PrintStat_Aux(const G4FieldTrack& aFieldTrack,
G4double requestStep,
G4double actualStep,
G4int subStepNo,
G4double subStepSize,
G4double dotVelocities);
private:
// G4int fVerboseLevel; // Verbose output for debugging
// unsigned int fNoIntegrationVariables);
};
#endif
@@ -66,7 +66,7 @@ class G4FSALIntegrationDriver
virtual void OnComputeStep() override {}
virtual G4bool DoesReIntegrate() override { return true; }
virtual G4bool DoesReIntegrate() const override { return true; }
virtual G4bool AccurateAdvance( G4FieldTrack& track,
G4double hstep,
@@ -86,6 +86,9 @@ class G4FSALIntegrationDriver
virtual void SetVerboseLevel(G4int newLevel) override;
virtual G4int GetVerboseLevel() const override;
virtual void StreamInfo( std::ostream& os ) const override;
// Write out the parameters / state of the driver
// Accessors
G4double GetMinimumStep() const;
@@ -334,3 +334,20 @@ G4FSALIntegrationDriver<T>::AdvanceChordLimited(G4FieldTrack& track,
return ChordFinderDelegate::AdvanceChordLimitedImpl(track, hstep,
eps, chordDistance);
}
template <class T>
void G4FSALIntegrationDriver<T>::StreamInfo( std::ostream& os ) const
{
// Write out the parameters / state of the driver
os << "State of G4IntegrationDriver: " << std::endl;
os << "--Base state (G4RKIntegrationDriver): " << std::endl;
Base::StreamInfo( os );
os << "--Own state (G4IntegrationDriver<>): " << std::endl;
os << " fMinimumStep = " << fMinimumStep << std::endl;
os << " Smallest Fraction = " << fSmallestFraction << std::endl;
os << " verbose level = " << fVerboseLevel << std::endl;
os << " Reintegrates = " << DoesReIntegrate() << std::endl;
os << "--Chord Finder Delegate state: " << std::endl;
ChordFinderDelegate::StreamDelegateInfo( os );
}
@@ -79,6 +79,10 @@ class G4FieldTrack
inline G4FieldTrack& operator= ( const G4FieldTrack& rStVec );
// Copy constructor & Assignment operator
inline G4FieldTrack(G4FieldTrack&& from);
inline G4FieldTrack& operator=(G4FieldTrack&& from);
// Move constructor & operator
inline void UpdateState( const G4ThreeVector& pPosition,
G4double LaboratoryTimeOfFlight,
const G4ThreeVector& pMomentumDirection,
@@ -78,6 +78,51 @@ G4FieldTrack& G4FieldTrack::operator= ( const G4FieldTrack& rStVec )
return *this;
}
inline
G4FieldTrack::G4FieldTrack(G4FieldTrack&& from)
: fDistanceAlongCurve( from.fDistanceAlongCurve),
fKineticEnergy( from.fKineticEnergy ),
fRestMass_c2( from.fRestMass_c2),
fLabTimeOfFlight( from.fLabTimeOfFlight ),
fProperTimeOfFlight( from.fProperTimeOfFlight ),
fChargeState( from.fChargeState )
{
SixVector[0]= from.SixVector[0];
SixVector[1]= from.SixVector[1];
SixVector[2]= from.SixVector[2];
SixVector[3]= from.SixVector[3];
SixVector[4]= from.SixVector[4];
SixVector[5]= from.SixVector[5];
fPolarization = std::move( from.fPolarization );
fMomentumDir = std::move( from.fMomentumDir );
}
inline
G4FieldTrack& G4FieldTrack::operator=(G4FieldTrack&& from)
{
if (&from == this) return *this;
SixVector[0]= from.SixVector[0];
SixVector[1]= from.SixVector[1];
SixVector[2]= from.SixVector[2];
SixVector[3]= from.SixVector[3];
SixVector[4]= from.SixVector[4];
SixVector[5]= from.SixVector[5];
fDistanceAlongCurve = from.fDistanceAlongCurve;
fKineticEnergy = from.fKineticEnergy;
fRestMass_c2 = from.fRestMass_c2;
fLabTimeOfFlight = from.fLabTimeOfFlight;
fProperTimeOfFlight = from.fProperTimeOfFlight;
fChargeState = from.fChargeState;
fPolarization = std::move( from.fPolarization );
fMomentumDir = std::move( from.fMomentumDir );
return *this;
}
inline
G4FieldTrack::~G4FieldTrack()
{
@@ -67,12 +67,12 @@ class G4IntegrationDriver : public G4RKIntegrationDriver<T>,
virtual void OnStartTracking() override;
virtual void OnComputeStep() override {}
virtual G4bool DoesReIntegrate() override { return true; }
virtual G4bool DoesReIntegrate() const override { return true; }
virtual G4bool AccurateAdvance(G4FieldTrack& track,
G4double hstep,
G4double eps, // Requested y_err/hstep
G4double hinitial = 0) override;
G4double hinitial = 0 ) override;
// Integrates ODE from current s (s=s0) to s=s0+h with accuracy eps.
// On output track is replaced by value at end of interval.
// The concept is similar to the odeint routine from NRC p.721-722.
@@ -87,6 +87,9 @@ class G4IntegrationDriver : public G4RKIntegrationDriver<T>,
virtual void SetVerboseLevel(G4int newLevel) override;
virtual G4int GetVerboseLevel() const override;
virtual void StreamInfo( std::ostream& os ) const override;
// Write out the parameters / state of the driver
// Accessors
//
G4double GetMinimumStep() const;
@@ -383,3 +383,20 @@ void G4IntegrationDriver<T>::IncrementQuickAdvanceCalls()
{
++fNoQuickAvanceCalls;
}
template <class T>
void G4IntegrationDriver<T>::StreamInfo( std::ostream& os ) const
{
// Write out the parameters / state of the driver
os << "State of G4IntegrationDriver: " << std::endl;
os << "--Base state (G4RKIntegrationDriver): " << std::endl;
Base::StreamInfo( os );
os << "--Own state (G4IntegrationDriver<>): " << std::endl;
os << " fMinimumStep = " << fMinimumStep << std::endl;
os << " Smallest Fraction = " << fSmallestFraction << std::endl;
os << " verbose level = " << fVerboseLevel << std::endl;
os << " Reintegrates = " << DoesReIntegrate() << std::endl;
os << "--Chord Finder Delegate state: " << std::endl;
ChordFinderDelegate::StreamDelegateInfo( os );
}
@@ -0,0 +1,443 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4IntegrationDriver inline implementation
//
// Author: Dmitry Sorokin, Google Summer of Code 2017
// Supervision: John Apostolakis, CERN
// --------------------------------------------------------------------
#include "G4FieldUtils.hh"
#include "G4DriverReporter.hh"
template <class T>
G4IntegrationDriver<T>::
G4IntegrationDriver ( G4double hminimum, T* pStepper,
G4int numComponents, G4int statisticsVerbose )
: G4RKIntegrationDriver<T>(pStepper),
fMinimumStep(hminimum),
fSmallestFraction(1e-12),
fVerboseLevel(statisticsVerbose),
fNoQuickAvanceCalls(0),
fNoAccurateAdvanceCalls(0),
fNoAccurateAdvanceBadSteps(0),
fNoAccurateAdvanceGoodSteps(0)
{
if (numComponents != Base::GetStepper()->GetNumberOfVariables())
{
std::ostringstream message;
message << "Driver's number of integrated components "
<< numComponents
<< " != Stepper's number of components "
<< pStepper->GetNumberOfVariables();
G4Exception("G4IntegrationDriver","GeomField0002",
FatalException, message);
}
}
template <class T>
G4IntegrationDriver<T>::~G4IntegrationDriver()
{
#ifdef G4VERBOSE
if (fVerboseLevel > 0)
{
G4cout << "G4Integration Driver Stats: "
<< "#QuickAdvance " << fNoQuickAvanceCalls
<< " - #AccurateAdvance " << fNoAccurateAdvanceCalls << " "
<< "#good steps " << fNoAccurateAdvanceGoodSteps << " "
<< "#bad steps " << fNoAccurateAdvanceBadSteps << G4endl;
}
#endif
}
template <class T>
G4double G4IntegrationDriver<T>::AdvanceChordLimited(G4FieldTrack& track,
G4double stepMax,
G4double epsStep,
G4double chordDistance)
{
return ChordFinderDelegate::AdvanceChordLimitedImpl(track, stepMax, epsStep,
chordDistance);
}
template <class T>
void G4IntegrationDriver<T>::OnStartTracking()
{
ChordFinderDelegate::ResetStepEstimate();
}
// Runge-Kutta driver with adaptive stepsize control. Integrate starting
// values at y_current over hstep x2 with accuracy eps.
// On output ystart is replaced by values at the end of the integration
// interval. RightHandSide is the right-hand side of ODE system.
// The source is similar to odeint routine from NRC p.721-722 .
//
template <class T>
G4bool G4IntegrationDriver<T>::
AccurateAdvance(G4FieldTrack& track, G4double hstep,
G4double eps, G4double hinitial)
{
++fNoAccurateAdvanceCalls;
if (hstep == 0.0)
{
std::ostringstream message;
message << "Proposed step is zero; hstep = " << hstep << " !";
G4Exception("G4IntegrationDriver::AccurateAdvance()",
"GeomField1001", JustWarning, message);
return true;
}
if (hstep < 0)
{
std::ostringstream message;
message << "Invalid run condition." << G4endl
<< "Proposed step is negative; hstep = " << hstep << "."
<< G4endl
<< "Requested step cannot be negative! Aborting event.";
G4Exception("G4IntegrationDriver::AccurateAdvance()",
"GeomField0003", EventMustBeAborted, message);
return false;
}
G4double hnext, hdid;
G4double dydx[G4FieldTrack::ncompSVEC];
G4bool succeeded = true, lastStepSucceeded;
G4int noFullIntegr = 0, noSmallIntegr = 0;
G4double y[G4FieldTrack::ncompSVEC];
track.DumpToArray(y);
const G4double startCurveLength = track.GetCurveLength();
const G4double endCurveLength = startCurveLength + hstep;
const G4double hThreshold =
std::min(eps * hstep, fSmallestFraction * startCurveLength);
G4double h = hstep;
if (hinitial > CLHEP::perMillion * hstep && hinitial < hstep)
{
h = hinitial;
}
#ifdef G4DEBUG_FIELD
if (fVerboseLevel > 3)
G4cout << "IDriver::AccurAdv called. "
<< " Input: hstep = " << hstep << " hinitial= " << hinitial
<< " , current: h = " << h << G4endl;
#endif
G4double curveLength = startCurveLength;
for (G4int nstp = 0; nstp < Base::GetMaxNoSteps(); ++nstp)
{
const G4ThreeVector StartPos =
field_utils::makeVector(y, field_utils::Value3D::Position);
#ifdef G4DEBUG_FIELD
const int nvar= Base::GetStepper()->GetNumberOfVariables();
G4double xStepStart= curveLength; // Initial: track.GetCurveLength();
G4double yStepStart[G4FieldTrack::ncompSVEC];
for (int i=0; i<nvar; ++i) { yStepStart[i] = y[i]; }
// G4FieldTrack yFldTrkStart( StartPos,
// field_utils::makeVector(y, field_utils::Value3D::Momentum),
// ... );
// G4FieldTrack yFldTrkStart('0');
// yFldTrkStart.LoadFromArray(y, Base::GetStepper()->GetNumberOfVariables());
// yFldTrkStart.SetCurveLength(curveLength);
G4cout << "----- Iteration = " << nstp << G4endl; // + 1
#endif
Base::GetStepper()->RightHandSide(y, dydx);
if (h > GetMinimumStep())
{
OneGoodStep(y, dydx, curveLength, h, eps, hdid, hnext);
lastStepSucceeded = (hdid == h);
#ifdef G4DEBUG_FIELD
G4cout << "IntegrationDriver -- after OneGoodStep / requesting step = " << h << G4endl;
G4DriverReporter::PrintStatus( yStepStart, xStepStart, y, curveLength, h, nstp+1, nvar); // Only
#endif
}
else
{
G4FieldTrack yFldTrk('0');
G4double dchord_step, dyerr, dyerr_len;
yFldTrk.LoadFromArray(y, Base::GetStepper()->GetNumberOfVariables());
yFldTrk.SetCurveLength(curveLength);
QuickAdvance(yFldTrk, dydx, h, dchord_step, dyerr_len);
yFldTrk.DumpToArray(y);
if (h == 0.0)
{
G4Exception("G4IntegrationDriver::AccurateAdvance()",
"GeomField0003", FatalException,
"Integration Step became Zero!");
}
dyerr = dyerr_len / h;
hdid = h;
curveLength += hdid;
hnext = Base::ComputeNewStepSize(dyerr / eps, h);
lastStepSucceeded = (dyerr <= eps);
}
if (lastStepSucceeded) { ++noFullIntegr; }
else { ++noSmallIntegr; }
const G4ThreeVector EndPos =
field_utils::makeVector(y, field_utils::Value3D::Position);
CheckStep(EndPos, StartPos, hdid);
// Avoid numerous small last steps
if (h < hThreshold || curveLength >= endCurveLength)
{
break;
}
h = std::max(hnext, GetMinimumStep());
if (curveLength + h > endCurveLength)
{
h = endCurveLength - curveLength;
}
}
// Have we reached the end ?
// --> a better test might be x-endCurveLength > an_epsilon
succeeded = (curveLength >= endCurveLength);
// If it was a "forced" last step
track.LoadFromArray(y, Base::GetStepper()->GetNumberOfVariables());
track.SetCurveLength(curveLength);
return succeeded;
}
// Driver for one Runge-Kutta Step with monitoring of local truncation error
// to ensure accuracy and adjust stepsize. Input are dependent variable
// array y[0,...,5] and its derivative dydx[0,...,5] at the
// starting value of the independent variable x . Also input are stepsize
// to be attempted htry, and the required accuracy eps. On output y and x
// are replaced by their new values, hdid is the stepsize that was actually
// accomplished, and hnext is the estimated next stepsize.
// This is similar to the function rkqs from the book:
// Numerical Recipes in C: The Art of Scientific Computing (NRC), Second
// Edition, by William H. Press, Saul A. Teukolsky, William T.
// Vetterling, and Brian P. Flannery (Cambridge University Press 1992),
// 16.2 Adaptive StepSize Control for Runge-Kutta, p. 719
//
template <class T>
void G4IntegrationDriver<T>::OneGoodStep(G4double y[], // InOut
const G4double dydx[],
G4double& curveLength, // InOut
G4double htry,
G4double eps_rel_max,
G4double& hdid, // Out
G4double& hnext) // Out
{
G4double error2 = DBL_MAX;
G4double yerr[G4FieldTrack::ncompSVEC], ytemp[G4FieldTrack::ncompSVEC];
G4double h = htry;
static G4ThreadLocal G4int tot_no_trials = 0;
const G4int max_trials = 100;
for (G4int iter = 0; iter < max_trials; ++iter)
{
tot_no_trials++;
Base::GetStepper()->Stepper(y, dydx, h, ytemp, yerr);
error2 = field_utils::relativeError2(y, yerr, std::max(h, fMinimumStep),
eps_rel_max);
if (error2 <= 1.0)
{
break;
}
h = Base::ShrinkStepSize2(h, error2);
G4double xnew = curveLength + h;
if(xnew == curveLength)
{
std::ostringstream message;
message << "Stepsize underflow in Stepper !" << G4endl
<< "- Step's start x=" << curveLength
<< " and end x= " << xnew
<< " are equal !! " << G4endl
<< " Due to step-size= " << h
<< ". Note that input step was " << htry;
G4Exception("G4IntegrationDriver::OneGoodStep()",
"GeomField1001", JustWarning, message);
break;
}
}
hnext = Base::GrowStepSize2(h, error2);
curveLength += (hdid = h);
field_utils::copy(y, ytemp, Base::GetStepper()->GetNumberOfVariables());
}
template <class T>
G4bool G4IntegrationDriver<T>::QuickAdvance(G4FieldTrack& track, // INOUT
const G4double dydx[],
G4double hstep,
G4double& dchord_step,
G4double& dyerr)
{
++fNoQuickAvanceCalls;
G4double yIn[G4FieldTrack::ncompSVEC],
yOut[G4FieldTrack::ncompSVEC],
yError[G4FieldTrack::ncompSVEC];
G4FieldTrack startTrack( track ); // For debugging
track.DumpToArray(yIn);
Base::GetStepper()->Stepper(yIn, dydx, hstep, yOut, yError);
dchord_step = Base::GetStepper()->DistChord();
dyerr = field_utils::absoluteError(yOut, yError, hstep);
track.LoadFromArray(yOut, Base::GetStepper()->GetNumberOfVariables());
track.SetCurveLength(track.GetCurveLength() + hstep);
#ifdef G4DEBUG_FIELD
// For debugging
static unsigned int numCall= 0;
G4cout // << "G4IntegratorDriver::"
<< "QuickAdvance call # " << ++numCall << G4endl
<< " Input: hstep= " << hstep << G4endl
<< " track= " << startTrack << G4endl
<< " Output: track= " << track << G4endl
<< " d_chord = " << dchord_step
<< " dyerr = " << dyerr << G4endl;
#endif
return true;
}
template <class T>
void G4IntegrationDriver<T>::SetSmallestFraction(G4double newFraction)
{
if (newFraction > 1.e-16 && newFraction < 1e-8)
{
fSmallestFraction = newFraction;
}
else
{
std::ostringstream message;
message << "Smallest Fraction not changed. " << G4endl
<< " Proposed value was " << newFraction << G4endl
<< " Value must be between 1.e-8 and 1.e-16";
G4Exception("G4IntegrationDriver::SetSmallestFraction()",
"GeomField1001", JustWarning, message);
}
}
template <class T>
void G4IntegrationDriver<T>::CheckStep(const G4ThreeVector& posIn,
const G4ThreeVector& posOut,
G4double hdid)
{
const G4double endPointDist = (posOut - posIn).mag();
if (endPointDist >= hdid * (1. + CLHEP::perMillion))
{
++fNoAccurateAdvanceBadSteps;
#ifdef G4DEBUG_FIELD
// Issue a warning only for gross differences -
// we understand how small difference occur.
if (endPointDist >= hdid * (1. + perThousand))
{
G4Exception("G4IntegrationDriver::CheckStep()",
"GeomField1002", JustWarning,
"endPointDist >= hdid!");
}
#endif
}
else
{
++fNoAccurateAdvanceGoodSteps;
}
}
template <class T>
inline G4double G4IntegrationDriver<T>::GetMinimumStep() const
{
return fMinimumStep;
}
template <class T>
void G4IntegrationDriver<T>::SetMinimumStep(G4double minimumStepLength)
{
fMinimumStep = minimumStepLength;
}
template <class T>
G4int G4IntegrationDriver<T>::GetVerboseLevel() const
{
return fVerboseLevel;
}
template <class T>
void G4IntegrationDriver<T>::SetVerboseLevel(G4int newLevel)
{
fVerboseLevel = newLevel;
}
template <class T>
G4double G4IntegrationDriver<T>::GetSmallestFraction() const
{
return fSmallestFraction;
}
template <class T>
void G4IntegrationDriver<T>::IncrementQuickAdvanceCalls()
{
++fNoQuickAvanceCalls;
}
template <class T>
void G4IntegrationDriver<T>::StreamInfo( std::ostream& os ) const
{
// Write out the parameters / state of the driver
os << "State of G4IntegrationDriver: " << std::endl;
os << "--Base state (G4RKIntegrationDriver): " << std::endl;
Base::StreamInfo( os );
os << "--Own state (G4IntegrationDriver<>): " << std::endl;
os << " fMinimumStep = " << fMinimumStep << std::endl;
os << " Smallest Fraction = " << fSmallestFraction << std::endl;
os << " verbose level = " << fVerboseLevel << std::endl;
os << " Reintegrates = " << DoesReIntegrate() << std::endl;
os << "--Chord Finder Delegate state: " << std::endl;
ChordFinderDelegate::StreamDelegateInfo( os );
}
@@ -65,7 +65,7 @@ class G4InterpolationDriver : public G4RKIntegrationDriver<T>
virtual void OnStartTracking() override;
virtual void OnComputeStep() override;
virtual G4bool DoesReIntegrate() override { return false; }
virtual G4bool DoesReIntegrate() const override { return false; }
// Interpolation driver does not recalculate when AccurateAdvance is called
// -- reintegration would require other calls
@@ -80,6 +80,8 @@ class G4InterpolationDriver : public G4RKIntegrationDriver<T>
virtual void SetVerboseLevel(G4int level) override;
virtual G4int GetVerboseLevel() const override;
virtual void StreamInfo( std::ostream& os ) const override;
private:
struct InterpStepper
@@ -388,7 +388,9 @@ G4double G4InterpolationDriver<T>::CalcChordStep(G4double stepTrialOld,
template <class T>
G4bool G4InterpolationDriver<T>::
AccurateAdvance(G4FieldTrack& track, G4double hstep,
G4double /*eps*/, G4double /*hinitial*/)
G4double /*eps*/,
G4double /*hinitial*/
)
{
if (hstep == 0.0)
{
@@ -574,3 +576,24 @@ void G4InterpolationDriver<T>::AccumulateStatistics(G4int noTrials)
}
}
template <class T>
void G4InterpolationDriver<T>::StreamInfo( std::ostream& os ) const
{
os << "State of G4InterpolationDriver: " << std::endl;
os << "--Base state (G4RKIntegrationDriver): " << std::endl;
Base::StreamInfo( os );
os << " fMinimumStep = " << fMinimumStep << std::endl;
// os << " Max number of Steps = " << fMaxNoSteps << std::endl;
// os << " Safety factor = " << safety << std::endl;
// os << " Power - shrink = " << pshrnk << std::endl;
// os << " Power - grow = " << pgrow << std::endl;
// os << " threshold - shrink = " << errorConstraintShrink << std::endl;
// os << " threshold - grow = " << errorConstraintGrow << std::endl;
os << " Max num of Trials = " << fMaxTrials << std::endl;
os << " Fract Next Estimate = " << fFractionNextEstimate << std::endl;
os << " Smallest Curve Fract= " << fSmallestCurveFraction << std::endl;
os << " VerboseLevel = " << fVerboseLevel << std::endl;
os << " KeepLastStepper = " << fKeepLastStepper << std::endl;
}
@@ -63,7 +63,7 @@ class G4MagInt_Driver : public G4VIntegrationDriver,
inline virtual void OnStartTracking() override;
inline virtual void OnComputeStep() override {};
virtual G4bool DoesReIntegrate() override { return true; }
virtual G4bool DoesReIntegrate() const override { return true; }
virtual G4bool AccurateAdvance(G4FieldTrack& y_current,
G4double hstep,
@@ -82,6 +82,9 @@ class G4MagInt_Driver : public G4VIntegrationDriver,
G4double& dyerr) override;
// QuickAdvance just tries one Step - it does not ensure accuracy.
void StreamInfo( std::ostream& os ) const override;
// Write out the parameters / state of the driver
G4bool QuickAdvance(G4FieldTrack& y_posvel, // INOUT
const G4double dydx[],
G4double hstep, // IN
@@ -146,9 +149,18 @@ class G4MagInt_Driver : public G4VIntegrationDriver,
G4double hstepCurrent) override;
// Taking the last step's normalised error, calculate
// a step size for the next step.
// Do not limit the next step's size within a factor of the
// current one.
// Does it limit the next step's size within a factor of the current?
// -- DOES NOT limit for very bad steps
// -- DOES limit for very good (x5)
G4double
ComputeNewStepSize_WithoutReductionLimit(G4double errMaxNorm,
G4double hstepCurrent);
// Taking the last step's normalised error, calculate
// a step size for the next step.
// Do not limit the next step's size within a factor of the
// current one when *reducing* the size, i.e. for badly failing steps.
G4double ComputeNewStepSize_WithinLimits(G4double errMaxNorm, // normalised
G4double hstepCurrent);
// Taking the last step's normalised error, calculate
@@ -55,7 +55,8 @@ class G4NystromRK4 : public G4MagIntegratorStepper
G4NystromRK4(G4Mag_EqRhs* EquationMotion,
G4double distanceConstField = 0.0);
// Can be used only for Magnetic Fields - and for 6 variables (x,p)
~G4NystromRK4() {}
virtual void Stepper(const G4double y[],
const G4double dydx[],
G4double hstep,
@@ -0,0 +1,268 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4OldMagIntDriver
//
// Class description:
//
// Provides a driver that talks to the Integrator Stepper, and insures that
// the error is within acceptable bounds.
// V.Grichine, 07.10.1996 - Created
// W.Wander, 28.01.1998 - Added ability for low order integrators
// J.Apostolakis, 08.11.2001 - Respect minimum step in AccurateAdvance
// --------------------------------------------------------------------
#ifndef G4OLD_MAGINT_DRIVER_HH
#define G4OLD_MAGINT_DRIVER_HH
#include "G4VIntegrationDriver.hh"
#include "G4MagIntegratorStepper.hh"
#include "G4ChordFinderDelegate.hh"
class G4OldMagIntDriver : public G4VIntegrationDriver,
public G4ChordFinderDelegate<G4OldMagIntDriver>
{
public: // with description
G4OldMagIntDriver(G4double hminimum,
G4MagIntegratorStepper* pItsStepper,
G4int numberOfComponents = 6,
G4int statisticsVerbosity = 0);
virtual ~G4OldMagIntDriver() override;
// Constructor, destructor.
G4OldMagIntDriver(const G4OldMagIntDriver&) = delete;
G4OldMagIntDriver& operator=(const G4OldMagIntDriver&) = delete;
inline virtual G4double AdvanceChordLimited(G4FieldTrack& track,
G4double stepMax,
G4double epsStep,
G4double chordDistance) override;
inline virtual void OnStartTracking() override;
inline virtual void OnComputeStep() override {};
virtual G4bool DoesReIntegrate() const override { return true; }
virtual G4bool AccurateAdvance(G4FieldTrack& y_current,
G4double hstep,
G4double eps, // Requested y_err/hstep
G4double hinitial = 0.0) override;
// Above drivers for integrator (Runge-Kutta) with stepsize control.
// Integrates ODE starting values y_current
// from current s (s=s0) to s=s0+h with accuracy eps.
// On output ystart is replaced by value at end of interval.
// The concept is similar to the odeint routine from NRC p.721-722.
virtual G4bool QuickAdvance(G4FieldTrack& y_val, // INOUT
const G4double dydx[],
G4double hstep,
G4double& dchord_step,
G4double& dyerr) override;
// QuickAdvance just tries one Step - it does not ensure accuracy.
G4bool QuickAdvance(G4FieldTrack& y_posvel, // INOUT
const G4double dydx[],
G4double hstep, // IN
G4double& dchord_step,
G4double& dyerr_pos_sq,
G4double& dyerr_mom_rel_sq );
// New QuickAdvance that also just tries one Step
// (so also does not ensure accuracy)
// but does return the errors in position and
// momentum (normalised: Delta_Integration(p^2)/(p^2) )
inline G4double GetHmin() const;
inline G4double Hmin() const; // Obsolete
inline G4double GetSafety() const;
inline G4double GetPshrnk() const;
inline G4double GetPgrow() const;
inline G4double GetErrcon() const;
virtual void GetDerivatives(const G4FieldTrack& y_curr, // INput
G4double dydx[]) const override; // OUTput
virtual void GetDerivatives(const G4FieldTrack& track,
G4double dydx[],
G4double field[]) const override;
// Accessors
virtual G4EquationOfMotion* GetEquationOfMotion() override;
virtual void SetEquationOfMotion(G4EquationOfMotion* equation) override;
virtual void RenewStepperAndAdjust(G4MagIntegratorStepper* pItsStepper) override;
// Sets a new stepper pItsStepper for this driver. Then it calls
// ReSetParameters to reset its parameters accordingly.
inline void ReSetParameters(G4double new_safety = 0.9);
// i) sets the exponents (pgrow & pshrnk),
// using the current Stepper's order,
// ii) sets the safety
// ii) calculates "errcon" according to the above values.
inline void SetSafety(G4double valS);
inline void SetPshrnk(G4double valPs);
inline void SetPgrow (G4double valPg);
inline void SetErrcon(G4double valEc);
// When setting safety or pgrow, errcon will be set to a compatible value.
inline G4double ComputeAndSetErrcon();
virtual const G4MagIntegratorStepper* GetStepper() const override;
virtual G4MagIntegratorStepper* GetStepper() override;
void OneGoodStep(G4double ystart[], // Like old RKF45step()
const G4double dydx[],
G4double& x,
G4double htry,
G4double eps, // memb variables ?
G4double& hdid,
G4double& hnext ) ;
// This takes one Step that is as large as possible while
// satisfying the accuracy criterion of:
// yerr < eps * |y_end-y_start|
virtual G4double ComputeNewStepSize(G4double errMaxNorm, // normalised
G4double hstepCurrent) override;
// Taking the last step's normalised error, calculate
// a step size for the next step.
// Do not limit the next step's size within a factor of the
// current one.
void StreamInfo( std::ostream& os ) const override;
G4double ComputeNewStepSize_WithinLimits(G4double errMaxNorm, // normalised
G4double hstepCurrent);
// Taking the last step's normalised error, calculate
// a step size for the next step.
// Limit the next step's size within a range around the current one.
inline G4int GetMaxNoSteps() const;
inline void SetMaxNoSteps(G4int val);
// Modify and Get the Maximum number of Steps that can be
// taken for the integration of a single segment -
// (i.e. a single call to AccurateAdvance).
public: // without description
inline void SetHmin(G4double newval);
virtual void SetVerboseLevel(G4int newLevel) override;
virtual G4int GetVerboseLevel() const override;
inline G4double GetSmallestFraction() const;
void SetSmallestFraction( G4double val );
protected: // without description
void WarnSmallStepSize(G4double hnext, G4double hstep,
G4double h, G4double xDone,
G4int noSteps);
void WarnTooManyStep(G4double x1start, G4double x2end, G4double xCurrent);
void WarnEndPointTooFar(G4double endPointDist,
G4double hStepSize ,
G4double epsilonRelative,
G4int debugFlag);
// Issue warnings for undesirable situations
void PrintStatus(const G4double* StartArr,
G4double xstart,
const G4double* CurrentArr,
G4double xcurrent,
G4double requestStep,
G4int subStepNo);
void PrintStatus(const G4FieldTrack& StartFT,
const G4FieldTrack& CurrentFT,
G4double requestStep,
G4int subStepNo);
void PrintStat_Aux(const G4FieldTrack& aFieldTrack,
G4double requestStep,
G4double actualStep,
G4int subStepNo,
G4double subStepSize,
G4double dotVelocities);
// Verbose output for debugging
void PrintStatisticsReport();
// Report on the number of steps, maximum errors etc.
#ifdef QUICK_ADV_TWO
G4bool QuickAdvance( G4double yarrin[], // In
const G4double dydx[],
G4double hstep,
G4double yarrout[], // Out
G4double& dchord_step, // Out
G4double& dyerr ); // in length
#endif
private:
// ---------------------------------------------------------------
// INVARIANTS
G4double fMinimumStep = 0.0;
// Minimum Step allowed in a Step (in absolute units)
G4double fSmallestFraction = 1.0e-12; // Expected range 1e-12 to 5e-15
// Smallest fraction of (existing) curve length - in relative units
// below this fraction the current step will be the last
const G4int fNoIntegrationVariables = 0; // Variables in integration
const G4int fMinNoVars = 12; // Minimum number for FieldTrack
const G4int fNoVars = 0; // Full number of variable
G4int fMaxNoSteps;
G4int fMaxStepBase = 250; // was 5000
// Default maximum number of steps is Base divided by the order of Stepper
G4double safety;
G4double pshrnk; // exponent for shrinking
G4double pgrow; // exponent for growth
G4double errcon;
// Parameters used to grow and shrink trial stepsize.
G4int fStatisticsVerboseLevel = 0;
// ---------------------------------------------------------------
// DEPENDENT Objects
G4MagIntegratorStepper* pIntStepper = nullptr;
// ---------------------------------------------------------------
// STATE
unsigned long fNoTotalSteps=0, fNoBadSteps=0;
unsigned long fNoSmallSteps=0, fNoInitialSmallSteps=0, fNoCalls=0;
G4double fDyerr_max=0.0, fDyerr_mx2=0.0;
G4double fDyerrPos_smTot=0.0, fDyerrPos_lgTot=0.0, fDyerrVel_lgTot=0.0;
G4double fSumH_sm=0.0, fSumH_lg=0.0;
// Step Statistics
G4int fVerboseLevel = 0; // Verbosity level for printing (debug, ..)
// Could be varied during tracking - to help identify issues
using ChordFinderDelegate = G4ChordFinderDelegate<G4OldMagIntDriver>;
};
#include "G4OldMagIntDriver.icc"
#endif
@@ -0,0 +1,152 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4OldMagIntDriver inline methods implementation
//
// V.Grichine, 07.10.1996 - Created
// --------------------------------------------------------------------
inline
G4double G4OldMagIntDriver::
AdvanceChordLimited(G4FieldTrack& track, G4double stepMax,
G4double epsStep, G4double chordDistance)
{
return ChordFinderDelegate::AdvanceChordLimitedImpl(track, stepMax,
epsStep, chordDistance);
}
inline
void G4OldMagIntDriver::OnStartTracking()
{
ChordFinderDelegate::ResetStepEstimate();
}
inline
G4double G4OldMagIntDriver::GetHmin() const
{
return fMinimumStep;
}
inline
G4double G4OldMagIntDriver::Hmin() const
{
return fMinimumStep;
}
inline
G4double G4OldMagIntDriver::GetSafety() const
{
return safety;
}
inline
G4double G4OldMagIntDriver::GetPshrnk() const
{
return pshrnk;
}
inline
G4double G4OldMagIntDriver::GetPgrow() const
{
return pgrow;
}
inline
G4double G4OldMagIntDriver::GetErrcon() const
{
return errcon;
}
inline
void G4OldMagIntDriver::SetHmin(G4double newval)
{
fMinimumStep = newval;
}
inline
G4double G4OldMagIntDriver::ComputeAndSetErrcon()
{
errcon = std::pow(max_stepping_increase/GetSafety(),1.0/GetPgrow());
return errcon;
}
inline
void G4OldMagIntDriver::ReSetParameters(G4double new_safety)
{
safety = new_safety;
pshrnk = -1.0 / pIntStepper->IntegratorOrder();
pgrow = -1.0 / (1.0 + pIntStepper->IntegratorOrder());
ComputeAndSetErrcon();
}
inline
void G4OldMagIntDriver::SetSafety(G4double val)
{
safety = val;
ComputeAndSetErrcon();
}
inline
void G4OldMagIntDriver::SetPgrow(G4double val)
{
pgrow = val;
ComputeAndSetErrcon();
}
inline
void G4OldMagIntDriver::SetErrcon(G4double val)
{
errcon = val;
}
inline
G4int G4OldMagIntDriver::GetMaxNoSteps() const
{
return fMaxNoSteps;
}
inline
void G4OldMagIntDriver::SetMaxNoSteps(G4int val)
{
fMaxNoSteps = val;
}
inline
G4int G4OldMagIntDriver::GetVerboseLevel() const
{
return fVerboseLevel;
}
inline
void G4OldMagIntDriver::SetVerboseLevel(G4int newLevel)
{
fVerboseLevel = newLevel;
}
inline
G4double G4OldMagIntDriver::GetSmallestFraction() const
{
return fSmallestFraction;
}
@@ -55,10 +55,10 @@ class G4RKIntegrationDriver : public G4VIntegrationDriver
G4double field[]) const override;
virtual G4double ComputeNewStepSize(G4double errMaxNorm, // normalised error
G4double hstepCurrent) override;
G4double hstepCurrent) override final;
// Taking the last step's normalised error, calculate
// a step size for the next step.
// Do not limit the next step's size within a factor of the current one.
// - Limits the next step's size within a factor of the current one.
virtual G4EquationOfMotion* GetEquationOfMotion() override;
virtual void SetEquationOfMotion(G4EquationOfMotion* equation) override;
@@ -66,6 +66,8 @@ class G4RKIntegrationDriver : public G4VIntegrationDriver
virtual const T* GetStepper() const override;
virtual T* GetStepper() override;
virtual void StreamInfo( std::ostream& os ) const override;
// Accessors.
G4double GetSafety() const;
G4double GetPshrnk() const;
@@ -223,3 +223,15 @@ void G4RKIntegrationDriver<T>::SetEquationOfMotion(G4EquationOfMotion* equation)
{
pIntStepper->SetEquationOfMotion(equation);
}
template <class T>
void G4RKIntegrationDriver<T>::StreamInfo( std::ostream& os ) const
{
os << "State of G4RKIntegrationDriver: " << std::endl;
os << " Max number of Steps = " << fMaxNoSteps << std::endl;
os << " Safety factor = " << safety << std::endl;
os << " Power - shrink = " << pshrnk << std::endl;
os << " Power - grow = " << pgrow << std::endl;
os << " threshold - shrink = " << errorConstraintShrink << std::endl;
os << " threshold - grow = " << errorConstraintGrow << std::endl;
}
@@ -62,7 +62,7 @@ class G4VIntegrationDriver
virtual G4bool AccurateAdvance(G4FieldTrack& track,
G4double hstep,
G4double eps, // Requested y_err/hstep
G4double hinitial = 0) = 0;
G4double hinitial = 0 ) = 0;
virtual void SetEquationOfMotion(G4EquationOfMotion* equation) = 0;
virtual G4EquationOfMotion* GetEquationOfMotion() = 0;
@@ -104,13 +104,19 @@ class G4VIntegrationDriver
G4double hstepCurrent) = 0;
// Taking the last step's normalised error, calculate
// a step size for the next step.
// Do not limit the next step's size within a factor of the current one.
// - Can limit the next step's size within a factor of the current one.
virtual G4bool DoesReIntegrate() = 0;
virtual G4bool DoesReIntegrate() const = 0;
// Whether the driver implementates re-integration
// - original Integration driver will re-start and re-calculate interval => yes
// - Interpolation Driver does not recalculate (it interpolates)
// Basically answer: does this driver *Recalculate* when AccurateAdvance is called ?
virtual void StreamInfo( std::ostream& os ) const = 0;
// Write out the parameters / state of the driver
friend std::ostream& operator<<( std::ostream& os, const G4VIntegrationDriver& id);
protected:
static constexpr G4double max_stepping_increase = 5;
+174 -191
View File
@@ -1,202 +1,185 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4magneticfield
# Package: Geant4.src.G4geometry.G4magneticfield
#
# 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 : 29/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 G4magneticfield
HEADERS
G4BFieldIntegrationDriver.hh
G4BogackiShampine23.hh
G4BogackiShampine45.hh
G4BulirschStoer.hh
G4BulirschStoer.icc
G4BulirschStoerDriver.hh
G4BulirschStoerDriver.icc
G4CachedMagneticField.hh
G4CashKarpRKF45.hh
G4ChargeState.hh
G4ChordFinder.hh
G4ChordFinder.icc
G4ChordFinderDelegate.hh
G4ChordFinderDelegate.icc
G4ClassicalRK4.hh
G4ConstRK4.hh
G4DELPHIMagField.hh
G4DoLoMcPriRK34.hh
G4DormandPrince745.hh
G4DormandPrinceRK56.hh
G4DormandPrinceRK78.hh
G4ElectricField.hh
G4ElectroMagneticField.hh
G4EqEMFieldWithEDM.hh
G4EqEMFieldWithSpin.hh
G4EqGravityField.hh
G4EqMagElectricField.hh
G4EquationOfMotion.hh
G4EquationOfMotion.icc
G4ErrorMag_UsualEqRhs.hh
G4ExactHelixStepper.hh
G4ExplicitEuler.hh
G4Field.hh
G4FieldManager.hh
G4FieldManager.icc
G4FieldManagerStore.hh
G4FieldTrack.hh
G4FieldTrack.icc
G4FieldUtils.hh
G4FieldUtils.icc
G4FSALBogackiShampine45.hh
G4FSALDormandPrince745.hh
G4FSALIntegrationDriver.hh
G4FSALIntegrationDriver.icc
G4VFSALIntegrationStepper.hh
G4VFSALIntegrationStepper.icc
G4HarmonicPolMagField.hh
G4HelixExplicitEuler.hh
G4HelixHeum.hh
G4HelixImplicitEuler.hh
G4HelixMixedStepper.hh
G4HelixSimpleRunge.hh
G4ImplicitEuler.hh
G4IntegrationDriver.hh
G4IntegrationDriver.icc
G4InterpolationDriver.hh
G4InterpolationDriver.icc
G4LineCurrentMagField.hh
G4LineSection.hh
G4MagErrorStepper.hh
G4MagErrorStepper.icc
G4MagHelicalStepper.hh
G4MagHelicalStepper.icc
G4MagIntegratorDriver.hh
G4MagIntegratorDriver.icc
G4MagIntegratorStepper.hh
G4MagIntegratorStepper.icc
G4Mag_EqRhs.hh
G4Mag_SpinEqRhs.hh
G4Mag_UsualEqRhs.hh
G4ModifiedMidpoint.hh
G4ModifiedMidpoint.icc
G4MonopoleEq.hh
G4MagneticField.hh
G4NystromRK4.hh
G4NystromRK4.icc
G4QuadrupoleMagField.hh
G4RepleteEofM.hh
G4SextupoleMagField.hh
G4RKG3_Stepper.hh
G4RK547FEq1.hh
G4RK547FEq2.hh
G4RK547FEq3.hh
G4RKIntegrationDriver.hh
G4RKIntegrationDriver.icc
G4SimpleHeum.hh
G4SimpleRunge.hh
G4TrialsCounter.hh
G4TrialsCounter.icc
G4TsitourasRK45.hh
G4UniformElectricField.hh
G4UniformGravityField.hh
G4UniformMagField.hh
G4VIntegrationDriver.hh
SOURCES
G4BFieldIntegrationDriver.cc
G4BogackiShampine23.cc
G4BogackiShampine45.cc
G4BulirschStoer.cc
G4CachedMagneticField.cc
G4CashKarpRKF45.cc
G4ChargeState.cc
G4ChordFinder.cc
G4ClassicalRK4.cc
G4ConstRK4.cc
G4DELPHIMagField.cc
G4DoLoMcPriRK34.cc
G4DormandPrince745.cc
G4DormandPrinceRK56.cc
G4DormandPrinceRK78.cc
G4ElectricField.cc
G4ElectroMagneticField.cc
G4EqEMFieldWithEDM.cc
G4EqEMFieldWithSpin.cc
G4EqGravityField.cc
G4EqMagElectricField.cc
G4EquationOfMotion.cc
G4ErrorMag_UsualEqRhs.cc
G4ExactHelixStepper.cc
G4ExplicitEuler.cc
G4Field.cc
G4FieldManager.cc
G4FieldManagerStore.cc
G4FieldTrack.cc
G4FieldUtils.cc
G4FSALBogackiShampine45.cc
G4FSALDormandPrince745.cc
G4VFSALIntegrationStepper.cc
G4HarmonicPolMagField.cc
G4HelixExplicitEuler.cc
G4HelixHeum.cc
G4HelixImplicitEuler.cc
G4HelixMixedStepper.cc
G4HelixSimpleRunge.cc
G4ImplicitEuler.cc
G4LineCurrentMagField.cc
G4LineSection.cc
G4MagErrorStepper.cc
G4MagHelicalStepper.cc
G4MagIntegratorDriver.cc
G4MagIntegratorStepper.cc
G4Mag_EqRhs.cc
G4Mag_SpinEqRhs.cc
G4Mag_UsualEqRhs.cc
G4MagneticField.cc
G4ModifiedMidpoint.cc
G4MonopoleEq.cc
G4NystromRK4.cc
G4QuadrupoleMagField.cc
G4RepleteEofM.cc
G4SextupoleMagField.cc
G4RKG3_Stepper.cc
G4RK547FEq1.cc
G4RK547FEq2.cc
G4RK547FEq3.cc
G4SimpleHeum.cc
G4SimpleRunge.cc
G4TrialsCounter.cc
G4TsitourasRK45.cc
G4UniformElectricField.cc
G4UniformGravityField.cc
G4UniformMagField.cc
G4VIntegrationDriver.cc
GRANULAR_DEPENDENCIES
G4globman
GLOBAL_DEPENDENCIES
G4global
LINK_LIBRARIES
geant4_define_module(NAME G4magneticfield
HEADERS
G4BFieldIntegrationDriver.hh
G4BogackiShampine23.hh
G4BogackiShampine45.hh
G4BulirschStoer.hh
G4BulirschStoer.icc
G4BulirschStoerDriver.hh
G4BulirschStoerDriver.icc
G4CachedMagneticField.hh
G4CashKarpRKF45.hh
G4ChargeState.hh
G4ChordFinder.hh
G4ChordFinder.icc
G4ChordFinderDelegate.hh
G4ChordFinderDelegate.icc
G4ClassicalRK4.hh
G4ConstRK4.hh
G4DELPHIMagField.hh
G4DoLoMcPriRK34.hh
G4DormandPrince745.hh
G4DormandPrinceRK56.hh
G4DormandPrinceRK78.hh
G4DriverReporter.hh
G4ElectricField.hh
G4ElectroMagneticField.hh
G4EqEMFieldWithEDM.hh
G4EqEMFieldWithSpin.hh
G4EqGravityField.hh
G4EqMagElectricField.hh
G4EquationOfMotion.hh
G4EquationOfMotion.icc
G4ErrorMag_UsualEqRhs.hh
G4ExactHelixStepper.hh
G4ExplicitEuler.hh
G4Field.hh
G4FieldManager.hh
G4FieldManager.icc
G4FieldManagerStore.hh
G4FieldTrack.hh
G4FieldTrack.icc
G4FieldUtils.hh
G4FieldUtils.icc
G4FSALBogackiShampine45.hh
G4FSALDormandPrince745.hh
G4FSALIntegrationDriver.hh
G4FSALIntegrationDriver.icc
G4VFSALIntegrationStepper.hh
G4VFSALIntegrationStepper.icc
G4HarmonicPolMagField.hh
G4HelixExplicitEuler.hh
G4HelixHeum.hh
G4HelixImplicitEuler.hh
G4HelixMixedStepper.hh
G4HelixSimpleRunge.hh
G4ImplicitEuler.hh
G4IntegrationDriver.hh
G4IntegrationDriver.icc
G4InterpolationDriver.hh
G4InterpolationDriver.icc
G4LineCurrentMagField.hh
G4LineSection.hh
G4MagErrorStepper.hh
G4MagErrorStepper.icc
G4MagHelicalStepper.hh
G4MagHelicalStepper.icc
G4MagIntegratorDriver.hh
G4MagIntegratorDriver.icc
G4MagIntegratorStepper.hh
G4MagIntegratorStepper.icc
G4Mag_EqRhs.hh
G4Mag_SpinEqRhs.hh
G4Mag_UsualEqRhs.hh
G4ModifiedMidpoint.hh
G4ModifiedMidpoint.icc
G4MonopoleEq.hh
G4MagneticField.hh
G4NystromRK4.hh
G4NystromRK4.icc
G4OldMagIntDriver.hh
G4OldMagIntDriver.icc
G4QuadrupoleMagField.hh
G4RepleteEofM.hh
G4SextupoleMagField.hh
G4RKG3_Stepper.hh
G4RK547FEq1.hh
G4RK547FEq2.hh
G4RK547FEq3.hh
G4RKIntegrationDriver.hh
G4RKIntegrationDriver.icc
G4SimpleHeum.hh
G4SimpleRunge.hh
G4TrialsCounter.hh
G4TrialsCounter.icc
G4TsitourasRK45.hh
G4UniformElectricField.hh
G4UniformGravityField.hh
G4UniformMagField.hh
G4VIntegrationDriver.hh
SOURCES
G4BFieldIntegrationDriver.cc
G4BogackiShampine23.cc
G4BogackiShampine45.cc
G4BulirschStoer.cc
G4CachedMagneticField.cc
G4CashKarpRKF45.cc
G4ChargeState.cc
G4ChordFinder.cc
G4ClassicalRK4.cc
G4ConstRK4.cc
G4DELPHIMagField.cc
G4DoLoMcPriRK34.cc
G4DormandPrince745.cc
G4DormandPrinceRK56.cc
G4DormandPrinceRK78.cc
G4DriverReporter.cc
G4ElectricField.cc
G4ElectroMagneticField.cc
G4EqEMFieldWithEDM.cc
G4EqEMFieldWithSpin.cc
G4EqGravityField.cc
G4EqMagElectricField.cc
G4EquationOfMotion.cc
G4ErrorMag_UsualEqRhs.cc
G4ExactHelixStepper.cc
G4ExplicitEuler.cc
G4Field.cc
G4FieldManager.cc
G4FieldManagerStore.cc
G4FieldTrack.cc
G4FieldUtils.cc
G4FSALBogackiShampine45.cc
G4FSALDormandPrince745.cc
G4VFSALIntegrationStepper.cc
G4HarmonicPolMagField.cc
G4HelixExplicitEuler.cc
G4HelixHeum.cc
G4HelixImplicitEuler.cc
G4HelixMixedStepper.cc
G4HelixSimpleRunge.cc
G4ImplicitEuler.cc
G4LineCurrentMagField.cc
G4LineSection.cc
G4MagErrorStepper.cc
G4MagHelicalStepper.cc
G4MagIntegratorDriver.cc
G4MagIntegratorStepper.cc
G4Mag_EqRhs.cc
G4Mag_SpinEqRhs.cc
G4Mag_UsualEqRhs.cc
G4MagneticField.cc
G4ModifiedMidpoint.cc
G4MonopoleEq.cc
G4NystromRK4.cc
G4OldMagIntDriver.cc
G4QuadrupoleMagField.cc
G4RepleteEofM.cc
G4SextupoleMagField.cc
G4RKG3_Stepper.cc
G4RK547FEq1.cc
G4RK547FEq2.cc
G4RK547FEq3.cc
G4SimpleHeum.cc
G4SimpleRunge.cc
G4TrialsCounter.cc
G4TsitourasRK45.cc
G4UniformElectricField.cc
G4UniformGravityField.cc
G4UniformMagField.cc
G4VIntegrationDriver.cc
GRANULAR_DEPENDENCIES
G4globman
GLOBAL_DEPENDENCIES
G4global
)
# List any source specific properties here
@@ -73,7 +73,7 @@ G4ChordFinder::G4ChordFinder(G4VIntegrationDriver* pIntegrationDriver)
// ..........................................................................
G4ChordFinder::G4ChordFinder( G4MagneticField* theMagField,
G4double stepMinimum,
G4double stepMinimum,
G4MagIntegratorStepper* pItsStepper,
G4bool useFSALstepper )
: fDefaultDeltaChord(0.25 * mm)
@@ -126,9 +126,20 @@ G4ChordFinder::G4ChordFinder( G4MagneticField* theMagField,
if( pItsStepper != nullptr )
{
#if 0
// G4cout << " G4ChordFinder: Creating G4IntegrationDriver<G4MagIntegratorStepper> with "
// << " stepMinimum = " << stepMinimum
// << " numVar= " << pItsStepper->GetNumberOfVariables() << G4endl;
// Type is not known - so must use old class
fIntgrDriver = new G4IntegrationDriver<G4MagIntegratorStepper>(
stepMinimum, pItsStepper, pItsStepper->GetNumberOfVariables());
#else
G4cout << " G4ChordFinder: Creating G4MagInt_Driver with "
<< " stepMinimum = " << stepMinimum
<< " numVar= " << pItsStepper->GetNumberOfVariables() << G4endl;
fIntgrDriver = new G4MagInt_Driver( stepMinimum, pItsStepper,
pItsStepper->GetNumberOfVariables());
#endif
}
else if ( !useFSALstepper )
{
@@ -150,7 +161,7 @@ G4ChordFinder::G4ChordFinder( G4MagneticField* theMagField,
errorInStepperCreation = true;
}
else
{
{
using SmallStepDriver = G4InterpolationDriver<G4DormandPrince745>;
using LargeStepDriver = G4IntegrationDriver<G4HelixHeum>;
@@ -483,3 +494,15 @@ ApproxCurvePointV( const G4FieldTrack& CurveA_PointVelocity,
}
// ...........................................................................
std::ostream& operator<<( std::ostream& os, const G4ChordFinder& cf)
{
// Dumping the state of G4ChordFinder
os << "State of G4ChordFinder : " << std::endl;
os << " delta_chord = " << cf.fDeltaChord;
os << " Default d_c = " << cf.fDefaultDeltaChord;
os << " stats-verbose = " << cf.fStatsVerbose;
return os;
}
@@ -0,0 +1,202 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4DriverReporter
//
// Implementation
//
//
// Authors: J.Apostolakis - January/March 2020
// -------------------------------------------------------------------
#include "G4DriverReporter.hh"
// ---------------------------------------------------------------------------
void G4DriverReporter::PrintStatus( const G4double* StartArr,
G4double xstart,
const G4double* CurrentArr,
G4double xcurrent,
G4double requestStep,
unsigned int subStepNo,
unsigned int noIntegrationVariables
)
// Potentially add as arguments:
// <dydx> - as Initial Force
// stepTaken(hdid) - last step taken
// nextStep (hnext) - proposal for size
{
G4FieldTrack StartFT(G4ThreeVector(0,0,0),
G4ThreeVector(0,0,0), 0., 0., 0., 0. );
G4FieldTrack CurrentFT (StartFT);
StartFT.LoadFromArray( StartArr, noIntegrationVariables);
StartFT.SetCurveLength( xstart);
CurrentFT.LoadFromArray( CurrentArr, noIntegrationVariables);
CurrentFT.SetCurveLength( xcurrent );
PrintStatus(StartFT, CurrentFT, requestStep, subStepNo );
}
// ---------------------------------------------------------------------------
const G4int noPrecision = 8;
const int prec7= noPrecision+2;
const int prec8= noPrecision+3;
const int prec9= noPrecision+4;
void G4DriverReporter::PrintStatus(const G4FieldTrack& StartFT,
const G4FieldTrack& CurrentFT,
G4double requestStep,
unsigned int subStepNo)
{
G4int verboseLevel= 2; // fVerboseLevel;
G4int oldPrec= G4cout.precision(noPrecision);
// G4cout.setf(ios_base::fixed,ios_base::floatfield);
const G4ThreeVector StartPosition= StartFT.GetPosition();
const G4ThreeVector StartUnitVelocity= StartFT.GetMomentumDir();
const G4ThreeVector CurrentPosition= CurrentFT.GetPosition();
const G4ThreeVector CurrentUnitVelocity= CurrentFT.GetMomentumDir();
G4double DotStartCurrentVeloc= StartUnitVelocity.dot(CurrentUnitVelocity);
G4double step_len= CurrentFT.GetCurveLength() - StartFT.GetCurveLength();
G4double subStepSize = step_len;
if( (subStepNo <= 1) || (verboseLevel > 3) )
{
subStepNo = - subStepNo; // To allow printing banner
G4cout << "------------------------------------------------------------------"
<< G4endl;
G4cout << std::setw( 6) << " " << std::setw( 25)
<< " G4DriverReporter: Current Position and Direction" << " "
<< G4endl;
G4cout << std::setw( 5) << "Step#" << " "
<< std::setw( prec7) << "s-curve" << " "
<< std::setw( prec9) << "X(mm)" << " "
<< std::setw( prec9) << "Y(mm)" << " "
<< std::setw( prec9) << "Z(mm)" << " "
<< std::setw( prec8) << " N_x " << " "
<< std::setw( prec8) << " N_y " << " "
<< std::setw( prec8) << " N_z " << " "
<< std::setw( 6) << " N^2-1 " << " "
<< std::setw(10) << " N(0).N " << " "
<< std::setw( 7) << "KinEner " << " "
<< std::setw(12) << "Track-l" << " " // Add the Sub-step ??
<< std::setw(12) << "Step-len" << " "
<< std::setw(12) << "Step-len" << " "
<< std::setw( 9) << "ReqStep" << " "
<< G4endl;
}
G4cout.precision(noPrecision);
if( (subStepNo <= 0) )
{
PrintStat_Aux( StartFT, requestStep, 0.,
0, 0.0, 1.0);
}
// if( verboseLevel <= 3 )
{
G4cout.precision(noPrecision);
PrintStat_Aux( CurrentFT, requestStep, step_len,
subStepNo, subStepSize, DotStartCurrentVeloc );
}
G4cout << "------------------------------------------------------------------"
<< G4endl;
G4cout.precision(oldPrec);
}
// ---------------------------------------------------------------------------
void G4DriverReporter::PrintStat_Aux(const G4FieldTrack& aFieldTrack,
G4double requestStep,
G4double step_len,
G4int subStepNo,
G4double subStepSize,
G4double dotVeloc_StartCurr)
{
const G4ThreeVector Position = aFieldTrack.GetPosition();
const G4ThreeVector UnitVelocity = aFieldTrack.GetMomentumDir();
G4int oldprec= G4cout.precision(noPrecision);
if( subStepNo >= 0)
{
G4cout << std::setw( 5) << subStepNo << " ";
}
else
{
G4cout << std::setw( 5) << "Start" << " ";
}
G4double curveLen= aFieldTrack.GetCurveLength();
G4cout << std::setw( 7) << curveLen;
// G4cout.precision(noPrecision);
G4cout << std::setw( prec9) << Position.x() << " "
<< std::setw( prec9) << Position.y() << " "
<< std::setw( prec9) << Position.z() << " "
<< std::setw( prec8) << UnitVelocity.x() << " "
<< std::setw( prec8) << UnitVelocity.y() << " "
<< std::setw( prec8) << UnitVelocity.z() << " ";
G4cout.precision(3);
G4double unitMagDif = UnitVelocity.mag2()-1.0;
if( std::fabs( unitMagDif ) < 1.0e-15 ) { unitMagDif = 0.0; }
G4cout << std::setw( 8) << unitMagDif << " ";
G4cout.precision(6);
G4cout << std::setw(10) << dotVeloc_StartCurr << " ";
G4cout.precision(oldprec);
G4cout << std::setw( prec7) << aFieldTrack.GetKineticEnergy();
G4cout << std::setw(12) << step_len << " ";
static G4ThreadLocal G4double oldCurveLength = 0.0;
static G4ThreadLocal G4double oldSubStepLength = 0.0;
static G4ThreadLocal G4int oldSubStepNo = -1;
G4double subStep_len = 0.0;
if( curveLen > oldCurveLength )
{
subStep_len= curveLen - oldCurveLength;
}
else if (subStepNo == oldSubStepNo)
{
subStep_len= oldSubStepLength;
}
oldCurveLength= curveLen;
oldSubStepLength= subStep_len;
G4cout << std::setw(12) << subStep_len << " ";
G4cout << std::setw(12) << subStepSize << " ";
if( requestStep != -1.0 )
{
G4cout << std::setw( prec9) << requestStep << " ";
}
else
{
G4cout << std::setw( prec9) << " InitialStep " << " ";
}
G4cout << G4endl;
}
@@ -38,6 +38,10 @@
#include "G4MagIntegratorDriver.hh"
#include "G4FieldTrack.hh"
#ifdef G4DEBUG_FIELD
#include "G4DriverReporter.hh"
#endif
// ---------------------------------------------------------
// Constructor
@@ -194,7 +198,8 @@ G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
#ifdef G4DEBUG_FIELD
if (dbg>2)
{
PrintStatus( ySubStepStart, xSubStepStart, y, x, h, nstp); // Only
// PrintStatus( ySubStepStart, xSubStepStart, y, x, h, nstp); // Only
G4DriverReporter::PrintStatus( ySubStepStart, xSubStepStart, y, x, h, nstp, nvar);
}
#endif
}
@@ -216,7 +221,7 @@ G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
if ( dyerr_len > fDyerr_max ) { fDyerr_max = dyerr_len; }
fDyerrPos_smTot += dyerr_len;
fSumH_sm += h; // Length total for 'small' steps
if (nstp<=1) { ++fNoInitialSmallSteps; }
if (nstp==1) { ++fNoInitialSmallSteps; }
#endif
#ifdef G4DEBUG_FIELD
if (dbg>1)
@@ -351,7 +356,7 @@ G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
#endif
}
}
} while ( ((nstp++)<=fMaxNoSteps) && (x < x2) && (!lastStep) );
} while ( ((++nstp)<=fMaxNoSteps) && (x < x2) && (!lastStep) );
// Loop checking, 07.10.2016, J. Apostolakis
// Have we reached the end ?
@@ -719,7 +724,7 @@ G4bool G4MagInt_Driver::QuickAdvance(G4double yarrin[], // In
// within certain factors
//
G4double G4MagInt_Driver::
ComputeNewStepSize(G4double errMaxNorm, // max error (normalised)
ComputeNewStepSize_WithoutReductionLimit(G4double errMaxNorm, // max error (normalised)
G4double hstepCurrent) // current step size
{
G4double hnew;
@@ -746,6 +751,17 @@ ComputeNewStepSize(G4double errMaxNorm, // max error (normalised)
// ---------------------------------------------------------------------------
G4double
G4MagInt_Driver::ComputeNewStepSize(
G4double errMaxNorm, // max error (normalised)
G4double hstepCurrent) // current step size
{
// Legacy behaviour:
return ComputeNewStepSize_WithoutReductionLimit( errMaxNorm, hstepCurrent );
// 'Improved' behaviour - at least more consistent with other step estimates:
// return ComputeNewStepSize_WithinLimits( errMaxNorm, hstepCurrent );
}
// This method computes new step sizes limiting changes within certain factors
//
// It shares its logic with AccurateAdvance.
@@ -1013,6 +1029,49 @@ G4MagIntegratorStepper* G4MagInt_Driver::GetStepper()
void G4MagInt_Driver::
RenewStepperAndAdjust(G4MagIntegratorStepper* pItsStepper)
{
pIntStepper = pItsStepper;
pIntStepper = pItsStepper;
ReSetParameters();
}
void G4MagInt_Driver::StreamInfo( std::ostream& os ) const
{
os << "State of G4MagInt_Driver: " << std::endl;
os << " Max number of Steps = " << fMaxNoSteps
<< " (base # = " << fMaxStepBase << " )" << std::endl;
os << " Safety factor = " << safety << std::endl;
os << " Power - shrink = " << pshrnk << std::endl;
os << " Power - grow = " << pgrow << std::endl;
os << " threshold (errcon) = " << errcon << std::endl;
os << " fMinimumStep = " << fMinimumStep << std::endl;
os << " Smallest Fraction = " << fSmallestFraction << std::endl;
os << " No Integrat Vars = " << fNoIntegrationVariables << std::endl;
os << " Min No Vars = " << fMinNoVars << std::endl;
os << " Num-Vars = " << fNoVars << std::endl;
os << " verbose level = " << fVerboseLevel << std::endl;
os << " Reintegrates = " << DoesReIntegrate() << std::endl;
}
void PrintInfo( const G4MagInt_Driver & magDrv, std::ostream& os )
{
os << "State of G4MagInt_Driver: " << std::endl;
os << " Max number of Steps = " << magDrv.GetMaxNoSteps();
// << " (base # = " << magDrv.fMaxStepBase << " )" << std::endl;
os << " Safety factor = " << magDrv.GetSafety() << std::endl;
os << " Power - shrink = " << magDrv.GetPshrnk() << std::endl;
os << " Power - grow = " << magDrv.GetPgrow() << std::endl;
os << " threshold (errcon) = " << magDrv.GetErrcon() << std::endl;
os << " fMinimumStep = " << magDrv.GetHmin() << std::endl;
os << " Smallest Fraction = " << magDrv.GetSmallestFraction() << std::endl;
/*****
os << " No Integrat Vars = " << magDrv.GetNoIntegrationVariables << std::endl;
os << " Min No Vars = " << magDrv.GetMinNoVars << std::endl;
os << " Num-Vars = " << magDrv.GetNoVars << std::endl;
*****/
os << " verbose level = " << magDrv.GetVerboseLevel() << std::endl;
os << " Reintegrates = " << magDrv.DoesReIntegrate() << std::endl;
}
File diff suppressed because it is too large Load Diff
@@ -38,3 +38,10 @@ void G4VIntegrationDriver::RenewStepperAndAdjust(G4MagIntegratorStepper *)
"This method exists only for the original G4MagIntegratorDriver class. "
"Not defined for other classes derived from G4VIntegrationDriver");
}
std::ostream& operator<<( std::ostream& os, const G4VIntegrationDriver& id)
{
id.StreamInfo( os );
return os;
}
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4geometrymng
# Package: Geant4.src.G4geometry.G4geometrymng
#
# 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()
+33 -16
View File
@@ -15,6 +15,23 @@ commit in the repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 28, 2019 B.Morgan (geommng-V10-06-04)
- When using new CMake build, add location of generated G4GeomConfig.hh
header to public include directories of G4geometrymng module.
April 30, 2020 Gabriele Cosmo (geommng-V10-06-03)
- Adopt new convention for location of headers in VecGeom for wrappers.
April 17, 2020 Gabriele Cosmo (geommng-V10-06-02)
- Added deleted declarations for copy constructor and assignment operators
on store singletons. Based on GitHub PR#12 suggestion.
April 2, 2020 Guilherme Amadio (geommng-V10-06-01)
- Reduce size of LogicalVolumes by reordering class members
December 10, 2019 Ben Morgan (geommng-V10-06-00)
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
November 15, 2019 Gabriele Cosmo (geommng-V10-05-15)
- Fixed cases of implicit type conversions from size_t to G4int.
@@ -49,7 +66,7 @@ October 23, 2019 J.Apostolakis (geommng-V10-05-11)
Preparing for addition of External Navigation, which adds an 'external'
physical volume type (for use with an External sub-Navigator).
Note: This is used by G4Navigator's CharacteriseDaughters() method.
The old method derived this value from response of IsReplicated()
The old method derived this value from response of IsReplicated()
virtual method and, in the case of replica/division/parameterised volumes,
information from a call to the 2nd virtual method ReplicationData.
- G4VPhysicalVolume copy constructor and assignment operator are now 'deleted'.
@@ -145,7 +162,7 @@ December 19, 2017 G.Cosmo (geommng-V10-04-00)
Thanks to Raphael Isemann for reporting this.
November 10, 2017 P.Arce (geommng-V10-03-22)
- Bug report 2011: precision correction in G4ErrorPlaneSurfaceTarget.cc
- Bug report 2011: precision correction in G4ErrorPlaneSurfaceTarget.cc
October 16, 2017 G.Cosmo geommng-V10-03-21
- Removed G4USolid base wrapper for USolids. Only native VecGeom
@@ -180,7 +197,7 @@ May 9, 2017 G.Cosmo geommng-V10-03-14
- Moved few key methods to be inline in G4USolid.
March 28, 2017 G.Cosmo geommng-V10-03-13
- Enabled deletion of solids in G4SolidsStore destructor also for MT mode.
- Enabled deletion of solids in G4SolidsStore destructor also for MT mode.
March 22, 2017 G.Cosmo geommng-V10-03-12
- Define IsGeometryClosed() in G4GeometryManager as a static method, to
@@ -423,7 +440,7 @@ November 30, 2013 M.Asai geommng-V09-06-15
- Explicitely initialize data members of G4LVData.
November 27, 2013 J.Apostolakis geommng-V09-06-14
- Fix in G4GeomSplitter::FreeSlave(): use free() to delete memory
- Fix in G4GeomSplitter::FreeSlave(): use free() to delete memory
which was allocated with malloc().
October 18, 2013, A. Dotti geommng-V09-06-13
@@ -433,11 +450,11 @@ October 18, 2013, A. Dotti geommng-V09-06-13
October 3, 2013 J.Apostolakis geommng-V09-06-12
- Cleanup of G4LogicalVolume, G4VPhysicalVolume
Moved long description of helper classes to end of headers.
Moved macros to icc file.
Moved macros to icc file.
Revised source code to use Get/Set methods in place of 'macros'
introduced with G4MT, ie G4MT_rot etc
- LogicalVolume: Added new methods, data member
* new methods AssignFieldManager,
* new methods AssignFieldManager,
* Get/Set Solid( G4LVData, .) for potential performance improvement
* bool fChangedState.
@@ -761,14 +778,14 @@ November 19, 2005 J.Apostolakis geommng-V07-01-05
+ Additional methods allow nested parameterisation to be identified:
G4bool IsNested() const;
and to provide their material via new interface class:
G4VVolumeMaterialScanner* GetMaterialScanner();
+ Suppressed temporary G4PhysicalTouchable class in volumes, not needed
G4VVolumeMaterialScanner* GetMaterialScanner();
+ Suppressed temporary G4PhysicalTouchable class in volumes, not needed
in the implementation any longer.
November 11, 2005 J.Apostolakis geommng-V07-01-04
- Added methods to identify Regular Structures in Physical volume
- Added methods to identify Regular Structures in Physical volume
New pure virtual methods:
- IsRegularStructure() , returns boolean
- IsRegularStructure() , returns boolean
- GetRegularStructureId() , returns code for structure type
November 9, 2005 G.Cosmo geommng-V07-01-03
@@ -1140,7 +1157,7 @@ November 23, 2001 G. Cosmo geommng-V03-02-03
November 08, 2001 G. Cosmo geommng-V03-02-02
- Fixed comments for reference manual in G4TouchableHandle.hh.
October 26, 2001 G. Cosmo geommng-V03-02-01
- Improved printout in G4GeometryManager::ReportVoxelStats().
@@ -1262,12 +1279,12 @@ November 09, 1999 J. Apostolakis geommng-V00-01-01
ii) Added GetObjectRotationValue() method.
iii) Minimal changes of comments for Software Ref. Manual in header file
[ Change i) caused problem with HP aCC compiler A.01.19. Atlas
was patching the code to try to get around this, but this
resolution is much better ]
[ Change i) caused problem with HP aCC compiler A.01.19. Atlas
was patching the code to try to get around this, but this
resolution is much better ]
March 17, 1999 J. Apostolakis geommng-01-00-02
- G4AffineTransform.icc:
Corrected a typo in InverseProduct (rzy->ryz) that caused the incorrect
- G4AffineTransform.icc:
Corrected a typo in InverseProduct (rzy->ryz) that caused the incorrect
calculation of a compound transformation (if tf1.tz*tf2.ryz != 0).
This problem was seen in ATLAS code.
@@ -391,26 +391,19 @@ class G4LogicalVolume
// Returns: success (true) or failure (false).
private:
// Data members:
// Data members:
G4GEOM_DLL static G4LVManager subInstanceManager;
// This new field helps to use the class G4LVManager introduced above.
G4PhysicalVolumeList fDaughters;
// Vector of daughters. Given initial size of 0.
G4String fName;
// Name of logical volume.
EVolume fDaughtersVolumeType;
// Are contents of volume placements, replica, parameterised or external?
G4UserLimits* fUserLimits = nullptr;
// Pointer (possibly nullptr) to user Step limit object for this node.
G4SmartVoxelHeader* fVoxel = nullptr;
// Pointer (possibly nullptr) to optimisation info objects.
G4bool fOptimise = true;
// Flag to identify if optimisation should be applied or not.
G4bool fRootRegion = false;
// Flag to identify if the logical volume is a root region.
G4bool fLock = false;
// Flag to identify if entity is locked for final deletion.
G4double fSmartless = 2.0;
// Quality for optimisation, average number of voxels to be spent
// per content.
@@ -420,11 +413,6 @@ class G4LogicalVolume
// Pointer to the cuts region (if any)
G4double fBiasWeight = 1.0;
// Weight used in the event biasing technique.
G4int instanceID;
// This new field is used as instance ID.
G4GEOM_DLL static G4LVManager subInstanceManager;
// This new field helps to use the class G4LVManager introduced above.
// Shadow of master pointers.
// Each worker thread can access this field from the master thread
@@ -434,6 +422,17 @@ class G4LogicalVolume
G4VSensitiveDetector* fSensitiveDetector = nullptr;
G4FieldManager* fFieldManager = nullptr;
G4LVData* lvdata = nullptr; // For use of object persistency
G4int instanceID;
// This new field is used as instance ID.
EVolume fDaughtersVolumeType;
// Are contents of volume placements, replica, parameterised or external?
G4bool fOptimise = true;
// Flag to identify if optimisation should be applied or not.
G4bool fRootRegion = false;
// Flag to identify if the logical volume is a root region.
G4bool fLock = false;
// Flag to identify if entity is locked for final deletion.
};
#include "G4LogicalVolume.icc"
@@ -27,13 +27,13 @@
//
// Class description:
//
// Container for all LogicalVolumes, with functionality derived from
// std::vector<T>. The class is a `singleton', in that only
// Container for all logical volumes, with functionality derived from
// std::vector<T>. The class is a 'singleton', in that only
// one can exist, and access is provided via the static function
// G4LogicalVolumeStore::GetInstance()
//
// All LogicalVolumes should be registered with G4LogicalVolumeStore,
// and removed on their destruction. Intended principally for UI browser.
// All logical volumes should be registered with G4LogicalVolumeStore,
// and removed on their destruction.
// The underlying container initially has a capacity of 100.
//
// If much additional functionality is added, should consider containment
@@ -44,8 +44,8 @@
// static G4LogicalVolumeStore* fgInstance
// - Ptr to the single G4LogicalVolumeStore.
// 18.04.01 - G.Cosmo, Migrated to STL vector
// 10.07.95 - P.Kent, Initial version
// 18.04.01 - G.Cosmo, Migrated to STL vector
// --------------------------------------------------------------------
#ifndef G4LOGICALVOLUMESTORE_HH
#define G4LOGICALVOLUMESTORE_HH
@@ -57,7 +57,7 @@
class G4LogicalVolumeStore : public std::vector<G4LogicalVolume*>
{
public: // with description
public:
static void Register(G4LogicalVolume* pVolume);
// Add the logical volume to the collection.
@@ -77,6 +77,10 @@ class G4LogicalVolumeStore : public std::vector<G4LogicalVolume*>
virtual ~G4LogicalVolumeStore();
// Destructor: takes care to delete allocated logical volumes.
G4LogicalVolumeStore(const G4LogicalVolumeStore&) = delete;
G4LogicalVolumeStore& operator=(const G4LogicalVolumeStore&) = delete;
// Forbidden copy constructor and assignment operator
protected:
G4LogicalVolumeStore();
@@ -27,14 +27,13 @@
//
// Class description:
//
// Container for all solids, with functionality derived from
// std::vector<T>. The class is a `singleton', in that only
// Container for all physical volumes, with functionality derived from
// std::vector<T>. The class is a 'singleton', in that only
// one can exist, and access is provided via the static method
// G4PhysicalVolumeStore::GetInstance()
//
// All solids should be registered with G4PhysicalVolumeStore, and removed on
// their destruction. Intended principally for UI browser. The underlying
// container initially has a capacity of 100.
// All volumes should be registered with G4PhysicalVolumeStore, and removed on
// their destruction. The underlying container initially has a capacity of 100.
//
// If much additional functionality is added, should consider containment
// instead of inheritance for std::vector<T>
@@ -44,8 +43,8 @@
// static G4PhysicalVolumeStore*
// - Ptr to the single G4PhysicalVolumeStore.
// 18.04.01, G.Cosmo - Migrated to STL vector
// 25.07.95, P.Kent - Initial version
// 18.04.01, G.Cosmo - Migrated to STL vector
// --------------------------------------------------------------------
#ifndef G4PHYSICALVOLUMESTORE_HH
#define G4PHYSICALVOLUMESTORE_HH
@@ -57,14 +56,14 @@
class G4PhysicalVolumeStore : public std::vector<G4VPhysicalVolume*>
{
public: // with description
public:
static void Register(G4VPhysicalVolume* pSolid);
// Add the volume to the collection.
static void DeRegister(G4VPhysicalVolume* pSolid);
// Remove the volume from the collection.
static G4PhysicalVolumeStore* GetInstance();
// Get a ptr to the unique G4PhysicalVolumeStore, creating it if necessary.
// Get a ptr to the unique store instance, creating it if necessary.
static void SetNotifier(G4VStoreNotifier* pNotifier);
// Assign a notifier for allocation/deallocation of the physical volumes.
static void Clean();
@@ -79,6 +78,10 @@ class G4PhysicalVolumeStore : public std::vector<G4VPhysicalVolume*>
virtual ~G4PhysicalVolumeStore();
// Destructor: takes care to delete allocated physical volumes.
G4PhysicalVolumeStore(const G4PhysicalVolumeStore&) = delete;
G4PhysicalVolumeStore& operator=(const G4PhysicalVolumeStore&) = delete;
// Forbidden copy constructor and assignment operator
protected:
G4PhysicalVolumeStore();
@@ -27,8 +27,8 @@
//
// Class description:
//
// Container for all regiong, with functionality derived from
// std::vector<T>. The class is a `singleton', in that only
// Container for all regions, with functionality derived from
// std::vector<T>. The class is a 'singleton', in that only
// one can exist, and access is provided via the static method
// G4RegionStore::GetInstance().
//
@@ -58,7 +58,7 @@ class G4VPhysicalVolume;
class G4RegionStore : public std::vector<G4Region*>
{
public: // with description
public:
static void Register(G4Region* pRegion);
// Add the region to the collection.
@@ -91,19 +91,22 @@ class G4RegionStore : public std::vector<G4Region*>
// If it does not exist it will allocate one delegating ownership
// to the client.
public: // without description
void SetWorldVolume();
// Set a world volume pointer to a region that belongs to it.
// Scan over all world volumes.
// This method should be exclusively used by G4RunManagerKernel.
virtual ~G4RegionStore();
// Destructor: takes care to delete allocated regions.
G4RegionStore(const G4RegionStore&) = delete;
G4RegionStore& operator=(const G4RegionStore&) = delete;
// Forbidden copy constructor and assignment operator
protected:
G4RegionStore();
// Protected singleton constructor.
virtual ~G4RegionStore();
// Destructor: takes care to delete allocated regions.
private:
@@ -28,13 +28,12 @@
// Class description:
//
// Container for all solids, with functionality derived from
// std::vector<T>. The class is a `singleton', in that only
// std::vector<T>. The class is a 'singleton', in that only
// one can exist, and access is provided via the static method
// G4SolidStore::GetInstance().
//
// All solids should be registered with G4SolidStore, and removed on their
// destruction. Intended principally for UI browser. The underlying
// container initially has a capacity of 100.
// destruction. The underlying container initially has a capacity of 100.
//
// If much additional functionality is added, should consider containment
// instead of inheritance for std::vector<T>
@@ -45,8 +44,8 @@
// - Ptr to the single G4SolidStore
// History:
// 18.04.01, G.Cosmo - Migrated to STL vector
// 10.07.95, P.Kent - Initial version
// 18.04.01, G.Cosmo - Migrated to STL vector
// --------------------------------------------------------------------
#ifndef G4VSOLIDSTORE_HH
#define G4VSOLIDSTORE_HH
@@ -58,7 +57,7 @@
class G4SolidStore : public std::vector<G4VSolid*>
{
public: // with description
public:
static void Register(G4VSolid* pSolid);
// Add the solid to the collection.
@@ -78,6 +77,10 @@ class G4SolidStore : public std::vector<G4VSolid*>
virtual ~G4SolidStore();
// Destructor: takes care to delete allocated solids.
G4SolidStore(const G4SolidStore&) = delete;
G4SolidStore& operator=(const G4SolidStore&) = delete;
// Forbidden copy constructor and assignment operator
protected:
G4SolidStore();
@@ -57,8 +57,8 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <base/Global.h>
#include <base/Vector3D.h>
#include <VecGeom/base/Global.h>
#include <VecGeom/base/Vector3D.h>
class G4VPVParameterisation;
+109 -130
View File
@@ -1,32 +1,8 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4geometrymng
# Package: Geant4.src.G4geometry.G4geometrymng
#
# 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/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)
# Configure header for preprocessor symbols for USolids
configure_file(${CMAKE_CURRENT_LIST_DIR}/include/G4GeomConfig.hh.in
${CMAKE_CURRENT_BINARY_DIR}/include/G4GeomConfig.hh
@@ -39,115 +15,118 @@ configure_file(${CMAKE_CURRENT_LIST_DIR}/include/G4GeomConfig.hh.in
set_property(GLOBAL APPEND
PROPERTY GEANT4_BUILDTREE_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/include")
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4geometrymng
HEADERS
${CMAKE_CURRENT_BINARY_DIR}/include/G4GeomConfig.hh
G4AffineTransform.hh
G4AffineTransform.icc
G4BlockingList.hh
G4BlockingList.icc
G4BoundingEnvelope.hh
G4ErrorCylSurfaceTarget.hh
G4ErrorPlaneSurfaceTarget.hh
G4ErrorSurfaceTarget.hh
G4ErrorTanPlaneTarget.hh
G4ErrorTarget.hh
G4GeomSplitter.hh
G4GeomTools.hh
G4GeomTypes.hh
G4GeometryManager.hh
G4IdentityTrajectoryFilter.hh
G4LogicalCrystalVolume.hh
G4LogicalSurface.hh
G4LogicalSurface.icc
G4LogicalVolume.hh
G4LogicalVolume.icc
G4LogicalVolumeStore.hh
G4PhysicalVolumeStore.hh
G4ReflectedSolid.hh
G4Region.hh
G4Region.icc
G4RegionStore.hh
G4ScaleTransform.hh
G4ScaleTransform.icc
G4SmartVoxelHeader.hh
G4SmartVoxelHeader.icc
G4SmartVoxelNode.hh
G4SmartVoxelNode.icc
G4SmartVoxelProxy.hh
G4SmartVoxelProxy.icc
G4SmartVoxelStat.hh
G4SolidStore.hh
G4TouchableHandle.hh
G4UAdapter.hh
G4VCurvedTrajectoryFilter.hh
G4VNestedParameterisation.hh
G4VPVDivisionFactory.hh
G4VPVParameterisation.hh
G4VPhysicalVolume.hh
G4VPhysicalVolume.icc
G4VSolid.hh
G4VSolid.icc
G4VStoreNotifier.hh
G4VTouchable.hh
G4VTouchable.icc
G4VUserRegionInformation.hh
G4VVolumeMaterialScanner.hh
G4VoxelLimits.hh
G4VoxelLimits.icc
geomwdefs.hh
meshdefs.hh
voxeldefs.hh
SOURCES
G4BlockingList.cc
G4BoundingEnvelope.cc
G4ErrorCylSurfaceTarget.cc
G4ErrorPlaneSurfaceTarget.cc
G4ErrorSurfaceTarget.cc
G4ErrorTanPlaneTarget.cc
G4ErrorTarget.cc
G4GeomTools.cc
G4GeometryManager.cc
G4IdentityTrajectoryFilter.cc
G4LogicalCrystalVolume.cc
G4LogicalSurface.cc
G4LogicalVolume.cc
G4LogicalVolumeStore.cc
G4PhysicalVolumeStore.cc
G4ReflectedSolid.cc
G4Region.cc
G4RegionStore.cc
G4SmartVoxelHeader.cc
G4SmartVoxelNode.cc
G4SmartVoxelProxy.cc
G4SmartVoxelStat.cc
G4SolidStore.cc
G4VCurvedTrajectoryFilter.cc
G4VNestedParameterisation.cc
G4VPVDivisionFactory.cc
G4VPVParameterisation.cc
G4VPhysicalVolume.cc
G4VSolid.cc
G4VTouchable.cc
G4VoxelLimits.cc
GRANULAR_DEPENDENCIES
G4globman
G4graphics_reps
G4intercoms
G4materials
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
G4materials
LINK_LIBRARIES
${VECGEOM_LIBRARIES}
geant4_define_module(NAME G4geometrymng
HEADERS
${CMAKE_CURRENT_BINARY_DIR}/include/G4GeomConfig.hh
G4AffineTransform.hh
G4AffineTransform.icc
G4BlockingList.hh
G4BlockingList.icc
G4BoundingEnvelope.hh
G4ErrorCylSurfaceTarget.hh
G4ErrorPlaneSurfaceTarget.hh
G4ErrorSurfaceTarget.hh
G4ErrorTanPlaneTarget.hh
G4ErrorTarget.hh
G4GeomSplitter.hh
G4GeomTools.hh
G4GeomTypes.hh
G4GeometryManager.hh
G4IdentityTrajectoryFilter.hh
G4LogicalCrystalVolume.hh
G4LogicalSurface.hh
G4LogicalSurface.icc
G4LogicalVolume.hh
G4LogicalVolume.icc
G4LogicalVolumeStore.hh
G4PhysicalVolumeStore.hh
G4ReflectedSolid.hh
G4Region.hh
G4Region.icc
G4RegionStore.hh
G4ScaleTransform.hh
G4ScaleTransform.icc
G4SmartVoxelHeader.hh
G4SmartVoxelHeader.icc
G4SmartVoxelNode.hh
G4SmartVoxelNode.icc
G4SmartVoxelProxy.hh
G4SmartVoxelProxy.icc
G4SmartVoxelStat.hh
G4SolidStore.hh
G4TouchableHandle.hh
G4UAdapter.hh
G4VCurvedTrajectoryFilter.hh
G4VNestedParameterisation.hh
G4VPVDivisionFactory.hh
G4VPVParameterisation.hh
G4VPhysicalVolume.hh
G4VPhysicalVolume.icc
G4VSolid.hh
G4VSolid.icc
G4VStoreNotifier.hh
G4VTouchable.hh
G4VTouchable.icc
G4VUserRegionInformation.hh
G4VVolumeMaterialScanner.hh
G4VoxelLimits.hh
G4VoxelLimits.icc
geomwdefs.hh
meshdefs.hh
voxeldefs.hh
SOURCES
G4BlockingList.cc
G4BoundingEnvelope.cc
G4ErrorCylSurfaceTarget.cc
G4ErrorPlaneSurfaceTarget.cc
G4ErrorSurfaceTarget.cc
G4ErrorTanPlaneTarget.cc
G4ErrorTarget.cc
G4GeomTools.cc
G4GeometryManager.cc
G4IdentityTrajectoryFilter.cc
G4LogicalCrystalVolume.cc
G4LogicalSurface.cc
G4LogicalVolume.cc
G4LogicalVolumeStore.cc
G4PhysicalVolumeStore.cc
G4ReflectedSolid.cc
G4Region.cc
G4RegionStore.cc
G4SmartVoxelHeader.cc
G4SmartVoxelNode.cc
G4SmartVoxelProxy.cc
G4SmartVoxelStat.cc
G4SolidStore.cc
G4VCurvedTrajectoryFilter.cc
G4VNestedParameterisation.cc
G4VPVDivisionFactory.cc
G4VPVParameterisation.cc
G4VPhysicalVolume.cc
G4VSolid.cc
G4VTouchable.cc
G4VoxelLimits.cc
GRANULAR_DEPENDENCIES
G4globman
G4graphics_reps
G4intercoms
G4materials
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
G4materials
LINK_LIBRARIES
${VECGEOM_LIBRARIES}
)
# List any source specific properties here
# For new system, must explicitly add path for generated header
if(GEANT4_USE_NEW_CMAKE)
geant4_module_include_directories(G4geometrymng
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
)
endif()
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4navigation
# Package: Geant4.src.G4geometry.G4navigation
#
# 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()
+42 -2
View File
@@ -16,11 +16,51 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
February 5, 2020 - P.Arce (geomnav-V10-05-20)
June 15, 2020 - G.Cosmo (geomnav-V10-06-05)
-----------------------
- Fixed Coverity defects in G4LocatorChangeRecord and some code cleanup.
June 8, 2020 - G.Cosmo (geomnav-V10-06-04)
----------------------
- Enabled "check-mode" for G4PropagatorInField and G4VIntersectionLocator.
Enable use of whiteboard for logging/debugging in G4MultiLevelLocator, if
"check-mode" in navigation is being activated through UI command.
May 28, 2020 - J.Apostolakis (geomnav-V10-06-03)
----------------------------
- G4MultiLevelLocator: introduced whiteboard for logging/debugging in
G4MultiLevelLocator, to help identify source(s) of recent issues seen
in CMS and Belle2.
Activating the following:
* Record points ( e.g. A, B, H ) changes using G4LocatorChangeRecord
* Report when a problem is encountered.
* Improved reports of check of distance of endpoints <= the curve length.
and of exception of interval start A being past end B during integration.
* New separate name for return of intersection 'PointGi'.
Improved PiF ClearPropagatorState.
- New classes G4LocatorChangeLogger and G4LocatorChangeRecord, implementing
simple 'whiteboard' to store successive curve-point values (e.g. start(A)
or end(B) ).
- G4PropagationInField: improved ClearPropagatorState() method.
Clears values of additional data members.
March 24, 2020 - J.Apostolakis (geomnav-V10-06-02)
------------------------------
- Reordered the data members of G4Navigator, to reduce size
of G4Navigator object(s), as compromise between full compactification and
keeping some related data members declarations close.
Inspired by the effort of G.Amadio in this direction.
February 5, 2020 - P.Arce (geomnav-V10-06-01)
-------------------------
- Fixed problem report #2196.
- Addressing problem report #2196.
Avoid looping infinitely by pushing N times with increasing step size.
December 10, 2019 - B.Morgan (geomnav-V10-06-0)
----------------------------
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
November 29, 2019 - J.Apostolakis (geomnav-V10-05-19)
---------------------------------
- Added method to PropagatorInField to Get/Set new parameter that
@@ -0,0 +1,99 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4LocatorChangeLogger
//
// Class description:
//
// Aggregate the records of changes in an endpoint of a locator.
// Its key use is in playing these back in case of a problem.
// Author: John Apostolakis, 04.09.19 - First version
// --------------------------------------------------------------------
#ifndef G4LOCATOR_CHANGE_LOGGER_HH
#define G4LOCATOR_CHANGE_LOGGER_HH
#include <vector>
#include "G4LocatorChangeRecord.hh"
#include "G4FieldTrack.hh"
class G4LocatorChangeLogger : public std::vector<G4LocatorChangeRecord>
{
public:
G4LocatorChangeLogger( const std::string name ) : fName(name) {}
void AddRecord( G4LocatorChangeRecord && chngRecord );
void AddRecord( const G4LocatorChangeRecord & chngRecord );
// Create a new record with full information
inline
void AddRecord( G4LocatorChangeRecord::EChangeLocation codeLocation,
G4int iter,
unsigned int count,
const G4FieldTrack & fieldTrack );
friend std::ostream& operator << ( std::ostream& os,
const G4LocatorChangeLogger& logR );
std::ostream& StreamInfo(std::ostream& os) const;
static std::ostream& ReportEndChanges ( std::ostream& os,
const G4LocatorChangeLogger& startA,
const G4LocatorChangeLogger& endB );
// Print the changes in start, end points in columns
// One event per row
private:
const std::string fName;
};
// --------------
// Inline methods
// --------------
void G4LocatorChangeLogger::
AddRecord( G4LocatorChangeRecord::EChangeLocation codeLocation,
G4int iter, unsigned int count,
const G4FieldTrack & fieldTrack )
{
this->push_back(G4LocatorChangeRecord(codeLocation, iter, count, fieldTrack));
}
inline
void G4LocatorChangeLogger::
AddRecord( const G4LocatorChangeRecord& chngRecord )
{
this->push_back( chngRecord );
}
inline
void G4LocatorChangeLogger::
AddRecord( G4LocatorChangeRecord && chngRecord )
{
this->push_back( chngRecord );
}
#endif
@@ -0,0 +1,99 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4LocatorChangeRecord
//
// Class description:
//
// Record the changes in an endpoint of a locator.
// Its key use is in playing these back in case of a problem.
// Author: John Apostolakis, 27.08.19 - First version
// --------------------------------------------------------------------
#ifndef G4LOCATOR_CHANGE_RECORD_HH
#define G4LOCATOR_CHANGE_RECORD_HH
#include <vector>
#include "G4FieldTrack.hh"
class G4LocatorChangeRecord
{
public:
enum EChangeLocation { kInvalidCL = 0, kUnknownCL = 1, // 2
kInitialisingCL, kIntersectsAF, kIntersectsFB, // 3
kNoIntersectAForFB, kRecalculatedB, // 2
kInsertingMidPoint, kRecalculatedBagn, // 2
kLevelPop };
static const char* fNameChangeLocation[];
static const char* GetNameChangeLocation( EChangeLocation );
G4LocatorChangeRecord( EChangeLocation codeLocation,
G4int iter,
unsigned int count,
const G4FieldTrack& fieldTrack )
: fCodeLocation( codeLocation), fIteration(iter), fEventCount(count),
fFieldTrack( fieldTrack ) {}
G4LocatorChangeRecord( const G4LocatorChangeRecord & ) = default;
G4LocatorChangeRecord( G4LocatorChangeRecord && ) = default;
// No set methods -> create a new record for each entry (more reliable)
// void SetLocation( EChangeLocation loc ) { fCodeLocation= loc; }
// void SetLength( double len ) { fLength= len; }
// void SetCount( int cnt ) { fEventCount= cnt; }
// void SetIteration( int iter ) { fIteration= iter; }
inline EChangeLocation GetLocation() const { return fCodeLocation; }
inline unsigned int GetCount() const { return fEventCount; }
inline G4int GetIteration() const { return fIteration; }
inline G4double GetLength() const { return fFieldTrack.GetCurveLength(); }
friend std::ostream& operator<< ( std::ostream& os,
const G4LocatorChangeRecord& r );
// Streaming operator, using StreamInfo().
friend std::ostream& operator<< ( std::ostream& os,
const std::vector<G4LocatorChangeRecord> & vecR );
std::ostream& StreamInfo(std::ostream& os) const;
static std::ostream& ReportVector ( std::ostream& os,
const std::string & nameOfRecord,
const std::vector<G4LocatorChangeRecord> & lcr );
static std::ostream& ReportEndChanges ( std::ostream& os,
const std::vector<G4LocatorChangeRecord> & startA,
const std::vector<G4LocatorChangeRecord> & endB );
private:
EChangeLocation fCodeLocation = kInvalidCL;
G4int fIteration = -1;
unsigned int fEventCount = 0;
G4FieldTrack fFieldTrack;
};
#endif
@@ -379,6 +379,16 @@ class G4Navigator
// Transformation and history of the current path
// through the geometrical hierarchy.
G4ThreeVector fStepEndPoint;
// Endpoint of last ComputeStep
// can be used for optimisation (e.g. when computing safety).
G4ThreeVector fLastStepEndPointLocal;
// Position of the end-point of the last call to ComputeStep
// in last Local coordinates.
G4int fVerbose = 0;
// Verbose(ness) level [if > 0, printout can occur].
G4bool fEnteredDaughter;
// A memory of whether in this Step a daughter volume is entered
// (set in Compute & Locate).
@@ -391,19 +401,52 @@ class G4Navigator
G4bool fWasLimitedByGeometry = false;
// Set true if last Step was limited by geometry.
G4ThreeVector fStepEndPoint;
// Endpoint of last ComputeStep
// can be used for optimisation (e.g. when computing safety).
G4ThreeVector fLastStepEndPointLocal;
// Position of the end-point of the last call to ComputeStep
// in last Local coordinates.
G4int fVerbose = 0;
// Verbose(ness) level [if > 0, printout can occur].
private:
G4ThreeVector fLastLocatedPointLocal;
// Position of the last located point relative to its containing volume.
// This is coupled with the bool member fLocatedOutsideWorld;
G4ThreeVector fExitNormal; // Leaving volume normal, in the
// volume containing the exited
// volume's coordinate system
// This is closely coupled with G4bool fValidExitNormal - which
// signals whether we have a (valid) normal for volume we're leaving
G4ThreeVector fGrandMotherExitNormal; // Leaving volume normal, in its
// own coordinate system
G4ThreeVector fExitNormalGlobalFrame; // Leaving volume normal, in the
// global coordinate system
G4ThreeVector fPreviousSftOrigin;
G4double fPreviousSafety;
// Memory of last safety origin & value. Used in ComputeStep to ensure
// that origin of current Step is in the same volume as the point of the
// last relocation
G4VPhysicalVolume* fLastMotherPhys = nullptr;
// Memory of the mother volume during previous step.
// Intended use: inform user in case of stuck track.
G4VPhysicalVolume* fBlockedPhysicalVolume;
G4int fBlockedReplicaNo;
// Identifies the volume and copy / replica number that is
// blocked (after exiting -- because the exit direction is along the exit normal)
// or a candidate for entry (after compute step.)
// Count zero steps - as one or two can occur due to changing momentum at
// a boundary or at an edge common between volumes
// - several are likely a problem in the geometry
// description or in the navigation
//
G4int fNumberZeroSteps;
// Number of preceding moves that were Zero. Reset to 0 after finite step
G4int fActionThreshold_NoZeroSteps = 10;
// After this many failed/zero steps, act (push etc)
G4int fAbandonThreshold_NoZeroSteps = 25;
// After this many failed/zero steps, abandon track
G4bool fActive = false;
// States if the navigator is activated or not.
@@ -421,60 +464,26 @@ class G4Navigator
// o If entering
// volume ptr & replica number (set by ComputeStep(),used by
// Locate..()) of volume for `automatic' entry
G4VPhysicalVolume* fBlockedPhysicalVolume;
G4int fBlockedReplicaNo;
G4ThreeVector fLastLocatedPointLocal;
// Position of the last located point relative to its containing volume.
G4bool fLocatedOutsideWorld;
// Whether the last call to Locate methods left the world
G4bool fValidExitNormal; // Set true if have leaving volume normal
G4ThreeVector fExitNormal; // Leaving volume normal, in the
// volume containing the exited
// volume's coordinate system
G4ThreeVector fGrandMotherExitNormal; // Leaving volume normal, in its
// own coordinate system
G4bool fChangedGrandMotherRefFrame; // Whether frame is changed
G4ThreeVector fExitNormalGlobalFrame; // Leaving volume normal, in the
// global coordinate system
G4bool fLastStepWasZero;
// Whether the last ComputeStep moved Zero. Used to check for edges.
G4bool fLocatedOnEdge;
// Whether the Navigator has detected an edge
G4bool fLocatedOutsideWorld;
// Whether the last call to Locate methods left the world
G4bool fChangedGrandMotherRefFrame; // Whether frame is changed
G4bool fCalculatedExitNormal; // Has it been computed since
// the last call to ComputeStep
// Covers both Global and GrandMother
// Count zero steps - as one or two can occur due to changing momentum at
// a boundary or at an edge common between volumes
// - several are likely a problem in the geometry
// description or in the navigation
//
G4bool fLastStepWasZero;
// Whether the last ComputeStep moved Zero. Used to check for edges.
G4bool fLocatedOnEdge;
// Whether the Navigator has detected an edge
G4int fNumberZeroSteps;
// Number of preceding moves that were Zero. Reset to 0 after finite step
G4int fActionThreshold_NoZeroSteps = 10;
// After this many failed/zero steps, act (push etc)
G4int fAbandonThreshold_NoZeroSteps = 25;
// After this many failed/zero steps, abandon track
G4ThreeVector fPreviousSftOrigin;
G4double fPreviousSafety;
// Memory of last safety origin & value. Used in ComputeStep to ensure
// that origin of current Step is in the same volume as the point of the
// last relocation
G4VPhysicalVolume* fLastMotherPhys = nullptr;
// Memory of the mother volume during previous step.
// Intended use: inform user in case of stuck track.
//
// END State information
//
// Optional State information (created/used as needed)
//
// Save key state information (NOT the navigation history stack)
//
struct G4SaveNavigatorState
@@ -496,19 +505,13 @@ class G4Navigator
G4double sPreviousSafety;
} fSaveState;
// Tracking Invariants
//
private:
// BEGIN -- Tracking Invariants
// ===========================================
G4VPhysicalVolume* fTopPhysical = nullptr;
// A link to the topmost physical volume in the detector.
// Must be positioned at the origin and unrotated.
// Utility information
//
G4bool fCheck = false;
// Check-mode flag [if true, more strict checks are performed].
G4bool fPushed = false, fWarnPush = true;
// Push flags [if true, means a stuck particle has been pushed].
// Helpers/Utility classes
//
G4NormalNavigation fnormalNav;
@@ -517,7 +520,16 @@ class G4Navigator
G4ReplicaNavigation freplicaNav;
G4RegularNavigation fregularNav;
G4VExternalNavigation* fpExternalNav = nullptr;
G4VoxelSafety* fpVoxelSafety;
G4VoxelSafety* fpVoxelSafety;
// Utility information
//
G4bool fCheck = false;
// Check-mode flag [if true, more strict checks are performed].
G4bool fPushed = false, fWarnPush = true;
// Push flags [if true, means a stuck particle has been pushed].
// End -- Tracking Invariants
};
#include "G4Navigator.icc"
@@ -92,6 +92,7 @@ class G4PropagatorInField
G4int SetVerboseLevel( G4int verbose );
inline G4int GetVerboseLevel() const;
inline G4int Verbose() const;
inline void CheckMode(G4bool mode);
inline void SetVerboseTrace( G4bool enable );
inline G4bool GetVerboseTrace();
@@ -293,6 +294,7 @@ class G4PropagatorInField
G4int fVerboseLevel = 0;
G4bool fVerbTracePiF = false;
G4bool fCheck = false;
// For debugging purposes
G4bool fFirstStepInVolume = true;
@@ -150,6 +150,18 @@ G4bool G4PropagatorInField::GetVerboseTrace()
return fVerbTracePiF;
}
// ------------------------------------------------------------------------
//
inline
void G4PropagatorInField::CheckMode(G4bool mode)
{
fCheck = mode;
if (fIntersectionLocator != nullptr)
{
fIntersectionLocator->SetCheckMode(mode);
}
}
// ------------------------------------------------------------------------
//
inline
@@ -32,7 +32,7 @@
// navigation does not stop at the surface
// History:
// - Created. P.Arce, May 2007
// - Created. P. Arce, May 2007
// --------------------------------------------------------------------
#ifndef G4RegularNavigation_HH
#define G4RegularNavigation_HH
@@ -119,22 +119,21 @@ class G4RegularNavigation
G4int fverbose = false;
G4bool fcheck = false;
G4NormalNavigation* fnormalNav = nullptr;
G4double kCarTolerance;
G4double fMinStep;
G4bool fLastStepWasZero;
// Whether the last ComputeStep moved Zero. Used to check for edges.
G4int fNumberZeroSteps;
// Number of preceding moves that were Zero. Reset to 0 after finite step
G4int fActionThreshold_NoZeroSteps;
// After this many failed/zero steps, act (push etc)
G4int fAbandonThreshold_NoZeroSteps;
G4int fActionThreshold_NoZeroSteps;
// After this many failed/zero steps, act (push etc)
G4int fAbandonThreshold_NoZeroSteps;
// After this many failed/zero steps, abandon track
G4int fNoStepsAllowed;
// Maximum number of steps a track can travel skipping voxels
// (if there are more, track is assumed to be stuck and it is killed)
// Maximum number of steps a track can travel skipping voxels (if there are more, track is assumed to be stuck and it is killed)
G4bool fWarnPush;
// Send warning message that a stuck particle has been pushed
};
@@ -126,7 +126,10 @@ class G4VIntersectionLocator
std::ostream& oss,
G4int verboseLevel );
// Print Method for any ostream - e.g. cerr -- and for G4Exception
inline void SetCheckMode( G4bool value ) { fCheckMode = value; }
inline G4bool GetCheckMode() { return fCheckMode; }
protected: // with description
G4FieldTrack ReEstimateEndpoint( const G4FieldTrack& CurrentStateA,
@@ -197,9 +200,6 @@ class G4VIntersectionLocator
G4int CheckMode );
// As above, but report information about code location.
// If CheckMode > 1, report extra information.
inline void SetCheckMode( G4bool value ) { fCheckMode = value; }
inline G4bool GetCheckMode() { return fCheckMode; }
protected: // without description
@@ -254,13 +254,13 @@ class G4VIntersectionLocator
G4int fVerboseLevel = 0; // For debugging
G4bool fUseNormalCorrection = false; // Configuration parameter
G4bool fCheckMode = false;
G4bool fiUseSafety = false; // Whether to use safety for 'fast steps'
G4Navigator* fiNavigator;
G4ChordFinder* fiChordFinder = nullptr; // Overridden at each step
G4double fiEpsilonStep = -1.0; // Overridden at each step
G4double fiDeltaIntersection = -1.0; // Overridden at each step
G4bool fiUseSafety = false; // Overridden at each step
// Parameters set at each physical step by calling method
// by G4PropagatorInField
+84 -108
View File
@@ -1,119 +1,95 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4navigation
# Package: Geant4.src.G4geometry.G4navigation
#
# 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/geometry/magneticfield/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/management/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)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4navigation
HEADERS
G4AuxiliaryNavServices.hh
G4AuxiliaryNavServices.icc
G4BrentLocator.hh
G4DrawVoxels.hh
G4ErrorPropagationNavigator.hh
G4GeomTestVolume.hh
G4GeometryMessenger.hh
G4GlobalMagFieldMessenger.hh
G4MultiLevelLocator.hh
G4MultiNavigator.hh
G4NavigationLogger.hh
G4Navigator.hh
G4Navigator.icc
G4NormalNavigation.hh
G4NormalNavigation.icc
G4ParameterisedNavigation.hh
G4ParameterisedNavigation.icc
G4PartialPhantomParameterisation.hh
G4PathFinder.hh
G4PhantomParameterisation.hh
G4PhantomParameterisation.icc
G4PropagatorInField.hh
G4PropagatorInField.icc
G4RegularNavigation.hh
G4RegularNavigationHelper.hh
G4ReplicaNavigation.hh
G4ReplicaNavigation.icc
G4SafetyHelper.hh
G4SimpleLocator.hh
G4TransportationManager.hh
G4TransportationManager.icc
G4VExternalNavigation.hh
G4VIntersectionLocator.hh
G4VIntersectionLocator.icc
G4VoxelNavigation.hh
G4VoxelNavigation.icc
G4VoxelSafety.hh
SOURCES
G4AuxiliaryNavServices.cc
G4BrentLocator.cc
G4DrawVoxels.cc
G4ErrorPropagationNavigator.cc
G4GeomTestVolume.cc
G4GeometryMessenger.cc
G4GlobalMagFieldMessenger.cc
G4MultiLevelLocator.cc
G4MultiNavigator.cc
G4NavigationLogger.cc
G4Navigator.cc
G4NormalNavigation.cc
G4ParameterisedNavigation.cc
G4PartialPhantomParameterisation.cc
G4PathFinder.cc
G4PhantomParameterisation.cc
G4PropagatorInField.cc
G4RegularNavigation.cc
G4RegularNavigationHelper.cc
G4ReplicaNavigation.cc
G4SafetyHelper.cc
G4SimpleLocator.cc
G4TransportationManager.cc
G4VExternalNavigation.cc
G4VIntersectionLocator.cc
G4VoxelNavigation.cc
G4VoxelSafety.cc
GRANULAR_DEPENDENCIES
G4geometrymng
G4globman
G4graphics_reps
G4intercoms
G4magneticfield
G4materials
G4volumes
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
G4materials
LINK_LIBRARIES
geant4_define_module(NAME G4navigation
HEADERS
G4AuxiliaryNavServices.hh
G4AuxiliaryNavServices.icc
G4BrentLocator.hh
G4DrawVoxels.hh
G4ErrorPropagationNavigator.hh
G4GeomTestVolume.hh
G4GeometryMessenger.hh
G4GlobalMagFieldMessenger.hh
G4LocatorChangeRecord.hh
G4LocatorChangeLogger.hh
G4MultiLevelLocator.hh
G4MultiNavigator.hh
G4NavigationLogger.hh
G4Navigator.hh
G4Navigator.icc
G4NormalNavigation.hh
G4NormalNavigation.icc
G4ParameterisedNavigation.hh
G4ParameterisedNavigation.icc
G4PartialPhantomParameterisation.hh
G4PathFinder.hh
G4PhantomParameterisation.hh
G4PhantomParameterisation.icc
G4PropagatorInField.hh
G4PropagatorInField.icc
G4RegularNavigation.hh
G4RegularNavigationHelper.hh
G4ReplicaNavigation.hh
G4ReplicaNavigation.icc
G4SafetyHelper.hh
G4SimpleLocator.hh
G4TransportationManager.hh
G4TransportationManager.icc
G4VExternalNavigation.hh
G4VIntersectionLocator.hh
G4VIntersectionLocator.icc
G4VoxelNavigation.hh
G4VoxelNavigation.icc
G4VoxelSafety.hh
SOURCES
G4AuxiliaryNavServices.cc
G4BrentLocator.cc
G4DrawVoxels.cc
G4ErrorPropagationNavigator.cc
G4GeomTestVolume.cc
G4GeometryMessenger.cc
G4GlobalMagFieldMessenger.cc
G4LocatorChangeRecord.cc
G4LocatorChangeLogger.cc
G4MultiLevelLocator.cc
G4MultiNavigator.cc
G4NavigationLogger.cc
G4Navigator.cc
G4NormalNavigation.cc
G4ParameterisedNavigation.cc
G4PartialPhantomParameterisation.cc
G4PathFinder.cc
G4PhantomParameterisation.cc
G4PropagatorInField.cc
G4RegularNavigation.cc
G4RegularNavigationHelper.cc
G4ReplicaNavigation.cc
G4SafetyHelper.cc
G4SimpleLocator.cc
G4TransportationManager.cc
G4VExternalNavigation.cc
G4VIntersectionLocator.cc
G4VoxelNavigation.cc
G4VoxelSafety.cc
GRANULAR_DEPENDENCIES
G4geometrymng
G4globman
G4graphics_reps
G4intercoms
G4magneticfield
G4materials
G4volumes
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
G4materials
)
# List any source specific properties here
@@ -36,6 +36,7 @@
#include "G4GeometryManager.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Navigator.hh"
#include "G4PropagatorInField.hh"
#include "G4UIdirectory.hh"
#include "G4UIcommand.hh"
@@ -317,6 +318,8 @@ G4GeometryMessenger::SetCheckMode(G4String input)
G4bool mode = chkCmd->GetNewBoolValue(input);
G4Navigator* navigator = tmanager->GetNavigatorForTracking();
navigator->CheckMode(mode);
G4PropagatorInField* pField = tmanager->GetPropagatorInField();
if (pField != nullptr) { pField->CheckMode(mode); }
}
//
@@ -0,0 +1,207 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4LocatorChangeLogger class implementation
//
// Author: John Apostolakis, 04.09.19 - First version
// --------------------------------------------------------------------
#include <iostream>
#include <iomanip>
#include <locale>
// #include <cassert>
#include "G4LocatorChangeLogger.hh"
// --------------------------------------------------------------------
// Streaming operator dumping record
//
std::ostream& operator<< ( std::ostream& os,
const G4LocatorChangeLogger& logger )
{
return logger.StreamInfo(os);
}
// --------------------------------------------------------------------
// Stream object contents to an output stream
//
std::ostream& G4LocatorChangeLogger::StreamInfo(std::ostream& os) const
{
G4int oldprc = os.precision(16);
G4LocatorChangeRecord::ReportVector( os, this->fName, *this );
os.precision(oldprc);
return os;
}
// --------------------------------------------------------------------
// Print the changes in start, end points in columns -- one event per row
//
std::ostream& G4LocatorChangeLogger::ReportEndChanges( std::ostream& os,
const G4LocatorChangeLogger & startA,
const G4LocatorChangeLogger & endB )
{
using std::setw;
G4int prec= 16;
const G4bool confirm = true;
G4int oldprc = os.precision(prec);
auto itrecA= startA.cbegin();
auto itrecB= endB.cbegin();
os << "====================================================================="
<< G4endl;
os << " Size of individual change record: startA : " << startA.size()
<< " endB : " << endB.size() << G4endl;
os << "====================================================================="
<< G4endl;
os << setw( 7 ) << "Change#" << " "
<< setw( 4 ) << "Iter" << " "
<< setw( 20 ) << "CodeLocation" << " "
<< setw( prec+9 ) << "Length-A (start)" << " "
<< setw( prec+9 ) << "Length-B (end)" << " "
<< G4endl;
os << "=====================================================================";
auto eventA = (*itrecA).GetCount();
auto eventB = (*itrecB).GetCount();
G4bool isLastA= false;
G4bool isLastB= false;
G4int jA=0, jB=0;
G4int maxEvent = std::max( startA[ startA.size() - 1 ].GetCount() ,
endB[ endB.size() - 1 ].GetCount() );
G4int prevA = -1;
G4int prevB = -1;
G4bool advanceA= false, advanceB= false;
do
{
advanceA= false;
advanceB= false;
if( ((G4int)eventA>prevA) && ((G4int)eventB>prevB) )
{
auto codeLocA= (*itrecA).GetLocation();
os << G4endl;
os << setw( 7 ) << eventA << " "
<< setw( 4 ) << (*itrecA).GetIteration() << " "
<< setw( 3 ) << codeLocA << " "
<< setw( 15 )
<< G4LocatorChangeRecord::GetNameChangeLocation( codeLocA ) << " "
<< setw( prec+9 ) << (*itrecA).GetLength() << " "
<< setw( prec+9 ) << (*itrecB).GetLength() << " ";
if( confirm )
{
os << setw( 4 ) << (*itrecB).GetIteration() << " "
<< setw( 15 ) << (*itrecB).GetLocation();
}
}
else
{
if ( (G4int)eventA > prevA )
{
auto codeLocA= (*itrecA).GetLocation();
os << G4endl;
os << setw( 7 ) << (*itrecA).GetCount() << " "
<< setw( 4 ) << (*itrecA).GetIteration() << " "
<< setw( 3 ) << codeLocA << " "
<< setw( 15 )
<< G4LocatorChangeRecord::GetNameChangeLocation( codeLocA ) << " "
<< setw( prec+9 ) << (*itrecA).GetLength() << " "
<< setw( prec+9 ) << " " << " ";
}
else
{
// assert( (G4int)eventB > prevB );
auto codeLocB= (*itrecB).GetLocation();
os << G4endl;
os << setw( 7 ) << eventB << " "
<< setw( 4 ) << (*itrecB).GetIteration() << " "
<< setw( 3 ) << codeLocB << " "
<< setw( 15 )
<< G4LocatorChangeRecord::GetNameChangeLocation( codeLocB ) << " "
<< setw( prec+9 ) << " " << " "
<< setw( prec+9 ) << (*itrecB).GetLength() << " " ;
}
}
prevA= eventA;
prevB= eventB;
auto nextA= itrecA;
auto nextB= itrecB;
G4int nextAct = maxEvent, nextBct = maxEvent;
++nextA;
++nextB;
if ( nextA != startA.end() ) { nextAct = (*nextA).GetCount(); }
if ( nextB != endB.end() ) { nextBct = (*nextB).GetCount(); }
isLastA= ( nextA >= startA.end() );
isLastB= ( nextB >= endB.end() );
advanceA= ( nextAct <= nextBct ) && !isLastA;
advanceB= ( nextBct <= nextAct ) && !isLastB;
if( advanceA )
{
++itrecA;
if( !isLastA ) { ++jA; }
eventA = isLastA ? maxEvent : (*itrecA).GetCount();
}
if( advanceB )
{
++itrecB;
if( !isLastB ) { ++jB; }
eventB = isLastB ? maxEvent : (*itrecB).GetCount();
}
// Checks
if( isLastA != ( nextA == startA.end() ) )
{
os << G4endl;
os << " Checking isLastA= " << isLastA
<< " vs expected : " << ( itrecA == startA.end() );
os << " BAD --- ERROR " << G4endl;
}
if( isLastB != ( nextB == endB.end() ) )
{
os << G4endl;
os << " Checking isLastB= " << isLastB
<< " vs expected : " << ( itrecB == endB.end() );
os << " BAD --- ERROR " << G4endl;
}
} while ( ! ( isLastA && isLastB ) );
os << G4endl;
os.precision(oldprc);
return os;
}
@@ -0,0 +1,285 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4LocatorChangeRecord class implementation
//
// Author: John Apostolakis, 28.08.19 - First version
// --------------------------------------------------------------------
#include <iostream>
#include <iomanip>
#include <locale>
// #include <cassert>
#include "G4LocatorChangeRecord.hh"
// Must correspond exactly with the count of the enum EChangeLocation
//
const char * G4LocatorChangeRecord::fNameChangeLocation[] =
{ "Invalid", "Unknown", "Initialising", "IntersectsAF", "IntersectsFB", // 5
"NoIntersections-AForFB", "RecalculatedB", // 2
"InsertingMidPoint", "RecalculatedB-2ndHalf", // 2
"Level Pop" };
// --------------------------------------------------------------------
//
std::ostream& G4LocatorChangeRecord::ReportVector ( std::ostream& os,
const std::string & name,
const std::vector<G4LocatorChangeRecord> & vecRec )
{
using std::setw;
G4int prec= 16;
if( vecRec.size() == 0 )
{
os << "Locator Change Record for " << name << " is empty" << G4endl;
return os;
}
G4int oldprc = os.precision(prec);
// std::vector<G4LocatorChangeRecord>::const_iterator
auto itRec
= std::vector<G4LocatorChangeRecord>::const_iterator(vecRec.cbegin());
os << setw( 7 ) << "Change#" << " "
<< setw( 4 ) << "Iter" << " "
<< std::left
<< setw( prec+9 ) << "Length" << " "
<< setw( 15 ) << "Code-Location" << " "
<< G4endl;
os << "====================================================================="
<< G4endl;
do
{
auto locationCode= (*itRec).GetLocation();
os << std::internal
<< setw( 7 ) << (*itRec).GetCount() << " " // Event Count
<< setw( 4 ) << (*itRec).GetIteration() << " "
<< std::left
<< setw( prec+9 ) << (*itRec).GetLength() << " "
<< setw( 2 ) << locationCode << " " // location enum
<< setw( 15 ) << fNameChangeLocation[ locationCode ]
<< std::internal
;
os << G4endl;
++itRec;
} while ( itRec != vecRec.cend() );
os.precision(oldprc);
return os;
}
// --------------------------------------------------------------------
//
std::ostream&
G4LocatorChangeRecord::ReportEndChanges (
std::ostream& os,
const std::vector<G4LocatorChangeRecord> & startA,
const std::vector<G4LocatorChangeRecord> & endB )
{
using std::setw;
G4int prec= 16;
const G4bool confirm = true;
G4int oldprc = os.precision(prec);
std::vector<G4LocatorChangeRecord>::const_iterator itrecA, itrecB;
itrecA= startA.begin();
itrecB= endB.begin();
os << "====================================================================="
<< G4endl;
os << " Size of individual change record: startA : " << startA.size()
<< " endB : " << endB.size() << G4endl;
os << "====================================================================="
<< G4endl;
os << setw( 7 ) << "Change#" << " "
<< setw( 4 ) << "Iter" << " "
<< setw( 20 ) << "CodeLocation" << " "
<< setw( prec+9 ) << "Length-A (start)" << " "
<< setw( prec+9 ) << "Length-B (end)" << " "
<< G4endl;
os << "=====================================================================";
auto eventA = (*itrecA).GetCount();
auto eventB = (*itrecB).GetCount();
G4bool isLastA= false;
G4bool isLastB= false;
G4int jA=0, jB=0;
G4int maxEvent = std::max( startA[ startA.size() - 1 ].GetCount() ,
endB[ endB.size() - 1 ].GetCount() );
G4int prevA = -1;
G4int prevB = -1;
G4bool advanceA= false, advanceB= false;
do
{
advanceA= false;
advanceB= false;
if( ((G4int)eventA>prevA) && ((G4int)eventB>prevB) )
{
auto codeLocA= (*itrecA).GetLocation();
os << G4endl;
os << setw( 7 ) << eventA << " "
<< setw( 4 ) << (*itrecA).GetIteration() << " "
<< setw( 3 ) << codeLocA << " "
<< setw( 15 ) << fNameChangeLocation[ codeLocA ] << " "
<< setw( prec+9 ) << (*itrecA).GetLength() << " "
<< setw( prec+9 ) << (*itrecB).GetLength() << " ";
if( confirm )
{
os << setw( 4 ) << (*itrecB).GetIteration() << " "
<< setw( 15 ) << (*itrecB).GetLocation();
}
}
else
{
if ( (G4int)eventA > prevA )
{
auto codeLocA = (*itrecA).GetLocation();
os << G4endl;
os << setw( 7 ) << (*itrecA).GetCount() << " "
<< setw( 4 ) << (*itrecA).GetIteration() << " "
<< setw( 3 ) << codeLocA << " "
<< setw( 15 ) << fNameChangeLocation[ codeLocA ] << " "
<< setw( prec+9 ) << (*itrecA).GetLength() << " "
<< setw( prec+9 ) << " " << " ";
}
else
{
// assert( (G4int)eventB > prevB );
auto codeLocB = (*itrecB).GetLocation();
os << G4endl;
os << setw( 7 ) << eventB << " "
<< setw( 4 ) << (*itrecB).GetIteration() << " "
<< setw( 3 ) << codeLocB << " "
<< setw( 15 ) << fNameChangeLocation[ codeLocB ] << " "
<< setw( prec+9 ) << " " << " "
<< setw( prec+9 ) << (*itrecB).GetLength() << " " ;
}
}
prevA= eventA;
prevB= eventB;
auto nextA= itrecA;
auto nextB= itrecB;
G4int nextAct = maxEvent, nextBct = maxEvent;
++nextA;
++nextB;
if ( nextA != startA.end() ) { nextAct = (*nextA).GetCount(); }
if ( nextB != endB.end() ) { nextBct = (*nextB).GetCount(); }
isLastA= ( nextA >= startA.end() );
isLastB= ( nextB >= endB.end() );
advanceA= ( nextAct <= nextBct ) && !isLastA;
advanceB= ( nextBct <= nextAct ) && !isLastB;
if( advanceA )
{
++itrecA;
if( !isLastA ) { ++jA; eventA = (*itrecA).GetCount(); }
else { eventA = maxEvent; }
}
if( advanceB )
{
++itrecB;
if( !isLastB ) { ++jB; eventB = (*itrecB).GetCount(); }
else { eventB = maxEvent; }
}
// Checks
if( isLastA != ( nextA == startA.end() ) )
{
os << G4endl;
os << " Checking isLastA= " << isLastA << " vs expected : "
<< ( itrecA == startA.end() );
os << " BAD --- ERROR " << G4endl;
}
if( isLastB != ( nextB == endB.end() ) )
{
os << G4endl;
os << " Checking isLastB= " << isLastB << " vs expected : "
<< ( itrecB == endB.end() );
os << " BAD --- ERROR " << G4endl;
}
} while ( ! ( isLastA && isLastB ) );
os << G4endl;
os.precision(oldprc);
return os;
}
// --------------------------------------------------------------------
// Streaming operator dumping record
//
std::ostream& operator<< ( std::ostream& os, const G4LocatorChangeRecord& e )
{
return e.StreamInfo(os);
}
// --------------------------------------------------------------------
// Stream object contents to an output stream
//
std::ostream& G4LocatorChangeRecord::StreamInfo(std::ostream& os) const
{
G4int oldprc = os.precision(16);
os << " count = " << fEventCount
<< " iter= " << fIteration
<< " Location code = " << fCodeLocation
<< " Length = " << GetLength() << G4endl;
os.precision(oldprc);
return os;
}
// --------------------------------------------------------------------
// Streaming operator
//
std::ostream& operator << ( std::ostream& os,
const std::vector<G4LocatorChangeRecord> & vecR )
{
G4LocatorChangeRecord::ReportVector( os, "", vecR );
return os;
}
// --------------------------------------------------------------------
//
const char *G4LocatorChangeRecord::GetNameChangeLocation( EChangeLocation loc )
{
return fNameChangeLocation[loc];
}
@@ -33,6 +33,8 @@
#include "G4ios.hh"
#include "G4MultiLevelLocator.hh"
#include "G4LocatorChangeRecord.hh"
#include "G4LocatorChangeLogger.hh"
G4MultiLevelLocator::G4MultiLevelLocator(G4Navigator *theNavigator)
: G4VIntersectionLocator(theNavigator)
@@ -47,12 +49,13 @@ G4MultiLevelLocator::G4MultiLevelLocator(G4Navigator *theNavigator)
ptrInterMedFT[ idepth ] = new G4FieldTrack( zeroV, zeroV, 0., 0., 0., 0.);
}
#ifdef G4DEBUG_FIELD
// Trial values Loose Tight
// To happen: Infrequent Often
SetMaxSteps(50); // 300 25
SetWarnSteps(40); // 250 15
#endif
if (fCheckMode)
{
// Trial values Loose Medium Tight
// To happen: Infrequent Occasional Often
SetMaxSteps(150); // 300 85 25
SetWarnSteps(80); // 250 60 15
}
}
G4MultiLevelLocator::~G4MultiLevelLocator()
@@ -123,7 +126,7 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
G4bool found_approximate_intersection = false;
G4bool there_is_no_intersection = false;
G4FieldTrack CurrentA_PointVelocity = CurveStartPointVelocity;
G4FieldTrack CurrentB_PointVelocity = CurveEndPointVelocity;
G4ThreeVector CurrentE_Point = TrialPoint;
@@ -138,8 +141,6 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
auto integrDriver = GetChordFinderFor()->GetIntegrationDriver();
G4bool driverReIntegrates = integrDriver->DoesReIntegrate();
// G4bool final_section= true; // Shows whether current section is last
// (i.e. B=full end)
G4bool first_section = true;
recalculatedEndPoint = false;
G4bool restoredFullEndpoint = false;
@@ -147,8 +148,37 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
unsigned int substep_no = 0;
// Statistics for substeps
//
static G4ThreadLocal unsigned int max_no_seen= 0;
static G4ThreadLocal unsigned int max_no_seen= 0;
#ifdef G4DEBUG_FIELD
unsigned int trigger_substepno_print = 0;
const G4double tolerance = 1.0e-8 * CLHEP::mm;
unsigned int biggest_depth = 0;
// using kInitialisingCL = G4LocatorChangeRecord::kInitialisingCL;
#endif
// Log the location, iteration of changes in A,B
//----------------------------------------------
static G4ThreadLocal G4LocatorChangeLogger endChangeA("StartPointA"),
endChangeB("EndPointB"), recApproxPoint("ApproxPoint"),
pointH_logger("Trial points 'E': position, normal");
unsigned int eventCount = 0;
if (fCheckMode)
{
// Clear previous call's data
endChangeA.clear();
endChangeB.clear();
recApproxPoint.clear();
pointH_logger.clear();
// Record the initialisation
++eventCount;
endChangeA.AddRecord( G4LocatorChangeRecord::kInitialisingCL, substep_no,
eventCount, CurrentA_PointVelocity );
endChangeB.AddRecord( G4LocatorChangeRecord::kInitialisingCL, substep_no,
eventCount, CurrentB_PointVelocity );
}
//--------------------------------------------------------------------------
// Algorithm for the case if progress in founding intersection is too slow.
@@ -175,22 +205,23 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
unsigned int depth = 0; // Depth counts subdivisions of initial step made
++fNumCalls;
#ifdef G4DEBUG_FIELD
unsigned int trigger_substepno_print = 0;
const G4double tolerance = 1.0e-8 * CLHEP::mm;
unsigned int biggest_depth = 0;
NormalAtEntry = GetSurfaceNormal(CurrentE_Point, validNormalAtE);
#if (G4DEBUG_FIELD>1)
G4ThreeVector StartPosition = CurveStartPointVelocity.GetPosition();
if( (TrialPoint - StartPosition).mag2() < sqr(tolerance))
if (fCheckMode)
{
ReportImmediateHit( MethodName, StartPosition, TrialPoint,
tolerance, fNumCalls);
pointH_logger.AddRecord( G4LocatorChangeRecord::kInitialisingCL,
substep_no, eventCount,
G4FieldTrack( CurrentE_Point,0.,NormalAtEntry,0.,
0., 1.,G4ThreeVector(0.),0.,0.) );
#if (G4DEBUG_FIELD>1)
G4ThreeVector StartPosition = CurveStartPointVelocity.GetPosition();
if( (TrialPoint - StartPosition).mag2() < sqr(tolerance))
{
ReportImmediateHit( MethodName, StartPosition, TrialPoint,
tolerance, fNumCalls);
}
#endif
}
#endif
#endif
NormalAtEntry = GetSurfaceNormal(CurrentE_Point, validNormalAtE);
// Intermediates Points on the Track = Subdivided Points must be stored.
// Give the initial values to 'InterMedFt'
@@ -222,9 +253,21 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
do // Loop checking, 07.10.2016, J.Apostolakis
{ // REPEAT param
#ifdef G4DEBUG_FIELD
if( CurrentA_PointVelocity.GetCurveLength() >=
CurrentB_PointVelocity.GetCurveLength() )
{
G4cerr << "ERROR> (Start) Point A coincides with or has gone past (end) point B"
<< "MLL: iters = " << substep_no << G4endl;
// G4LocatorChangeRecord::ReportVector(G4cerr, "endPointB", endChangeB );
// G4cerr<<"EndPoints A(start) and B(end): combined changes " << G4endl;
G4LocatorChangeLogger::ReportEndChanges(G4cerr, endChangeA, endChangeB);
}
#endif
G4ThreeVector Point_A = CurrentA_PointVelocity.GetPosition();
G4ThreeVector Point_B = CurrentB_PointVelocity.GetPosition();
// F = a point on true AB path close to point E
// (the closest if possible)
//
@@ -232,15 +275,33 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
->ApproxCurvePointV( CurrentA_PointVelocity,
CurrentB_PointVelocity,
CurrentE_Point,
GetEpsilonStepFor());
GetEpsilonStepFor() );
// The above method is the key & most intuitive part ...
#ifdef G4DEBUG_FIELD
if( ApproxIntersecPointV.GetCurveLength() >
CurrentB_PointVelocity.GetCurveLength() * (1.0 + tolerance) )
#ifdef G4DEBUG_FIELD
recApproxPoint.push_back(G4LocatorChangeRecord(G4LocatorChangeRecord::kInvalidCL,
substep_no, eventCount, ApproxIntersecPointV ) );
G4double lenIntsc= ApproxIntersecPointV.GetCurveLength();
G4double lenB = CurrentB_PointVelocity.GetCurveLength();
G4double checkVsEnd= lenB - lenIntsc;
if( lenIntsc > lenB )
{
G4Exception(MethodName, "GeomNav0003", FatalException,
"Intermediate F point is past end B point" );
std::ostringstream errmsg;
errmsg.precision(17);
G4double ratio = checkVsEnd / lenB;
G4double ratioTol = std::fabs(ratio) / tolerance;
errmsg << "Intermediate F point is past end B point" << G4endl
<< " l( intersection ) = " << lenIntsc << G4endl
<< " l( endpoint ) = " << lenB << G4endl;
errmsg.precision(8);
errmsg << " l_end - l_inters = " << checkVsEnd << G4endl
<< " / l_end = " << ratio << G4endl
<< " ratio / tolerance = " << ratioTol << G4endl;
if( ratioTol < 1.0 )
G4Exception(MethodName, "GeomNav0003", JustWarning, errmsg );
else
G4Exception(MethodName, "GeomNav0003", FatalException, errmsg );
}
#endif
@@ -253,7 +314,7 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
G4ThreeVector NewMomentumDir = ApproxIntersecPointV.GetMomentumDir();
G4double MomDir_dot_Norm = NewMomentumDir.dot( NormalAtEntry );
#ifdef G4DEBUG_FIELD
if( fVerboseLevel > 3 )
{
@@ -316,6 +377,7 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
G4ThreeVector PointG; // Candidate intersection point
G4double stepLengthAF;
G4bool Intersects_FB = false;
G4bool Intersects_AF = IntersectChord( Point_A, CurrentF_Point,
NewSafety, previousSafety,
previousSftOrigin,
@@ -325,13 +387,9 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
if( Intersects_AF )
{
// G is our new Candidate for the intersection point.
// It replaces "E" and we will repeat the test to see if
// it is a good enough approximate point for us.
// B <- F
// E <- G
//
CurrentB_PointVelocity = ApproxIntersecPointV;
CurrentE_Point = PointG;
// It replaces "E" and we will see if it's good enough.
CurrentB_PointVelocity = ApproxIntersecPointV; // B <- F
CurrentE_Point = PointG; // E <- G
validIntersectP = true; // 'E' has been updated.
@@ -339,11 +397,17 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
NormalAtEntry = GetSurfaceNormal( PointG, validNormalLast );
validNormalAtE = validNormalLast;
// By moving point B, must take care if current
// As we move point B, must take care in case the current
// AF has no intersection to try current FB!!
//
fin_section_depth[depth] = false;
if (fCheckMode)
{
++eventCount;
endChangeB.push_back(
G4LocatorChangeRecord(G4LocatorChangeRecord::kIntersectsAF,
substep_no, eventCount, CurrentB_PointVelocity) );
}
#ifdef G4VERBOSE
if( fVerboseLevel > 3 )
{
@@ -368,11 +432,11 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
// Check whether any volumes are encountered by the chord FB
// ---------------------------------------------------------
G4bool Intersects_FB = IntersectChord( CurrentF_Point, Point_B,
NewSafety, previousSafety,
previousSftOrigin,
stepLengthFB,
PointH );
Intersects_FB = IntersectChord( CurrentF_Point, Point_B,
NewSafety, previousSafety,
previousSftOrigin,
stepLengthFB,
PointH );
if( Intersects_FB )
{
// There is an intersection of FB with a volume boundary
@@ -394,7 +458,21 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
G4bool validNormalH;
NormalAtEntry = GetSurfaceNormal( PointH, validNormalH );
validNormalAtE = validNormalH;
validNormalAtE = validNormalH;
if (fCheckMode)
{
++eventCount;
endChangeA.push_back(
G4LocatorChangeRecord(G4LocatorChangeRecord::kIntersectsFB,
substep_no, eventCount, CurrentA_PointVelocity) );
G4FieldTrack intersectH_pn('0'); // Point and normal
// nothing else will be valid
intersectH_pn.SetPosition( PointH );
intersectH_pn.SetMomentum( NormalAtEntry );
pointH_logger.AddRecord(G4LocatorChangeRecord::kIntersectsFB,
substep_no, eventCount, intersectH_pn );
}
}
else // not Intersects_FB
{
@@ -433,6 +511,19 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
restoredFullEndpoint = true;
validIntersectP = false; // 'E' has NOT been updated.
if (fCheckMode)
{
++eventCount;
endChangeA.push_back(
G4LocatorChangeRecord(
G4LocatorChangeRecord::kNoIntersectAForFB,
substep_no, eventCount, CurrentA_PointVelocity) );
endChangeB.push_back(
G4LocatorChangeRecord (
G4LocatorChangeRecord::kNoIntersectAForFB,
substep_no, eventCount, CurrentB_PointVelocity) );
}
}
} // Endif (Intersects_FB)
} // Endif (Intersects_AF)
@@ -469,6 +560,18 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
// [ Implementation: a counter for # of recomputations
// => avoids extra work]
}
// else
// Move forward the other points
// - or better flag it, so that they are re-computed when next used
// [ Implementation: a counter for # of recomputations
// => avoids extra work]
if (fCheckMode)
{
++eventCount;
endChangeB.push_back(
G4LocatorChangeRecord( G4LocatorChangeRecord::kRecalculatedB,
substep_no, eventCount, RevisedB_FT ) );
}
}
else
{
@@ -479,15 +582,19 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
if( errorEndPt > 1 ) // errorEndPt = 1 is milder, just: len(B)=len(A)
{
std::ostringstream errmsg;
errmsg << "Location: " << MethodName
<< "- After EndIf(Intersects_AF)" << G4endl;
ReportReversedPoints(errmsg,
CurveStartPointVelocity, CurveEndPointVelocity,
NewSafety, fiEpsilonStep,
CurrentA_PointVelocity, CurrentB_PointVelocity,
SubStart_PointVelocity, CurrentE_Point,
ApproxIntersecPointV, substep_no, substep_no_p, depth);
G4Exception(MethodName, "GeomNav0003", FatalException, errmsg);
errmsg << G4endl << " * Location: " << MethodName
<< "- After EndIf(Intersects_AF)" << G4endl;
errmsg << " * Bool flags: Recalculated = " << recalculatedB
<< " Intersects_AF = " << Intersects_AF
<< " Intersects_FB = " << Intersects_FB << G4endl;
errmsg << " * Number of calls to MLL:EIP= " << fNumCalls << G4endl;
G4Exception(MethodName, "GeomNav0003", FatalException, errmsg);
}
if( restoredFullEndpoint )
{
@@ -506,17 +613,21 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
if( substep_no >= trigger_substepno_print )
{
G4cout << "Difficulty in converging in " << MethodName
<< G4endl
<< " Substep no = " << substep_no << G4endl;
if( substep_no == trigger_substepno_print )
{
G4cout << " Start: ";
printStatus( CurveStartPointVelocity, CurveEndPointVelocity,
-1.0, NewSafety, 0 );
G4cout << " ** Change records: " << G4endl;
G4cout << "endPoints A (start) and B (end): combined changes of AB intervals" << G4endl;
G4LocatorChangeRecord::ReportEndChanges(G4cout, endChangeA, endChangeB );
}
G4cout << " State of point A: ";
G4cout << " Point A: ";
printStatus( CurrentA_PointVelocity, CurrentA_PointVelocity,
-1.0, NewSafety, substep_no-1 );
G4cout << " State of point B: ";
G4cout << " Point B: ";
printStatus( CurrentA_PointVelocity, CurrentB_PointVelocity,
-1.0, NewSafety, substep_no );
}
@@ -537,7 +648,6 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
- SubStart_PointVelocity.GetCurveLength());
G4double distAB = -1;
G4ThreeVector PointGe;
//
// Is progress is too slow, and is it possible to go deeper?
// If so, then *halve the step*
@@ -605,6 +715,14 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
*ptrInterMedFT[depth] = midPoint;
CurrentB_PointVelocity = midPoint;
if (fCheckMode)
{
++eventCount;
endChangeB.push_back(
G4LocatorChangeRecord( G4LocatorChangeRecord::kInsertingMidPoint,
substep_no, eventCount, midPoint) );
}
// Adjust 'SubStartPoint' to calculate the 'did_length' in next loop
//
SubStart_PointVelocity = CurrentA_PointVelocity;
@@ -613,7 +731,8 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
//
G4ThreeVector Point_A = CurrentA_PointVelocity.GetPosition();
G4ThreeVector Point_B = CurrentB_PointVelocity.GetPosition();
G4ThreeVector PointGe;
GetNavigatorFor()->LocateGlobalPointWithinVolume(Point_A);
G4bool Intersects_AB = IntersectChord(Point_A, Point_B,
NewSafety, previousSafety,
@@ -658,8 +777,21 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
CurrentA_PointVelocity = *ptrInterMedFT[depth];
CurrentB_PointVelocity = *ptrInterMedFT[depth-1];
G4int errorEndPt = 0; // Default: no error (if not calling CheckAnd...
if (fCheckMode)
{
++eventCount;
G4LocatorChangeRecord chngPop_a( G4LocatorChangeRecord::kLevelPop,
substep_no, eventCount, CurrentA_PointVelocity);
endChangeA.push_back( chngPop_a );
G4LocatorChangeRecord chngPop_b( G4LocatorChangeRecord::kLevelPop,
substep_no, eventCount, CurrentB_PointVelocity);
endChangeB.push_back( chngPop_b );
}
// Ensure that the new endpoints are not further apart in space
// than on the curve due to different errors in the integration
//
G4int errorEndPt = -1;
G4bool recalculatedB= false;
if( driverReIntegrates )
{
@@ -688,45 +820,53 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
if( CurrentB_PointVelocity.GetCurveLength() < CurrentA_PointVelocity.GetCurveLength() )
errorEndPt = 2;
}
if (fCheckMode)
{
++eventCount;
endChangeB.push_back(
G4LocatorChangeRecord(G4LocatorChangeRecord::kRecalculatedBagn,
substep_no, eventCount, RevisedEndPointFT));
}
}
if( errorEndPt > 1 ) // errorEndPt = 1 is milder, just: len(B)=len(A)
{
std::ostringstream errmsg;
errmsg << "Location: " << MethodName << "- Second-Half" << G4endl;
ReportReversedPoints(errmsg,
CurveStartPointVelocity, CurveEndPointVelocity,
NewSafety, fiEpsilonStep,
CurrentA_PointVelocity, CurrentB_PointVelocity,
SubStart_PointVelocity, CurrentE_Point,
ApproxIntersecPointV, substep_no, substep_no_p, depth);
errmsg << " * Location: " << MethodName << "- Second-Half" << G4endl;
errmsg << " * Recalculated = " << recalculatedB << G4endl; // false
G4Exception(MethodName, "GeomNav0003", FatalException, errmsg);
}
G4ThreeVector Point_A = CurrentA_PointVelocity.GetPosition();
G4ThreeVector Point_B = CurrentB_PointVelocity.GetPosition();
G4ThreeVector Point_B = CurrentB_PointVelocity.GetPosition();
G4ThreeVector PointGi;
GetNavigatorFor()->LocateGlobalPointWithinVolume(Point_A);
G4bool Intersects_AB = IntersectChord(Point_A, Point_B, NewSafety,
previousSafety,
previousSftOrigin, distAB,
PointGe);
PointGi);
if( Intersects_AB )
{
last_AF_intersection = Intersects_AB;
CurrentE_Point = PointGe;
CurrentE_Point = PointGi;
validIntersectP = true; // 'E' has been updated.
G4bool validNormalAB;
NormalAtEntry = GetSurfaceNormal( PointGe, validNormalAB );
validNormalAtE = validNormalAB;
NormalAtEntry = GetSurfaceNormal( PointGi, validNormalAtE );
}
else
{
validIntersectP = false; // No new 'E' chord intersection found
if( depth == 1)
{
{
there_is_no_intersection = true;
}
}
}
depth--;
fin_section_depth[depth] = true;
unfinished = !validIntersectP;
@@ -678,6 +678,9 @@ void G4PropagatorInField::ClearPropagatorState()
fParticleIsLooping = false;
fNoZeroStep = 0;
fSetFieldMgr = false; // Has field-manager been set for the current step?
fEpsilonStep= 1.0e-5; // Relative accuracy of current Step
End_PointAndTangent= G4FieldTrack( G4ThreeVector(0.,0.,0.),
G4ThreeVector(0.,0.,0.),
0.0,0.0,0.0,0.0,0.0);
@@ -686,6 +689,8 @@ void G4PropagatorInField::ClearPropagatorState()
fPreviousSftOrigin= G4ThreeVector(0.,0.,0.);
fPreviousSafety= 0.0;
fNewTrack = true;
}
// ---------------------------------------------------------------------------
@@ -210,16 +210,16 @@ G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
.InverseTransformPoint(localPoint);
std::ostringstream message;
message << "G4RegularNavigation::ComputeStepSkippingEqualMaterials()"
<< "Stuck Track: potential geometry or navigation problem."
<< G4endl
<< " Track stuck, moving for more than "
<< ii << " steps" << G4endl
<< "- at point " << pGlobalpoint << G4endl
<< " local direction: " << localDirection << G4endl;
<< "Stuck Track: potential geometry or navigation problem."
<< G4endl
<< " Track stuck, moving for more than "
<< ii << " steps" << G4endl
<< "- at point " << pGlobalpoint << G4endl
<< " local direction: " << localDirection << G4endl;
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1001",
EventMustBeAborted,
message);
"GeomRegNav1001",
EventMustBeAborted,
message);
}
newStep = voxelBox->DistanceToOut( localPoint, localDirection );
fLastStepWasZero = (newStep<fMinStep);
@@ -231,65 +231,64 @@ G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
{
G4ThreeVector pGlobalpoint = history.GetTransform(ide)
.InverseTransformPoint(localPoint);
G4cout << "G4RegularNavigation::ComputeStepSkippingEqualMaterials():"
<< " another 'zero' step, # "
<< fNumberZeroSteps
<< ", at " << pGlobalpoint
<< ", nav-comp-step calls # " << ii
<< ", Step= " << newStep
<< G4endl;
G4cout << "G4RegularNavigation::ComputeStepSkippingEqualMaterials(): another 'zero' step, # "
<< fNumberZeroSteps
<< ", at " << pGlobalpoint
<< ", nav-comp-step calls # " << ii
<< ", Step= " << newStep
<< G4endl;
}
//#endif
if( fNumberZeroSteps > fActionThreshold_NoZeroSteps-1 )
{
// Act to recover this stuck track. Pushing it along direction
//
newStep = std::min(101*kCarTolerance*pow(10,fNumberZeroSteps-2),0.1);
// Act to recover this stuck track. Pushing it along direction
//
newStep = std::min(101*kCarTolerance*std::pow(10,fNumberZeroSteps-2),0.1);
#ifdef G4VERBOSE
if (fWarnPush)
{
if (fWarnPush)
{
G4ThreeVector pGlobalpoint = history.GetTransform(ide)
.InverseTransformPoint(localPoint);
std::ostringstream message;
message.precision(16);
message << "Track stuck or not moving." << G4endl
<< " Track stuck, not moving for "
<< fNumberZeroSteps << " steps" << G4endl
<< "- at point " << pGlobalpoint
<< " (local point " << localPoint << ")" << G4endl
<< " local direction: " << localDirection
<< " Potential geometry or navigation problem !"
<< G4endl
<< " Trying pushing it of " << newStep << " mm ...";
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1002",
JustWarning,
message,
"Potential overlap in geometry!");
}
std::ostringstream message;
message.precision(16);
message << "Track stuck or not moving." << G4endl
<< " Track stuck, not moving for "
<< fNumberZeroSteps << " steps" << G4endl
<< "- at point " << pGlobalpoint
<< " (local point " << localPoint << ")" << G4endl
<< " local direction: " << localDirection
<< " Potential geometry or navigation problem !"
<< G4endl
<< " Trying pushing it of " << newStep << " mm ...";
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1002",
JustWarning,
message,
"Potential overlap in geometry!");
}
#endif
}
if( fNumberZeroSteps > fAbandonThreshold_NoZeroSteps-1 )
{
// Must kill this stuck track
//
G4ThreeVector pGlobalpoint = history.GetTransform(ide)
// Must kill this stuck track
//
G4ThreeVector pGlobalpoint = history.GetTransform(ide)
.InverseTransformPoint(localPoint);
std::ostringstream message;
message << "G4RegularNavigation::ComputeStepSkippingEqualMaterials()"
<< "Stuck Track: potential geometry or navigation problem."
<< G4endl
<< " Track stuck, not moving for "
<< fNumberZeroSteps << " steps" << G4endl
<< "- at point " << pGlobalpoint << G4endl
<< " local direction: " << localDirection << G4endl;
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1003",
EventMustBeAborted,
message);
std::ostringstream message;
message << "G4RegularNavigation::ComputeStepSkippingEqualMaterials()"
<< "Stuck Track: potential geometry or navigation problem."
<< G4endl
<< " Track stuck, not moving for "
<< fNumberZeroSteps << " steps" << G4endl
<< "- at point " << pGlobalpoint << G4endl
<< " local direction: " << localDirection << G4endl;
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1003",
EventMustBeAborted,
message);
}
}
if( (bFirstStep) && (newStep < currentProposedStepLength) )
{
exiting = true;
@@ -777,26 +777,30 @@ ReportReversedPoints( std::ostringstream& msg,
G4VIntersectionLocator::printStatus( A_PtVel, B_PtVel,
-1.0, NewSafety, substep_no, msg, verboseLevel );
msg << "Error in advancing propagation." << G4endl
<< " Point A (start) is " << A_PtVel << G4endl
<< " Point B (end) is " << B_PtVel << G4endl
<< " Curve distance is " << curveDist << G4endl
<< " The final curve point is NOT further along"
<< " than the original!" << G4endl
<< " Going *backwards* from len(A) = " << A_PtVel.GetCurveLength()
<< " to len(B) = " << B_PtVel.GetCurveLength() << G4endl
<< " Curve distance is " << curveDist / CLHEP::millimeter << " mm "
<< G4endl
<< "The final curve point is not further along"
<< " than the original!" << G4endl;
msg << " Value of fEpsStep= " << epsStep << G4endl;
<< " Point A' (start) is " << A_PtVel << G4endl
<< " Point B' (end) is " << B_PtVel << G4endl;
msg << " fEpsStep= " << epsStep << G4endl << G4endl;
G4int oldprc = msg.precision(20);
msg << " Point A (Curve start) is " << StartPointVel << G4endl
<< " Point B (Curve end) is " << EndPointVel << G4endl
<< " Point A (Current start) is " << A_PtVel << G4endl
<< " Point B (Current end) is " << B_PtVel << G4endl
<< " Point S (Sub start) is " << SubStart_PtVel
<< " Point E (Trial Point) is " << E_Point << G4endl
<< " Point F (Intersection) is " << ApproxIntersecPointV
msg << " In full precision, the position, momentum, E_kin, length, rest mass "
<< " ... are: " << G4endl;
msg << " Point A[0] (Curve start) is " << StartPointVel << G4endl
<< " Point S (Sub start) is " << SubStart_PtVel
<< " Point A' (Current start) is " << A_PtVel << G4endl
<< " Point E (Trial Point) is " << E_Point << G4endl
<< " Point F (Intersection) is " << ApproxIntersecPointV << G4endl
<< " Point B' (Current end) is " << B_PtVel << G4endl
<< " Point B[0] (Curve end) is " << EndPointVel << G4endl
<< G4endl
<< " LocateIntersection parameters are : " << G4endl
<< " Substep no (total) = " << substep_no << G4endl
<< " Substep (depth= " << depth << substep_no_p;
<< " Substep no = " << substep_no_p << " at depth= " << depth;
msg.precision(oldprc);
}
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4geomBoolean
# Package: Geant4.src.G4geometry..G4geomBoolean
#
# 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()
+4
View File
@@ -19,6 +19,10 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
December 10, 2019 B.Morgan geom-bool-V10-06-00
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
November 26, 2019 G.Cosmo geom-bool-V10-05-04
- G4MultiUnion: fixed cases of implicit type conversions from size_t to G4int.
+32 -60
View File
@@ -1,71 +1,43 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4geomBoolean
# Package: Geant4.src.G4geometry.G4geomBoolean
#
# 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/geometry/management/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/volumes/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/solids/CSG/include)
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/solids/specific/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)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4geomBoolean
HEADERS
G4BooleanSolid.hh
G4BooleanSolid.icc
G4DisplacedSolid.hh
G4IntersectionSolid.hh
G4MultiUnion.hh
G4ScaledSolid.hh
G4SubtractionSolid.hh
G4UnionSolid.hh
SOURCES
G4BooleanSolid.cc
G4DisplacedSolid.cc
G4IntersectionSolid.cc
G4MultiUnion.cc
G4ScaledSolid.cc
G4SubtractionSolid.cc
G4UnionSolid.cc
GRANULAR_DEPENDENCIES
G4geometrymng
G4globman
G4graphics_reps
G4intercoms
G4volumes
G4csg
G4specsolids
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
LINK_LIBRARIES
${VECGEOM_LIBRARIES}
geant4_define_module(NAME G4geomBoolean
HEADERS
G4BooleanSolid.hh
G4BooleanSolid.icc
G4DisplacedSolid.hh
G4IntersectionSolid.hh
G4MultiUnion.hh
G4ScaledSolid.hh
G4SubtractionSolid.hh
G4UnionSolid.hh
SOURCES
G4BooleanSolid.cc
G4DisplacedSolid.cc
G4IntersectionSolid.cc
G4MultiUnion.cc
G4ScaledSolid.cc
G4SubtractionSolid.cc
G4UnionSolid.cc
GRANULAR_DEPENDENCIES
G4geometrymng
G4globman
G4graphics_reps
G4intercoms
G4volumes
G4csg
G4specsolids
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
LINK_LIBRARIES
${VECGEOM_LIBRARIES}
)
# List any source specific properties here
-15
View File
@@ -1,15 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module :
# Package: Geant4.src.G4geometry.
#
# Intermediate level CMakeLists.txt - just process subdirectories
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
add_subdirectory(Boolean)
add_subdirectory(CSG)
add_subdirectory(specific)
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4csg
# Package: Geant4.src.G4geometry..G4csg
#
# 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()
+12
View File
@@ -16,6 +16,18 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
April 30, 2020 G.Cosmo geom-csg-V10-06-02
- Adopt new convention for location of headers in VecGeom for all wrappers.
April 09, 2020 E.Tcherniaev geom-csg-V10-06-01
- G4Trap.cc: fixed calculation of normal for points on edge in
SurfaceNormal(), improved code for Inside().
- testG4Sphere.cc: removed obsolete code for testing CalculateExtent().
December 10, 2019 B.Morgan geom-csg-V10-06-00
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
August 23, 2019 G.Cosmo geom-csg-V10-05-05
- Minor c++11 revision and headers cleanup.
- Use pre-increment wherever possible.
+1 -1
View File
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedBox.h>
#include <VecGeom/volumes/UnplacedBox.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedCone.h>
#include <VecGeom/volumes/UnplacedCone.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedCutTube.h>
#include <VecGeom/volumes/UnplacedCutTube.h>
#include "G4Polyhedron.hh"
+1 -1
View File
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedOrb.h>
#include <VecGeom/volumes/UnplacedOrb.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedParallelepiped.h>
#include <VecGeom/volumes/UnplacedParallelepiped.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedSphere.h>
#include <VecGeom/volumes/UnplacedSphere.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedTorus2.h>
#include <VecGeom/volumes/UnplacedTorus2.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedTrapezoid.h>
#include <VecGeom/volumes/UnplacedTrapezoid.h>
#include "G4Polyhedron.hh"
+1 -1
View File
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedTrd.h>
#include <VecGeom/volumes/UnplacedTrd.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedTube.h>
#include <VecGeom/volumes/UnplacedTube.h>
#include "G4Polyhedron.hh"
+68 -95
View File
@@ -1,106 +1,79 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4csg
# Package: Geant4.src.G4geometry.G4csg
#
# 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/geometry/management/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/HEPNumerics/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)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4csg
HEADERS
G4Box.hh
G4Box.icc
G4CSGSolid.hh
G4Cons.hh
G4Cons.icc
G4CutTubs.hh
G4CutTubs.icc
G4Orb.hh
G4Orb.icc
G4Para.hh
G4Para.icc
G4Sphere.hh
G4Sphere.icc
G4Torus.hh
G4Torus.icc
G4Trap.hh
G4Trap.icc
G4Trd.hh
G4Trd.icc
G4Tubs.hh
G4Tubs.icc
G4UBox.hh
G4UCons.hh
G4UCutTubs.hh
G4UOrb.hh
G4UPara.hh
G4USphere.hh
G4UTorus.hh
G4UTrap.hh
G4UTrd.hh
G4UTubs.hh
SOURCES
G4Box.cc
G4CSGSolid.cc
G4Cons.cc
G4CutTubs.cc
G4Orb.cc
G4Para.cc
G4Sphere.cc
G4Torus.cc
G4Trap.cc
G4Trd.cc
G4Tubs.cc
G4UBox.cc
G4UCons.cc
G4UCutTubs.cc
G4UOrb.cc
G4UPara.cc
G4USphere.cc
G4UTorus.cc
G4UTrap.cc
G4UTrd.cc
G4UTubs.cc
GRANULAR_DEPENDENCIES
G4geometrymng
G4globman
G4graphics_reps
G4hepnumerics
G4intercoms
G4volumes
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
LINK_LIBRARIES
${VECGEOM_LIBRARIES}
geant4_define_module(NAME G4csg
HEADERS
G4Box.hh
G4Box.icc
G4CSGSolid.hh
G4Cons.hh
G4Cons.icc
G4CutTubs.hh
G4CutTubs.icc
G4Orb.hh
G4Orb.icc
G4Para.hh
G4Para.icc
G4Sphere.hh
G4Sphere.icc
G4Torus.hh
G4Torus.icc
G4Trap.hh
G4Trap.icc
G4Trd.hh
G4Trd.icc
G4Tubs.hh
G4Tubs.icc
G4UBox.hh
G4UCons.hh
G4UCutTubs.hh
G4UOrb.hh
G4UPara.hh
G4USphere.hh
G4UTorus.hh
G4UTrap.hh
G4UTrd.hh
G4UTubs.hh
SOURCES
G4Box.cc
G4CSGSolid.cc
G4Cons.cc
G4CutTubs.cc
G4Orb.cc
G4Para.cc
G4Sphere.cc
G4Torus.cc
G4Trap.cc
G4Trd.cc
G4Tubs.cc
G4UBox.cc
G4UCons.cc
G4UCutTubs.cc
G4UOrb.cc
G4UPara.cc
G4USphere.cc
G4UTorus.cc
G4UTrap.cc
G4UTrd.cc
G4UTubs.cc
GRANULAR_DEPENDENCIES
G4geometrymng
G4globman
G4graphics_reps
G4hepnumerics
G4intercoms
G4volumes
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
LINK_LIBRARIES
${VECGEOM_LIBRARIES}
)
# List any source specific properties here
+30 -42
View File
@@ -607,13 +607,11 @@ G4bool G4Trap::CalculateExtent( const EAxis pAxis,
EInside G4Trap::Inside( const G4ThreeVector& p ) const
{
G4double dz = std::abs(p.z())-fDz;
if (dz > halfCarTolerance) return kOutside;
switch (fTrapType)
{
case 0: // General case
{
G4double dz = std::abs(p.z())-fDz;
G4double dy1 = fPlanes[0].b*p.y()+fPlanes[0].c*p.z()+fPlanes[0].d;
G4double dy2 = fPlanes[1].b*p.y()+fPlanes[1].c*p.z()+fPlanes[1].d;
G4double dy = std::max(dz,std::max(dy1,dy2));
@@ -624,11 +622,12 @@ EInside G4Trap::Inside( const G4ThreeVector& p ) const
+ fPlanes[3].c*p.z()+fPlanes[3].d;
G4double dist = std::max(dy,std::max(dx1,dx2));
if (dist > halfCarTolerance) return kOutside;
return (dist > -halfCarTolerance) ? kSurface : kInside;
return (dist > halfCarTolerance) ? kOutside :
((dist > -halfCarTolerance) ? kSurface : kInside);
}
case 1: // YZ section is a rectangle
{
G4double dz = std::abs(p.z())-fDz;
G4double dy = std::max(dz,std::abs(p.y())+fPlanes[1].d);
G4double dx1 = fPlanes[2].a*p.x()+fPlanes[2].b*p.y()
+ fPlanes[2].c*p.z()+fPlanes[2].d;
@@ -636,28 +635,30 @@ EInside G4Trap::Inside( const G4ThreeVector& p ) const
+ fPlanes[3].c*p.z()+fPlanes[3].d;
G4double dist = std::max(dy,std::max(dx1,dx2));
if (dist > halfCarTolerance) return kOutside;
return (dist > -halfCarTolerance) ? kSurface : kInside;
return (dist > halfCarTolerance) ? kOutside :
((dist > -halfCarTolerance) ? kSurface : kInside);
}
case 2: // YZ section is a rectangle and
{ // XZ section is an isosceles trapezoid
G4double dz = std::abs(p.z())-fDz;
G4double dy = std::max(dz,std::abs(p.y())+fPlanes[1].d);
G4double dx = fPlanes[3].a*std::abs(p.x())
+ fPlanes[3].c*p.z()+fPlanes[3].d;
G4double dist = std::max(dy,dx);
if (dist > halfCarTolerance) return kOutside;
return (dist > -halfCarTolerance) ? kSurface : kInside;
return (dist > halfCarTolerance) ? kOutside :
((dist > -halfCarTolerance) ? kSurface : kInside);
}
case 3: // YZ section is a rectangle and
{ // XY section is an isosceles trapezoid
G4double dz = std::abs(p.z())-fDz;
G4double dy = std::max(dz,std::abs(p.y())+fPlanes[1].d);
G4double dx = fPlanes[3].a*std::abs(p.x())
+ fPlanes[3].b*p.y()+fPlanes[3].d;
G4double dist = std::max(dy,dx);
if (dist > halfCarTolerance) return kOutside;
return (dist > -halfCarTolerance) ? kSurface : kInside;
return (dist > halfCarTolerance) ? kOutside :
((dist > -halfCarTolerance) ? kSurface : kInside);
}
}
return kOutside;
@@ -669,14 +670,9 @@ EInside G4Trap::Inside( const G4ThreeVector& p ) const
G4ThreeVector G4Trap::SurfaceNormal( const G4ThreeVector& p ) const
{
G4int nsurf = 0; // number of surfaces where p is placed
G4double nx = 0, ny = 0, nz = 0;
G4double dz = std::abs(p.z()) - fDz;
if (std::abs(dz) <= halfCarTolerance)
{
nz = (p.z() < 0) ? -1 : 1;
++nsurf;
}
nz = std::copysign(G4double(std::abs(dz) <= halfCarTolerance), p.z());
switch (fTrapType)
{
@@ -688,7 +684,6 @@ G4ThreeVector G4Trap::SurfaceNormal( const G4ThreeVector& p ) const
if (std::abs(dy) > halfCarTolerance) continue;
ny = fPlanes[i].b;
nz += fPlanes[i].c;
++nsurf;
break;
}
for (G4int i=2; i<4; ++i)
@@ -699,15 +694,14 @@ G4ThreeVector G4Trap::SurfaceNormal( const G4ThreeVector& p ) const
nx = fPlanes[i].a;
ny += fPlanes[i].b;
nz += fPlanes[i].c;
++nsurf;
break;
}
break;
}
case 1: // YZ section is a rectangle
case 1: // YZ section - rectangle
{
G4double dy = std::abs(p.y()) + fPlanes[1].d;
if (std::abs(dy) <= halfCarTolerance) ny = (p.y() < 0) ? -1 : 1;
ny = std::copysign(G4double(std::abs(dy) <= halfCarTolerance), p.y());
for (G4int i=2; i<4; ++i)
{
G4double dx = fPlanes[i].a*p.x() +
@@ -716,45 +710,39 @@ G4ThreeVector G4Trap::SurfaceNormal( const G4ThreeVector& p ) const
nx = fPlanes[i].a;
ny += fPlanes[i].b;
nz += fPlanes[i].c;
++nsurf;
break;
}
break;
}
case 2: // YZ section is a rectangle and
{ // XZ section is an isosceles trapezoid
case 2: // YZ section - rectangle, XZ section - isosceles trapezoid
{
G4double dy = std::abs(p.y()) + fPlanes[1].d;
if (std::abs(dy) <= halfCarTolerance) ny = (p.y() < 0) ? -1 : 1;
ny = std::copysign(G4double(std::abs(dy) <= halfCarTolerance), p.y());
G4double dx = fPlanes[3].a*std::abs(p.x()) +
fPlanes[3].c*p.z() + fPlanes[3].d;
if (std::abs(dx) <= halfCarTolerance)
{
nx = (p.x() < 0) ? -fPlanes[3].a : fPlanes[3].a;
nz += fPlanes[3].c;
++nsurf;
}
G4double k = std::abs(dx) <= halfCarTolerance;
nx = std::copysign(k, p.x())*fPlanes[3].a;
nz += k*fPlanes[3].c;
break;
}
case 3: // YZ section is a rectangle and
{ // XY section is an isosceles trapezoid
case 3: // YZ section - rectangle, XY section - isosceles trapezoid
{
G4double dy = std::abs(p.y()) + fPlanes[1].d;
if (std::abs(dy) <= halfCarTolerance) ny = (p.y() < 0) ? -1 : 1;
ny = std::copysign(G4double(std::abs(dy) <= halfCarTolerance), p.y());
G4double dx = fPlanes[3].a*std::abs(p.x()) +
fPlanes[3].b*p.y() + fPlanes[3].d;
if (std::abs(dx) <= halfCarTolerance)
{
nx = (p.x() < 0) ? -fPlanes[3].a : fPlanes[3].a;
ny += fPlanes[3].b;
++nsurf;
}
G4double k = std::abs(dx) <= halfCarTolerance;
nx = std::copysign(k, p.x())*fPlanes[3].a;
ny += k*fPlanes[3].b;
break;
}
}
// Return normal
//
if (nsurf == 1) return G4ThreeVector(nx,ny,nz);
else if (nsurf != 0) return G4ThreeVector(nx,ny,nz).unit(); // edge or corner
G4double mag2 = nx*nx + ny*ny + nz*nz;
if (mag2 == 1) return G4ThreeVector(nx,ny,nz);
else if (mag2 != 0) return G4ThreeVector(nx,ny,nz).unit(); // edge or corner
else
{
// Point is not on the surface
+4
View File
@@ -16,6 +16,10 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
December 10, 2019 B.Morgan - geomsolids-V10-06-00
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
June 3, 2019 J.Apostolakis - geomsolids-V10-05-00
- Change CMakeLists.txt in test directories to allow optional use
with integrate testing or via one-target builds using G4TARGET
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4specsolids
# Package: Geant4.src.G4geometry..G4specsolids
#
# 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()
+22 -8
View File
@@ -16,28 +16,42 @@ committal in the source repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
21-May-2020 G.Lima (geom-specific-V10-05-23)
- Fix constructor signatures in G4UExtrudedSolid wrapper.
May 21, 2020 Guilherme Lima (geom-specific-V10-06-08)
----------------------------
- Fix constructor signatures in G4UExtrudedSolid wrappers, to match those in G4 version.
There were missing const and reference qualifiers in non-POD parameters.
17-January-2020 E.Tcherniaev (geom-specific-V10-05-22)
30-April-2020 G.Cosmo (geom-specific-V10-06-07)
- Adopt new convention for location of headers in VecGeom for all wrappers.
09-April-2020 E.Tcherniaev (geom-specific-V10-06-06)
- Added G4GenericTrap::GetTwistedFaceSurfaceArea().
- testG4GenericTrap.cc: fixed test for calculation of surface area.
- testG4ExtrudedSolid.cc: fixed assert statements for cases where
point flys along the surface (DistanceToIn() returns kInfinity).
17-January-2020 E.Tcherniaev (geom-specific-V10-06-05)
- Implemented G4Tet::SetVertices(), it addresses request made
at Geant4 Technical Forum.
14-January-2020 G.Cosmo
14-January-2020 Gabriele Cosmo (geom-specific-V10-06-04)
- Added protection in G4VFacet header for double definition of global
symbols from Windows Kits code.
08-January-2020 E.Tcherniaev
08-January-2020 E.Tcherniaev (geom-specific-V10-06-03)
- Complete revision of G4Tet, speed up, new testG4Tet.cc.
It also fixes issues spotted by new unit test.
16-December-2019 E.Tcherniaev
16-December-2019 E.Tcherniaev (geom-specific-V10-06-02)
- Complete revision of G4Ellipsoid, it fixes issues with former
implementation, in particular it addresses problem report #2206.
30%-70% speed-up in all main methods
30%-70% speed-up in all main methods.
10-December-2019 G.Cosmo
11-December-2019 B.Morgan (geom-specific-V10-06-01)
- Cleanup CMake build, removing obsolete granular library options and
explicit include_directories.
10-December-2019 G.Cosmo (geom-specific-V10-06-00)
- Re-established parameterisation mechanism for G4Tet and G4UTet which was
removed by mistake. Addressing problem report #2209.
@@ -185,6 +185,10 @@ class G4GenericTrap : public G4VSolid
const G4ThreeVector& p1,
const G4ThreeVector& p2,
const G4ThreeVector& p3) const;
G4double GetTwistedFaceSurfaceArea(const G4ThreeVector& p0,
const G4ThreeVector& p1,
const G4ThreeVector& p2,
const G4ThreeVector& p3) const;
G4double GetFaceCubicVolume(const G4ThreeVector& p0,
const G4ThreeVector& p1,
const G4ThreeVector& p2,
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedEllipsoid.h>
#include <VecGeom/volumes/UnplacedEllipsoid.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedEllipticalCone.h>
#include <VecGeom/volumes/UnplacedEllipticalCone.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedEllipticalTube.h>
#include <VecGeom/volumes/UnplacedEllipticalTube.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedExtruded.h>
#include <VecGeom/volumes/UnplacedExtruded.h>
#include "G4TwoVector.hh"
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedGenericPolycone.h>
#include <VecGeom/volumes/UnplacedGenericPolycone.h>
#include "G4TwoVector.hh"
#include "G4PolyconeSide.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedGenTrap.h>
#include <VecGeom/volumes/UnplacedGenTrap.h>
#include "G4TwoVector.hh"
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedHype.h>
#include <VecGeom/volumes/UnplacedHype.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedParaboloid.h>
#include <VecGeom/volumes/UnplacedParaboloid.h>
#include "G4Polyhedron.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedPolycone.h>
#include <VecGeom/volumes/UnplacedPolycone.h>
#include "G4TwoVector.hh"
#include "G4PolyconeSide.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedPolyhedron.h>
#include <VecGeom/volumes/UnplacedPolyhedron.h>
#include "G4TwoVector.hh"
#include "G4PolyhedraSide.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedTessellated.h>
#include <VecGeom/volumes/UnplacedTessellated.h>
#include "G4Polyhedron.hh"
#include "G4VFacet.hh"
@@ -38,7 +38,7 @@
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedTet.h>
#include <VecGeom/volumes/UnplacedTet.h>
#include "G4Polyhedron.hh"
+143 -171
View File
@@ -1,182 +1,154 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4specsolids
# Package: Geant4.src.G4geometry.G4specsolids
#
# 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/geometry/management/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/HEPNumerics/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)
#
# Define the Geant4 Module.
#
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4specsolids
HEADERS
G4ClippablePolygon.hh
G4ClippablePolygon.icc
G4Ellipsoid.hh
G4Ellipsoid.icc
G4EllipticalCone.hh
G4EllipticalCone.icc
G4EllipticalTube.hh
G4EllipticalTube.icc
G4EnclosingCylinder.hh
G4ExtrudedSolid.hh
G4ExtrudedSolid.icc
G4GenericPolycone.hh
G4GenericPolycone.icc
G4GenericTrap.hh
G4GenericTrap.icc
G4Hype.hh
G4Hype.icc
G4IntersectingCone.hh
G4Paraboloid.hh
G4Paraboloid.icc
G4PolyPhiFace.hh
G4PolyPhiFace.icc
G4Polycone.hh
G4Polycone.icc
G4PolyconeHistorical.hh
G4PolyconeSide.hh
G4Polyhedra.hh
G4Polyhedra.icc
G4PolyhedraHistorical.hh
G4PolyhedraSide.hh
G4QuadrangularFacet.hh
G4ReduciblePolygon.hh
G4SolidExtentList.hh
G4SolidsWorkspace.hh
G4SurfBits.hh
G4TessellatedGeometryAlgorithms.hh
G4TessellatedSolid.hh
G4Tet.hh
G4TriangularFacet.hh
G4TwistBoxSide.hh
G4TwistTrapAlphaSide.hh
G4TwistTrapFlatSide.hh
G4TwistTrapParallelSide.hh
G4TwistTubsFlatSide.hh
G4TwistTubsHypeSide.hh
G4TwistTubsSide.hh
G4TwistedBox.hh
G4TwistedTrap.hh
G4TwistedTrd.hh
G4TwistedTubs.hh
G4UEllipsoid.hh
G4UEllipticalCone.hh
G4UEllipticalTube.hh
G4UExtrudedSolid.hh
G4UGenericPolycone.hh
G4UGenericTrap.hh
G4UHype.hh
G4UParaboloid.hh
G4UPolycone.hh
G4UPolyhedra.hh
G4UHype.hh
G4UTessellatedSolid.hh
G4UTet.hh
G4VCSGface.hh
G4VCSGfaceted.hh
G4VFacet.hh
G4Voxelizer.hh
G4Voxelizer.icc
G4VTwistSurface.hh
G4VTwistSurface.icc
G4VTwistedFaceted.hh
SOURCES
G4ClippablePolygon.cc
G4Ellipsoid.cc
G4EllipticalCone.cc
G4EllipticalTube.cc
G4EnclosingCylinder.cc
G4ExtrudedSolid.cc
G4GenericPolycone.cc
G4GenericTrap.cc
G4Hype.cc
G4IntersectingCone.cc
G4Paraboloid.cc
G4PolyPhiFace.cc
G4Polycone.cc
G4PolyconeHistorical.cc
G4PolyconeSide.cc
G4Polyhedra.cc
G4PolyhedraHistorical.cc
G4PolyhedraSide.cc
G4QuadrangularFacet.cc
G4ReduciblePolygon.cc
G4SolidExtentList.cc
G4SolidsWorkspace.cc
G4SurfBits.cc
G4TessellatedGeometryAlgorithms.cc
G4TessellatedSolid.cc
G4Tet.cc
G4TriangularFacet.cc
G4TwistBoxSide.cc
G4TwistTrapAlphaSide.cc
G4TwistTrapFlatSide.cc
G4TwistTrapParallelSide.cc
G4TwistTubsFlatSide.cc
G4TwistTubsHypeSide.cc
G4TwistTubsSide.cc
G4TwistedBox.cc
G4TwistedTrap.cc
G4TwistedTrd.cc
G4TwistedTubs.cc
G4UEllipsoid.cc
G4UEllipticalCone.cc
G4UEllipticalTube.cc
G4UExtrudedSolid.cc
G4UGenericPolycone.cc
G4UGenericTrap.cc
G4UHype.cc
G4UParaboloid.cc
G4UPolycone.cc
G4UPolyhedra.cc
G4UTessellatedSolid.cc
G4UTet.cc
G4VCSGfaceted.cc
G4VFacet.cc
G4Voxelizer.cc
G4VTwistSurface.cc
G4VTwistedFaceted.cc
GRANULAR_DEPENDENCIES
G4csg
G4geometrymng
G4globman
G4graphics_reps
G4hepnumerics
G4intercoms
G4volumes
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
LINK_LIBRARIES
${VECGEOM_LIBRARIES}
geant4_define_module(NAME G4specsolids
HEADERS
G4ClippablePolygon.hh
G4ClippablePolygon.icc
G4Ellipsoid.hh
G4Ellipsoid.icc
G4EllipticalCone.hh
G4EllipticalCone.icc
G4EllipticalTube.hh
G4EllipticalTube.icc
G4EnclosingCylinder.hh
G4ExtrudedSolid.hh
G4ExtrudedSolid.icc
G4GenericPolycone.hh
G4GenericPolycone.icc
G4GenericTrap.hh
G4GenericTrap.icc
G4Hype.hh
G4Hype.icc
G4IntersectingCone.hh
G4Paraboloid.hh
G4Paraboloid.icc
G4PolyPhiFace.hh
G4PolyPhiFace.icc
G4Polycone.hh
G4Polycone.icc
G4PolyconeHistorical.hh
G4PolyconeSide.hh
G4Polyhedra.hh
G4Polyhedra.icc
G4PolyhedraHistorical.hh
G4PolyhedraSide.hh
G4QuadrangularFacet.hh
G4ReduciblePolygon.hh
G4SolidExtentList.hh
G4SolidsWorkspace.hh
G4SurfBits.hh
G4TessellatedGeometryAlgorithms.hh
G4TessellatedSolid.hh
G4Tet.hh
G4TriangularFacet.hh
G4TwistBoxSide.hh
G4TwistTrapAlphaSide.hh
G4TwistTrapFlatSide.hh
G4TwistTrapParallelSide.hh
G4TwistTubsFlatSide.hh
G4TwistTubsHypeSide.hh
G4TwistTubsSide.hh
G4TwistedBox.hh
G4TwistedTrap.hh
G4TwistedTrd.hh
G4TwistedTubs.hh
G4UEllipsoid.hh
G4UEllipticalCone.hh
G4UEllipticalTube.hh
G4UExtrudedSolid.hh
G4UGenericPolycone.hh
G4UGenericTrap.hh
G4UHype.hh
G4UParaboloid.hh
G4UPolycone.hh
G4UPolyhedra.hh
G4UHype.hh
G4UTessellatedSolid.hh
G4UTet.hh
G4VCSGface.hh
G4VCSGfaceted.hh
G4VFacet.hh
G4Voxelizer.hh
G4Voxelizer.icc
G4VTwistSurface.hh
G4VTwistSurface.icc
G4VTwistedFaceted.hh
SOURCES
G4ClippablePolygon.cc
G4Ellipsoid.cc
G4EllipticalCone.cc
G4EllipticalTube.cc
G4EnclosingCylinder.cc
G4ExtrudedSolid.cc
G4GenericPolycone.cc
G4GenericTrap.cc
G4Hype.cc
G4IntersectingCone.cc
G4Paraboloid.cc
G4PolyPhiFace.cc
G4Polycone.cc
G4PolyconeHistorical.cc
G4PolyconeSide.cc
G4Polyhedra.cc
G4PolyhedraHistorical.cc
G4PolyhedraSide.cc
G4QuadrangularFacet.cc
G4ReduciblePolygon.cc
G4SolidExtentList.cc
G4SolidsWorkspace.cc
G4SurfBits.cc
G4TessellatedGeometryAlgorithms.cc
G4TessellatedSolid.cc
G4Tet.cc
G4TriangularFacet.cc
G4TwistBoxSide.cc
G4TwistTrapAlphaSide.cc
G4TwistTrapFlatSide.cc
G4TwistTrapParallelSide.cc
G4TwistTubsFlatSide.cc
G4TwistTubsHypeSide.cc
G4TwistTubsSide.cc
G4TwistedBox.cc
G4TwistedTrap.cc
G4TwistedTrd.cc
G4TwistedTubs.cc
G4UEllipsoid.cc
G4UEllipticalCone.cc
G4UEllipticalTube.cc
G4UExtrudedSolid.cc
G4UGenericPolycone.cc
G4UGenericTrap.cc
G4UHype.cc
G4UParaboloid.cc
G4UPolycone.cc
G4UPolyhedra.cc
G4UTessellatedSolid.cc
G4UTet.cc
G4VCSGfaceted.cc
G4VFacet.cc
G4Voxelizer.cc
G4VTwistSurface.cc
G4VTwistedFaceted.cc
GRANULAR_DEPENDENCIES
G4csg
G4geometrymng
G4globman
G4graphics_reps
G4hepnumerics
G4intercoms
G4volumes
GLOBAL_DEPENDENCIES
G4global
G4graphics_reps
G4intercoms
LINK_LIBRARIES
${VECGEOM_LIBRARIES}
)
# List any source specific properties here

Some files were not shown because too many files have changed in this diff Show More