Geant4-11
Public Member Functions
G4VTrajectory Class Referenceabstract

#include <G4VTrajectory.hh>

Inheritance diagram for G4VTrajectory:
G4RayTrajectory G4SmoothTrajectory G4Trajectory G4RichTrajectory

Public Member Functions

virtual void AppendStep (const G4Step *aStep)=0
 
virtual std::vector< G4AttValue > * CreateAttValues () const
 
virtual void DrawTrajectory () const
 
 G4VTrajectory ()
 
virtual const std::map< G4String, G4AttDef > * GetAttDefs () const
 
virtual G4double GetCharge () const =0
 
virtual G4ThreeVector GetInitialMomentum () const =0
 
virtual G4int GetParentID () const =0
 
virtual G4String GetParticleName () const =0
 
virtual G4int GetPDGEncoding () const =0
 
virtual G4VTrajectoryPointGetPoint (G4int i) const =0
 
virtual G4int GetPointEntries () const =0
 
virtual G4int GetTrackID () const =0
 
virtual void MergeTrajectory (G4VTrajectory *secondTrajectory)=0
 
G4bool operator== (const G4VTrajectory &right) const
 
virtual void ShowTrajectory (std::ostream &os=G4cout) const
 
virtual ~G4VTrajectory ()
 

Detailed Description

Definition at line 57 of file G4VTrajectory.hh.

Constructor & Destructor Documentation

◆ G4VTrajectory()

G4VTrajectory::G4VTrajectory ( )

Definition at line 47 of file G4VTrajectory.cc.

48{
49}

◆ ~G4VTrajectory()

G4VTrajectory::~G4VTrajectory ( )
virtual

Definition at line 51 of file G4VTrajectory.cc.

52{
53}

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 G4RichTrajectory, G4SmoothTrajectory, G4Trajectory, and G4RayTrajectory.

Definition at line 120 of file G4VTrajectory.cc.

121{
123
124 if (pVVisManager != nullptr)
125 {
126 pVVisManager->DispatchToModel(*this);
127 }
128}
virtual void DispatchToModel(const G4VTrajectory &)=0
static G4VVisManager * GetConcreteInstance()

References G4VVisManager::DispatchToModel(), and G4VVisManager::GetConcreteInstance().

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

◆ GetAttDefs()

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

◆ GetCharge()

virtual G4double G4VTrajectory::GetCharge ( ) const
pure virtual

◆ 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()

virtual G4VTrajectoryPoint * G4VTrajectory::GetPoint ( G4int  i) const
pure virtual

◆ GetPointEntries()

virtual G4int G4VTrajectory::GetPointEntries ( ) const
pure virtual

◆ 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 55 of file G4VTrajectory.cc.

56{
57 return (this==&right);
58}

◆ ShowTrajectory()

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

Reimplemented in G4RayTrajectory, G4RichTrajectory, G4SmoothTrajectory, and G4Trajectory.

Definition at line 60 of file G4VTrajectory.cc.

61{
62 // Makes use of attribute values implemented in the concrete class.
63 // Note: the user needs to follow with new-line or end-of-string,
64 // depending on the nature of os
65
66 std::vector<G4AttValue>* attValues = CreateAttValues();
67 const std::map<G4String,G4AttDef>* attDefs = GetAttDefs();
68
69 // Ensure validity...
70 //
71 if (G4AttCheck(attValues,attDefs).Check("G4VTrajectory::ShowTrajectory"))
72 {
73 return;
74 }
75
76 os << "Trajectory:";
77
78 for (auto iAttVal = attValues->cbegin();
79 iAttVal != attValues->cend(); ++iAttVal)
80 {
81 std::map<G4String,G4AttDef>::const_iterator iAttDef =
82 attDefs->find(iAttVal->GetName());
83 os << "\n " << iAttDef->second.GetDesc()
84 << " (" << iAttVal->GetName()
85 << "): " << iAttVal->GetValue();
86 }
87
88 delete attValues; // AttValues must be deleted after use.
89
90 // Now do trajectory points...
91
92 for (G4int i=0; i<GetPointEntries(); ++i)
93 {
94 G4VTrajectoryPoint* aTrajectoryPoint = GetPoint(i);
95 attValues = aTrajectoryPoint->CreateAttValues();
96 attDefs = aTrajectoryPoint->GetAttDefs();
97
98 // Ensure validity...
99 //
100 if (G4AttCheck(attValues,attDefs).Check("G4VTrajectory::ShowTrajectory"))
101 {
102 return;
103 }
104
105 for (auto iAttVal = attValues->cbegin();
106 iAttVal != attValues->cend(); ++iAttVal)
107 {
108 std::map<G4String,G4AttDef>::const_iterator iAttDef =
109 attDefs->find(iAttVal->GetName());
110 os << "\n " << iAttDef->second.GetDesc()
111 << " (" << iAttVal->GetName()
112 << "): " << iAttVal->GetValue();
113 }
114
115 delete attValues; // AttValues must be deleted after use.
116 }
117 os << std::endl;
118}
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

References CreateAttValues(), G4VTrajectoryPoint::CreateAttValues(), GetAttDefs(), G4VTrajectoryPoint::GetAttDefs(), GetPoint(), and GetPointEntries().

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


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