Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VTrajectory Class Referenceabstract

#include <G4VTrajectory.hh>

+ Inheritance diagram for G4VTrajectory:

Public Member Functions

 G4VTrajectory ()=default
 
virtual ~G4VTrajectory ()=default
 
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
 
virtual G4int GetPDGEncoding () const =0
 
virtual G4ThreeVector GetInitialMomentum () const =0
 
virtual G4int GetPointEntries () const =0
 
virtual G4VTrajectoryPointGetPoint (G4int i) const =0
 
virtual void ShowTrajectory (std::ostream &os=G4cout) const
 
virtual void DrawTrajectory () const
 
virtual const std::map< G4String, G4AttDef > * GetAttDefs () const
 
virtual std::vector< G4AttValue > * CreateAttValues () const
 
virtual void AppendStep (const G4Step *aStep)=0
 
virtual void MergeTrajectory (G4VTrajectory *secondTrajectory)=0
 

Detailed Description

Definition at line 57 of file G4VTrajectory.hh.

Constructor & Destructor Documentation

◆ G4VTrajectory()

G4VTrajectory::G4VTrajectory ( )
default

◆ ~G4VTrajectory()

virtual G4VTrajectory::~G4VTrajectory ( )
virtualdefault

Member Function Documentation

◆ AppendStep()

virtual void G4VTrajectory::AppendStep ( const G4Step * aStep)
pure virtual

◆ CreateAttValues()

virtual std::vector< G4AttValue > * G4VTrajectory::CreateAttValues ( ) const
inlinevirtual

◆ DrawTrajectory()

void G4VTrajectory::DrawTrajectory ( ) const
virtual

Reimplemented in G4RayTrajectory, G4RichTrajectory, G4SmoothTrajectory, and G4Trajectory.

Definition at line 99 of file G4VTrajectory.cc.

100{
102
103 if (pVVisManager != nullptr) {
104 pVVisManager->DispatchToModel(*this);
105 }
106}
virtual void DispatchToModel(const G4VTrajectory &)=0
static G4VVisManager * GetConcreteInstance()

Referenced by G4GMocrenFileSceneHandler::AddCompound(), G4VSceneHandler::AddCompound(), G4RichTrajectory::DrawTrajectory(), G4SmoothTrajectory::DrawTrajectory(), and G4Trajectory::DrawTrajectory().

◆ GetAttDefs()

virtual const std::map< G4String, G4AttDef > * G4VTrajectory::GetAttDefs ( ) const
inlinevirtual

◆ GetCharge()

◆ GetInitialMomentum()

virtual G4ThreeVector G4VTrajectory::GetInitialMomentum ( ) const
pure virtual

◆ GetParentID()

virtual G4int G4VTrajectory::GetParentID ( ) const
pure virtual

◆ GetParticleName()

virtual G4String G4VTrajectory::GetParticleName ( ) const
pure virtual

◆ GetPDGEncoding()

virtual G4int G4VTrajectory::GetPDGEncoding ( ) const
pure virtual

◆ GetPoint()

◆ GetPointEntries()

◆ GetTrackID()

virtual G4int G4VTrajectory::GetTrackID ( ) const
pure virtual

◆ MergeTrajectory()

virtual void G4VTrajectory::MergeTrajectory ( G4VTrajectory * secondTrajectory)
pure virtual

◆ operator==()

G4bool G4VTrajectory::operator== ( const G4VTrajectory & right) const

Definition at line 48 of file G4VTrajectory.cc.

48{ return (this == &right); }

◆ ShowTrajectory()

void G4VTrajectory::ShowTrajectory ( std::ostream & os = G4cout) const
virtual

Reimplemented in G4RayTrajectory, G4RichTrajectory, G4SmoothTrajectory, and G4Trajectory.

Definition at line 50 of file G4VTrajectory.cc.

51{
52 // Makes use of attribute values implemented in the concrete class.
53 // Note: the user needs to follow with new-line or end-of-string,
54 // depending on the nature of os
55
56 std::vector<G4AttValue>* attValues = CreateAttValues();
57 const std::map<G4String, G4AttDef>* attDefs = GetAttDefs();
58
59 // Ensure validity...
60 //
61 if (G4AttCheck(attValues, attDefs).Check("G4VTrajectory::ShowTrajectory")) {
62 return;
63 }
64
65 os << "Trajectory:";
66
67 for (const auto& attValue : *attValues) {
68 auto iAttDef = attDefs->find(attValue.GetName());
69 os << "\n " << iAttDef->second.GetDesc() << " (" << attValue.GetName()
70 << "): " << attValue.GetValue();
71 }
72
73 delete attValues; // AttValues must be deleted after use.
74
75 // Now do trajectory points...
76
77 for (G4int i = 0; i < GetPointEntries(); ++i) {
78 G4VTrajectoryPoint* aTrajectoryPoint = GetPoint(i);
79 attValues = aTrajectoryPoint->CreateAttValues();
80 attDefs = aTrajectoryPoint->GetAttDefs();
81
82 // Ensure validity...
83 //
84 if (G4AttCheck(attValues, attDefs).Check("G4VTrajectory::ShowTrajectory")) {
85 return;
86 }
87
88 for (const auto& attValue : *attValues) {
89 const auto iAttDef = attDefs->find(attValue.GetName());
90 os << "\n " << iAttDef->second.GetDesc() << " (" << attValue.GetName()
91 << "): " << attValue.GetValue();
92 }
93
94 delete attValues; // AttValues must be deleted after use.
95 }
96 os << std::endl;
97}
int G4int
Definition G4Types.hh:85
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual G4VTrajectoryPoint * GetPoint(G4int i) const =0
virtual G4int GetPointEntries() const =0
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const

Referenced by G4TrackingManager::ProcessOneTrack(), G4RichTrajectory::ShowTrajectory(), G4SmoothTrajectory::ShowTrajectory(), and G4Trajectory::ShowTrajectory().


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