BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
A Point in a trajectory with extra information. More...
#include <BDSTrajectoryPoint.hh>
Public Member Functions | |
BDSTrajectoryPoint () | |
Default constructor. | |
BDSTrajectoryPoint (const G4Step *step, G4bool storeExtrasLocalIn, G4bool storeExtrasLinkIn, G4bool storeExtrasIonIn) | |
BDSTrajectoryPoint (const G4Track *track, G4bool storeExtrasLocalIn, G4bool storeExtrasLinkIn, G4bool storeExtrasIonIn) | |
BDSTrajectoryPoint (const BDSTrajectoryPoint &other) | |
Implement copy constructor as we have pointers we own. | |
void * | operator new (size_t) |
void | operator delete (void *aTrajectoryPoint) |
int | operator== (const BDSTrajectoryPoint &right) const |
void | DeleteExtraLocal () |
void | DeleteExtraLinks () |
void | DeleteExtraIon () |
G4bool | IsScatteringPoint () const |
G4bool | NotTransportationLimitedStep () const |
Return true if step isn't defined by transportation processes. | |
G4int | GetPreProcessType () const |
Accessor. | |
G4int | GetPreProcessSubType () const |
Accessor. | |
G4int | GetPostProcessType () const |
Accessor. | |
G4int | GetPostProcessSubType () const |
Accessor. | |
G4double | GetPreWeight () const |
Accessor. | |
G4double | GetPostWeight () const |
Accessor. | |
G4double | GetPreEnergy () const |
Accessor. | |
G4double | GetPostEnergy () const |
Accessor. | |
G4double | GetEnergyDeposit () const |
Accessor. | |
G4ThreeVector | GetPreMomentum () const |
Accessor. | |
G4ThreeVector | GetPostMomentum () const |
Accessor. | |
G4double | GetPreS () const |
Accessor. | |
G4double | GetPostS () const |
Accessor. | |
G4double | GetPreGlobalTime () const |
Accessor. | |
G4double | GetPostGlobalTime () const |
Accessor. | |
G4int | GetBeamLineIndex () const |
Accessor. | |
BDSBeamline * | GetBeamLine () const |
Accessor. | |
G4ThreeVector | GetPrePosLocal () const |
Accessor. | |
G4ThreeVector | GetPostPosLocal () const |
Accessor. | |
G4Material * | GetMaterial () const |
Accessor. | |
void | SetMaterial (G4Material *materialIn) |
G4ThreeVector | GetPositionLocal () const |
Accessor for the extra information local. | |
G4ThreeVector | GetMomentumLocal () const |
Accessor. | |
G4int | GetCharge () const |
Accessor for the extra information links. | |
G4double | GetKineticEnergy () const |
Accessor for the extra information links. | |
G4int | GetTurnsTaken () const |
Accessor for the extra information links. | |
G4double | GetMass () const |
Accessor for the extra information links. | |
G4double | GetRigidity () const |
Accessor for the extra information links. | |
G4bool | GetIsIon () const |
Accessor for the extra information ions. | |
G4int | GetIonA () const |
Accessor for the extra information ions. | |
G4int | GetIonZ () const |
Accessor for the extra information ions. | |
G4int | GetNElectrons () const |
Accessor for the extra information ions. | |
G4double | PrePosR () const |
Return the transverse local radius in x,y. | |
G4double | PostPosR () const |
Return the transverse local radius in x,y. | |
G4bool | operator< (const BDSTrajectoryPoint &other) const |
Comparison operator. | |
G4bool | operator> (const BDSTrajectoryPoint &other) const |
Comparison operator. | |
G4bool | operator<= (const BDSTrajectoryPoint &other) const |
Comparison operator. | |
G4bool | operator>= (const BDSTrajectoryPoint &other) const |
Comparison operator. | |
Static Public Member Functions | |
static G4bool | IsScatteringPoint (const G4Step *step) |
Static function to determine whether a step corresponds to scattering. | |
static G4bool | IsScatteringPoint (G4int postProcessType, G4int postProcessSubType, G4double totalEnergyDeposit) |
Static function to determine whether a step corresponds to scattering. | |
Data Fields | |
BDSTrajectoryPointLocal * | extraLocal |
BDSTrajectoryPointLink * | extraLink |
BDSTrajectoryPointIon * | extraIon |
Static Public Attributes | |
static G4double | dEThresholdForScattering = 1e-8 |
Private Member Functions | |
void | InitialiseVariables () |
void | StoreExtrasLink (const G4Track *track) |
Utility function to prepare and fill extra link variables. | |
void | StoreExtrasIon (const G4Track *track) |
Utility function to prepare and fill extra ion variables. | |
Private Attributes | |
G4int | preProcessType |
Process type of pre-step point. | |
G4int | preProcessSubType |
Process sub type of pre-step point. | |
G4int | postProcessType |
Process type of post step point. | |
G4int | postProcessSubType |
Process sub type of post step point. | |
G4double | preWeight |
Weight associated with pre-step point. | |
G4double | postWeight |
Weight associated with post step point. | |
G4double | preEnergy |
Kinetic energy of pre-step point. | |
G4double | postEnergy |
Kinetic energy of post step point. | |
G4ThreeVector | preMomentum |
Momentum of pre-step point. | |
G4ThreeVector | postMomentum |
Momentum of post-step point. | |
G4double | energyDeposit |
Total energy deposited during step. | |
G4double | preS |
Global curvilinear S coordinate of pre-step point. | |
G4double | postS |
Global curvilinear S coordinate of post step point. | |
G4double | preGlobalTime |
Time since event started of pre-step point. | |
G4double | postGlobalTime |
Time since event started of post-step point. | |
G4int | beamlineIndex |
Index to beam line element in the mass world beam line. | |
BDSBeamline * | beamline |
Beam line (if any) point belongs to (always mass world). | |
G4ThreeVector | prePosLocal |
Local coordinates of pre-step point. | |
G4ThreeVector | postPosLocal |
Local coordinates of post-step point. | |
G4Material * | material |
Material point for pre-step point. | |
Static Private Attributes | |
static BDSAuxiliaryNavigator * | auxNavigator = new BDSAuxiliaryNavigator() |
Friends | |
std::ostream & | operator<< (std::ostream &out, BDSTrajectoryPoint const &p) |
Output stream. | |
A Point in a trajectory with extra information.
Definition at line 44 of file BDSTrajectoryPoint.hh.
BDSTrajectoryPoint::BDSTrajectoryPoint | ( | ) |
Default constructor.
Definition at line 56 of file BDSTrajectoryPoint.cc.
References InitialiseVariables().
BDSTrajectoryPoint::BDSTrajectoryPoint | ( | const G4Step * | step, |
G4bool | storeExtrasLocalIn, | ||
G4bool | storeExtrasLinkIn, | ||
G4bool | storeExtrasIonIn | ||
) |
This constructor is used to construct a point from a step intended to be appended to a trajectory. It uses the post step point as the main position.
Definition at line 125 of file BDSTrajectoryPoint.cc.
References auxNavigator, beamline, beamlineIndex, BDSAuxiliaryNavigator::ConvertToLocal(), energyDeposit, BDSPhysicalVolumeInfo::GetBeamlineMassWorld(), BDSPhysicalVolumeInfo::GetBeamlineMassWorldIndex(), BDSPhysicalVolumeInfoRegistry::GetInfo(), BDSProcessMap::GetProcessName(), BDSPhysicalVolumeInfo::GetSPos(), InitialiseVariables(), BDSPhysicalVolumeInfoRegistry::Instance(), BDSProcessMap::Instance(), material, postEnergy, postGlobalTime, postMomentum, postPosLocal, postProcessSubType, postProcessType, postS, BDSStep::PostStepPoint(), postWeight, preEnergy, preGlobalTime, preMomentum, prePosLocal, preProcessSubType, preProcessType, preS, BDSStep::PreStepPoint(), preWeight, StoreExtrasIon(), StoreExtrasLink(), and BDSStep::VolumeForTransform().
BDSTrajectoryPoint::BDSTrajectoryPoint | ( | const G4Track * | track, |
G4bool | storeExtrasLocalIn, | ||
G4bool | storeExtrasLinkIn, | ||
G4bool | storeExtrasIonIn | ||
) |
This constructor is required for the beginning of each track and produces the initial vertex point.
Definition at line 62 of file BDSTrajectoryPoint.cc.
References auxNavigator, beamline, beamlineIndex, BDSAuxiliaryNavigator::ConvertToLocal(), energyDeposit, BDSPhysicalVolumeInfo::GetBeamlineMassWorld(), BDSPhysicalVolumeInfo::GetBeamlineMassWorldIndex(), BDSPhysicalVolumeInfoRegistry::GetInfo(), BDSProcessMap::GetProcessName(), BDSPhysicalVolumeInfo::GetSPos(), InitialiseVariables(), BDSPhysicalVolumeInfoRegistry::Instance(), BDSProcessMap::Instance(), material, postEnergy, postGlobalTime, postMomentum, postPosLocal, postProcessSubType, postProcessType, postS, BDSStep::PostStepPoint(), postWeight, preEnergy, preGlobalTime, preMomentum, prePosLocal, preProcessSubType, preProcessType, preS, BDSStep::PreStepPoint(), preWeight, StoreExtrasIon(), StoreExtrasLink(), and BDSStep::VolumeForTransform().
BDSTrajectoryPoint::BDSTrajectoryPoint | ( | const BDSTrajectoryPoint & | other | ) |
Implement copy constructor as we have pointers we own.
Definition at line 189 of file BDSTrajectoryPoint.cc.
References beamline, beamlineIndex, energyDeposit, material, postEnergy, postGlobalTime, postMomentum, postPosLocal, postProcessSubType, postProcessType, postS, postWeight, preEnergy, preGlobalTime, preMomentum, prePosLocal, preProcessSubType, preProcessType, preS, and preWeight.
|
virtual |
Definition at line 218 of file BDSTrajectoryPoint.cc.
|
inline |
Definition at line 75 of file BDSTrajectoryPoint.hh.
|
inline |
Definition at line 74 of file BDSTrajectoryPoint.hh.
|
inline |
Definition at line 73 of file BDSTrajectoryPoint.hh.
|
inline |
|
inline |
|
inline |
Accessor for the extra information links.
Definition at line 126 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor.
Definition at line 103 of file BDSTrajectoryPoint.hh.
References energyDeposit.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor for the extra information ions.
Definition at line 135 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor for the extra information ions.
Definition at line 136 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor for the extra information ions.
Definition at line 134 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor for the extra information links.
Definition at line 127 of file BDSTrajectoryPoint.hh.
References preEnergy.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor for the extra information links.
Definition at line 129 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor.
Definition at line 114 of file BDSTrajectoryPoint.hh.
References material.
Referenced by BDSTrajectory::AppendStep(), and BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor.
Definition at line 122 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor for the extra information ions.
Definition at line 137 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor for the extra information local.
Definition at line 121 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Accessor.
Definition at line 98 of file BDSTrajectoryPoint.hh.
References postProcessSubType.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory(), and IsScatteringPoint().
|
inline |
Accessor.
Definition at line 97 of file BDSTrajectoryPoint.hh.
References postProcessType.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory(), and IsScatteringPoint().
|
inline |
|
inline |
Accessor.
Definition at line 100 of file BDSTrajectoryPoint.hh.
References postWeight.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
|
inline |
Accessor.
Definition at line 108 of file BDSTrajectoryPoint.hh.
References preGlobalTime.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor.
Definition at line 104 of file BDSTrajectoryPoint.hh.
References preMomentum.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
|
inline |
Accessor.
Definition at line 96 of file BDSTrajectoryPoint.hh.
References preProcessSubType.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor.
Definition at line 95 of file BDSTrajectoryPoint.hh.
References preProcessType.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor.
Definition at line 106 of file BDSTrajectoryPoint.hh.
References preS.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory(), and IsScatteringPoint().
|
inline |
Accessor.
Definition at line 99 of file BDSTrajectoryPoint.hh.
References preWeight.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor for the extra information links.
Definition at line 130 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
inline |
Accessor for the extra information links.
Definition at line 128 of file BDSTrajectoryPoint.hh.
Referenced by BDSOutputROOTEventTrajectory::FillIndividualTrajectory().
|
private |
Initialisation of variables in separate function to reduce duplication in multiple constructors.
Definition at line 225 of file BDSTrajectoryPoint.cc.
References beamline, beamlineIndex, energyDeposit, material, postEnergy, postGlobalTime, postMomentum, postPosLocal, postProcessSubType, postProcessType, postS, postWeight, preEnergy, preGlobalTime, preMomentum, prePosLocal, preProcessSubType, preProcessType, preS, and preWeight.
Referenced by BDSTrajectoryPoint().
G4bool BDSTrajectoryPoint::IsScatteringPoint | ( | ) | const |
Check to see if point is a scattering point (from a physics point of view). Uses static functions defined below. This is defined by whether the processes that defined the step length is non-transportation or the energy loss along step is greater than 1e-9 MeV, which could be due to continuous energy loss processes along step that might not limit the step length.
Definition at line 278 of file BDSTrajectoryPoint.cc.
References energyDeposit, GetPostProcessSubType(), GetPostProcessType(), GetPreS(), BDSProcessMap::GetProcessName(), BDSProcessMap::Instance(), IsScatteringPoint(), postProcessSubType, and postProcessType.
Referenced by BDSTrajectoryPrimary::AppendStep(), BDSTrajectory::FirstInteraction(), IsScatteringPoint(), BDSSDCollimator::ProcessHitsOrdered(), and BDSSDThinThing::ProcessHitsOrdered().
|
static |
Static function to determine whether a step corresponds to scattering.
Definition at line 322 of file BDSTrajectoryPoint.cc.
References IsScatteringPoint(), postProcessSubType, and postProcessType.
|
static |
Static function to determine whether a step corresponds to scattering.
Definition at line 344 of file BDSTrajectoryPoint.cc.
References dEThresholdForScattering, postProcessSubType, and postProcessType.
G4bool BDSTrajectoryPoint::NotTransportationLimitedStep | ( | ) | const |
Return true if step isn't defined by transportation processes.
Definition at line 295 of file BDSTrajectoryPoint.cc.
References postProcessType, and preProcessType.
Referenced by BDSTrajectory::AppendStep().
|
inline |
Definition at line 213 of file BDSTrajectoryPoint.hh.
|
inline |
Definition at line 206 of file BDSTrajectoryPoint.hh.
|
inline |
Comparison operator.
Definition at line 218 of file BDSTrajectoryPoint.hh.
References preGlobalTime, and preS.
|
inline |
Comparison operator.
Definition at line 152 of file BDSTrajectoryPoint.hh.
|
inline |
Definition at line 71 of file BDSTrajectoryPoint.hh.
|
inline |
Comparison operator.
Definition at line 151 of file BDSTrajectoryPoint.hh.
|
inline |
Comparison operator.
Definition at line 153 of file BDSTrajectoryPoint.hh.
G4double BDSTrajectoryPoint::PostPosR | ( | ) | const |
Return the transverse local radius in x,y.
Definition at line 317 of file BDSTrajectoryPoint.cc.
References postPosLocal.
Referenced by BDSEventAction::IdentifyTrajectoriesForStorage().
G4double BDSTrajectoryPoint::PrePosR | ( | ) | const |
Return the transverse local radius in x,y.
Definition at line 312 of file BDSTrajectoryPoint.cc.
References prePosLocal.
|
inline |
For initial points in a trajectory it is not possible to yet know the material so it has to be updated after the first step.
Definition at line 118 of file BDSTrajectoryPoint.hh.
References material.
|
private |
Utility function to prepare and fill extra ion variables.
Definition at line 265 of file BDSTrajectoryPoint.cc.
References BDS::IsIon().
Referenced by BDSTrajectoryPoint().
|
private |
Utility function to prepare and fill extra link variables.
Definition at line 252 of file BDSTrajectoryPoint.cc.
References BDSGlobalConstants::Instance(), BDS::IsFinite(), and BDS::Rigidity().
Referenced by BDSTrajectoryPoint().
|
friend |
Output stream.
Definition at line 306 of file BDSTrajectoryPoint.cc.
|
staticprivate |
An auxiliary navigator to get curvilinear coordinates. Lots of points, but only need one navigator so make it static.
Definition at line 201 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint().
|
private |
Beam line (if any) point belongs to (always mass world).
Definition at line 194 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetBeamLine(), and InitialiseVariables().
|
private |
Index to beam line element in the mass world beam line.
Definition at line 193 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetBeamLineIndex(), and InitialiseVariables().
|
static |
Threshold energy (in geant4 units) for considering a point a scattering point. In some cases the along step process such as multiple scattering won't show as the process that defined the step but may significantly degrade the energy. Use this value as a threshold over which we consider the step a 'scattering' one.
Definition at line 164 of file BDSTrajectoryPoint.hh.
Referenced by IsScatteringPoint().
|
private |
Total energy deposited during step.
Definition at line 188 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetEnergyDeposit(), InitialiseVariables(), and IsScatteringPoint().
BDSTrajectoryPointIon* BDSTrajectoryPoint::extraIon |
Definition at line 158 of file BDSTrajectoryPoint.hh.
BDSTrajectoryPointLink* BDSTrajectoryPoint::extraLink |
Definition at line 157 of file BDSTrajectoryPoint.hh.
BDSTrajectoryPointLocal* BDSTrajectoryPoint::extraLocal |
Definition at line 156 of file BDSTrajectoryPoint.hh.
|
private |
Material point for pre-step point.
Definition at line 197 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetMaterial(), InitialiseVariables(), and SetMaterial().
|
private |
Kinetic energy of post step point.
Definition at line 185 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPostEnergy(), and InitialiseVariables().
|
private |
Time since event started of post-step point.
Definition at line 192 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPostGlobalTime(), and InitialiseVariables().
|
private |
Momentum of post-step point.
Definition at line 187 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPostMomentum(), and InitialiseVariables().
|
private |
Local coordinates of post-step point.
Definition at line 196 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPostPosLocal(), InitialiseVariables(), and PostPosR().
|
private |
Process sub type of post step point.
Definition at line 180 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPostProcessSubType(), InitialiseVariables(), and IsScatteringPoint().
|
private |
Process type of post step point.
Definition at line 179 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPostProcessType(), InitialiseVariables(), IsScatteringPoint(), and NotTransportationLimitedStep().
|
private |
Global curvilinear S coordinate of post step point.
Definition at line 190 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPostS(), and InitialiseVariables().
|
private |
Weight associated with post step point.
Definition at line 183 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPostWeight(), and InitialiseVariables().
|
private |
Kinetic energy of pre-step point.
Definition at line 184 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetKineticEnergy(), GetPreEnergy(), and InitialiseVariables().
|
private |
Time since event started of pre-step point.
Definition at line 191 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPreGlobalTime(), InitialiseVariables(), and operator<().
|
private |
Momentum of pre-step point.
Definition at line 186 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPreMomentum(), and InitialiseVariables().
|
private |
Local coordinates of pre-step point.
Definition at line 195 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPrePosLocal(), InitialiseVariables(), and PrePosR().
|
private |
Process sub type of pre-step point.
Definition at line 178 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPreProcessSubType(), and InitialiseVariables().
|
private |
Process type of pre-step point.
Definition at line 177 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPreProcessType(), InitialiseVariables(), and NotTransportationLimitedStep().
|
private |
Global curvilinear S coordinate of pre-step point.
Definition at line 189 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPreS(), InitialiseVariables(), and operator<().
|
private |
Weight associated with pre-step point.
Definition at line 182 of file BDSTrajectoryPoint.hh.
Referenced by BDSTrajectoryPoint(), GetPreWeight(), and InitialiseVariables().