Import Geant4 11.2.0 source tree
This commit is contained in:
@@ -6,6 +6,13 @@ It must **not** be used as a substitute for writing good git commit messages!
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
## 2023-08-31 Gabriele Cosmo (procscore-V11-01-03)
|
||||
- Removed unnecessary forward declarations to G4VTouchable.
|
||||
- Minor code cleanup.
|
||||
|
||||
## 2023-07-04 Gabriele Cosmo (procscore-V11-01-02)
|
||||
- Fixed Coverity warning in G4EnergySplitter::SplitEnergyInVolumes().
|
||||
|
||||
## 2023-06-01 Ben Morgan (procscore-V11-01-01)
|
||||
- Make dependency on G4intercoms private, fixing issue introduced in previous tag
|
||||
|
||||
|
||||
@@ -23,24 +23,19 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4ParallelWorldProcess
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This process takes a parallel world and limits a step
|
||||
// on the boundaries of volumes in the parallel world.
|
||||
// It invokes sensitive detectors assigned in the parallel world.
|
||||
// It switches a material (and a region if defined) in the
|
||||
// assigned parallel world over the material (and the region)
|
||||
// in the mass world.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4ParallelWorldProcess.hh
|
||||
//
|
||||
// Description:
|
||||
// This procss takes a parallel world and limits a step
|
||||
// on the boundaries of volumes in the parallel world.
|
||||
// It invokes sensitive detectors assigned in the parallel
|
||||
// world.
|
||||
// It switches a material (and a region if defined) in the
|
||||
// assigned parallel world over the material (and the region)
|
||||
// in the mass world.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
// Author: M.Asai (SLAC), 2010.
|
||||
//---------------------------------------------------------------------
|
||||
#ifndef G4ParallelWorldProcess_h
|
||||
#define G4ParallelWorldProcess_h 1
|
||||
|
||||
@@ -55,23 +50,12 @@ class G4StepPoint;
|
||||
class G4Navigator;
|
||||
class G4TransportationManager;
|
||||
class G4PathFinder;
|
||||
class G4VTouchable;
|
||||
class G4VPhysicalVolume;
|
||||
class G4ParticleChange;
|
||||
//------------------------------------------
|
||||
//
|
||||
// G4ParallelWorldProcess class
|
||||
//
|
||||
//------------------------------------------
|
||||
|
||||
// Class Description:
|
||||
|
||||
class G4ParallelWorldProcess : public G4VProcess
|
||||
{
|
||||
public: // with description
|
||||
//------------------------
|
||||
// Constructor/Destructor
|
||||
//------------------------
|
||||
public:
|
||||
|
||||
G4ParallelWorldProcess(const G4String& processName = "ParaWorld",
|
||||
G4ProcessType theType = fParallel);
|
||||
@@ -132,10 +116,12 @@ class G4ParallelWorldProcess : public G4VProcess
|
||||
static G4int GetHypNavigatorID();
|
||||
|
||||
protected:
|
||||
|
||||
void CopyStep(const G4Step& step);
|
||||
void SwitchMaterial(G4StepPoint*);
|
||||
|
||||
protected:
|
||||
|
||||
G4Step* fGhostStep;
|
||||
G4StepPoint* fGhostPreStepPoint;
|
||||
G4StepPoint* fGhostPostStepPoint;
|
||||
@@ -165,6 +151,7 @@ class G4ParallelWorldProcess : public G4VProcess
|
||||
G4bool layeredMaterialFlag{false};
|
||||
|
||||
private:
|
||||
|
||||
static G4ThreadLocal G4Step* fpHyperStep;
|
||||
static G4ThreadLocal G4int nParallelWorlds;
|
||||
static G4ThreadLocal G4int fNavIDHyp;
|
||||
|
||||
@@ -23,24 +23,19 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4ParallelWorldProcessStore
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This process takes a parallel world and limits a step
|
||||
// on the boundaries of volumes in the parallel world.
|
||||
// It invokes sensitive detectors assigned in the parallel world.
|
||||
// It switches a material (and a region if defined) in the
|
||||
// assigned parallel world over the material (and the region)
|
||||
// in the mass world.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4ParallelWorldProcessStore.hh
|
||||
//
|
||||
// Description:
|
||||
// This procss takes a parallel world and limits a step
|
||||
// on the boundaries of volumes in the parallel world.
|
||||
// It invokes sensitive detectors assigned in the parallel
|
||||
// world.
|
||||
// It switches a material (and a region if defined) in the
|
||||
// assigned parallel world over the material (and the region)
|
||||
// in the mass world.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
// Author: M.Asai (SLAC), 2010.
|
||||
//---------------------------------------------------------------------
|
||||
#ifndef G4ParallelWorldProcessStore_h
|
||||
#define G4ParallelWorldProcessStore_h 1
|
||||
|
||||
@@ -50,33 +45,26 @@
|
||||
|
||||
class G4ParallelWorldProcess;
|
||||
|
||||
//------------------------------------------
|
||||
//
|
||||
// G4ParallelWorldProcessStore class
|
||||
//
|
||||
//------------------------------------------
|
||||
|
||||
// Class Description:
|
||||
|
||||
class G4ParallelWorldProcessStore : public std::map<G4ParallelWorldProcess*, G4String>
|
||||
{
|
||||
public: // with description
|
||||
public:
|
||||
|
||||
static G4ParallelWorldProcessStore* GetInstance();
|
||||
static G4ParallelWorldProcessStore* GetInstanceIfExist();
|
||||
|
||||
// Set Paralle World
|
||||
void SetParallelWorld(G4ParallelWorldProcess* proc, G4String parallelWorldName);
|
||||
void SetParallelWorld(G4ParallelWorldProcess* proc, const G4String& parallelWorldName);
|
||||
void UpdateWorlds();
|
||||
G4ParallelWorldProcess* GetProcess(G4String parallelWorldName);
|
||||
G4ParallelWorldProcess* GetProcess(const G4String& parallelWorldName);
|
||||
void Clear();
|
||||
|
||||
public:
|
||||
virtual ~G4ParallelWorldProcessStore();
|
||||
|
||||
private:
|
||||
|
||||
G4ParallelWorldProcessStore();
|
||||
|
||||
private:
|
||||
|
||||
static G4ThreadLocal G4ParallelWorldProcessStore* fInstance;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,21 +23,16 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4ParallelWorldScoringProcess
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This process takes a parallel world and limits a step
|
||||
// on the boundaries of volumes in the parallel world.
|
||||
// It invokes sensitive detectors assigned in the parallel world.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4ParallelWorldScoringProcess.hh
|
||||
//
|
||||
// Description:
|
||||
// This procss takes a parallel world and limits a step
|
||||
// on the boundaries of volumes in the parallel world.
|
||||
// It invokes sensitive detectors assigned in the parallel
|
||||
// world.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
// Author: M.Asai (SLAC), 2010.
|
||||
//---------------------------------------------------------------------
|
||||
#ifndef G4ParallelWorldScoringProcess_h
|
||||
#define G4ParallelWorldScoringProcess_h 1
|
||||
|
||||
@@ -50,24 +45,13 @@ class G4Step;
|
||||
class G4Navigator;
|
||||
class G4TransportationManager;
|
||||
class G4PathFinder;
|
||||
class G4VTouchable;
|
||||
class G4VPhysicalVolume;
|
||||
class G4ParticleChange;
|
||||
class G4ParticleDefinition;
|
||||
//------------------------------------------
|
||||
//
|
||||
// G4ParallelWorldScoringProcess class
|
||||
//
|
||||
//------------------------------------------
|
||||
|
||||
// Class Description:
|
||||
|
||||
class G4ParallelWorldScoringProcess : public G4VProcess
|
||||
{
|
||||
public: // with description
|
||||
//------------------------
|
||||
// Constructor/Destructor
|
||||
//------------------------
|
||||
public:
|
||||
|
||||
G4ParallelWorldScoringProcess(const G4String& processName = "ParaWorldScore",
|
||||
G4ProcessType theType = fParameterisation);
|
||||
@@ -113,7 +97,10 @@ class G4ParallelWorldScoringProcess : public G4VProcess
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
|
||||
|
||||
void Verbose(const G4Step&) const;
|
||||
|
||||
private:
|
||||
|
||||
void CopyStep(const G4Step& step);
|
||||
|
||||
G4Step* fGhostStep;
|
||||
@@ -138,16 +125,6 @@ class G4ParallelWorldScoringProcess : public G4VProcess
|
||||
G4FieldTrack fFieldTrack;
|
||||
G4double fGhostSafety;
|
||||
G4bool fOnBoundary;
|
||||
|
||||
// ******************************************************
|
||||
// ******************************************************
|
||||
//
|
||||
// For TESTS:
|
||||
//
|
||||
// ******************************************************
|
||||
// ******************************************************
|
||||
public:
|
||||
void Verbose(const G4Step&) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,23 +23,17 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4ScoreSplittingProcess
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This process is used to split the length and energy
|
||||
// of a step in a regular structure into sub-steps, and to
|
||||
// call the scorers for each sub-volume.
|
||||
// It invokes sensitive detectors assigned in the *mass* world.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4ScoreSplittingProcess.hh
|
||||
//
|
||||
// Description:
|
||||
// This process is used to split the length and energy
|
||||
// of a step in a regular structure into sub-steps, and to
|
||||
// call the scorers for each sub-volume.
|
||||
// It invokes sensitive detectors assigned in the *mass*
|
||||
// world.
|
||||
//
|
||||
// Design and first implementation: J. Apostolakis / M.Asai 2010
|
||||
//---------------------------------------------------------------
|
||||
|
||||
// Design and first implementation: J.Apostolakis, M.Asai - 2010
|
||||
//---------------------------------------------------------------------
|
||||
#ifndef G4ScoreSplittingProcess_h
|
||||
#define G4ScoreSplittingProcess_h 1
|
||||
|
||||
@@ -47,31 +41,19 @@
|
||||
#include "G4TouchableHandle.hh"
|
||||
#include "G4VProcess.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4Navigator;
|
||||
class G4TransportationManager;
|
||||
class G4PathFinder;
|
||||
class G4VTouchable;
|
||||
class G4VPhysicalVolume;
|
||||
class G4ParticleChange;
|
||||
class G4EnergySplitter;
|
||||
|
||||
class G4TouchableHistory;
|
||||
|
||||
//------------------------------------------
|
||||
//
|
||||
// G4ScoreSplittingProcess class
|
||||
//
|
||||
//------------------------------------------
|
||||
|
||||
// Class Description:
|
||||
|
||||
class G4ScoreSplittingProcess : public G4VProcess
|
||||
{
|
||||
public: // with description
|
||||
//------------------------
|
||||
// Constructor/Destructor
|
||||
//------------------------
|
||||
public:
|
||||
|
||||
G4ScoreSplittingProcess(const G4String& processName = "ScoreSplittingProc",
|
||||
G4ProcessType theType = fParameterisation);
|
||||
@@ -109,10 +91,14 @@ class G4ScoreSplittingProcess : public G4VProcess
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
|
||||
|
||||
void Verbose(const G4Step&) const;
|
||||
|
||||
private:
|
||||
|
||||
G4TouchableHistory* CreateTouchableForSubStep(G4int newVoxelNum, G4ThreeVector newPosition);
|
||||
|
||||
private:
|
||||
|
||||
void CopyStepStart(const G4Step& step);
|
||||
|
||||
G4Step* fSplitStep;
|
||||
@@ -122,9 +108,6 @@ class G4ScoreSplittingProcess : public G4VProcess
|
||||
G4VParticleChange dummyParticleChange;
|
||||
G4ParticleChange xParticleChange;
|
||||
|
||||
// G4TransportationManager* fTransportationManager;
|
||||
// G4PathFinder* fPathFinder;
|
||||
|
||||
// -------------------------------
|
||||
// Touchables for the Split Step
|
||||
// -------------------------------
|
||||
@@ -136,12 +119,6 @@ class G4ScoreSplittingProcess : public G4VProcess
|
||||
G4TouchableHandle fFinalTouchableH;
|
||||
|
||||
G4EnergySplitter* fpEnergySplitter;
|
||||
|
||||
// ******************************************************
|
||||
// For TESTS:
|
||||
// ******************************************************
|
||||
public:
|
||||
void Verbose(const G4Step&) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -57,6 +57,8 @@ G4int G4EnergySplitter::SplitEnergyInVolumes(const G4Step* aStep)
|
||||
{
|
||||
theEnergies.clear();
|
||||
|
||||
if (aStep == nullptr) return false; // it is 0 when called by GmScoringMgr after last event
|
||||
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
|
||||
#ifdef VERBOSE_ENERSPLIT
|
||||
@@ -78,8 +80,6 @@ G4int G4EnergySplitter::SplitEnergyInVolumes(const G4Step* aStep)
|
||||
|
||||
if (thePhantomParam == nullptr) GetPhantomParam(true);
|
||||
|
||||
if (aStep == nullptr) return false; // it is 0 when called by GmScoringMgr after last event
|
||||
|
||||
//----- Distribute energy deposited in voxels
|
||||
std::vector<std::pair<G4int, G4double>> rnsl =
|
||||
G4RegularNavigationHelper::Instance()->GetStepLengths();
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4ParallelWorldProcessStore implementation
|
||||
//
|
||||
//
|
||||
//
|
||||
// Author: M.Asai (SLAC), 2010.
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
#include "G4ParallelWorldProcessStore.hh"
|
||||
|
||||
@@ -35,7 +36,8 @@ G4ThreadLocal G4ParallelWorldProcessStore* G4ParallelWorldProcessStore::fInstanc
|
||||
|
||||
G4ParallelWorldProcessStore* G4ParallelWorldProcessStore::GetInstance()
|
||||
{
|
||||
if (fInstance == nullptr) {
|
||||
if (fInstance == nullptr)
|
||||
{
|
||||
fInstance = new G4ParallelWorldProcessStore();
|
||||
}
|
||||
return fInstance;
|
||||
@@ -55,12 +57,14 @@ G4ParallelWorldProcessStore::~G4ParallelWorldProcessStore()
|
||||
}
|
||||
|
||||
void G4ParallelWorldProcessStore::SetParallelWorld(G4ParallelWorldProcess* proc,
|
||||
G4String parallelWorldName)
|
||||
const G4String& parallelWorldName)
|
||||
{
|
||||
for (const auto& [process, name] : *fInstance)
|
||||
{
|
||||
if(process == proc) {
|
||||
if(name == parallelWorldName) {
|
||||
if(process == proc)
|
||||
{
|
||||
if(name == parallelWorldName)
|
||||
{
|
||||
return; // already registered
|
||||
}
|
||||
|
||||
@@ -83,7 +87,7 @@ void G4ParallelWorldProcessStore::UpdateWorlds()
|
||||
}
|
||||
}
|
||||
|
||||
G4ParallelWorldProcess* G4ParallelWorldProcessStore::GetProcess(G4String parallelWorldName)
|
||||
G4ParallelWorldProcess* G4ParallelWorldProcessStore::GetProcess(const G4String& parallelWorldName)
|
||||
{
|
||||
for(const auto& [proc, name] : *fInstance)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user