BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | Friends
BDSTrajectoryPrimary Class Reference

Trajectory information for only the primary. More...

#include <BDSTrajectoryPrimary.hh>

Inheritance diagram for BDSTrajectoryPrimary:
Inheritance graph
Collaboration diagram for BDSTrajectoryPrimary:
Collaboration graph

Public Member Functions

 BDSTrajectoryPrimary (const G4Track *aTrack, G4bool interactive, const BDS::TrajectoryOptions &storageOptionsIn, G4bool storeTrajectoryPointsIn)
 
 BDSTrajectoryPrimary (BDSTrajectoryPrimary &)=delete
 copy constructor is not needed
 
virtual G4bool IsPrimary () const
 Override and return true always.
 
void * operator new (size_t)
 
void operator delete (void *)
 
int operator== (const BDSTrajectoryPrimary &right) const
 
virtual void AppendStep (const G4Step *aStep)
 
virtual void MergeTrajectory (G4VTrajectory *secondTrajectory)
 
G4bool HasHitSomething () const
 
const BDSTrajectoryPointFirstHit () const
 Accessor.
 
const BDSTrajectoryPointLastPoint () const
 Accessor.
 
- Public Member Functions inherited from BDSTrajectory
 BDSTrajectory (const G4Track *aTrack, G4bool interactiveIn, const BDS::TrajectoryOptions &storageOptionsIn)
 
 BDSTrajectory (BDSTrajectory &)=delete
 copy constructor is not needed
 
void * operator new (size_t)
 
void operator delete (void *)
 
int operator== (const BDSTrajectory &right) const
 
virtual void AppendStep (const G4Step *aStep)
 
void AppendStep (const BDSTrajectoryPoint *pointIn)
 
void CleanPoint (BDSTrajectoryPoint *point) const
 
virtual void MergeTrajectory (G4VTrajectory *secondTrajectory)
 Merge another trajectory into this one.
 
virtual G4VTrajectoryPoint * GetPoint (G4int i) const
 Access a point - use this class's container.
 
virtual int GetPointEntries () const
 Get number of trajectory points in this trajectory.
 
virtual G4bool IsPrimary () const
 Method to identify which one is a primary. Overridden in derived class.
 
void SetTrajIndex (G4int trajIndexIn)
 
G4int GetTrajIndex () const
 
void SetParentIndex (G4int parentIndexIn)
 
G4int GetParentIndex () const
 
void SetParentStepIndex (G4int parentStepIndexIn)
 The index of the step along the parent trajectory from which this one was created.
 
G4int GetParentStepIndex () const
 
G4int GetDepth () const
 Depth in the tree. Will be filled later once all trajectories are created and sorted.
 
void SetDepth (G4int depthIn)
 
void SetParent (BDSTrajectory *parentIn)
 Record the parent trajectory.
 
BDSTrajectoryGetParent () const
 
G4int GetCreatorProcessType () const
 
G4int GetCreatorProcessSubType () const
 
BDSTrajectoryPointFirstInteraction () const
 
BDSTrajectoryPointLastInteraction () const
 

Static Public Attributes

static G4bool hasScatteredThisTurn = false
 

Protected Attributes

BDSTrajectoryPointfirstHit
 Point owned by this class for the first scattering point.
 
BDSTrajectoryPointlastPoint
 Point owned by this class for the last-most point.
 
- Protected Attributes inherited from BDSTrajectory
G4int creatorProcessType
 
G4int creatorProcessSubType
 
G4double weight
 
G4bool interactive
 
G4bool suppressTransportationAndNotInteractive
 
const BDS::TrajectoryOptions storageOptions
 
BDSTrajectoryparent
 
G4int trajIndex
 
G4int parentIndex
 
G4int parentStepIndex
 
G4int depth
 
BDSTrajectoryPointsContainer * fpBDSPointsContainer
 

Private Member Functions

 BDSTrajectoryPrimary ()=delete
 No default constructor required.
 

Private Attributes

const G4bool storeTrajectoryPoints
 Whether to use base class to store all points.
 

Friends

std::ostream & operator<< (std::ostream &out, BDSTrajectoryPrimary const &t)
 Output stream.
 

Detailed Description

Trajectory information for only the primary.

Similar to BDSTrajectory but keeps two separate BDSTrajectoryPoints. One for the end of the trajectory (last hit), and one for the first scattering point (first 'hit').

Author
L. Nevay

Definition at line 48 of file BDSTrajectoryPrimary.hh.

Constructor & Destructor Documentation

◆ BDSTrajectoryPrimary()

