Geant4 9.6.0
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 ()
 
virtual ~G4VTrajectory ()
 
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 int GetPointEntries () const =0
 
virtual G4VTrajectoryPointGetPoint (G4int i) const =0
 
virtual void ShowTrajectory (std::ostream &os=G4cout) const
 
virtual void DrawTrajectory (G4int i_mode=0) 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 ( )

Definition at line 53 of file G4VTrajectory.cc.

53{;}

◆ ~G4VTrajectory()

G4VTrajectory::~G4VTrajectory ( )
virtual

Definition at line 54 of file G4VTrajectory.cc.

54{;}

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 ( G4int  i_mode = 0) const
virtual

Reimplemented in G4SmoothTrajectory, G4Trajectory, and G4RayTrajectory.

Definition at line 125 of file G4VTrajectory.cc.

126{
128
129 static G4bool warnedAboutIMode = false;
130 if (!warnedAboutIMode && i_mode != 0) {
132 ("G4VTrajectory::DrawTrajectory()",
133 "Tracking0100", JustWarning,
134 "DEPRECATED! The use of i_mode argument in DrawTrajectory()"
135 "\n is deprecated and will be removed at the next major release.");
136 warnedAboutIMode = true;
137 }
138
139 if (0 != pVVisManager) {
140 pVVisManager->DispatchToModel(*this, i_mode);
141 }
142}
@ JustWarning
bool G4bool
Definition: G4Types.hh:67
virtual void DispatchToModel(const G4VTrajectory &)=0
static G4VVisManager * GetConcreteInstance()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by G4VSceneHandler::AddCompound(), G4GMocrenFileSceneHandler::AddCompound(), 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 56 of file G4VTrajectory.cc.

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

◆ ShowTrajectory()

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

Reimplemented in G4RayTrajectory, G4SmoothTrajectory, and G4Trajectory.

Definition at line 61 of file G4VTrajectory.cc.

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

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


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