Import Geant4 11.2.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2023-06-30 09:09:57 +02:00
parent aef78ca386
commit dd1f179cda
3780 changed files with 212808 additions and 142780 deletions
@@ -25,7 +25,7 @@
//
//
//
//
//
//---------------------------------------------------------------
//
// G4ParallelWorldProcess.hh
@@ -41,11 +41,15 @@
//
//---------------------------------------------------------------
#ifndef G4ParallelWorldProcess_h
#define G4ParallelWorldProcess_h 1
#include "G4FieldTrack.hh"
#include "G4MultiNavigator.hh"
#include "G4TouchableHandle.hh"
#include "G4VProcess.hh"
#include "globals.hh"
class G4Step;
class G4StepPoint;
class G4Navigator;
@@ -54,127 +58,117 @@ class G4PathFinder;
class G4VTouchable;
class G4VPhysicalVolume;
class G4ParticleChange;
#include "G4VProcess.hh"
#include "G4FieldTrack.hh"
#include "G4TouchableHandle.hh"
#include "G4MultiNavigator.hh"
//------------------------------------------
//
// G4ParallelWorldProcess class
//
//------------------------------------------
// Class Description:
class G4ParallelWorldProcess : public G4VProcess
{
public: // with description
public: // with description
//------------------------
// Constructor/Destructor
//------------------------
//------------------------
// Constructor/Destructor
//------------------------
G4ParallelWorldProcess(const G4String& processName = "ParaWorld",
G4ProcessType theType = fParallel);
virtual ~G4ParallelWorldProcess();
//--------------------------------------------------------------
// Set Paralle World
//--------------------------------------------------------------
G4ParallelWorldProcess(const G4String& processName = "ParaWorld",
G4ProcessType theType = fParallel);
~G4ParallelWorldProcess() override;
void SetParallelWorld(G4String parallelWorldName);
void SetParallelWorld(G4VPhysicalVolume* parallelWorld);
//--------------------------------------------------------------
// Set Paralle World
//--------------------------------------------------------------
//--------------------------------------------------------------
// Process interface
//--------------------------------------------------------------
void SetParallelWorld(G4String parallelWorldName);
void SetParallelWorld(G4VPhysicalVolume* parallelWorld);
void StartTracking(G4Track*);
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AtRest
//------------------------------------------------------------------------
G4double AtRestGetPhysicalInteractionLength(const G4Track&,G4ForceCondition*);
G4VParticleChange* AtRestDoIt(const G4Track&,const G4Step&);
//--------------------------------------------------------------
// Process interface
//--------------------------------------------------------------
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AlongStep
//------------------------------------------------------------------------
G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,G4double,G4double,G4double&,G4GPILSelection*);
G4VParticleChange* AlongStepDoIt(const G4Track&,const G4Step&);
void StartTracking(G4Track*) override;
//-----------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for PostStep
//-----------------------------------------------------------------------
G4double PostStepGetPhysicalInteractionLength(
const G4Track&,G4double,G4ForceCondition*);
G4VParticleChange* PostStepDoIt(const G4Track&,const G4Step&);
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AtRest
//------------------------------------------------------------------------
//-----------------------------------------------------------------------
// Flag for material switching
//-----------------------------------------------------------------------
G4double AtRestGetPhysicalInteractionLength(const G4Track&, G4ForceCondition*) override;
G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) override;
inline void SetLayeredMaterialFlag(G4bool flg=true)
{ layeredMaterialFlag = flg; }
inline G4bool GetLayeredMaterialFlag() const
{ return layeredMaterialFlag; }
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AlongStep
//------------------------------------------------------------------------
protected:
void CopyStep(const G4Step & step);
void SwitchMaterial(G4StepPoint*);
G4double AlongStepGetPhysicalInteractionLength(const G4Track&, G4double, G4double, G4double&,
G4GPILSelection*) override;
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) override;
public: // with description
//--------------------------------------------------------------------
// Returns whether a particular particle type requires AtRest process
//--------------------------------------------------------------------
G4bool IsAtRestRequired(G4ParticleDefinition*);
//-----------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for PostStep
//-----------------------------------------------------------------------
protected:
G4Step * fGhostStep;
G4StepPoint * fGhostPreStepPoint;
G4StepPoint * fGhostPostStepPoint;
G4double PostStepGetPhysicalInteractionLength(const G4Track&, G4double,
G4ForceCondition*) override;
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
G4VParticleChange aDummyParticleChange;
G4ParticleChange xParticleChange;
//-----------------------------------------------------------------------
// Flag for material switching
//-----------------------------------------------------------------------
G4TransportationManager* fTransportationManager;
G4PathFinder* fPathFinder;
inline void SetLayeredMaterialFlag(G4bool flg = true) { layeredMaterialFlag = flg; }
inline G4bool GetLayeredMaterialFlag() const { return layeredMaterialFlag; }
// -------------------------------
// Navigation in the Ghost World:
// -------------------------------
G4String fGhostWorldName;
G4VPhysicalVolume* fGhostWorld;
G4Navigator* fGhostNavigator;
G4int fNavigatorID;
G4TouchableHandle fOldGhostTouchable;
G4TouchableHandle fNewGhostTouchable;
G4FieldTrack fFieldTrack;
G4double fGhostSafety;
G4bool fOnBoundary;
//--------------------------------------------------------------------
// Returns whether a particular particle type requires AtRest process
//--------------------------------------------------------------------
G4bool IsAtRestRequired(G4ParticleDefinition*);
//-----------------------------------------------------------------------
// Flag for material switching
//-----------------------------------------------------------------------
G4bool layeredMaterialFlag;
//-----------------------------------------------------------------------
// Static G4Step object for "Hyper-step"
//-----------------------------------------------------------------------
static const G4Step* GetHyperStep();
static G4int GetHypNavigatorID();
//-----------------------------------------------------------------------
// Static G4Step object for "Hyper-step"
//-----------------------------------------------------------------------
public:
static const G4Step* GetHyperStep();
static G4int GetHypNavigatorID();
private:
static G4ThreadLocal G4Step* fpHyperStep;
static G4ThreadLocal G4int nParallelWorlds;
static G4ThreadLocal G4int fNavIDHyp;
G4int iParallelWorld;
protected:
void CopyStep(const G4Step& step);
void SwitchMaterial(G4StepPoint*);
protected:
G4Step* fGhostStep;
G4StepPoint* fGhostPreStepPoint;
G4StepPoint* fGhostPostStepPoint;
G4VParticleChange aDummyParticleChange;
G4ParticleChange xParticleChange;
G4TransportationManager* fTransportationManager;
G4PathFinder* fPathFinder;
// -------------------------------
// Navigation in the Ghost World:
// -------------------------------
G4String fGhostWorldName;
G4VPhysicalVolume* fGhostWorld{nullptr};
G4Navigator* fGhostNavigator{nullptr};
G4int fNavigatorID{-1};
G4TouchableHandle fOldGhostTouchable;
G4TouchableHandle fNewGhostTouchable;
G4FieldTrack fFieldTrack;
G4double fGhostSafety{0.};
G4bool fOnBoundary{false};
//-----------------------------------------------------------------------
// Flag for material switching
//-----------------------------------------------------------------------
G4bool layeredMaterialFlag{false};
private:
static G4ThreadLocal G4Step* fpHyperStep;
static G4ThreadLocal G4int nParallelWorlds;
static G4ThreadLocal G4int fNavIDHyp;
G4int iParallelWorld;
};
#endif
@@ -25,7 +25,7 @@
//
//
//
//
//
//---------------------------------------------------------------
//
// G4ParallelWorldProcessStore.hh
@@ -41,12 +41,13 @@
//
//---------------------------------------------------------------
#ifndef G4ParallelWorldProcessStore_h
#define G4ParallelWorldProcessStore_h 1
#include "globals.hh"
#include <map>
class G4ParallelWorldProcess;
//------------------------------------------
@@ -55,38 +56,28 @@ class G4ParallelWorldProcess;
//
//------------------------------------------
// Class Description:
class G4ParallelWorldProcessStore
: public std::map<G4ParallelWorldProcess*,G4String>
class G4ParallelWorldProcessStore : public std::map<G4ParallelWorldProcess*, G4String>
{
public: // with description
static G4ParallelWorldProcessStore* GetInstance();
static G4ParallelWorldProcessStore* GetInstanceIfExist();
public: // with description
static G4ParallelWorldProcessStore* GetInstance();
static G4ParallelWorldProcessStore* GetInstanceIfExist();
private:
static G4ThreadLocal G4ParallelWorldProcessStore* fInstance;
// Set Paralle World
void SetParallelWorld(G4ParallelWorldProcess* proc, G4String parallelWorldName);
void UpdateWorlds();
G4ParallelWorldProcess* GetProcess(G4String parallelWorldName);
void Clear();
//------------------------
// Constructor/Destructor
//------------------------
private:
G4ParallelWorldProcessStore();
public:
virtual ~G4ParallelWorldProcessStore();
//--------------------------------------------------------------
// Set Paralle World
//--------------------------------------------------------------
public:
virtual ~G4ParallelWorldProcessStore();
public:
void SetParallelWorld(G4ParallelWorldProcess* proc,
G4String parallelWorldName);
void UpdateWorlds();
G4ParallelWorldProcess* GetProcess(G4String parallelWorldName);
void Clear();
private:
G4ParallelWorldProcessStore();
private:
static G4ThreadLocal G4ParallelWorldProcessStore* fInstance;
};
#endif
@@ -25,7 +25,7 @@
//
//
//
//
//
//---------------------------------------------------------------
//
// G4ParallelWorldScoringProcess.hh
@@ -38,11 +38,14 @@
//
//---------------------------------------------------------------
#ifndef G4ParallelWorldScoringProcess_h
#define G4ParallelWorldScoringProcess_h 1
#include "G4FieldTrack.hh"
#include "G4TouchableHandle.hh"
#include "G4VProcess.hh"
#include "globals.hh"
class G4Step;
class G4Navigator;
class G4TransportationManager;
@@ -51,121 +54,100 @@ class G4VTouchable;
class G4VPhysicalVolume;
class G4ParticleChange;
class G4ParticleDefinition;
#include "G4VProcess.hh"
#include "G4FieldTrack.hh"
#include "G4TouchableHandle.hh"
//------------------------------------------
//
// G4ParallelWorldScoringProcess class
//
//------------------------------------------
// Class Description:
class G4ParallelWorldScoringProcess : public G4VProcess
{
public: // with description
public: // with description
//------------------------
// Constructor/Destructor
//------------------------
//------------------------
// Constructor/Destructor
//------------------------
G4ParallelWorldScoringProcess(const G4String& processName = "ParaWorldScore",
G4ProcessType theType = fParameterisation);
virtual ~G4ParallelWorldScoringProcess();
//--------------------------------------------------------------
// Set Paralle World
//--------------------------------------------------------------
G4ParallelWorldScoringProcess(const G4String& processName = "ParaWorldScore",
G4ProcessType theType = fParameterisation);
~G4ParallelWorldScoringProcess() override;
void SetParallelWorld(G4String parallelWorldName);
void SetParallelWorld(G4VPhysicalVolume* parallelWorld);
G4bool IsAtRestRequired(G4ParticleDefinition* partDef);
//--------------------------------------------------------------
// Set Paralle World
//--------------------------------------------------------------
//--------------------------------------------------------------
// Process interface
//--------------------------------------------------------------
void SetParallelWorld(G4String parallelWorldName);
void SetParallelWorld(G4VPhysicalVolume* parallelWorld);
G4bool IsAtRestRequired(G4ParticleDefinition* partDef);
void StartTracking(G4Track*);
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AtRest
//------------------------------------------------------------------------
G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
);
//--------------------------------------------------------------
// Process interface
//--------------------------------------------------------------
G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
);
void StartTracking(G4Track*) override;
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AlongStep
//------------------------------------------------------------------------
G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double&,
G4GPILSelection*
);
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AtRest
//------------------------------------------------------------------------
G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
);
G4double AtRestGetPhysicalInteractionLength(const G4Track&, G4ForceCondition*) override;
//-----------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for PostStep
//-----------------------------------------------------------------------
G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
G4VParticleChange* PostStepDoIt(const G4Track& ,const G4Step& );
G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) override;
private:
void CopyStep(const G4Step & step);
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AlongStep
//------------------------------------------------------------------------
G4Step * fGhostStep;
G4StepPoint * fGhostPreStepPoint;
G4StepPoint * fGhostPostStepPoint;
G4double AlongStepGetPhysicalInteractionLength(const G4Track&, G4double, G4double, G4double&,
G4GPILSelection*) override;
G4VParticleChange aDummyParticleChange;
G4ParticleChange xParticleChange;
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) override;
G4TransportationManager* fTransportationManager;
G4PathFinder* fPathFinder;
//-----------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for PostStep
//-----------------------------------------------------------------------
// -------------------------------
// Navigation in the Ghost World:
// -------------------------------
G4String fGhostWorldName;
G4VPhysicalVolume* fGhostWorld;
G4Navigator* fGhostNavigator;
G4int fNavigatorID;
G4TouchableHandle fOldGhostTouchable;
G4TouchableHandle fNewGhostTouchable;
G4FieldTrack fFieldTrack;
G4double fGhostSafety;
G4bool fOnBoundary;
G4double PostStepGetPhysicalInteractionLength(const G4Track& track, G4double previousStepSize,
G4ForceCondition* condition) override;
// ******************************************************
// ******************************************************
//
// For TESTS:
//
// ******************************************************
// ******************************************************
public:
void Verbose(const G4Step&) const;
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
private:
void CopyStep(const G4Step& step);
G4Step* fGhostStep;
G4StepPoint* fGhostPreStepPoint;
G4StepPoint* fGhostPostStepPoint;
G4VParticleChange aDummyParticleChange;
G4ParticleChange xParticleChange;
G4TransportationManager* fTransportationManager;
G4PathFinder* fPathFinder;
// -------------------------------
// Navigation in the Ghost World:
// -------------------------------
G4String fGhostWorldName;
G4VPhysicalVolume* fGhostWorld;
G4Navigator* fGhostNavigator{nullptr};
G4int fNavigatorID{-1};
G4TouchableHandle fOldGhostTouchable;
G4TouchableHandle fNewGhostTouchable;
G4FieldTrack fFieldTrack;
G4double fGhostSafety;
G4bool fOnBoundary;
// ******************************************************
// ******************************************************
//
// For TESTS:
//
// ******************************************************
// ******************************************************
public:
void Verbose(const G4Step&) const;
};
#endif
@@ -25,14 +25,14 @@
//
//
//
//
//
//---------------------------------------------------------------
//
// 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
// 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.
@@ -40,10 +40,12 @@
// Design and first implementation: J. Apostolakis / M.Asai 2010
//---------------------------------------------------------------
#ifndef G4ScoreSplittingProcess_h
#define G4ScoreSplittingProcess_h 1
#include "G4FieldTrack.hh"
#include "G4TouchableHandle.hh"
#include "G4VProcess.hh"
#include "globals.hh"
class G4Step;
class G4Navigator;
@@ -52,13 +54,9 @@ class G4PathFinder;
class G4VTouchable;
class G4VPhysicalVolume;
class G4ParticleChange;
class G4EnergySplitter;
class G4EnergySplitter;
#include "G4VProcess.hh"
#include "G4FieldTrack.hh"
#include "G4TouchableHandle.hh"
class G4TouchableHistory;
// #include "G4TouchableHistory.hh"
//------------------------------------------
//
@@ -66,101 +64,84 @@ class G4TouchableHistory;
//
//------------------------------------------
// Class Description:
class G4ScoreSplittingProcess : public G4VProcess
{
public: // with description
public: // with description
//------------------------
// Constructor/Destructor
//------------------------
//------------------------
// Constructor/Destructor
//------------------------
G4ScoreSplittingProcess(const G4String& processName = "ScoreSplittingProc",
G4ProcessType theType = fParameterisation);
virtual ~G4ScoreSplittingProcess();
//--------------------------------------------------------------
// Process interface
//--------------------------------------------------------------
G4ScoreSplittingProcess(const G4String& processName = "ScoreSplittingProc",
G4ProcessType theType = fParameterisation);
~G4ScoreSplittingProcess() override;
void StartTracking(G4Track*);
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AtRest
//------------------------------------------------------------------------
G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
);
//--------------------------------------------------------------
// Process interface
//--------------------------------------------------------------
G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
);
void StartTracking(G4Track*) override;
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AlongStep
//------------------------------------------------------------------------
G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double&,
G4GPILSelection*
);
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AtRest
//------------------------------------------------------------------------
G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
);
G4double AtRestGetPhysicalInteractionLength(const G4Track&, G4ForceCondition*) override;
//-----------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for PostStep
//-----------------------------------------------------------------------
G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
G4VParticleChange* PostStepDoIt(const G4Track& ,const G4Step& );
G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) override;
private:
G4TouchableHistory* CreateTouchableForSubStep( G4int newVoxelNum, G4ThreeVector newPosition );
//------------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for AlongStep
//------------------------------------------------------------------------
private:
void CopyStepStart(const G4Step & step);
G4double AlongStepGetPhysicalInteractionLength(const G4Track&, G4double, G4double, G4double&,
G4GPILSelection*) override;
G4Step * fSplitStep;
G4StepPoint *fSplitPreStepPoint;
G4StepPoint *fSplitPostStepPoint;
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) override;
G4VParticleChange dummyParticleChange;
G4ParticleChange xParticleChange;
//-----------------------------------------------------------------------
// GetPhysicalInteractionLength() and DoIt() methods for PostStep
//-----------------------------------------------------------------------
// G4TransportationManager* fTransportationManager;
// G4PathFinder* fPathFinder;
G4double PostStepGetPhysicalInteractionLength(const G4Track& track, G4double previousStepSize,
G4ForceCondition* condition) override;
// -------------------------------
// Touchables for the Split Step
// -------------------------------
G4TouchableHandle fOldTouchableH;
G4TouchableHandle fNewTouchableH;
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
// Memory of Touchables of full step
G4TouchableHandle fInitialTouchableH;
G4TouchableHandle fFinalTouchableH;
private:
G4TouchableHistory* CreateTouchableForSubStep(G4int newVoxelNum, G4ThreeVector newPosition);
G4EnergySplitter *fpEnergySplitter;
private:
void CopyStepStart(const G4Step& step);
// ******************************************************
// For TESTS:
// ******************************************************
public:
void Verbose(const G4Step&) const;
G4Step* fSplitStep;
G4StepPoint* fSplitPreStepPoint;
G4StepPoint* fSplitPostStepPoint;
G4VParticleChange dummyParticleChange;
G4ParticleChange xParticleChange;
// G4TransportationManager* fTransportationManager;
// G4PathFinder* fPathFinder;
// -------------------------------
// Touchables for the Split Step
// -------------------------------
G4TouchableHandle fOldTouchableH;
G4TouchableHandle fNewTouchableH;
// Memory of Touchables of full step
G4TouchableHandle fInitialTouchableH;
G4TouchableHandle fFinalTouchableH;
G4EnergySplitter* fpEnergySplitter;
// ******************************************************
// For TESTS:
// ******************************************************
public:
void Verbose(const G4Step&) const;
};
#endif
@@ -28,54 +28,60 @@
////////////////////////////////////////////////////////////////////////////////
// (Description)
//
//
// Class to calculate the split of energy in voxels when G4RegularNavigation is used
// It takes into account energy loss and multiple scattering corrections as the particles loses energies from voxel to voxel
// It takes into account energy loss and multiple scattering corrections as the particles loses
// energies from voxel to voxel
//
// Created: 2010-11-09 Pedro Arce
//
//
///////////////////////////////////////////////////////////////////////////////
#include "globals.hh"
#include <vector>
class G4PhantomParameterisation;
class G4EnergyLossForExtrapolator;
class G4VPhysicalVolume;
class G4Material;
class G4Step;
#include <vector>
class G4EnergySplitter
{
public: // with description
G4EnergySplitter();
virtual ~G4EnergySplitter();
G4int SplitEnergyInVolumes(const G4Step* aStep ); // Calculates the energy splitting, and dumps it into theEnergies. Returns number of steps
public: // with description
G4EnergySplitter();
virtual ~G4EnergySplitter();
void GetLastVoxelID( G4int& voxelID);
void GetFirstVoxelID( G4int& voxelID);
void GetVoxelID( G4int stepNo, G4int& voxelID );
inline void GetVoxelIDAndLength( G4int stepNo, G4int& voxelID, G4double& stepLength );
inline void GetLengthAndEnergyDeposited( G4int stepNo, G4int& voxelID, G4double& stepLength, G4double &energyLoss);
inline void GetLengthAndInitialEnergy( G4double &preStepEnergy, G4int stepNo, G4int& voxelID, G4double& stepLength, G4double &initialEnergy);
// Calculates the energy splitting, and dumps it
// into theEnergies. Returns number of steps
G4int SplitEnergyInVolumes(const G4Step* aStep);
inline void SetNIterations( G4int niter );
void GetLastVoxelID(G4int& voxelID);
void GetFirstVoxelID(G4int& voxelID);
void GetVoxelID(G4int stepNo, G4int& voxelID);
inline void GetVoxelIDAndLength(G4int stepNo, G4int& voxelID, G4double& stepLength);
inline void GetLengthAndEnergyDeposited(G4int stepNo, G4int& voxelID, G4double& stepLength,
G4double& energyLoss);
inline void GetLengthAndInitialEnergy(G4double& preStepEnergy, G4int stepNo, G4int& voxelID,
G4double& stepLength, G4double& initialEnergy);
inline G4Material* GetVoxelMaterial( G4int stepNo );
inline void SetNIterations(G4int niter);
private:
void GetStepLength( G4int stepNo, G4double& stepLength );
inline G4Material* GetVoxelMaterial(G4int stepNo);
void GetPhantomParam(G4bool mustExist);
G4bool IsPhantomVolume( G4VPhysicalVolume* pv );
private:
void GetStepLength(G4int stepNo, G4double& stepLength);
G4EnergyLossForExtrapolator* theElossExt;
G4int theNIterations;
void GetPhantomParam(G4bool mustExist);
G4bool IsPhantomVolume(G4VPhysicalVolume* pv);
std::vector<G4double> theEnergies;
G4EnergyLossForExtrapolator* theElossExt;
G4PhantomParameterisation* thePhantomParam;
G4int theNIterations;
std::vector<G4double> theEnergies;
G4PhantomParameterisation* thePhantomParam;
};
#include "G4EnergySplitter.icc"
@@ -23,47 +23,51 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#include "G4UIcommand.hh"
#include "G4PhantomParameterisation.hh"
#include "G4UIcommand.hh"
//-----------------------------------------------------------------------
inline void G4EnergySplitter::GetVoxelIDAndLength( G4int stepNo, G4int& voxelID, G4double& stepLength )
inline void G4EnergySplitter::GetVoxelIDAndLength(G4int stepNo, G4int& voxelID,
G4double& stepLength)
{
GetVoxelID( stepNo, voxelID );
GetStepLength( stepNo, stepLength);
GetVoxelID(stepNo, voxelID);
GetStepLength(stepNo, stepLength);
}
//-----------------------------------------------------------------------
inline void G4EnergySplitter::GetLengthAndEnergyDeposited( G4int stepNo, G4int& voxelID, G4double& stepLength, G4double &energyLoss)
inline void G4EnergySplitter::GetLengthAndEnergyDeposited(G4int stepNo, G4int& voxelID,
G4double& stepLength,
G4double& energyLoss)
{
GetVoxelIDAndLength( stepNo, voxelID, stepLength );
GetVoxelIDAndLength(stepNo, voxelID, stepLength);
energyLoss = theEnergies[stepNo];
}
//-----------------------------------------------------------------------
inline void G4EnergySplitter::GetLengthAndInitialEnergy( G4double &preStepEnergy, G4int stepNo, G4int& voxelID, G4double& stepLength, G4double &initialEnergy)
inline void G4EnergySplitter::GetLengthAndInitialEnergy(G4double& preStepEnergy, G4int stepNo,
G4int& voxelID, G4double& stepLength,
G4double& initialEnergy)
{
GetVoxelIDAndLength( stepNo, voxelID, stepLength );
GetVoxelIDAndLength(stepNo, voxelID, stepLength);
initialEnergy = preStepEnergy;
for( G4int ii = 0; ii < stepNo; ii++ ){
for (G4int ii = 0; ii < stepNo; ii++) {
initialEnergy -= theEnergies[stepNo];
}
}
//-----------------------------------------------------------------------
inline void G4EnergySplitter::SetNIterations( G4int niter )
inline void G4EnergySplitter::SetNIterations(G4int niter)
{
theNIterations = niter;
}
//-----------------------------------------------------------------------
inline G4Material* G4EnergySplitter::GetVoxelMaterial( G4int stepNo )
inline G4Material* G4EnergySplitter::GetVoxelMaterial(G4int stepNo)
{
if( !thePhantomParam ) GetPhantomParam(TRUE);
if (thePhantomParam == nullptr) GetPhantomParam(true);
G4int voxelID;
GetVoxelID( stepNo, voxelID );
return thePhantomParam->GetMaterial( voxelID );
GetVoxelID(stepNo, voxelID);
return thePhantomParam->GetMaterial(voxelID);
}