BDSTrajectoryPrimary::BDSTrajectoryPrimary ( const G4Track *  aTrack,
G4bool  interactive,
const BDS::TrajectoryOptions storageOptionsIn,
G4bool  storeTrajectoryPointsIn 
)

Definition at line 36 of file BDSTrajectoryPrimary.cc.

◆ ~BDSTrajectoryPrimary()

BDSTrajectoryPrimary::~BDSTrajectoryPrimary ( )
virtual

Definition at line 48 of file BDSTrajectoryPrimary.cc.

Member Function Documentation

◆ AppendStep()

void BDSTrajectoryPrimary::AppendStep ( const G4Step *  aStep)
virtual

Append a step point to this trajectory. This is required for the trajectory points to show up in the visualisation correctly.

Reimplemented from BDSTrajectory.

Definition at line 54 of file BDSTrajectoryPrimary.cc.

References BDSTrajectory::AppendStep(), firstHit, hasScatteredThisTurn, BDSTrajectoryPoint::IsScatteringPoint(), lastPoint, and storeTrajectoryPoints.

Here is the call graph for this function:

◆ FirstHit()

const BDSTrajectoryPoint * BDSTrajectoryPrimary::FirstHit ( ) const
inline

Accessor.

Definition at line 81 of file BDSTrajectoryPrimary.hh.

References firstHit.

◆ HasHitSomething()

G4bool BDSTrajectoryPrimary::HasHitSomething ( ) const
inline

Whether this primary trajectory has hit an object (ie physics process invoked). Judged by casting first hit pointer to Boolean.

Definition at line 87 of file BDSTrajectoryPrimary.hh.

References firstHit.

◆ IsPrimary()

virtual G4bool BDSTrajectoryPrimary::IsPrimary ( ) const
inlinevirtual

Override and return true always.

Reimplemented from BDSTrajectory.

Definition at line 62 of file BDSTrajectoryPrimary.hh.

◆ LastPoint()

const BDSTrajectoryPoint * BDSTrajectoryPrimary::LastPoint ( ) const
inline

Accessor.

Definition at line 82 of file BDSTrajectoryPrimary.hh.

References lastPoint.

◆ MergeTrajectory()

void BDSTrajectoryPrimary::MergeTrajectory ( G4VTrajectory *  secondTrajectory)
virtual

Merge another trajectory into this one. The first hit will always be lower in this one but the lastpoint could be later, so copy that. Must implement this function to avoid double deletion if trajectory is merged.

Reimplemented from BDSTrajectory.

Definition at line 85 of file BDSTrajectoryPrimary.cc.

References lastPoint, and BDSTrajectory::MergeTrajectory().

Here is the call graph for this function:

◆ operator delete()

void BDSTrajectoryPrimary::operator delete ( void *  aTrajectory)
inline

Definition at line 112 of file BDSTrajectoryPrimary.hh.

◆ operator new()

void * BDSTrajectoryPrimary::operator new ( size_t  )
inline

Definition at line 105 of file BDSTrajectoryPrimary.hh.

◆ operator==()

int BDSTrajectoryPrimary::operator== ( const BDSTrajectoryPrimary right) const
inline

Definition at line 66 of file BDSTrajectoryPrimary.hh.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
BDSTrajectoryPrimary const &  t 
)
friend

Output stream.

Definition at line 102 of file BDSTrajectoryPrimary.cc.

Field Documentation

◆ firstHit

BDSTrajectoryPoint* BDSTrajectoryPrimary::firstHit
protected

Point owned by this class for the first scattering point.

Definition at line 94 of file BDSTrajectoryPrimary.hh.

Referenced by AppendStep(), FirstHit(), and HasHitSomething().

◆ hasScatteredThisTurn

G4bool BDSTrajectoryPrimary::hasScatteredThisTurn = false
static

Whether this primary has scattered on this turn. It should be reset at the end of each turn. This is static so it can be done externally.

Definition at line 91 of file BDSTrajectoryPrimary.hh.

Referenced by AppendStep(), and BDSPTCOneTurnMap::ShouldApplyToPrimary().

◆ lastPoint

BDSTrajectoryPoint* BDSTrajectoryPrimary::lastPoint
protected

Point owned by this class for the last-most point.

Definition at line 95 of file BDSTrajectoryPrimary.hh.

Referenced by AppendStep(), LastPoint(), and MergeTrajectory().

◆ storeTrajectoryPoints

const G4bool BDSTrajectoryPrimary::storeTrajectoryPoints
private

Whether to use base class to store all points.

Definition at line 98 of file BDSTrajectoryPrimary.hh.

Referenced by AppendStep().


The documentation for this class was generated from the following files: