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
@@ -23,34 +23,23 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4AdjointCrossSurfChecker
//
/////////////////////////////////////////////////////////////////////////////////
// Class Name: G4AdjointCrossSurfChecker
// Author: L. Desorgher
// Organisation: SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
/////////////////////////////////////////////////////////////////////////////////
//
// CHANGE HISTORY
// --------------
// ChangeHistory:
// 15 January 2007 creation by L. Desorgher
// - 01/11/2009 Some cleaning and adding of documentation for the
// first Release in the Geant4 toolkit, L. Desorgher
//
//-------------------------------------------------------------
// Documentation:
// This class is responsible for checking the crossing of a surface
// that could be the external boundary of a volume or the external
// surface of a sphere.
// It is used to check if an adjoint particle reaches the external
// surface or reenter the sensitive region delimited by the adjoint
// source.
// Class Description:
//
// This class is responsible for checking the crossing of a surface
// that could be the external boundary of a volume or the external
// surface of a sphere.
// It is used to check if an adjoint particle reaches the external
// surface or reenter the sensitive region delimited by the adjoint
// source.
#ifndef G4AdjointCrossSurfChecker_h
#define G4AdjointCrossSurfChecker_h 1
// Author: L. Desorgher, SpaceIT GmbH - 15 January 2007
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
//---------------------------------------------------------------------
#ifndef G4AdjointCrossSurfChecker_hh
#define G4AdjointCrossSurfChecker_hh 1
#include "globals.hh"
#include "G4ThreeVector.hh"
@@ -58,49 +47,92 @@
class G4Step;
class G4AdjointCrossSurfChecker
{
public:
public:
static G4AdjointCrossSurfChecker* GetInstance();
static G4AdjointCrossSurfChecker* GetInstance();
public:
G4bool CrossingASphere(const G4Step* aStep,G4double sphere_radius, G4ThreeVector sphere_center,G4ThreeVector& crossing_pos, G4double& cos_to_surface, G4bool& GoingIn);
G4bool GoingInOrOutOfaVolume(const G4Step* aStep,const G4String& volume_name, G4double& cos_to_surface, G4bool& GoingIn);
G4bool GoingInOrOutOfaVolumeByExtSurface(const G4Step* aStep,const G4String& volume_name,const G4String& mother_log_vol_name, G4double& cos_to_surface, G4bool& GoingIn);
G4bool CrossingASphere(const G4Step* aStep,
G4double sphere_radius,
G4ThreeVector sphere_center,
G4ThreeVector& cross_pos,
G4double& cos_to_surface,
G4bool& GoingIn);
G4bool CrossingAGivenRegisteredSurface(const G4Step* aStep,const G4String& surface_name,G4ThreeVector& crossing_pos, G4double& cos_to_surface, G4bool& GoingIn);
G4bool CrossingAGivenRegisteredSurface(const G4Step* aStep, int ind,G4ThreeVector& crossing_pos, G4double& cos_to_surface, G4bool& GoingIn);
G4bool CrossingOneOfTheRegisteredSurface(const G4Step* aStep,G4String& surface_name,G4ThreeVector& crossing_pos,G4double& cos_to_surface, G4bool& GoingIn);
G4bool CrossingAnInterfaceBetweenTwoVolumes(const G4Step* aStep,const G4String& vol1_name,const G4String& vol2_name,G4ThreeVector& crossing_pos, G4double& cos_to_surface, G4bool& GoingIn);
G4bool AddaSphericalSurface(const G4String& SurfaceName, G4double radius, G4ThreeVector pos,G4double& area);
G4bool AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(const G4String& SurfaceName, G4double radius, const G4String& volume_name, G4ThreeVector& center, G4double& area);
G4bool AddanExtSurfaceOfAvolume(const G4String& SurfaceName,const G4String& volume_name,G4double& area);
G4bool AddanInterfaceBetweenTwoVolumes(const G4String& SurfaceName, const G4String& volume_name1, const G4String& volume_name2,G4double& area);
void ClearListOfSelectedSurface();
private:
G4AdjointCrossSurfChecker();
~G4AdjointCrossSurfChecker();
G4int FindRegisteredSurface(const G4String& name);
private:
static G4ThreadLocal G4AdjointCrossSurfChecker* instance;
std::vector<G4String> ListOfSurfaceName;
std::vector<G4String> ListOfSurfaceType;
std::vector<G4double> ListOfSphereRadius;
std::vector<G4ThreeVector> ListOfSphereCenter;
std::vector<G4String> ListOfVol1Name;
std::vector<G4String> ListOfVol2Name;
std::vector<G4double> AreaOfSurface;
G4bool GoingInOrOutOfaVolume(const G4Step* aStep,
const G4String& volume_name,
G4double& cos_to_surface,
G4bool& GoingIn);
G4bool GoingInOrOutOfaVolumeByExtSurface(const G4Step* aStep,
const G4String& volume_name,
const G4String& mother_lvol_name,
G4double& cos_to_surface,
G4bool& GoingIn);
G4bool CrossingAGivenRegisteredSurface(const G4Step* aStep,
const G4String& surface_name,
G4ThreeVector& cross_pos,
G4double& cos_to_surface,
G4bool& GoingIn);
G4bool CrossingAGivenRegisteredSurface(const G4Step* aStep,
G4int ind,
G4ThreeVector& cross_pos,
G4double& cos_to_surface,
G4bool& GoingIn);
G4bool CrossingOneOfTheRegisteredSurface(const G4Step* aStep,
G4String& surface_name,
G4ThreeVector& cross_pos,
G4double& cos_to_surface,
G4bool& GoingIn);
G4bool CrossingAnInterfaceBetweenTwoVolumes(const G4Step* aStep,
const G4String& vol1_name,
const G4String& vol2_name,
G4ThreeVector& cross_pos,
G4double& cos_to_surface,
G4bool& GoingIn);
G4bool AddaSphericalSurface(const G4String& SurfaceName,
G4double radius,
G4ThreeVector pos,
G4double& area);
G4bool AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(
const G4String& SurfaceName,
G4double radius,
const G4String& volume_name,
G4ThreeVector& center,
G4double& area);
G4bool AddanExtSurfaceOfAvolume(const G4String& SurfaceName,
const G4String& volume_name,
G4double& area);
G4bool AddanInterfaceBetweenTwoVolumes(const G4String& SurfaceName,
const G4String& volume_name1,
const G4String& volume_name2,
G4double& area);
void ClearListOfSelectedSurface();
private:
G4AdjointCrossSurfChecker();
~G4AdjointCrossSurfChecker();
G4int FindRegisteredSurface(const G4String& name);
private:
static G4ThreadLocal G4AdjointCrossSurfChecker* instance;
std::vector<G4String> ListOfSurfaceName;
std::vector<G4String> ListOfSurfaceType;
std::vector<G4double> ListOfSphereRadius;
std::vector<G4ThreeVector> ListOfSphereCenter;
std::vector<G4String> ListOfVol1Name;
std::vector<G4String> ListOfVol2Name;
std::vector<G4double> AreaOfSurface;
};
#endif
@@ -23,38 +23,34 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4AdjointSteppingAction
//
/////////////////////////////////////////////////////////////////////////////////
// Class Name: G4AdjointSteppingAction
// Author: L. Desorgher
// Contract: ESA contract 21435/08/NL/AT
// Organisation: SpaceIT GmbH
// Customer: ESA/ESTEC
/////////////////////////////////////////////////////////////////////////////////
//
// CHANGE HISTORY
// --------------
// ChangeHistory:
// -15/01/2007 Creation by L. Desorgher
// -01/11/2009 Some cleaning and adding of documentation for the first Release in the Geant4 toolkit, L. Desorgher
// -04/11/2009 Adding the possibility to use user stepping action, L. Desorgher
// -20/11/2009 Correct the stop of adjoint particles tracking when it reenters the adjoint source.
//
//
//-------------------------------------------------------------
// Documentation:
// Stepping action used in the adjoint simulation.
// It is responsible to stop the adjoint tracking phase when:
// -a)The adjoint track reaches the external surface.
// -b)The being tracked adjoint dynamic particle get an energy higher than the maximum energy of the external source.
// -c)The adjoint track enters the volume delimited by the adjoint source.
// In the case a) the info (energy,weight,...) of the adjoint dynamic particle associated to the track
// when crossing the external source is registered and in the next event a forward primary is generated. In the other cases b) and c)
// The next generated fwd particle is killed before being tracked and the next tracking of an adjoint particle is started directly.
// Class description:
//
// Stepping action used in the adjoint simulation.
// It is responsible to stop the adjoint tracking phase when:
// a) The adjoint track reaches the external surface.
// b) The being tracked adjoint dynamic particle get an energy higher than
// the maximum energy of the external source.
// c) The adjoint track enters the volume delimited by the adjoint source.
// In the case a) the info (energy,weight,...) of the adjoint dynamic particle
// associated to the track when crossing the external source is registered and
// in the next event a forward primary is generated.
// In the other cases b) and c) the next generated fwd particle is killed
// before being tracked and the next tracking of an adjoint particle is
// started directly.
#ifndef G4AdjointSteppingAction_h
#define G4AdjointSteppingAction_h 1
// Author: L. Desorgher, SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// History:
// - 15/01/2007 L.Desorgher, created.
// - 04/11/2009 L.Desorgher, added possibility to use user stepping action.
// - 20/11/2009 L.Desorgher, corrected stop of adjoint particles tracking
// when reentering the adjoint source.
//---------------------------------------------------------------------
#ifndef G4AdjointSteppingAction_hh
#define G4AdjointSteppingAction_hh 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
@@ -63,52 +59,62 @@
class G4AdjointCrossSurfChecker;
class G4ParticleDefinition;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4AdjointSteppingAction : public G4UserSteppingAction
{
public:
G4AdjointSteppingAction();
~G4AdjointSteppingAction();
void UserSteppingAction(const G4Step*);
inline void SetExtSourceEMax(G4double Emax){ext_sourceEMax=Emax;}
inline void SetStartEvent(G4bool aBool){start_event =aBool;}
inline G4bool GetDidAdjParticleReachTheExtSource(){return did_adj_part_reach_ext_source;}
inline G4ThreeVector GetLastMomentum(){return last_momentum;}
inline G4ThreeVector GetLastPosition(){return last_pos;}
inline G4double GetLastEkin(){return last_ekin;}
inline G4double GetLastWeight(){return last_weight;}
inline void SetPrimWeight(G4double weight){prim_weight=weight;}
inline G4ParticleDefinition* GetLastPartDef(){return last_part_def;}
inline void SetUserAdjointSteppingAction( G4UserSteppingAction* anAction) {
theUserAdjointSteppingAction = anAction;}
inline void SetUserForwardSteppingAction( G4UserSteppingAction* anAction) {
theUserFwdSteppingAction = anAction;}
inline void SetAdjointTrackingMode(G4bool aBool){is_adjoint_tracking_mode =aBool;}
inline void SetExtSourceEMax(G4double Emax)
{ ext_sourceEMax = Emax; }
inline void SetStartEvent(G4bool aBool)
{ start_event = aBool; }
inline G4bool GetDidAdjParticleReachTheExtSource()
{ return did_adj_part_reach_ext_source; }
inline G4ThreeVector GetLastMomentum()
{ return last_momentum; }
inline G4ThreeVector GetLastPosition()
{ return last_pos; }
inline G4double GetLastEkin()
{ return last_ekin; }
inline G4double GetLastWeight()
{ return last_weight; }
inline void SetPrimWeight(G4double weight)
{ prim_weight = weight; }
inline G4ParticleDefinition* GetLastPartDef()
{ return last_part_def; }
inline void SetUserAdjointSteppingAction(G4UserSteppingAction* anAction)
{ theUserAdjointSteppingAction = anAction; }
inline void SetUserForwardSteppingAction(G4UserSteppingAction* anAction)
{ theUserFwdSteppingAction = anAction; }
inline void SetAdjointTrackingMode(G4bool aBool)
{ is_adjoint_tracking_mode = aBool; }
inline void ResetDidOneAdjPartReachExtSourceDuringEvent()
{did_one_adj_part_reach_ext_source_during_event =false;}
inline void SetAdjointGeantinoTrackingMode(G4bool aBool){is_adjoint_geantino_tracking_mode =aBool;}
{ did_one_adj_part_reach_ext_source_during_event = false; }
inline void SetAdjointGeantinoTrackingMode(G4bool aBool)
{ is_adjoint_geantino_tracking_mode = aBool; }
private:
G4double ext_sourceEMax;
G4AdjointCrossSurfChecker* theG4AdjointCrossSurfChecker;
G4bool start_event;
G4double ext_sourceEMax = 0.0;
G4AdjointCrossSurfChecker* theG4AdjointCrossSurfChecker = nullptr;
G4bool did_adj_part_reach_ext_source;
G4bool did_one_adj_part_reach_ext_source_during_event;
G4ThreeVector last_momentum, last_pos;
G4double last_ekin;
G4double last_weight ;
G4double prim_weight ;
G4ParticleDefinition* last_part_def;
G4UserSteppingAction* theUserAdjointSteppingAction;
G4UserSteppingAction* theUserFwdSteppingAction;
G4bool is_adjoint_tracking_mode;
G4bool is_adjoint_geantino_tracking_mode;
G4double last_ekin = 0.0;
G4double last_weight = 0.0;
G4double prim_weight = 1.0;
G4ParticleDefinition* last_part_def = nullptr;
G4UserSteppingAction* theUserAdjointSteppingAction = nullptr;
G4UserSteppingAction* theUserFwdSteppingAction = nullptr;
G4bool start_event = false;
G4bool did_adj_part_reach_ext_source = false;
G4bool did_one_adj_part_reach_ext_source_during_event = false;
G4bool is_adjoint_tracking_mode = false;
G4bool is_adjoint_geantino_tracking_mode = false;
};
#endif
#endif
@@ -23,97 +23,96 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4AdjointTrackingAction
//
// Class description:
//
//
//---------------------------------------------------------------
//
// G4AdjointTrackingAction.hh
//
// class description:
// This class represents actions taken place at the
// the start/end point of processing one track during an adjoint simulation
//
//---------------------------------------------------------------
// This class represents actions taken place at the start/end point
// of processing one track during an adjoint simulation
// Author: L. Desorgher, SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// --------------------------------------------------------------------
#ifndef G4AdjointTrackingAction_hh
#define G4AdjointTrackingAction_hh 1
#ifndef G4AdjointTrackingAction_h
#define G4AdjointTrackingAction_h 1
#include "globals.hh"
#include "G4UserTrackingAction.hh"
#include "G4ThreeVector.hh"
#include <vector>
class G4AdjointSteppingAction;
class G4Track;
class G4ParticleDefinition;
///////////////////////////
class G4AdjointTrackingAction : public G4UserTrackingAction
///////////////////////////
{
//--------
public: // with description
//--------
public:
// Constructor & Destructor
G4AdjointTrackingAction(G4AdjointSteppingAction* anAction);
virtual ~G4AdjointTrackingAction();
G4AdjointTrackingAction(G4AdjointSteppingAction* anAction);
virtual ~G4AdjointTrackingAction();
// Member functions
virtual void PreUserTrackingAction(const G4Track*);
virtual void PostUserTrackingAction(const G4Track*);
void RegisterAtEndOfAdjointTrack();
void ClearEndOfAdjointTrackInfoVectors();
virtual void PreUserTrackingAction(const G4Track*);
virtual void PostUserTrackingAction(const G4Track*);
void RegisterAtEndOfAdjointTrack();
void ClearEndOfAdjointTrackInfoVectors();
//inline methods
inline void SetUserForwardTrackingAction(G4UserTrackingAction* anAction){
theUserFwdTrackingAction = anAction;}
inline G4ThreeVector GetPositionAtEndOfLastAdjointTrack(size_t i=0){ return last_pos_vec[i];}
inline G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(size_t i=0){ return last_direction_vec[i];}
inline G4double GetEkinAtEndOfLastAdjointTrack(size_t i=0){ return last_ekin_vec[i];}
inline G4double GetEkinNucAtEndOfLastAdjointTrack(size_t i=0){ return last_ekin_nuc_vec[i];}
inline G4double GetWeightAtEndOfLastAdjointTrack(size_t i=0){return last_weight_vec[i];}
inline G4double GetCosthAtEndOfLastAdjointTrack(size_t i=0){return last_cos_th_vec[i];}
inline const G4String& GetFwdParticleNameAtEndOfLastAdjointTrack(){return last_fwd_part_name;}
inline G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(size_t i=0){return last_fwd_part_PDGEncoding_vec[i];}
inline G4bool GetIsAdjointTrackingMode(){return is_adjoint_tracking_mode;}
inline G4int GetLastFwdParticleIndex(size_t i=0){
return last_fwd_part_index_vec[i];};
inline size_t GetNbOfAdointTracksReachingTheExternalSurface(){return last_pos_vec.size();}
inline void SetListOfPrimaryFwdParticles( std::vector<G4ParticleDefinition*>*
aListOfParticles){pListOfPrimaryFwdParticles=aListOfParticles;}
inline void SetUserForwardTrackingAction(G4UserTrackingAction* anAction)
{ theUserFwdTrackingAction = anAction; }
inline G4ThreeVector GetPositionAtEndOfLastAdjointTrack(std::size_t i=0)
{ return last_pos_vec[i]; }
inline G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(std::size_t i=0)
{ return last_direction_vec[i]; }
inline G4double GetEkinAtEndOfLastAdjointTrack(std::size_t i=0)
{ return last_ekin_vec[i]; }
inline G4double GetEkinNucAtEndOfLastAdjointTrack(std::size_t i=0)
{ return last_ekin_nuc_vec[i]; }
inline G4double GetWeightAtEndOfLastAdjointTrack(std::size_t i=0)
{ return last_weight_vec[i]; }
inline G4double GetCosthAtEndOfLastAdjointTrack(std::size_t i=0)
{ return last_cos_th_vec[i]; }
inline const G4String& GetFwdParticleNameAtEndOfLastAdjointTrack()
{ return last_fwd_part_name; }
inline G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(std::size_t i=0)
{ return last_fwd_part_PDGEncoding_vec[i]; }
inline G4bool GetIsAdjointTrackingMode()
{ return is_adjoint_tracking_mode; }
inline G4int GetLastFwdParticleIndex(std::size_t i=0)
{ return last_fwd_part_index_vec[i]; }
inline std::size_t GetNbOfAdointTracksReachingTheExternalSurface()
{ return last_pos_vec.size(); }
inline void SetListOfPrimaryFwdParticles(std::vector<G4ParticleDefinition*>* aListOfParticles)
{ pListOfPrimaryFwdParticles = aListOfParticles; }
private:
private:
G4AdjointSteppingAction* theAdjointSteppingAction;
G4UserTrackingAction* theUserFwdTrackingAction;
G4bool is_adjoint_tracking_mode;
G4AdjointSteppingAction* theAdjointSteppingAction = nullptr;
G4UserTrackingAction* theUserFwdTrackingAction = nullptr;
G4bool is_adjoint_tracking_mode = false;
// Adjoint particle information on the external surface
// ----------------------------------------------------
G4ThreeVector last_pos;
G4ThreeVector last_direction;
G4double last_ekin = 0.0, last_ekin_nuc = 0.0;
// last_ekin_nuc=last_ekin/nuc, nuc is 1 if not a nucleus
G4double last_cos_th = 0.0;
G4String last_fwd_part_name;
G4int last_fwd_part_PDGEncoding = 0;
G4double last_weight = 0.0;
G4int last_fwd_part_index = 0;
std::vector<G4ParticleDefinition*>* pListOfPrimaryFwdParticles = nullptr;
//adjoint particle information on the external surface
//-----------------------------
G4ThreeVector last_pos;
G4ThreeVector last_direction;
G4double last_ekin,last_ekin_nuc; //last_ekin_nuc=last_ekin/nuc, nuc is 1 if not a nucleus
G4double last_cos_th;
G4String last_fwd_part_name;
G4int last_fwd_part_PDGEncoding;
G4double last_weight;
G4int last_fwd_part_index;
std::vector<G4ParticleDefinition*>* pListOfPrimaryFwdParticles;
std::vector<G4ThreeVector> last_pos_vec;
std::vector<G4ThreeVector> last_direction_vec;
std::vector<G4double> last_ekin_vec;
std::vector<G4double> last_ekin_nuc_vec;
std::vector<G4double> last_cos_th_vec;
std::vector<G4double> last_weight_vec;
std::vector<G4int> last_fwd_part_PDGEncoding_vec;
std::vector<G4int> last_fwd_part_index_vec;
std::vector<G4ThreeVector> last_pos_vec;
std::vector<G4ThreeVector> last_direction_vec;
std::vector<G4double> last_ekin_vec;
std::vector<G4double> last_ekin_nuc_vec;
std::vector<G4double> last_cos_th_vec;
std::vector<G4double> last_weight_vec;
std::vector<G4int> last_fwd_part_PDGEncoding_vec;
std::vector<G4int> last_fwd_part_index_vec;
};
#endif
@@ -23,50 +23,46 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4MultiSteppingAction
//
// Class description:
//
//---------------------------------------------------------------
// This class extends G4UserSteppingAction and allows multiple user-defined
// tracking actions to be used in the same job.
// The class is a vector of user-defined tracking actions; it owns and manages
// the dependent user-actions.
//
// G4MultiSteppingAction.hh
//
// Created on: Jan 17, 2016
// Author: adotti
//
//
// class description:
// This class extends G4UserSteppingAction and allows multiple
// user-defined tracking actions to be used in the same job.
// The class is a vector of user-defined tracking actions.
// This class owns and manages the dependent user-actions.
// Usage:
// There is no need to explicitly use this class as long as the
// user actions are set via G4UserActionInitialization::SetUserAction
// that can be called several times. Explicitly this is what is happening:
// In user-defined action initialization:
// G4MultiSteppingAction* action = new G4MultiSteppingAction;
// action->push_back( G4UserSteppingActionUPtr( new MyUserSteppingAction );
// [... add as many as needed ...]
// SetUserAction( action );
// ---------------------------------------------------------------
//
// There is no need to explicitly use this class as long as the user actions
// are set via G4UserActionInitialization::SetUserAction(), that can be
// called several times. Explicitly this is what happens:
// In user-defined action initialization:
// G4MultiSteppingAction* action = new G4MultiSteppingAction;
// action->push_back( G4UserSteppingActionUPtr( new MyUserSteppingAction );
// [... add as many as needed ...]
// SetUserAction( action );
#ifndef G4MULTISTEPPINGACTION_HH_
#define G4MULTISTEPPINGACTION_HH_
// Author: Andrea Dotti, SLAC - 17 January 2016
// --------------------------------------------------------------------
#ifndef G4MULTISTEPPINGACTION_HH
#define G4MULTISTEPPINGACTION_HH
#include "G4UserSteppingAction.hh"
#include <vector>
#include <memory>
using G4UserSteppingActionUPtr=std::unique_ptr<G4UserSteppingAction>;
using G4UserSteppingActionVector=std::vector<G4UserSteppingActionUPtr>;
using G4UserSteppingActionUPtr = std::unique_ptr<G4UserSteppingAction>;
using G4UserSteppingActionVector = std::vector<G4UserSteppingActionUPtr>;
class G4MultiSteppingAction : public G4UserSteppingAction , public G4UserSteppingActionVector
class G4MultiSteppingAction : public G4UserSteppingAction,
public G4UserSteppingActionVector
{
public:
G4MultiSteppingAction() = default;
virtual ~G4MultiSteppingAction() override = default;
virtual void UserSteppingAction(const G4Step*) override;
virtual void SetSteppingManagerPointer(G4SteppingManager* pValue) override;
public:
G4MultiSteppingAction() = default;
virtual ~G4MultiSteppingAction() override = default;
virtual void UserSteppingAction(const G4Step*) override;
virtual void SetSteppingManagerPointer(G4SteppingManager* pVal) override;
};
#endif /* SOURCE_TRACKING_INCLUDE_G4MULTISTEPPINGACTION_HH_ */
#endif
@@ -23,34 +23,29 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4MultiTrackingAction
//
// Class description:
//
//---------------------------------------------------------------
// This class extends G4UserTrackingAction and allows multiple user-defined
// tracking actions to be used in the same job.
// The class is a vector of user-defined tracking actions; it owns and manages
// the dependent user-actions.
//
// G4MultiTrackingAction.hh
//
// Created on: Jan 17, 2016
// Author: adotti
//
//
// class description:
// This class extends G4UserTrackingAction and allows multiple
// user-defined tracking actions to be used in the same job.
// The class is a vector of user-defined tracking actions.
// This class owns and manages the dependent user-actions.
// Usage:
// There is no need to explicitly use this class as long as the
// user actions are set via G4UserActionInitialization::SetUserAction
// that can be called several times. Explicitly this is what is happening:
// In user-defined action initialization:
// G4MultiTrackingAction* action = new G4MultiTrackingAction;
// action->push_back( G4UserTrackingActionUPtr( new MyUserTrackingAction );
// [... add as many as needed ...]
// SetUserAction( action );
// ---------------------------------------------------------------
// There is no need to explicitly use this class as long as the user actions
// are set via G4UserActionInitialization::SetUserAction(), that can be
// called several times. Explicitly this is what happens:
// In user-defined action initialization:
// G4MultiTrackingAction* action = new G4MultiTrackingAction;
// action->push_back( G4UserTrackingActionUPtr( new MyUserTrackingAction );
// [... add as many as needed ...]
// SetUserAction( action );
#ifndef G4MULTITRACKINGACTION_HH_
#define G4MULTITRACKINGACTION_HH_
// Author: Andrea Dotti, SLAC - 17 January 2016
// --------------------------------------------------------------------
#ifndef G4MULTITRACKINGACTION_HH
#define G4MULTITRACKINGACTION_HH
#include "G4UserTrackingAction.hh"
#include <vector>
@@ -59,14 +54,16 @@
using G4UserTrackingActionUPtr=std::unique_ptr<G4UserTrackingAction>;
using G4UserTrackingActionVector=std::vector<G4UserTrackingActionUPtr>;
class G4MultiTrackingAction : public G4UserTrackingAction , public G4UserTrackingActionVector
class G4MultiTrackingAction : public G4UserTrackingAction,
public G4UserTrackingActionVector
{
public:
G4MultiTrackingAction() = default;
virtual ~G4MultiTrackingAction() override = default;
virtual void SetTrackingManagerPointer(G4TrackingManager* pValue) override;
virtual void PreUserTrackingAction(const G4Track*) override;
virtual void PostUserTrackingAction(const G4Track*) override;
public:
G4MultiTrackingAction() = default;
virtual ~G4MultiTrackingAction() override = default;
virtual void SetTrackingManagerPointer(G4TrackingManager* pVal) override;
virtual void PreUserTrackingAction(const G4Track*) override;
virtual void PostUserTrackingAction(const G4Track*) override;
};
#endif /* G4MULTITRACKINGACTION_HH_ */
#endif
+39 -22
View File
@@ -25,23 +25,23 @@
//
// G4RichTrajectory
//
// class description:
// Class description:
//
// This class extends G4Trajectory, which includes the following:
// 1) List of trajectory points which compose the trajectory,
// 2) static information of particle which generated the
// trajectory,
// 3) trackID and parent particle ID of the trajectory.
// The extended information, only publicly accessible through AttValues,
// includes:
// 4) physical volume and next physical volume;
// 5) creator process;
// ...and much more.
// This class extends G4Trajectory, which includes the following:
// 1) List of trajectory points which compose the trajectory,
// 2) static information of particle which generated the
// trajectory,
// 3) trackID and parent particle ID of the trajectory.
// The extended information, only publicly accessible through AttValues,
// includes:
// 4) physical volume and next physical volume;
// 5) creator process;
// ...and much more.
// Contact:
// Questions and comments on G4Trajectory should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Makoto Asai (e-mail: asai@kekvax.kek.jp)
// Makoto Asai (e-mail: asai@slac.stanford.edu)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
// and on the extended code to:
// John Allison (e-mail: John.Allison@manchester.ac.uk)
@@ -58,15 +58,17 @@ class G4RichTrajectory : public G4Trajectory
{
using RichTrajectoryPointsContainer = std::vector<G4VTrajectoryPoint*>;
public: // with description
public:
// Constructors/destructor
//
G4RichTrajectory();
G4RichTrajectory(const G4Track* aTrack);
G4RichTrajectory(G4RichTrajectory &);
virtual ~G4RichTrajectory();
// Operators
//
G4RichTrajectory& operator= (const G4RichTrajectory &) = delete;
G4int operator == (const G4RichTrajectory& r) const { return (this==&r); }
@@ -74,37 +76,42 @@ class G4RichTrajectory : public G4Trajectory
inline void operator delete(void*);
// Other (virtual) member functions
//
void ShowTrajectory(std::ostream& os=G4cout) const;
void DrawTrajectory() const;
void AppendStep(const G4Step* aStep);
void MergeTrajectory(G4VTrajectory* secondTrajectory);
G4int GetPointEntries() const {return G4int(fpRichPointsContainer->size());}
G4VTrajectoryPoint* GetPoint(G4int i) const {return (*fpRichPointsContainer)[i];}
inline G4int GetPointEntries() const;
inline G4VTrajectoryPoint* GetPoint(G4int i) const;
// Get methods for HepRep style attributes
//
virtual const std::map<G4String, G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
private:
// Extended information (only publicly accessible through AttValues)...
RichTrajectoryPointsContainer* fpRichPointsContainer;
//
RichTrajectoryPointsContainer* fpRichPointsContainer = nullptr;
G4TouchableHandle fpInitialVolume;
G4TouchableHandle fpInitialNextVolume;
const G4VProcess* fpCreatorProcess;
G4int fCreatorModelID;
const G4VProcess* fpCreatorProcess = nullptr;
G4int fCreatorModelID = 0;
G4TouchableHandle fpFinalVolume;
G4TouchableHandle fpFinalNextVolume;
const G4VProcess* fpEndingProcess;
G4double fFinalKineticEnergy;
const G4VProcess* fpEndingProcess = nullptr;
G4double fFinalKineticEnergy = 0.0;
};
extern G4TRACKING_DLL G4Allocator<G4RichTrajectory>*& aRichTrajectoryAllocator();
inline void* G4RichTrajectory::operator new(size_t)
{
if (!aRichTrajectoryAllocator())
{ aRichTrajectoryAllocator() = new G4Allocator<G4RichTrajectory>; }
if (aRichTrajectoryAllocator() == nullptr)
{
aRichTrajectoryAllocator() = new G4Allocator<G4RichTrajectory>;
}
return (void*)aRichTrajectoryAllocator()->MallocSingle();
}
@@ -113,4 +120,14 @@ inline void G4RichTrajectory::operator delete(void* aRichTrajectory)
aRichTrajectoryAllocator()->FreeSingle((G4RichTrajectory*)aRichTrajectory);
}
inline G4int G4RichTrajectory::GetPointEntries() const
{
return G4int(fpRichPointsContainer->size());
}
inline G4VTrajectoryPoint* G4RichTrajectory::GetPoint(G4int i) const
{
return (*fpRichPointsContainer)[i];
}
#endif
@@ -23,36 +23,31 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4RichTrajectoryPoint
//
// Class description:
//
//---------------------------------------------------------------
//
// G4RichTrajectoryPoint.hh
//
// class description:
// This class extends G4TrajectoryPoint.
// From G4Trajectory, the following information is included:
// 1) Position (end of step).
// The extended information, only publicly accessible through AttValues,
// includes:
// 2) Auxiliary points, as in G4SmoothTrajectory.
// 3) Total energy deposit.
// 4) Remaining energy.
// 5) Process defining end of step.
// 6) Global time (from start of event) at pre- amd post-step.
// ...and more.
//
// This class extends G4TrajectoryPoint.
// From G4Trajectory, the following information is included:
// 1) Position (end of step).
// The extended information, only publicly accessible through AttValues,
// includes:
// 2) Auxiliary points, as in G4SmoothTrajectory.
// 3) Total energy deposit.
// 4) Remaining energy.
// 5) Process defining end of step.
// 6) Global time (from start of event) at pre- amd post-step.
// ...and more.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Makoto Asai (e-mail: asai@kekvax.kek.jp)
// Makoto Asai (e-mail: asai@slac.stanford.edu)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
// and on the extended code to:
// John Allison (e-mail: John.Allison@manchester.ac.uk)
// Joseph Perl (e-mail: perl@slac.stanford.edu)
//
// ---------------------------------------------------------------
// --------------------------------------------------------------------
#ifndef G4RICHTRAJECTORYPOINT_HH
#define G4RICHTRAJECTORYPOINT_HH
@@ -71,64 +66,77 @@ class G4VProcess;
class G4RichTrajectoryPoint : public G4TrajectoryPoint
{
public: // without description
public: // without description
// Constructor/Destructor
G4RichTrajectoryPoint();
G4RichTrajectoryPoint(const G4Track*); // For first point.
G4RichTrajectoryPoint(const G4Step*); // For subsequent points.
G4RichTrajectoryPoint(const G4RichTrajectoryPoint &right);
virtual ~G4RichTrajectoryPoint();
// Constructors/Destructor
//
G4RichTrajectoryPoint();
G4RichTrajectoryPoint(const G4Track*); // For first point.
G4RichTrajectoryPoint(const G4Step*); // For subsequent points.
G4RichTrajectoryPoint(const G4RichTrajectoryPoint& right);
virtual ~G4RichTrajectoryPoint();
private:
G4RichTrajectoryPoint& operator= (const G4RichTrajectoryPoint&);
// Operators
//
G4RichTrajectoryPoint& operator= (const G4RichTrajectoryPoint&) = delete;
inline G4bool operator==(const G4RichTrajectoryPoint& right) const;
inline void *operator new(size_t);
inline void operator delete(void *aRichTrajectoryPoint);
public:
// Get/Set functions
//
inline const std::vector<G4ThreeVector>* GetAuxiliaryPoints() const;
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
// Get/Set functions
const std::vector<G4ThreeVector>* GetAuxiliaryPoints() const
{ return fpAuxiliaryPointVector; }
private:
// Operators
inline void *operator new(size_t);
inline void operator delete(void *aRichTrajectoryPoint);
inline G4bool operator==(const G4RichTrajectoryPoint& right) const
{ return (this==&right); }
// Get methods for HepRep style attributes
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
private:
// Extended member data
std::vector<G4ThreeVector>* fpAuxiliaryPointVector;
G4double fTotEDep;
G4double fRemainingEnergy;
const G4VProcess* fpProcess;
G4StepStatus fPreStepPointStatus;
G4StepStatus fPostStepPointStatus;
G4double fPreStepPointGlobalTime;
G4double fPostStepPointGlobalTime;
G4TouchableHandle fpPreStepPointVolume;
G4TouchableHandle fpPostStepPointVolume;
G4double fPreStepPointWeight;
G4double fPostStepPointWeight;
// Extended member data
//
std::vector<G4ThreeVector>* fpAuxiliaryPointVector = nullptr;
G4double fTotEDep = 0.0;
G4double fRemainingEnergy = 0.0;
const G4VProcess* fpProcess = nullptr;
G4StepStatus fPreStepPointStatus = fUndefined;
G4StepStatus fPostStepPointStatus = fUndefined;
G4double fPreStepPointGlobalTime = 0.0;
G4double fPostStepPointGlobalTime = 0.0;
G4TouchableHandle fpPreStepPointVolume;
G4TouchableHandle fpPostStepPointVolume;
G4double fPreStepPointWeight = 0.0;
G4double fPostStepPointWeight = 0.0;
};
extern G4TRACKING_DLL G4Allocator<G4RichTrajectoryPoint>*& aRichTrajectoryPointAllocator();
extern G4TRACKING_DLL
G4Allocator<G4RichTrajectoryPoint>*& aRichTrajectoryPointAllocator();
inline void* G4RichTrajectoryPoint::operator new(size_t)
inline void*
G4RichTrajectoryPoint::operator new(size_t)
{
if (!aRichTrajectoryPointAllocator())
{ aRichTrajectoryPointAllocator() = new G4Allocator<G4RichTrajectoryPoint>; }
if (aRichTrajectoryPointAllocator() == nullptr)
{
aRichTrajectoryPointAllocator() = new G4Allocator<G4RichTrajectoryPoint>;
}
return (void *) aRichTrajectoryPointAllocator()->MallocSingle();
}
inline void G4RichTrajectoryPoint::operator delete(void *aRichTrajectoryPoint)
inline void
G4RichTrajectoryPoint::operator delete(void *aRichTrajectoryPoint)
{
aRichTrajectoryPointAllocator()->FreeSingle
((G4RichTrajectoryPoint *) aRichTrajectoryPoint);
}
inline G4bool
G4RichTrajectoryPoint::operator==(const G4RichTrajectoryPoint& r) const
{
return (this==&r);
}
inline const std::vector<G4ThreeVector>*
G4RichTrajectoryPoint::GetAuxiliaryPoints() const
{
return fpAuxiliaryPointVector;
}
#endif
+79 -67
View File
@@ -25,17 +25,22 @@
//
// G4SmoothTrajectory
//
// class description:
// Class description:
//
// This class represents the trajectory of a particle tracked.
// It includes information of
// 1) List of trajectory points which compose the trajectory,
// 2) static information of particle which generated the
// trajectory,
// 3) trackID and parent particle ID of the trajectory,
// 4) Auxiliary points will be associated to G4SmoothTrajectoryPoint
// to assist drawing smoothly curved trajectory.
// This class represents the trajectory of a particle tracked.
// It includes information of
// 1) List of trajectory points which compose the trajectory,
// 2) static information of particle which generates the
// trajectory,
// 3) trackID and parent particle ID of the trajectory,
// 4) Auxiliary points will be associated to G4SmoothTrajectoryPoint
// to assist drawing smoothly curved trajectory.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Makoto Asai (e-mail: asai@slac.stanford.edu)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
// --------------------------------------------------------------------
#ifndef G4SmoothTrajectory_hh
#define G4SmoothTrajectory_hh 1
@@ -57,78 +62,80 @@ class G4Polyline;
class G4SmoothTrajectory : public G4VTrajectory
{
using G4TrajectoryPointContainer = std::vector<G4VTrajectoryPoint*>;
using TrajectoryPointContainer = std::vector<G4VTrajectoryPoint*>;
public:
//--------
public: // with description
//--------
// Constructors/Destructor
//
G4SmoothTrajectory();
G4SmoothTrajectory(const G4Track* aTrack);
G4SmoothTrajectory(G4SmoothTrajectory &);
virtual ~G4SmoothTrajectory();
// Constructor/Destructor
// Operators
//
G4SmoothTrajectory& operator= (const G4SmoothTrajectory&) = delete;
inline G4int operator == (const G4SmoothTrajectory& r) const;
inline void* operator new(size_t);
inline void operator delete(void*);
G4SmoothTrajectory();
G4SmoothTrajectory(const G4Track* aTrack);
G4SmoothTrajectory(G4SmoothTrajectory &);
virtual ~G4SmoothTrajectory();
// Get/Set functions
//
inline G4int GetTrackID() const
{ return fTrackID; }
inline G4int GetParentID() const
{ return fParentID; }
inline G4String GetParticleName() const
{ return ParticleName; }
inline G4double GetCharge() const
{ return PDGCharge; }
inline G4int GetPDGEncoding() const
{ return PDGEncoding; }
inline G4double GetInitialKineticEnergy() const
{ return initialKineticEnergy; }
inline G4ThreeVector GetInitialMomentum() const
{ return initialMomentum; }
// Operators
// Other member functions
//
virtual void ShowTrajectory(std::ostream& os=G4cout) const;
virtual void DrawTrajectory() const;
virtual void AppendStep(const G4Step* aStep);
virtual G4int GetPointEntries() const
{ return positionRecord->size(); }
virtual G4VTrajectoryPoint* GetPoint(G4int i) const
{ return (*positionRecord)[i]; }
virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
G4SmoothTrajectory& operator= (const G4SmoothTrajectory&) = delete;
G4int operator == (const G4SmoothTrajectory& r) const {return (this==&r);}
G4ParticleDefinition* GetParticleDefinition();
inline void* operator new(size_t);
inline void operator delete(void*);
// Get method for HEPRep style attributes
//
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
// Get/Set functions
inline G4int GetTrackID() const
{ return fTrackID; }
inline G4int GetParentID() const
{ return fParentID; }
inline G4String GetParticleName() const
{ return ParticleName; }
inline G4double GetCharge() const
{ return PDGCharge; }
inline G4int GetPDGEncoding() const
{ return PDGEncoding; }
inline G4double GetInitialKineticEnergy() const
{ return initialKineticEnergy; }
inline G4ThreeVector GetInitialMomentum() const
{ return initialMomentum; }
private:
// Other member functions
virtual void ShowTrajectory(std::ostream& os=G4cout) const;
virtual void DrawTrajectory() const;
virtual void AppendStep(const G4Step* aStep);
virtual int GetPointEntries() const { return positionRecord->size(); }
virtual G4VTrajectoryPoint* GetPoint(G4int i) const { return (*positionRecord)[i]; }
virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
G4ParticleDefinition* GetParticleDefinition();
// Get method for HEPRep style attributes
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
//---------
private:
//---------
TrajectoryPointContainer* positionRecord;
G4int fTrackID;
G4int fParentID;
G4int PDGEncoding;
G4double PDGCharge;
G4String ParticleName;
G4double initialKineticEnergy;
G4ThreeVector initialMomentum;
G4TrajectoryPointContainer* positionRecord = nullptr;
G4int fTrackID = 0;
G4int fParentID = 0;
G4int PDGEncoding = 0;
G4double PDGCharge = 0.0;
G4String ParticleName = "";
G4double initialKineticEnergy = 0.0;
G4ThreeVector initialMomentum;
};
extern G4TRACKING_DLL G4Allocator<G4SmoothTrajectory>*& aSmoothTrajectoryAllocator();
extern G4TRACKING_DLL
G4Allocator<G4SmoothTrajectory>*& aSmoothTrajectoryAllocator();
inline void* G4SmoothTrajectory::operator new(size_t)
{
if (!aSmoothTrajectoryAllocator())
{ aSmoothTrajectoryAllocator() = new G4Allocator<G4SmoothTrajectory>; }
if (aSmoothTrajectoryAllocator() == nullptr)
{
aSmoothTrajectoryAllocator() = new G4Allocator<G4SmoothTrajectory>;
}
return (void*)aSmoothTrajectoryAllocator()->MallocSingle();
}
@@ -137,4 +144,9 @@ inline void G4SmoothTrajectory::operator delete(void* aTrajectory)
aSmoothTrajectoryAllocator()->FreeSingle((G4SmoothTrajectory*)aTrajectory);
}
inline G4int G4SmoothTrajectory::operator== (const G4SmoothTrajectory& r) const
{
return (this==&r);
}
#endif
@@ -23,19 +23,20 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4SmoothTrajectoryPoint
//
// Class description:
//
//---------------------------------------------------------------
//
// G4SmoothTrajectoryPoint.hh
//
// class description:
// This class contains position and auxiliary points of a trajectory point.
//
// ---------------------------------------------------------------
// This class contains position and auxiliary points of a trajectory point.
#ifndef G4SmoothTrajectoryPoint_h
#define G4SmoothTrajectoryPoint_h 1
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Makoto Asai (e-mail: asai@slac.stanford.edu)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
// ---------------------------------------------------------------
#ifndef G4SmoothTrajectoryPoint_hh
#define G4SmoothTrajectoryPoint_hh 1
#include "trkgdefs.hh"
#include "G4VTrajectoryPoint.hh"
@@ -43,66 +44,71 @@
#include "G4ThreeVector.hh" // Include from 'geometry'
#include "G4Allocator.hh" // Include from 'particle+matter'
class G4SmoothTrajectoryPoint : public G4VTrajectoryPoint
{
//--------
public: // without description
//--------
public:
// Constructor/Destructor
G4SmoothTrajectoryPoint();
// No auxiliary points setter, so must set the points in the
// constructor already
G4SmoothTrajectoryPoint(G4ThreeVector pos,
std::vector<G4ThreeVector>* auxiliaryPoints);
G4SmoothTrajectoryPoint(G4ThreeVector pos);
G4SmoothTrajectoryPoint(const G4SmoothTrajectoryPoint &right);
virtual ~G4SmoothTrajectoryPoint();
G4SmoothTrajectoryPoint();
G4SmoothTrajectoryPoint(G4ThreeVector pos,
std::vector<G4ThreeVector>* auxiliaryPoints);
// No auxiliary points setter, so must set the points in the
// constructor already
private:
G4SmoothTrajectoryPoint& operator= (const G4SmoothTrajectoryPoint&);
G4SmoothTrajectoryPoint(G4ThreeVector pos);
G4SmoothTrajectoryPoint(const G4SmoothTrajectoryPoint& right);
virtual ~G4SmoothTrajectoryPoint();
public:
G4SmoothTrajectoryPoint& operator= (const G4SmoothTrajectoryPoint&)= delete;
// Operators
inline void *operator new(size_t);
inline void operator delete(void *aTrajectoryPoint);
inline G4bool operator==(const G4SmoothTrajectoryPoint& right) const
{ return (this==&right); };
// Operators
//
inline void* operator new(size_t);
inline void operator delete(void* aTrajectoryPoint);
inline G4bool operator==(const G4SmoothTrajectoryPoint& right) const;
// Get/Set functions
inline const G4ThreeVector GetPosition() const
{ return fPosition; }
inline const std::vector<G4ThreeVector>* GetAuxiliaryPoints() const
{ return fAuxiliaryPointVector; }
// Get/Set functions
//
inline const G4ThreeVector GetPosition() const
{ return fPosition; }
inline const std::vector<G4ThreeVector>* GetAuxiliaryPoints() const
{ return fAuxiliaryPointVector; }
// Get method for HEPRep style attributes
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
// Get method for HEPRep style attributes
//
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
//---------
private:
//---------
private:
// Member data
G4ThreeVector fPosition;
std::vector<G4ThreeVector>* fAuxiliaryPointVector;
G4ThreeVector fPosition;
std::vector<G4ThreeVector>* fAuxiliaryPointVector = nullptr;
};
extern G4TRACKING_DLL G4Allocator<G4SmoothTrajectoryPoint>*& aSmoothTrajectoryPointAllocator();
extern G4TRACKING_DLL
G4Allocator<G4SmoothTrajectoryPoint>*& aSmoothTrajectoryPointAllocator();
inline void* G4SmoothTrajectoryPoint::operator new(size_t)
inline void*
G4SmoothTrajectoryPoint::operator new(size_t)
{
if (!aSmoothTrajectoryPointAllocator())
{ aSmoothTrajectoryPointAllocator()= new G4Allocator<G4SmoothTrajectoryPoint>; }
if (aSmoothTrajectoryPointAllocator() == nullptr)
{
aSmoothTrajectoryPointAllocator()= new G4Allocator<G4SmoothTrajectoryPoint>;
}
return (void *) aSmoothTrajectoryPointAllocator()->MallocSingle();
}
inline void G4SmoothTrajectoryPoint::operator delete(void *aTrajectoryPoint)
inline void
G4SmoothTrajectoryPoint::operator delete(void *aTrajectoryPoint)
{
aSmoothTrajectoryPointAllocator()->FreeSingle((G4SmoothTrajectoryPoint *) aTrajectoryPoint);
aSmoothTrajectoryPointAllocator()
->FreeSingle((G4SmoothTrajectoryPoint*) aTrajectoryPoint);
}
inline G4bool
G4SmoothTrajectoryPoint::operator==(const G4SmoothTrajectoryPoint& r) const
{
return (this==&r);
}
#endif
+418 -364
View File
@@ -23,474 +23,528 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4SteppingManager
//
//
//---------------------------------------------------------------
//
// G4SteppingManager.hh
//
// class description:
// This is the class which plays an essential role in tracking
// the particle. It takes cares all message passing between
// objects in the different categories (for example,
// geometry(including transportation), interactions in
// matter, etc). It's public method 'stepping' steers to step
// the particle.
// Geant4 kernel use only
// Class description:
//
// This is the class which plays an essential role in tracking particles.
// It takes cares of all message passing between objects in the different
// categories (for example, geometry - including transportation, interactions
// in matter, etc). Its public method 'stepping' steers to step the particle.
// Only used within the Geant4 kernel.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
// modified for new ParticleChange 12 Mar. 1998 H.Kurashige
// History:
// 12.03.1998, H.Kurashige - modified for use of G4ParticleChange
// --------------------------------------------------------------------
#ifndef G4SteppingManager_hh
#define G4SteppingManager_hh 1
#include <iomanip> // Include from 'system'
#include <vector> // Include from 'system'
#include "globals.hh" // Include from 'global'
#include "Randomize.hh" // Include from 'global'
class G4SteppingManager;
#include "G4Navigator.hh" // Include from 'geometry'
#include "G4LogicalVolume.hh" // Include from 'geometry'
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
#include "G4ProcessManager.hh" // Include from 'processes'
#ifndef G4SteppingManager_h
#define G4SteppingManager_h 1
#include "G4Track.hh" // Include from 'tracking'
#include "G4TrackVector.hh" // Include from 'tracking'
#include "G4TrackStatus.hh" // Include from 'tracking'
#include "G4StepStatus.hh" // Include from 'tracking'
#include "G4UserSteppingAction.hh" // Include from 'tracking'
#include "G4Step.hh" // Include from 'tracking'
#include "G4StepPoint.hh" // Include from 'tracking'
#include "G4VSteppingVerbose.hh" // Include from 'tracking'
#include "G4TouchableHandle.hh" // Include from 'geometry'
#include "G4TouchableHistoryHandle.hh" // Include from 'geometry'
using G4SelectedAtRestDoItVector = std::vector<G4int>;
using G4SelectedAlongStepDoItVector = std::vector<G4int>;
using G4SelectedPostStepDoItVector = std::vector<G4int>;
class G4VSensitiveDetector;
#include "G4ios.hh" // Include from 'system'
#include <iomanip> // Include from 'system'
#include <vector> // Include from 'system'
#include "globals.hh" // Include from 'global'
#include "Randomize.hh" // Include from 'global'
#include "G4Navigator.hh" // Include from 'geometry'
#include "G4LogicalVolume.hh" // Include from 'geometry'
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
#include "G4ProcessManager.hh" // Include from 'piim'
#include "G4Track.hh" // Include from 'tracking'
#include "G4TrackVector.hh" // Include from 'tracking'
#include "G4TrackStatus.hh" // Include from 'tracking'
#include "G4StepStatus.hh" // Include from 'tracking'
#include "G4UserSteppingAction.hh" // Include from 'tracking'
#include "G4Step.hh" // Include from 'tracking'
#include "G4StepPoint.hh" // Include from 'tracking'
#include "G4VSteppingVerbose.hh" // Include from 'tracking'
#include "G4TouchableHandle.hh" // Include from 'geometry'
#include "G4TouchableHistoryHandle.hh" // Include from 'geometry'
//
typedef std::vector<G4int>
G4SelectedAtRestDoItVector;
typedef std::vector<G4int>
G4SelectedAlongStepDoItVector;
typedef std::vector<G4int>
G4SelectedPostStepDoItVector;
static const size_t SizeOfSelectedDoItVector=100;
// In global scope for porting on WIN-VC compiler...
///////////////////////
class G4SteppingManager
///////////////////////
{
public:
//--------
public: //without description
//--------
// Constructor/Destructor
// Constructor/Destructor
G4SteppingManager();
// SteppingManger should be dynamically persistent, therefore
G4SteppingManager();
// SteppingManger should be dynamically allocated, therefore
// you need to invoke new() when you call this constructor.
// "Secodary track vector" will be dynamically created by this
// cosntructor. "G4UserSteppingAction" will be also constructed
// constructor. G4UserSteppingAction will be also created
// in this constructor, and "this" pointer will be passed to
// "G4UserSteppingAction".
// G4UserSteppingAction.
~G4SteppingManager();
// Get/Set functions
// Get/Set functions
const G4TrackVector* GetSecondary() const;
void SetUserAction(G4UserSteppingAction* apAction);
G4Track* GetTrack() const;
void SetVerboseLevel(G4int vLevel);
void SetVerbose(G4VSteppingVerbose*);
G4Step* GetStep() const;
void SetNavigator(G4Navigator* value);
const G4TrackVector* GetSecondary() const;
void SetUserAction(G4UserSteppingAction* apAction);
G4Track* GetTrack() const;
void SetVerboseLevel(G4int vLevel);
void SetVerbose(G4VSteppingVerbose*);
G4Step* GetStep() const;
void SetNavigator(G4Navigator* value);
// Other member functions
// Other member functions
G4StepStatus Stepping();
// Steers to move the give particle from the TrackingManger by one Step.
G4StepStatus Stepping();
// Steers to move the give particle from the TrackingManger
// by one Step.
void SetInitialStep(G4Track* valueTrack);
// Sets up initial track information (enegry, position, etc) to
// the PreStepPoint of the G4Step. This funciton has to be called
// just once before the stepping loop in the "TrackingManager".
void SetInitialStep(G4Track* valueTrack);
// Sets up initial track information (enegry, position, etc) to
// the PreStepPoint of the G4Step. This funciton has to be called
// just once before the stepping loop in the "TrackingManager".
void GetProcessNumber();
void GetProcessNumber();
// Get methods
// Get methods
G4double GetPhysicalStep();
G4double GetGeometricalStep();
G4double GetCorrectedStep();
G4bool GetPreStepPointIsGeom();
G4bool GetFirstStep();
G4StepStatus GetfStepStatus();
G4double GetTempInitVelocity();
G4double GetTempVelocity();
G4double GetMass();
G4double GetsumEnergyChange();
G4VParticleChange* GetfParticleChange();
G4Track* GetfTrack();
G4TrackVector* GetfSecondary();
G4Step* GetfStep();
G4StepPoint* GetfPreStepPoint();
G4StepPoint* GetfPostStepPoint();
G4VPhysicalVolume* GetfCurrentVolume();
G4VSensitiveDetector* GetfSensitive();
G4VProcess* GetfCurrentProcess();
G4ProcessVector* GetfAtRestDoItVector();
G4ProcessVector* GetfAlongStepDoItVector();
G4ProcessVector* GetfPostStepDoItVector();
G4ProcessVector* GetfAlongStepGetPhysIntVector();
G4ProcessVector* GetfPostStepGetPhysIntVector();
G4ProcessVector* GetfAtRestGetPhysIntVector();
G4double GetcurrentMinimumStep();
G4double GetnumberOfInteractionLengthLeft();
size_t GetfAtRestDoItProcTriggered();
size_t GetfAlongStepDoItProcTriggered();
size_t GetfPostStepDoItProcTriggered();
G4int GetfN2ndariesAtRestDoIt();
G4int GetfN2ndariesAlongStepDoIt();
G4int GetfN2ndariesPostStepDoIt();
G4Navigator* GetfNavigator();
G4int GetverboseLevel();
size_t GetMAXofAtRestLoops();
size_t GetMAXofAlongStepLoops();
size_t GetMAXofPostStepLoops();
G4SelectedAtRestDoItVector* GetfSelectedAtRestDoItVector();
G4SelectedAlongStepDoItVector* GetfSelectedAlongStepDoItVector();
G4SelectedPostStepDoItVector* GetfSelectedPostStepDoItVector();
G4double GetfPreviousStepSize();
const G4TouchableHandle& GetTouchableHandle();
G4SteppingControl GetStepControlFlag();
G4UserSteppingAction* GetUserAction();
G4double GetphysIntLength();
G4ForceCondition GetfCondition();
G4GPILSelection GetfGPILSelection();
//
G4bool KillVerbose;
//---------
private:
//---------
G4double GetPhysicalStep();
G4double GetGeometricalStep();
G4double GetCorrectedStep();
G4bool GetPreStepPointIsGeom();
G4bool GetFirstStep();
G4StepStatus GetfStepStatus();
G4double GetTempInitVelocity();
G4double GetTempVelocity();
G4double GetMass();
G4double GetsumEnergyChange();
G4VParticleChange* GetfParticleChange();
G4Track* GetfTrack();
G4TrackVector* GetfSecondary();
G4Step* GetfStep();
G4StepPoint* GetfPreStepPoint();
G4StepPoint* GetfPostStepPoint();
G4VPhysicalVolume* GetfCurrentVolume();
G4VSensitiveDetector* GetfSensitive();
G4VProcess* GetfCurrentProcess();
G4ProcessVector* GetfAtRestDoItVector();
G4ProcessVector* GetfAlongStepDoItVector();
G4ProcessVector* GetfPostStepDoItVector();
G4ProcessVector* GetfAlongStepGetPhysIntVector();
G4ProcessVector* GetfPostStepGetPhysIntVector();
G4ProcessVector* GetfAtRestGetPhysIntVector();
G4double GetcurrentMinimumStep();
G4double GetnumberOfInteractionLengthLeft();
std::size_t GetfAtRestDoItProcTriggered();
std::size_t GetfAlongStepDoItProcTriggered();
std::size_t GetfPostStepDoItProcTriggered();
G4int GetfN2ndariesAtRestDoIt();
G4int GetfN2ndariesAlongStepDoIt();
G4int GetfN2ndariesPostStepDoIt();
G4Navigator* GetfNavigator();
G4int GetverboseLevel();
std::size_t GetMAXofAtRestLoops();
std::size_t GetMAXofAlongStepLoops();
std::size_t GetMAXofPostStepLoops();
G4SelectedAtRestDoItVector* GetfSelectedAtRestDoItVector();
G4SelectedAlongStepDoItVector* GetfSelectedAlongStepDoItVector();
G4SelectedPostStepDoItVector* GetfSelectedPostStepDoItVector();
G4double GetfPreviousStepSize();
const G4TouchableHandle& GetTouchableHandle();
G4SteppingControl GetStepControlFlag();
G4UserSteppingAction* GetUserAction();
G4double GetphysIntLength();
G4ForceCondition GetfCondition();
G4GPILSelection GetfGPILSelection();
// Member functions
private:
void DefinePhysicalStepLength();
// Member functions
void DefinePhysicalStepLength();
// Calculate corresponding physical length from the mean free path
// left for each discrete phyiscs process. The minimum allowable
// Step for each continious process will be also calculated.
void InvokeAtRestDoItProcs();
void InvokeAlongStepDoItProcs();
void InvokePostStepDoItProcs();
void InvokePSDIP(size_t); //
G4double CalculateSafety();
// left for each discrete physics process. The minimum allowable
// step for each continuous process will be also calculated.
void InvokeAtRestDoItProcs();
void InvokeAlongStepDoItProcs();
void InvokePostStepDoItProcs();
void InvokePSDIP(size_t); //
G4double CalculateSafety();
// Return the estimated safety value at the PostStepPoint
void ApplyProductionCut(G4Track*);
void ApplyProductionCut(G4Track*);
// Member data
G4UserSteppingAction* fUserSteppingAction;
// Member data
G4VSteppingVerbose* fVerbose;
static const size_t SizeOfSelectedDoItVector = 100;
G4double PhysicalStep;
G4double GeometricalStep;
G4double CorrectedStep;
G4bool PreStepPointIsGeom;
G4bool FirstStep;
G4StepStatus fStepStatus;
G4bool KillVerbose = false;
G4double TempInitVelocity;
G4double TempVelocity;
G4double Mass;
G4UserSteppingAction* fUserSteppingAction = nullptr;
G4double sumEnergyChange;
G4VSteppingVerbose* fVerbose = nullptr;
G4VParticleChange* fParticleChange;
G4Track* fTrack;
G4TrackVector* fSecondary;
G4Step* fStep;
G4StepPoint* fPreStepPoint;
G4StepPoint* fPostStepPoint;
G4double PhysicalStep = 0.0;
G4double GeometricalStep = 0.0;
G4double CorrectedStep = 0.0;
G4bool PreStepPointIsGeom = false;
G4bool FirstStep = false;
G4StepStatus fStepStatus = fUndefined;
G4VPhysicalVolume* fCurrentVolume;
G4VSensitiveDetector* fSensitive;
G4VProcess* fCurrentProcess;
// The pointer to the process of which DoIt or
// GetPhysicalInteractionLength has been just executed.
G4double TempInitVelocity = 0.0;
G4double TempVelocity = 0.0;
G4double Mass = 0.0;
G4double sumEnergyChange = 0.0;
G4VParticleChange* fParticleChange = nullptr;
G4Track* fTrack = nullptr;
G4TrackVector* fSecondary = nullptr;
G4Step* fStep = nullptr;
G4StepPoint* fPreStepPoint = nullptr;
G4StepPoint* fPostStepPoint = nullptr;
G4VPhysicalVolume* fCurrentVolume = nullptr;
G4VSensitiveDetector* fSensitive = nullptr;
G4VProcess* fCurrentProcess = nullptr;
// The pointer to the process of which DoIt() or
// GetPhysicalInteractionLength() has been just executed.
G4ProcessVector* fAtRestDoItVector;
G4ProcessVector* fAlongStepDoItVector;
G4ProcessVector* fPostStepDoItVector;
G4ProcessVector* fAtRestDoItVector = nullptr;
G4ProcessVector* fAlongStepDoItVector = nullptr;
G4ProcessVector* fPostStepDoItVector = nullptr;
G4ProcessVector* fAtRestGetPhysIntVector;
G4ProcessVector* fAlongStepGetPhysIntVector;
G4ProcessVector* fPostStepGetPhysIntVector;
G4ProcessVector* fAtRestGetPhysIntVector = nullptr;
G4ProcessVector* fAlongStepGetPhysIntVector = nullptr;
G4ProcessVector* fPostStepGetPhysIntVector = nullptr;
size_t MAXofAtRestLoops;
size_t MAXofAlongStepLoops;
size_t MAXofPostStepLoops;
std::size_t MAXofAtRestLoops = 0;
std::size_t MAXofAlongStepLoops = 0;
std::size_t MAXofPostStepLoops = 0;
size_t fAtRestDoItProcTriggered;
size_t fAlongStepDoItProcTriggered;
size_t fPostStepDoItProcTriggered;
std::size_t fAtRestDoItProcTriggered = 0;
std::size_t fAlongStepDoItProcTriggered = 0;
std::size_t fPostStepDoItProcTriggered = 0;
G4int fN2ndariesAtRestDoIt;
G4int fN2ndariesAlongStepDoIt;
G4int fN2ndariesPostStepDoIt;
G4int fN2ndariesAtRestDoIt = 0;
G4int fN2ndariesAlongStepDoIt = 0;
G4int fN2ndariesPostStepDoIt = 0;
// These are the numbers of secondaries generated by the process
// just executed.
G4Navigator *fNavigator;
G4Navigator* fNavigator = nullptr;
G4int verboseLevel;
G4int verboseLevel = 0;
G4SelectedAtRestDoItVector* fSelectedAtRestDoItVector;
G4SelectedAlongStepDoItVector* fSelectedAlongStepDoItVector;
G4SelectedPostStepDoItVector* fSelectedPostStepDoItVector;
G4SelectedAtRestDoItVector* fSelectedAtRestDoItVector = nullptr;
G4SelectedAlongStepDoItVector* fSelectedAlongStepDoItVector = nullptr;
G4SelectedPostStepDoItVector* fSelectedPostStepDoItVector = nullptr;
G4double fPreviousStepSize;
G4double fPreviousStepSize = 0.0;
G4TouchableHandle fTouchableHandle;
G4TouchableHandle fTouchableHandle;
G4SteppingControl StepControlFlag;
G4SteppingControl StepControlFlag = NormalCondition;
G4double kCarTolerance;
G4double kCarTolerance = 0.0;
// Cached geometrical tolerance on surface
G4double proposedSafety;
G4double proposedSafety = 0.0;
// This keeps the minimum safety value proposed by AlongStepGPILs.
G4ThreeVector endpointSafOrigin;
G4double endpointSafety;
G4ThreeVector endpointSafOrigin;
G4double endpointSafety = 0.0;
// To get the true safety value at the PostStepPoint, you have
// to subtract the distance to 'endpointSafOrigin' from this value.
G4double physIntLength;
G4ForceCondition fCondition;
G4GPILSelection fGPILSelection;
G4double physIntLength = 0.0;
G4ForceCondition fCondition = InActivated;
G4GPILSelection fGPILSelection = NotCandidateForSelection;
// Above three variables are for the method
// DefinePhysicalStepLength(). To pass these information to
// the method Verbose, they are kept at here. Need a more
// elegant mechanism.
};
//*******************************************************************
//
// Inline function
// Inline functions
//
//*******************************************************************
inline G4double G4SteppingManager::GetPhysicalStep(){
inline G4double G4SteppingManager::GetPhysicalStep()
{
return PhysicalStep;
}
inline G4double G4SteppingManager::GetGeometricalStep(){
inline G4double G4SteppingManager::GetGeometricalStep()
{
return GeometricalStep;
}
inline G4double G4SteppingManager::GetCorrectedStep(){
inline G4double G4SteppingManager::GetCorrectedStep()
{
return CorrectedStep;
}
inline G4bool G4SteppingManager::GetPreStepPointIsGeom(){
return PreStepPointIsGeom;
inline G4bool G4SteppingManager::GetPreStepPointIsGeom()
{
return PreStepPointIsGeom;
}
inline G4bool G4SteppingManager::GetFirstStep(){
return FirstStep;
inline G4bool G4SteppingManager::GetFirstStep()
{
return FirstStep;
}
inline G4StepStatus G4SteppingManager::GetfStepStatus(){
return fStepStatus;
inline G4StepStatus G4SteppingManager::GetfStepStatus()
{
return fStepStatus;
}
inline G4double G4SteppingManager::GetTempInitVelocity(){
return TempInitVelocity;
}
inline G4double G4SteppingManager::GetTempVelocity(){
return TempVelocity;
}
inline G4double G4SteppingManager::GetMass(){
return Mass;
inline G4double G4SteppingManager::GetTempInitVelocity()
{
return TempInitVelocity;
}
inline G4double G4SteppingManager::GetsumEnergyChange(){
return sumEnergyChange;
inline G4double G4SteppingManager::GetTempVelocity()
{
return TempVelocity;
}
inline G4VParticleChange* G4SteppingManager::GetfParticleChange(){
return fParticleChange;
inline G4double G4SteppingManager::GetMass()
{
return Mass;
}
inline G4Track* G4SteppingManager::GetfTrack(){
return fTrack;
inline G4double G4SteppingManager::GetsumEnergyChange()
{
return sumEnergyChange;
}
inline G4TrackVector* G4SteppingManager::GetfSecondary(){
return fStep->GetfSecondary();
}
inline G4Step* G4SteppingManager::GetfStep(){
return fStep;
}
inline G4StepPoint* G4SteppingManager::GetfPreStepPoint(){
return fPreStepPoint;
}
inline G4StepPoint* G4SteppingManager::GetfPostStepPoint(){
return fPostStepPoint;
inline G4VParticleChange* G4SteppingManager::GetfParticleChange()
{
return fParticleChange;
}
inline G4VPhysicalVolume* G4SteppingManager::GetfCurrentVolume(){
return fCurrentVolume;
}
inline G4VSensitiveDetector* G4SteppingManager::GetfSensitive(){
return fSensitive;
}
inline G4VProcess* G4SteppingManager::GetfCurrentProcess(){
return fCurrentProcess;
inline G4Track* G4SteppingManager::GetfTrack()
{
return fTrack;
}
inline G4ProcessVector* G4SteppingManager::GetfAtRestDoItVector(){
return fAtRestDoItVector;
}
inline G4ProcessVector* G4SteppingManager::GetfAlongStepDoItVector(){
return fAlongStepDoItVector;
}
inline G4ProcessVector* G4SteppingManager::GetfPostStepDoItVector(){
return fPostStepDoItVector;
inline G4TrackVector* G4SteppingManager::GetfSecondary()
{
return fStep->GetfSecondary();
}
inline G4ProcessVector* G4SteppingManager::GetfAtRestGetPhysIntVector(){
return fAtRestGetPhysIntVector;
}
inline G4ProcessVector* G4SteppingManager::GetfAlongStepGetPhysIntVector(){
return fAlongStepGetPhysIntVector;
}
inline G4ProcessVector* G4SteppingManager::GetfPostStepGetPhysIntVector(){
return fPostStepGetPhysIntVector;
}
inline size_t G4SteppingManager::GetMAXofAtRestLoops(){
return MAXofAtRestLoops;
}
inline size_t G4SteppingManager::GetMAXofAlongStepLoops(){
return MAXofAlongStepLoops;
}
inline size_t G4SteppingManager::GetMAXofPostStepLoops(){
return MAXofPostStepLoops;
}
inline size_t G4SteppingManager::GetfAtRestDoItProcTriggered(){
return fAtRestDoItProcTriggered;
}
inline size_t G4SteppingManager::GetfAlongStepDoItProcTriggered(){
return fAtRestDoItProcTriggered;
}
inline size_t G4SteppingManager::GetfPostStepDoItProcTriggered(){
return fPostStepDoItProcTriggered;
}
inline G4int G4SteppingManager::GetfN2ndariesAtRestDoIt(){
return fN2ndariesAtRestDoIt;
}
inline G4int G4SteppingManager::GetfN2ndariesAlongStepDoIt(){
return fN2ndariesAlongStepDoIt;
}
inline G4int G4SteppingManager::GetfN2ndariesPostStepDoIt(){
return fN2ndariesPostStepDoIt;
}
inline G4Navigator* G4SteppingManager::GetfNavigator(){
return fNavigator;
}
inline G4int G4SteppingManager::GetverboseLevel(){
return verboseLevel;
}
inline G4SelectedAtRestDoItVector* G4SteppingManager::GetfSelectedAtRestDoItVector(){
return fSelectedAtRestDoItVector;
}
inline G4SelectedAlongStepDoItVector* G4SteppingManager::GetfSelectedAlongStepDoItVector(){
return fSelectedAlongStepDoItVector;
}
inline G4SelectedPostStepDoItVector* G4SteppingManager::GetfSelectedPostStepDoItVector(){
return fSelectedPostStepDoItVector;
}
inline G4double G4SteppingManager::GetfPreviousStepSize(){
return fPreviousStepSize;
}
inline const G4TouchableHandle& G4SteppingManager::GetTouchableHandle() {
return fTouchableHandle;
}
inline G4SteppingControl G4SteppingManager::GetStepControlFlag(){
return StepControlFlag;
}
inline G4double G4SteppingManager::GetphysIntLength(){
return physIntLength;
}
inline G4ForceCondition G4SteppingManager::GetfCondition(){
return fCondition;
}
inline G4GPILSelection G4SteppingManager::GetfGPILSelection(){
return fGPILSelection;
}
inline const G4TrackVector* G4SteppingManager::GetSecondary() const {
return fStep->GetSecondary();
}
inline void G4SteppingManager::SetNavigator(G4Navigator* value){
fNavigator = value;
}
inline void G4SteppingManager::SetUserAction(G4UserSteppingAction* apAction){
fUserSteppingAction = apAction;
}
inline G4UserSteppingAction* G4SteppingManager::GetUserAction(){
return fUserSteppingAction;
}
inline G4Track* G4SteppingManager::GetTrack() const {
return fTrack;
}
inline void G4SteppingManager::SetVerboseLevel(G4int vLevel){
verboseLevel = vLevel;
}
inline void G4SteppingManager::SetVerbose(G4VSteppingVerbose* yourVerbose){
fVerbose = yourVerbose;
}
inline G4Step* G4SteppingManager::GetStep() const {
inline G4Step* G4SteppingManager::GetfStep()
{
return fStep;
}
inline G4double G4SteppingManager::CalculateSafety(){
return std::max( endpointSafety -
(endpointSafOrigin - fPostStepPoint->GetPosition()).mag(),
kCarTolerance );
inline G4StepPoint* G4SteppingManager::GetfPreStepPoint()
{
return fPreStepPoint;
}
inline G4StepPoint* G4SteppingManager::GetfPostStepPoint()
{
return fPostStepPoint;
}
inline G4VPhysicalVolume* G4SteppingManager::GetfCurrentVolume()
{
return fCurrentVolume;
}
inline G4VSensitiveDetector* G4SteppingManager::GetfSensitive()
{
return fSensitive;
}
inline G4VProcess* G4SteppingManager::GetfCurrentProcess()
{
return fCurrentProcess;
}
inline G4ProcessVector* G4SteppingManager::GetfAtRestDoItVector()
{
return fAtRestDoItVector;
}
inline G4ProcessVector* G4SteppingManager::GetfAlongStepDoItVector()
{
return fAlongStepDoItVector;
}
inline G4ProcessVector* G4SteppingManager::GetfPostStepDoItVector()
{
return fPostStepDoItVector;
}
inline G4ProcessVector* G4SteppingManager::GetfAtRestGetPhysIntVector()
{
return fAtRestGetPhysIntVector;
}
inline G4ProcessVector* G4SteppingManager::GetfAlongStepGetPhysIntVector()
{
return fAlongStepGetPhysIntVector;
}
inline G4ProcessVector* G4SteppingManager::GetfPostStepGetPhysIntVector()
{
return fPostStepGetPhysIntVector;
}
inline size_t G4SteppingManager::GetMAXofAtRestLoops()
{
return MAXofAtRestLoops;
}
inline size_t G4SteppingManager::GetMAXofAlongStepLoops()
{
return MAXofAlongStepLoops;
}
inline size_t G4SteppingManager::GetMAXofPostStepLoops()
{
return MAXofPostStepLoops;
}
inline size_t G4SteppingManager::GetfAtRestDoItProcTriggered()
{
return fAtRestDoItProcTriggered;
}
inline size_t G4SteppingManager::GetfAlongStepDoItProcTriggered()
{
return fAtRestDoItProcTriggered;
}
inline size_t G4SteppingManager::GetfPostStepDoItProcTriggered()
{
return fPostStepDoItProcTriggered;
}
inline G4int G4SteppingManager::GetfN2ndariesAtRestDoIt()
{
return fN2ndariesAtRestDoIt;
}
inline G4int G4SteppingManager::GetfN2ndariesAlongStepDoIt()
{
return fN2ndariesAlongStepDoIt;
}
inline G4int G4SteppingManager::GetfN2ndariesPostStepDoIt()
{
return fN2ndariesPostStepDoIt;
}
inline G4Navigator* G4SteppingManager::GetfNavigator()
{
return fNavigator;
}
inline G4int G4SteppingManager::GetverboseLevel()
{
return verboseLevel;
}
inline G4SelectedAtRestDoItVector*
G4SteppingManager::GetfSelectedAtRestDoItVector()
{
return fSelectedAtRestDoItVector;
}
inline G4SelectedAlongStepDoItVector*
G4SteppingManager::GetfSelectedAlongStepDoItVector()
{
return fSelectedAlongStepDoItVector;
}
inline G4SelectedPostStepDoItVector*
G4SteppingManager::GetfSelectedPostStepDoItVector()
{
return fSelectedPostStepDoItVector;
}
inline G4double G4SteppingManager::GetfPreviousStepSize()
{
return fPreviousStepSize;
}
inline const G4TouchableHandle& G4SteppingManager::GetTouchableHandle()
{
return fTouchableHandle;
}
inline G4SteppingControl G4SteppingManager::GetStepControlFlag()
{
return StepControlFlag;
}
inline G4double G4SteppingManager::GetphysIntLength()
{
return physIntLength;
}
inline G4ForceCondition G4SteppingManager::GetfCondition()
{
return fCondition;
}
inline G4GPILSelection G4SteppingManager::GetfGPILSelection()
{
return fGPILSelection;
}
inline const G4TrackVector* G4SteppingManager::GetSecondary() const
{
return fStep->GetSecondary();
}
inline void G4SteppingManager::SetNavigator(G4Navigator* value)
{
fNavigator = value;
}
inline void G4SteppingManager::SetUserAction(G4UserSteppingAction* apAction)
{
fUserSteppingAction = apAction;
}
inline G4UserSteppingAction* G4SteppingManager::GetUserAction()
{
return fUserSteppingAction;
}
inline G4Track* G4SteppingManager::GetTrack() const
{
return fTrack;
}
inline void G4SteppingManager::SetVerboseLevel(G4int vLevel)
{
verboseLevel = vLevel;
}
inline void G4SteppingManager::SetVerbose(G4VSteppingVerbose* yourVerbose)
{
fVerbose = yourVerbose;
}
inline G4Step* G4SteppingManager::GetStep() const
{
return fStep;
}
inline G4double G4SteppingManager::CalculateSafety()
{
return std::max( endpointSafety -
(endpointSafOrigin - fPostStepPoint->GetPosition()).mag(),
kCarTolerance );
}
#endif
+32 -41
View File
@@ -23,57 +23,48 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4SteppingVerbose
//
// Class description:
//
//---------------------------------------------------------------
//
// G4SteppingVerbose.hh
//
// class dscription:
// This class manages the vervose outputs in G4SteppingManager.
//
//
// This class manages the verbose outputs in G4SteppingManager.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
class G4SteppingVerbose;
#ifndef G4SteppingVerose_h
#define G4SteppingVerose_h 1
//---------------------------------------------------------------------
#ifndef G4SteppingVerose_hh
#define G4SteppingVerose_hh 1
#include "G4VSteppingVerbose.hh"
class G4SteppingVerbose : public G4VSteppingVerbose {
public: // with description
// Constructor/Destructor
G4SteppingVerbose();
~G4SteppingVerbose();
// methods to be invoked in the SteppingManager
void NewStep();
void AtRestDoItInvoked();
void AlongStepDoItAllDone();
void PostStepDoItAllDone();
void AlongStepDoItOneByOne();
void PostStepDoItOneByOne();
void StepInfo();
void TrackingStarted();
void DPSLStarted();
void DPSLUserLimit();
void DPSLPostStep();
void DPSLAlongStep();
// void DPSLAlongStepDoItOneByOne();
// void DPSLPostStepDoItOneByOne();
void VerboseTrack();
void VerboseParticleChange();
void ShowStep() const;
//
class G4SteppingVerbose : public G4VSteppingVerbose
{
public:
// Constructor/Destructor
G4SteppingVerbose();
~G4SteppingVerbose();
// Methods to be invoked in the SteppingManager
void NewStep();
void AtRestDoItInvoked();
void AlongStepDoItAllDone();
void PostStepDoItAllDone();
void AlongStepDoItOneByOne();
void PostStepDoItOneByOne();
void StepInfo();
void TrackingStarted();
void DPSLStarted();
void DPSLUserLimit();
void DPSLPostStep();
void DPSLAlongStep();
void VerboseTrack();
void VerboseParticleChange();
void ShowStep() const;
};
#endif
+107 -111
View File
@@ -23,35 +23,26 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4TrackingManager
//
// Class description:
//
//---------------------------------------------------------------
//
// G4TrackingManager.hh
//
// class description:
// This is an interface class among the event, the track
// and the tracking category. It handles necessary
// message passings between the upper hierarchical object, which
// is the event manager (G4EventManager), and lower hierarchical
// objects in the tracking category. It receives one track in an
// event from the event manager and takes care to finish tracking it.
// Geant4 kernel use only.
//
// This is an interface class between the event, the track and the tracking
// categories. It handles necessary message passing between the upper
// hierarchical object, which is the event manager (G4EventManager), and
// lower hierarchical objects in the tracking category. It receives one track
// in an event from the event manager and takes care to finish tracking it.
// Used exclusively by the Geant4 kernel.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
class G4TrackingManager;
#ifndef G4TrackingManager_h
#define G4TrackingManager_h 1
#ifndef G4TrackingManager_hh
#define G4TrackingManager_hh 1
#include "globals.hh" // Include from 'global'
/////#include "G4Hit.hh" // Include from 'Hit/dig'
#include "G4SteppingManager.hh" // Include from 'tracking'
#include "G4Track.hh" // Include from 'tracking'
#include "G4TrackingMessenger.hh"
@@ -60,7 +51,7 @@ class G4TrackingManager;
#include "G4StepStatus.hh" // Include from 'tracking'
#include "G4UserTrackingAction.hh" // Include from 'tracking'
#include "G4UserSteppingAction.hh" // Include from 'tracking'
#include "G4VTrajectory.hh" // Include from 'tracking'
#include "G4VTrajectory.hh" // Include from 'tracking'
class G4VUserTrackInformation;
@@ -69,144 +60,149 @@ class G4TrackingManager
////////////////////////
{
//--------
public: // without description
//--------
public:
// Constructor/Destructor
// Constructor/Destructor
G4TrackingManager();
// TrackingManger should be dynamic persistent, therefore you
G4TrackingManager();
// G4TrackingManger should be dynamically allocated, therefore you
// need to invoke new() when you call this constructor.
// "G4SteppingManger' and "G4UserTrackingAction" will be
// constructed in this constructor. "This" pointer will be
// passed to "G4UserTrackingAction".
// G4SteppingManger and G4UserTrackingAction will be created
// in this constructor. "This" pointer will be passed to
// G4UserTrackingAction.
~G4TrackingManager();
~G4TrackingManager();
// Get/Set functions
// Get/Set functions
G4Track* GetTrack() const;
G4Track* GetTrack() const;
G4int GetStoreTrajectory() const;
void SetStoreTrajectory(G4int value);
G4int GetStoreTrajectory() const;
void SetStoreTrajectory(G4int value);
G4SteppingManager* GetSteppingManager() const;
G4SteppingManager* GetSteppingManager() const;
G4UserTrackingAction* GetUserTrackingAction() const;
G4UserTrackingAction* GetUserTrackingAction() const;
G4VTrajectory* GimmeTrajectory() const;
void SetTrajectory(G4VTrajectory* aTrajectory);
G4VTrajectory* GimmeTrajectory() const;
void SetTrajectory(G4VTrajectory* aTrajectory);
G4TrackVector* GimmeSecondaries() const;
G4TrackVector* GimmeSecondaries() const;
// void SetNavigator(G4Navigator* apValue);
void SetUserAction(G4UserTrackingAction* apAction);
void SetUserAction(G4UserSteppingAction* apAction);
void SetUserAction(G4UserTrackingAction* apAction);
void SetUserAction(G4UserSteppingAction* apAction);
void SetVerboseLevel(G4int vLevel);
G4int GetVerboseLevel() const;
void SetVerboseLevel(G4int vLevel);
G4int GetVerboseLevel() const;
// Other member functions
// Other member functions
void ProcessOneTrack(G4Track* apValueG4Track);
void ProcessOneTrack(G4Track* apValueG4Track);
// Invoking this function, a G4Track given by the argument
// will be tracked.
void EventAborted();
void EventAborted();
// Invoking this function, the current tracking will be
// aborted immediately. The tracking will return the
// G4TrackStatus in 'fUserKillTrackAndSecondaries'.
// By this the EventManager deletes the current track and all
// its accoicated csecondaries.
// its associated secondaries.
void SetUserTrackInformation(G4VUserTrackInformation* aValue);
void SetUserTrackInformation(G4VUserTrackInformation* aValue);
// This method can be invoked from the user's G4UserTrackingAction
// implementation to set his/her own G4VUserTrackInformation concrete
// class object to a G4Track object.
//---------
private:
//---------
private:
// Member data
void TrackBanner(); // verbose
G4Track* fpTrack;
G4SteppingManager* fpSteppingManager;
G4UserTrackingAction* fpUserTrackingAction;
G4VTrajectory* fpTrajectory;
G4int StoreTrajectory;
G4int verboseLevel;
G4TrackingMessenger* messenger;
G4bool EventIsAborted;
// verbose
void TrackBanner();
// Member data
G4Track* fpTrack = nullptr;
G4SteppingManager* fpSteppingManager = nullptr;
G4UserTrackingAction* fpUserTrackingAction = nullptr;
G4VTrajectory* fpTrajectory = nullptr;
G4int StoreTrajectory = 0;
G4int verboseLevel = 0;
G4TrackingMessenger* messenger = nullptr;
G4bool EventIsAborted = false;
};
//*******************************************************************
//
// Inline function
//
//*******************************************************************
inline G4Track* G4TrackingManager::GetTrack() const {
return fpTrack;
}
inline G4Track* G4TrackingManager::GetTrack() const
{
return fpTrack;
}
inline G4int G4TrackingManager::GetStoreTrajectory() const {
return StoreTrajectory;
}
inline G4int G4TrackingManager::GetStoreTrajectory() const
{
return StoreTrajectory;
}
inline void G4TrackingManager::SetStoreTrajectory(G4int value){
StoreTrajectory = value;
}
inline void G4TrackingManager::SetStoreTrajectory(G4int value)
{
StoreTrajectory = value;
}
inline G4SteppingManager* G4TrackingManager::GetSteppingManager() const {
return fpSteppingManager;
}
inline G4SteppingManager* G4TrackingManager::GetSteppingManager() const
{
return fpSteppingManager;
}
inline G4UserTrackingAction* G4TrackingManager::GetUserTrackingAction() const {
return fpUserTrackingAction;
}
inline G4UserTrackingAction* G4TrackingManager::GetUserTrackingAction() const
{
return fpUserTrackingAction;
}
inline G4VTrajectory* G4TrackingManager::GimmeTrajectory() const {
return fpTrajectory ;
}
inline G4VTrajectory* G4TrackingManager::GimmeTrajectory() const
{
return fpTrajectory;
}
inline G4TrackVector* G4TrackingManager::GimmeSecondaries() const {
return fpSteppingManager->GetfSecondary();
}
inline G4TrackVector* G4TrackingManager::GimmeSecondaries() const
{
return fpSteppingManager->GetfSecondary();
}
inline void G4TrackingManager::SetUserAction(G4UserTrackingAction* apAction){
fpUserTrackingAction = apAction;
if(apAction != 0){
apAction->SetTrackingManagerPointer(this);
}
}
inline void G4TrackingManager::SetUserAction(G4UserTrackingAction* apAction)
{
fpUserTrackingAction = apAction;
if(apAction != nullptr)
{
apAction->SetTrackingManagerPointer(this);
}
}
inline void G4TrackingManager::SetUserAction(G4UserSteppingAction* apAction){
fpSteppingManager->SetUserAction(apAction);
if(apAction != 0){
apAction->SetSteppingManagerPointer(fpSteppingManager);
}
}
inline void G4TrackingManager::SetUserAction(G4UserSteppingAction* apAction)
{
fpSteppingManager->SetUserAction(apAction);
if(apAction != nullptr)
{
apAction->SetSteppingManagerPointer(fpSteppingManager);
}
}
inline void G4TrackingManager::SetVerboseLevel(G4int vLevel){
verboseLevel = vLevel;
fpSteppingManager -> SetVerboseLevel( vLevel );
}
inline void G4TrackingManager::SetVerboseLevel(G4int vLevel)
{
verboseLevel = vLevel;
fpSteppingManager -> SetVerboseLevel( vLevel );
}
inline G4int G4TrackingManager::GetVerboseLevel() const
{
return verboseLevel;
}
inline G4int G4TrackingManager::GetVerboseLevel() const {
return verboseLevel;
}
inline void G4TrackingManager::SetUserTrackInformation(G4VUserTrackInformation* aValue) {
if(fpTrack) fpTrack->SetUserInformation(aValue);
}
inline void
G4TrackingManager::SetUserTrackInformation(G4VUserTrackInformation* aValue)
{
if(fpTrack != nullptr) fpTrack->SetUserInformation(aValue);
}
#endif
+24 -34
View File
@@ -23,26 +23,23 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4TrackingMessenger
//
// Class description:
//
//---------------------------------------------------------------
//
// G4TrackingMessenger.hh
//
// class Description:
// This is a messenger class to interface to exchange information
// between tracking/stepping and UI.
//
// This is a messenger class to interface and exchange information
// between tracking/stepping and UI.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Makoto Asai (e-mail: asai@kekvax.kek.jp)
// Makoto Asai (e-mail: asai@slac.stanford.edu)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
#ifndef G4TrackingMessenger_hh
#define G4TrackingMessenger_hh 1
#ifndef G4TrackingMessenger_h
#define G4TrackingMessenger_h 1
#include "G4UImessenger.hh"
class G4UIdirectory;
class G4UIcmdWithoutParameter;
@@ -50,36 +47,29 @@ class G4UIcmdWithAnInteger;
class G4UIcmdWithABool;
class G4TrackingManager;
class G4SteppingManager;
#include "G4UImessenger.hh"
///////////////////////////////////////////////
class G4TrackingMessenger: public G4UImessenger
///////////////////////////////////////////////
class G4TrackingMessenger : public G4UImessenger
{
//--------
public: // without description
//--------
public:
G4TrackingMessenger(G4TrackingManager* trMan);
G4TrackingMessenger(G4TrackingManager* trMan);
~G4TrackingMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
void SetNewValue(G4UIcommand* command, G4String newValues);
G4String GetCurrentValue(G4UIcommand* command);
//---------
private:
//---------
private:
G4TrackingManager* trackingManager;
G4SteppingManager* steppingManager;
G4TrackingManager* trackingManager = nullptr;
G4SteppingManager* steppingManager = nullptr;
// commands
G4UIdirectory * TrackingDirectory;
G4UIcmdWithoutParameter * AbortCmd;
G4UIcmdWithoutParameter * ResumeCmd;
G4UIcmdWithAnInteger * StoreTrajectoryCmd;
G4UIcmdWithAnInteger * VerboseCmd;
// commands
G4UIdirectory* TrackingDirectory = nullptr;
G4UIcmdWithoutParameter* AbortCmd = nullptr;
G4UIcmdWithoutParameter* ResumeCmd = nullptr;
G4UIcmdWithAnInteger* StoreTrajectoryCmd = nullptr;
G4UIcmdWithAnInteger* VerboseCmd = nullptr;
};
#endif
+64 -62
View File
@@ -25,20 +25,20 @@
//
// G4Trajectory
//
// class description:
// This class represents the trajectory of a particle tracked.
// It includes information of
// 1) List of trajectory points which compose the trajectory,
// 2) static information of particle which generated the
// trajectory,
// 3) trackID and parent particle ID of the trajectory,
// Class description:
//
// This class represents the trajectory of a particle being tracked.
// It includes information of:
// 1) List of trajectory points which compose the trajectory;
// 2) Static information of the particle which generated the
// trajectory;
// 3) Track ID and parent particle ID of the trajectory.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Makoto Asai (e-mail: asai@kekvax.kek.jp)
// Makoto Asai (e-mail: asai@slac.stanford.edu)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
// --------------------------------------------------------------------
#ifndef G4Trajectory_hh
#define G4Trajectory_hh 1
@@ -58,82 +58,79 @@
class G4Polyline;
///////////////////
class G4Trajectory : public G4VTrajectory
///////////////////
{
using TrajectoryPointContainer = std::vector<G4VTrajectoryPoint*>;
using G4TrajectoryPointContainer = std::vector<G4VTrajectoryPoint*>;
//--------
public: // with description
//--------
public:
// Constructor/Destructor
// Constructors/Destructor
G4Trajectory();
G4Trajectory(const G4Track* aTrack);
G4Trajectory(G4Trajectory &);
virtual ~G4Trajectory();
G4Trajectory();
G4Trajectory(const G4Track* aTrack);
G4Trajectory(G4Trajectory &);
virtual ~G4Trajectory();
// Operators
// Operators
inline void* operator new(size_t);
inline void operator delete(void*);
G4int operator == (const G4Trajectory& r) const {return (this==&r);}
inline void* operator new(size_t);
inline void operator delete(void*);
inline G4int operator == (const G4Trajectory& r) const;
// Get/Set functions
// Get/Set functions
inline G4int GetTrackID() const
{ return fTrackID; }
inline G4int GetParentID() const
{ return fParentID; }
inline G4String GetParticleName() const
{ return ParticleName; }
inline G4double GetCharge() const
{ return PDGCharge; }
inline G4int GetPDGEncoding() const
{ return PDGEncoding; }
inline G4double GetInitialKineticEnergy() const
{ return initialKineticEnergy; }
inline G4ThreeVector GetInitialMomentum() const
{ return initialMomentum; }
inline G4int GetTrackID() const
{ return fTrackID; }
inline G4int GetParentID() const
{ return fParentID; }
inline G4String GetParticleName() const
{ return ParticleName; }
inline G4double GetCharge() const
{ return PDGCharge; }
inline G4int GetPDGEncoding() const
{ return PDGEncoding; }
inline G4double GetInitialKineticEnergy() const
{ return initialKineticEnergy; }
inline G4ThreeVector GetInitialMomentum() const
{ return initialMomentum; }
// Other member functions
// Other member functions
virtual void ShowTrajectory(std::ostream& os=G4cout) const;
virtual void DrawTrajectory() const;
virtual void AppendStep(const G4Step* aStep);
virtual G4int GetPointEntries() const {return G4int(positionRecord->size());}
virtual G4VTrajectoryPoint* GetPoint(G4int i) const { return (*positionRecord)[i]; }
virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
virtual void ShowTrajectory(std::ostream& os=G4cout) const;
virtual void DrawTrajectory() const;
virtual void AppendStep(const G4Step* aStep);
virtual G4int GetPointEntries() const
{ return G4int(positionRecord->size()); }
virtual G4VTrajectoryPoint* GetPoint(G4int i) const
{ return (*positionRecord)[i]; }
virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
G4ParticleDefinition* GetParticleDefinition();
G4ParticleDefinition* GetParticleDefinition();
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
//---------
private:
//---------
TrajectoryPointContainer* positionRecord;
G4int fTrackID;
G4int fParentID;
G4int PDGEncoding;
G4double PDGCharge;
G4String ParticleName;
G4double initialKineticEnergy;
G4ThreeVector initialMomentum;
G4TrajectoryPointContainer* positionRecord = nullptr;
G4int fTrackID = 0;
G4int fParentID = 0;
G4int PDGEncoding = 0;
G4double PDGCharge = 0.0;
G4String ParticleName = "";
G4double initialKineticEnergy = 0.0;
G4ThreeVector initialMomentum;
};
extern G4TRACKING_DLL G4Allocator<G4Trajectory>*& aTrajectoryAllocator();
inline void* G4Trajectory::operator new(size_t)
{
if (!aTrajectoryAllocator())
{ aTrajectoryAllocator() = new G4Allocator<G4Trajectory>; }
if (aTrajectoryAllocator() == nullptr)
{
aTrajectoryAllocator() = new G4Allocator<G4Trajectory>;
}
return (void*)aTrajectoryAllocator()->MallocSingle();
}
@@ -142,4 +139,9 @@ inline void G4Trajectory::operator delete(void* aTrajectory)
aTrajectoryAllocator()->FreeSingle((G4Trajectory*)aTrajectory);
}
inline G4int G4Trajectory::operator == (const G4Trajectory& r) const
{
return (this==&r);
}
#endif
+40 -48
View File
@@ -23,30 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4TrajectoryPoint
//
// Class description:
//
//---------------------------------------------------------------
//
// G4TrajectoryPoint.hh
//
// class description:
// This class represents the trajectory of a particle tracked.
// It includes information of
// 1) List of trajectory points which compose the trajectory,
// 2) static information of particle which generated the
// trajectory,
// 3) trackID and parent particle ID of the trajectory,
// 4) termination condition of the trajectory.
//
// This class represents the trajectory point of a particle being tracked.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
// ---------------------------------------------------------------
#ifndef G4TrajectoryPoint_h
#define G4TrajectoryPoint_h 1
// --------------------------------------------------------------------
#ifndef G4TrajectoryPoint_hh
#define G4TrajectoryPoint_hh 1
#include "trkgdefs.hh"
#include "G4VTrajectoryPoint.hh"
@@ -54,43 +43,37 @@
#include "G4ThreeVector.hh" // Include from 'geometry'
#include "G4Allocator.hh" // Include from 'particle+matter'
////////////////////////
class G4TrajectoryPoint : public G4VTrajectoryPoint
////////////////////////
{
public:
//--------
public: // without description
//--------
// Constructors/Destructor
// Constructor/Destructor
G4TrajectoryPoint();
G4TrajectoryPoint(G4ThreeVector pos);
G4TrajectoryPoint(const G4TrajectoryPoint &right);
virtual ~G4TrajectoryPoint();
G4TrajectoryPoint();
G4TrajectoryPoint(G4ThreeVector pos);
G4TrajectoryPoint(const G4TrajectoryPoint& right);
virtual ~G4TrajectoryPoint();
// Operators
inline void *operator new(size_t);
inline void operator delete(void *aTrajectoryPoint);
inline G4bool operator==(const G4TrajectoryPoint& right) const
{ return (this==&right); };
// Operators
// Get/Set functions
inline const G4ThreeVector GetPosition() const
{ return fPosition; };
inline void *operator new(size_t);
inline void operator delete(void *aTrajectoryPoint);
inline G4bool operator==(const G4TrajectoryPoint& right) const;
// Get method for HEPRep style attributes
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
// Get/Set functions
//---------
private:
//---------
inline const G4ThreeVector GetPosition() const
{ return fPosition; }
// Get method for HEPRep style attributes
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
private:
// Member data
G4ThreeVector fPosition;
};
extern G4TRACKING_DLL
@@ -98,14 +81,23 @@ G4Allocator<G4TrajectoryPoint>*& aTrajectoryPointAllocator();
inline void* G4TrajectoryPoint::operator new(size_t)
{
if (!aTrajectoryPointAllocator())
{ aTrajectoryPointAllocator() = new G4Allocator<G4TrajectoryPoint>; }
if (aTrajectoryPointAllocator() == nullptr)
{
aTrajectoryPointAllocator() = new G4Allocator<G4TrajectoryPoint>;
}
return (void *) aTrajectoryPointAllocator()->MallocSingle();
}
inline void G4TrajectoryPoint::operator delete(void *aTrajectoryPoint)
{
aTrajectoryPointAllocator()->FreeSingle((G4TrajectoryPoint *) aTrajectoryPoint);
aTrajectoryPointAllocator()
->FreeSingle((G4TrajectoryPoint *) aTrajectoryPoint);
}
inline G4bool
G4TrajectoryPoint::operator==(const G4TrajectoryPoint& right) const
{
return (this==&right);
}
#endif
+18 -32
View File
@@ -23,55 +23,41 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4UserSteppingAction
//
// Class description:
//
//---------------------------------------------------------------
//
// G4UserSteppingAction.hh
//
// class description:
// This class represents actions taken place by the user at each
// end of stepping.
//
// This class represents any action taken place by the user at each
// end of stepping.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
#ifndef G4UserSteppingAction_h
#define G4UserSteppingAction_h 1
// --------------------------------------------------------------------
#ifndef G4UserSteppingAction_hh
#define G4UserSteppingAction_hh 1
class G4Step;
class G4SteppingManager; // Forward declaration
class G4SteppingManager;
///////////////////////////
class G4UserSteppingAction
///////////////////////////
{
public:
//--------
public: // with description
//--------
// Constructor and destructor
// Constructor and destructors
G4UserSteppingAction();
virtual ~G4UserSteppingAction();
G4UserSteppingAction();
virtual ~G4UserSteppingAction();
// Member functions
virtual void SetSteppingManagerPointer(G4SteppingManager* pValue);
virtual void UserSteppingAction(const G4Step*){;}
// Member functions
//-----------
protected:
//-----------
virtual void SetSteppingManagerPointer(G4SteppingManager* pValue);
virtual void UserSteppingAction(const G4Step*){}
// Member data
G4SteppingManager* fpSteppingManager;
protected:
G4SteppingManager* fpSteppingManager = nullptr;
};
#endif
+19 -36
View File
@@ -23,59 +23,42 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4UserTrackingAction
//
// Class description:
//
//
//---------------------------------------------------------------
//
// G4UserTrackingAction.hh
//
// class description:
// This class represents actions taken place by the user at
// the start/end point of processing one track.
//
// This class represents any action taking place by the user at the
// start/end point of processing one track.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
// --------------------------------------------------------------------
#ifndef G4UserTrackingAction_hh
#define G4UserTrackingAction_hh 1
class G4UserTrackingAction;
#ifndef G4UserTrackingAction_h
#define G4UserTrackingAction_h 1
class G4TrackingManager; // Forward declaration
class G4TrackingManager;
class G4Track;
///////////////////////////
class G4UserTrackingAction
///////////////////////////
{
public:
//--------
public: // with description
//--------
// Constructor & Destructor
// Constructor & Destructor
G4UserTrackingAction();
virtual ~G4UserTrackingAction();
G4UserTrackingAction();
virtual ~G4UserTrackingAction();
// Member functions
virtual void SetTrackingManagerPointer(G4TrackingManager* pValue);
virtual void PreUserTrackingAction(const G4Track*){;}
virtual void PostUserTrackingAction(const G4Track*){;}
// Member functions
//-----------
protected:
//-----------
virtual void SetTrackingManagerPointer(G4TrackingManager* pValue);
virtual void PreUserTrackingAction(const G4Track*){}
virtual void PostUserTrackingAction(const G4Track*){}
// Member data
G4TrackingManager* fpTrackingManager;
protected:
G4TrackingManager* fpTrackingManager = nullptr;
};
#endif
+126 -134
View File
@@ -23,173 +23,165 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VSteppingVerbose
//
// Class description:
//
//---------------------------------------------------------------
//
// G4VSteppingVerbose.hh
//
// class description:
// This class manages the vervose outputs in G4SteppingManager.
// The instance should be singleton. Users can inherit this
// class to make their own verbosing class.
//
// This class manages the verbose outputs in G4SteppingManager.
// The instance should be a singleton. Users can inherit this
// class to make their own verbosity class.
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
// --------------------------------------------------------------------
#ifndef G4VSteppingVerbose_hh
#define G4VSteppingVerbose_hh 1
#ifndef G4VSteppingVerbose_h
#define G4VSteppingVerbose_h
#include <vector>
#include "globals.hh" // Include from 'global'
#include "G4VProcess.hh"
#include "G4TrackVector.hh" // Include from 'tracking'
#include "G4StepStatus.hh" // Include from 'track'
#include "G4TouchableHandle.hh"
#include "G4ForceCondition.hh" // enum 'track'
#include "G4GPILSelection.hh" // enum 'track'
class G4SteppingManager;
#include "globals.hh" // Include from 'global'
#include <vector>
class G4Navigator;
class G4VPhysicalVolume;
class G4VSensitiveDetector;
#include "G4VProcess.hh"
class G4ProcessVector;
class G4SteppingManager; // Include from 'tracking'
class G4SteppingManager;
class G4Track;
#include "G4TrackVector.hh" // Include from 'tracking'
#include "G4StepStatus.hh" // Include from 'track'
class G4UserSteppingAction;
class G4StepPoint;
#include "G4TouchableHandle.hh"
class G4VParticleChange;
#include "G4ForceCondition.hh" //enum 'track'
#include "G4GPILSelection.hh" //enum 'track'
class G4VSteppingVerbose
{
// Constructor/Destructor
protected: // to force 'singleton'
G4VSteppingVerbose();
public:
virtual ~G4VSteppingVerbose();
//
protected:
static G4ThreadLocal G4VSteppingVerbose* fInstance;// pointer to the instance
static G4ThreadLocal G4int Silent; //flag for verbosity
static G4ThreadLocal G4int SilentStepInfo; //another flag for verbosity
public: // with description
// static methods to set/get the object's pointer
static void SetInstance(G4VSteppingVerbose* Instance);
static G4VSteppingVerbose* GetInstance();
static G4int GetSilent();
static void SetSilent(G4int fSilent);
static G4int GetSilentStepInfo();
static void SetSilentStepInfo(G4int fSilent);
// these method are invoked in the SteppingManager
virtual void NewStep() = 0;
void CopyState();
void SetManager(G4SteppingManager* const);
virtual void AtRestDoItInvoked() = 0;
virtual void AlongStepDoItAllDone() = 0;
virtual void PostStepDoItAllDone() = 0;
virtual void AlongStepDoItOneByOne() = 0;
virtual void PostStepDoItOneByOne() = 0;
virtual void StepInfo() = 0;
virtual void TrackingStarted() = 0;
virtual void DPSLStarted() = 0;
virtual void DPSLUserLimit() = 0;
virtual void DPSLPostStep() = 0;
virtual void DPSLAlongStep() = 0;
virtual void VerboseTrack() = 0;
virtual void VerboseParticleChange() = 0;
// Member data
public:
protected:
G4SteppingManager* fManager;
virtual ~G4VSteppingVerbose();
// static methods to set/get the object's pointer
static void SetInstance(G4VSteppingVerbose* Instance);
static G4VSteppingVerbose* GetInstance();
static G4int GetSilent();
static void SetSilent(G4int fSilent);
static G4int GetSilentStepInfo();
static void SetSilentStepInfo(G4int fSilent);
// these method are invoked by G4SteppingManager
virtual void NewStep() = 0;
void CopyState();
void SetManager(G4SteppingManager* const);
virtual void AtRestDoItInvoked() = 0;
virtual void AlongStepDoItAllDone() = 0;
virtual void PostStepDoItAllDone() = 0;
virtual void AlongStepDoItOneByOne() = 0;
virtual void PostStepDoItOneByOne() = 0;
virtual void StepInfo() = 0;
virtual void TrackingStarted() = 0;
virtual void DPSLStarted() = 0;
virtual void DPSLUserLimit() = 0;
virtual void DPSLPostStep() = 0;
virtual void DPSLAlongStep() = 0;
virtual void VerboseTrack() = 0;
virtual void VerboseParticleChange() = 0;
protected:
G4VSteppingVerbose(); // 'singleton'
static G4ThreadLocal G4VSteppingVerbose* fInstance;
// pointer to the instance
static G4ThreadLocal G4int Silent;
//flag for verbosity
static G4ThreadLocal G4int SilentStepInfo;
//another flag for verbosity
G4SteppingManager* fManager = nullptr;
G4UserSteppingAction* fUserSteppingAction = nullptr;
G4UserSteppingAction* fUserSteppingAction;
G4double PhysicalStep = 0.0;
G4double GeometricalStep = 0.0;
G4double CorrectedStep = 0.0;
G4bool PreStepPointIsGeom = false;
G4bool FirstStep = false;
G4StepStatus fStepStatus = fUndefined;
G4double TempInitVelocity = 0.0;
G4double TempVelocity = 0.0;
G4double Mass = 0.0;
G4double sumEnergyChange = 0.0;
G4VParticleChange* fParticleChange = nullptr;
G4Track* fTrack = nullptr;
G4TrackVector* fSecondary = nullptr;
G4Step* fStep = nullptr;
G4StepPoint* fPreStepPoint = nullptr;
G4StepPoint* fPostStepPoint = nullptr;
G4VPhysicalVolume* fCurrentVolume = nullptr;
G4VSensitiveDetector* fSensitive = nullptr;
G4VProcess* fCurrentProcess = nullptr;
// The pointer to the process whose DoIt() or
// GetPhysicalInteractionLength() has been just executed
G4ProcessVector* fAtRestDoItVector = nullptr;
G4ProcessVector* fAlongStepDoItVector = nullptr;
G4ProcessVector* fPostStepDoItVector = nullptr;
G4ProcessVector* fAtRestGetPhysIntVector = nullptr;
G4ProcessVector* fAlongStepGetPhysIntVector = nullptr;
G4ProcessVector* fPostStepGetPhysIntVector = nullptr;
std::size_t MAXofAtRestLoops = 0;
std::size_t MAXofAlongStepLoops = 0;
std::size_t MAXofPostStepLoops = 0;
G4double PhysicalStep;
G4double GeometricalStep;
G4double CorrectedStep;
G4bool PreStepPointIsGeom;
G4bool FirstStep;
G4StepStatus fStepStatus;
G4double currentMinimumStep = 0.0;
G4double numberOfInteractionLengthLeft = 0.0;
G4double TempInitVelocity;
G4double TempVelocity;
G4double Mass;
std::size_t fAtRestDoItProcTriggered = 0;
std::size_t fAlongStepDoItProcTriggered = 0;
std::size_t fPostStepDoItProcTriggered = 0;
G4double sumEnergyChange;
G4VParticleChange* fParticleChange;
G4Track* fTrack;
G4TrackVector* fSecondary;
G4Step* fStep;
G4StepPoint* fPreStepPoint;
G4StepPoint* fPostStepPoint;
G4VPhysicalVolume* fCurrentVolume;
G4VSensitiveDetector* fSensitive;
G4VProcess* fCurrentProcess;
// The pointer to the process of which DoIt or
// GetPhysicalInteractionLength has been just executed.
G4ProcessVector* fAtRestDoItVector;
G4ProcessVector* fAlongStepDoItVector;
G4ProcessVector* fPostStepDoItVector;
G4ProcessVector* fAtRestGetPhysIntVector;
G4ProcessVector* fAlongStepGetPhysIntVector;
G4ProcessVector* fPostStepGetPhysIntVector;
size_t MAXofAtRestLoops;
size_t MAXofAlongStepLoops;
size_t MAXofPostStepLoops;
G4double currentMinimumStep;
G4double numberOfInteractionLengthLeft;
size_t fAtRestDoItProcTriggered;
size_t fAlongStepDoItProcTriggered;
size_t fPostStepDoItProcTriggered;
G4int fN2ndariesAtRestDoIt;
G4int fN2ndariesAlongStepDoIt;
G4int fN2ndariesPostStepDoIt;
G4int fN2ndariesAtRestDoIt = 0;
G4int fN2ndariesAlongStepDoIt = 0;
G4int fN2ndariesPostStepDoIt = 0;
// These are the numbers of secondaries generated by the process
// just executed.
// just executed
G4Navigator *fNavigator;
G4Navigator* fNavigator = nullptr;
G4int verboseLevel;
G4int verboseLevel = 0;
typedef std::vector<G4int>
G4SelectedAtRestDoItVector;
typedef std::vector<G4int>
G4SelectedAlongStepDoItVector;
typedef std::vector<G4int>
G4SelectedPostStepDoItVector;
G4SelectedAtRestDoItVector* fSelectedAtRestDoItVector;
G4SelectedAlongStepDoItVector* fSelectedAlongStepDoItVector;
G4SelectedPostStepDoItVector* fSelectedPostStepDoItVector;
using G4SelectedAtRestDoItVector = std::vector<G4int>;
using G4SelectedAlongStepDoItVector = std::vector<G4int>;
using G4SelectedPostStepDoItVector = std::vector<G4int>;
G4double fPreviousStepSize;
G4SelectedAtRestDoItVector* fSelectedAtRestDoItVector = nullptr;
G4SelectedAlongStepDoItVector* fSelectedAlongStepDoItVector = nullptr;
G4SelectedPostStepDoItVector* fSelectedPostStepDoItVector = nullptr;
G4TouchableHandle fTouchableHandle;
G4double fPreviousStepSize = 0.0;
G4SteppingControl StepControlFlag;
G4double physIntLength;
G4ForceCondition fCondition;
G4GPILSelection fGPILSelection;
// Above three variables are for the method
// DefinePhysicalStepLength(). To pass these information to
// the method Verbose, they are kept at here. Need a more
// elegant mechanism.
G4TouchableHandle fTouchableHandle;
G4SteppingControl StepControlFlag = NormalCondition;
G4double physIntLength = 0.0;
G4ForceCondition fCondition = InActivated;
G4GPILSelection fGPILSelection = NotCandidateForSelection;
// Above three variables are for the method DefinePhysicalStepLength().
// To pass this information to the method Verbose(), they are kept at
// here. Need a more elegant mechanism
};
#endif
+66 -79
View File
@@ -23,29 +23,30 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VTrajectory
//
// Class description:
//
//---------------------------------------------------------------
//
// G4VTrajectory.hh
//
// class description:
// This class is the abstract base class which represents a trajectory of
// a particle tracked.
// Its concrete class includes information of
// 1) List of trajectory points which compose the trajectory,
// 2) static information of particle which generated the
// trajectory,
// 3) trackID and parent particle ID of the trajectory,
//
// ---------------------------------------------------------------
// This class is the abstract base class representing a trajectory of
// a particle being tracked.
// Its concrete class includes information of:
// 1) List of trajectory points composing the trajectory;
// 2) Static information of the particle which generated the trajectory;
// 3) Track ID and parent particle ID of the trajectory.
#ifndef G4VTrajectory_h
#define G4VTrajectory_h 1
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Makoto Asai (e-mail: asai@slac.stanford.edu)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
// --------------------------------------------------------------------
#ifndef G4VTrajectory_hh
#define G4VTrajectory_hh 1
#include "globals.hh"
#include <vector>
#include <map>
#include "globals.hh"
#include "G4ThreeVector.hh"
class G4Step;
@@ -55,74 +56,60 @@ class G4AttValue;
class G4VTrajectory
{
public: // with description
public:
// Constructor/Destrcutor
G4VTrajectory();
virtual ~G4VTrajectory();
// Constructor/Destrcutor
G4VTrajectory();
virtual ~G4VTrajectory();
G4bool operator == (const G4VTrajectory& right) const;
// Equality operator
// Operators
G4bool operator == (const G4VTrajectory& right) const;
virtual G4int GetTrackID() const = 0;
virtual G4int GetParentID() const = 0;
virtual G4String GetParticleName() const = 0;
virtual G4double GetCharge() const = 0;
// Accessors
// Get/Set functions
virtual G4int GetTrackID() const = 0;
virtual G4int GetParentID() const = 0;
virtual G4String GetParticleName() const = 0;
virtual G4double GetCharge() const = 0;
// Charge is that of G4DynamicParticle
virtual G4int GetPDGEncoding() const = 0;
// Zero will be returned if the particle does not have PDG code.
virtual G4ThreeVector GetInitialMomentum() const = 0;
// Momentum at the origin of the track in global coordinate system.
virtual G4int GetPDGEncoding() const = 0;
// Charge is that of G4DynamicParticle
virtual G4ThreeVector GetInitialMomentum() const = 0;
// Zero will be returned if the particle does not have PDG code.
// Momentum at the origin of the track in global coordinate system
// Other member functions
virtual int GetPointEntries() const = 0;
// Returns the number of trajectory points
virtual G4VTrajectoryPoint* GetPoint(G4int i) const = 0;
// Returns i-th trajectory point.
virtual void ShowTrajectory(std::ostream& os=G4cout) const;
// Convert attributes in trajectory (and trajectory point if
// needed) to ostream. A default implementation in this base class
// may be used or may be overridden in the concrete class. Note:
// the user needs to follow with new-line or end-of-string,
// depending on the nature of os.
virtual void DrawTrajectory() const;
// Draw the trajectory. A default implementation in this base
// class may be used or may be overridden in the concrete class.
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const
{ return 0; }
// If implemented by a derived class, returns a pointer to a map of
// attribute definitions for the attribute values below. The user
// must test the validity of this pointer. See G4Trajectory for an
// example of a concrete implementation of this method.
virtual std::vector<G4AttValue>* CreateAttValues() const
{ return 0; }
// If implemented by a derived class, returns a pointer to a list
// of attribute values suitable, e.g., for picking. Each must
// refer to an attribute definition in the above map; its name is
// the key. The user must test the validity of this pointer (it
// must be non-zero and conform to the G4AttDefs, which may be
// checked with G4AttCheck) and delete the list after use. See
// G4Trajectory for an example of a concrete implementation of this
// method and G4VTrajectory::ShowTrajectory for an example of its
// use.
public:
// Following methods MUST be invoked exclusively by G4TrackingManager
virtual void AppendStep(const G4Step* aStep) = 0;
virtual void MergeTrajectory(G4VTrajectory* secondTrajectory) = 0;
virtual G4int GetPointEntries() const = 0;
// Returns the number of trajectory points
virtual G4VTrajectoryPoint* GetPoint(G4int i) const = 0;
// Returns i-th trajectory point
virtual void ShowTrajectory(std::ostream& os=G4cout) const;
// Converts attributes in trajectory (and trajectory point if
// needed) to ostream. A default implementation in this base class
// may be used or may be overridden in the concrete class. Note:
// the user needs to follow with new-line or end-of-string,
// depending on the nature of os
virtual void DrawTrajectory() const;
// Draw the trajectory. A default implementation in this base
// class may be used or may be overridden in the concrete class
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const
{ return nullptr; }
// If implemented by a derived class, returns a pointer to a map of
// attribute definitions for the attribute values below. The user
// must test the validity of this pointer. See G4Trajectory for an
// example of a concrete implementation of this method
virtual std::vector<G4AttValue>* CreateAttValues() const
{ return nullptr; }
// If implemented by a derived class, returns a pointer to a list
// of attribute values suitable, e.g., for picking. Each must
// refer to an attribute definition in the above map; its name is
// the key. The user must test the validity of this pointer (it
// must be non-zero and conform to the G4AttDefs, which may be
// checked with G4AttCheck) and delete the list after use. See
// G4Trajectory for an example of a concrete implementation of this
// method and G4VTrajectory::ShowTrajectory for an example of its use.
virtual void AppendStep(const G4Step* aStep) = 0;
virtual void MergeTrajectory(G4VTrajectory* secondTrajectory) = 0;
// Methods invoked exclusively by G4TrackingManager
};
#endif
+46 -49
View File
@@ -23,25 +23,25 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4VTrajectoryPoint
//
// Class description:
//
//---------------------------------------------------------------
//
// G4VTrajectoryPoint.hh
//
// class description:
// This class is the abstract base class which represents the point
// which consists of a trajectory.
// It includes information of a the point.
//
// ---------------------------------------------------------------
// This class is the abstract base class representing the point
// forming a trajectory. It includes information of a the point.
#ifndef G4VTrajectoryPoint_h
#define G4VTrajectoryPoint_h 1
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
// --------------------------------------------------------------------
#ifndef G4VTrajectoryPoint_hh
#define G4VTrajectoryPoint_hh 1
#include "globals.hh"
#include <vector>
#include <map>
#include "globals.hh"
#include "G4ThreeVector.hh"
class G4AttDef;
@@ -49,48 +49,45 @@ class G4AttValue;
class G4VTrajectoryPoint
{
public: // with description
public:
// Constructor/Destructor
G4VTrajectoryPoint();
virtual ~G4VTrajectoryPoint();
G4VTrajectoryPoint();
virtual ~G4VTrajectoryPoint();
// Constructor/Destructor
// Operators
G4bool operator==(const G4VTrajectoryPoint& right) const;
G4bool operator==(const G4VTrajectoryPoint& right) const;
// Equality operator
// Get/Set functions
virtual const G4ThreeVector GetPosition() const = 0;
virtual const G4ThreeVector GetPosition() const = 0;
// Return point position
// Get method for a vector of auxiliary points
virtual const std::vector<G4ThreeVector>* GetAuxiliaryPoints() const
{ return 0; }
// If implemented by a derived class, returns a pointer to a list
// of auxiliary points, e.g., intermediate points used during the
// calculation of the step that can be used for drawing a smoother
// trajectory. The user must test the validity of this pointer.
virtual const std::vector<G4ThreeVector>* GetAuxiliaryPoints() const
{ return nullptr; }
// Get method for a vector of auxiliary points.
// If implemented by a derived class, returns a pointer to a list
// of auxiliary points, e.g., intermediate points used during the
// calculation of the step that can be used for drawing a smoother
// trajectory. The user must test the validity of this pointer
// Get method for HEPRep style attribute definitions
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const
{ return 0; }
// If implemented by a derived class, returns a pointer to a map of
// attribute definitions for the attribute values below. The user
// must test the validity of this pointer. See G4Trajectory for an
// example of a concrete implementation of this method.
// Get method for HEPRep style attribute values
virtual std::vector<G4AttValue>* CreateAttValues() const
{ return 0; }
// If implemented by a derived class, returns a pointer to a list
// of attribute values suitable, e.g., for picking. Each must
// refer to an attribute definition in the above map; its name is
// the key. The user must test the validity of this pointer (it
// must be non-zero and conform to the G4AttDefs, which may be
// checked with G4AttCheck) and delete the list after use. See
// G4Trajectory for an example of a concrete implementation of this
// method and G4VTrajectory::ShowTrajectory for an example of its
// use.
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const
{ return nullptr; }
// Get method for HEPRep style attribute definitions.
// If implemented by a derived class, returns a pointer to a map of
// attribute definitions for the attribute values below. The user
// must test the validity of this pointer. See G4Trajectory for an
// example of a concrete implementation of this method
virtual std::vector<G4AttValue>* CreateAttValues() const
{ return nullptr; }
// Get method for HEPRep style attribute values.
// If implemented by a derived class, returns a pointer to a list
// of attribute values suitable, e.g., for picking. Each must
// refer to an attribute definition in the above map; its name is
// the key. The user must test the validity of this pointer (it
// must be non-zero and conform to the G4AttDefs, which may be
// checked with G4AttCheck) and delete the list after use. See
// G4Trajectory for an example of a concrete implementation of this
// method and G4VTrajectory::ShowTrajectory() for an example of its use.
};
#endif
+3 -5
View File
@@ -23,14 +23,12 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Defines for Windows DLLs import/export
//
// Author: G.Cosmo, CERN
// --------------------------------------------------------------------
#ifndef TRKGDEFS_HH
#define TRKGDEFS_HH
#define TRKGDEFS_HH 1
#include "G4Types.hh"