Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4RayTrajectory Class Reference

#include <G4RayTrajectory.hh>

+ Inheritance diagram for G4RayTrajectory:

Public Member Functions

 G4RayTrajectory ()
 
 G4RayTrajectory (G4RayTrajectory &right)
 
virtual ~G4RayTrajectory ()
 
void * operator new (size_t)
 
void operator delete (void *)
 
virtual void AppendStep (const G4Step *)
 
virtual void ShowTrajectory (std::ostream &) const
 
virtual void DrawTrajectory () const
 
virtual void DrawTrajectory (G4int) const
 
virtual int GetPointEntries () const
 
virtual G4VTrajectoryPointGetPoint (G4int i) const
 
G4RayTrajectoryPointGetPointC (G4int i) const
 
virtual void MergeTrajectory (G4VTrajectory *secondTrajectory)
 
G4int GetTrackID () const
 
G4int GetParentID () const
 
G4String GetParticleName () const
 
G4double GetCharge () const
 
G4int GetPDGEncoding () const
 
G4ThreeVector GetInitialMomentum () const
 
- Public Member Functions inherited from G4VTrajectory
 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 G4RayTrajectory.hh.

Constructor & Destructor Documentation

◆ G4RayTrajectory() [1/2]

G4RayTrajectory::G4RayTrajectory ( )

Definition at line 48 of file G4RayTrajectory.cc.

49{
50 positionRecord = new std::vector<G4RayTrajectoryPoint*>;
51}

◆ G4RayTrajectory() [2/2]

G4RayTrajectory::G4RayTrajectory ( G4RayTrajectory right)

Definition at line 53 of file G4RayTrajectory.cc.

55{
56 positionRecord = new std::vector<G4RayTrajectoryPoint*>;
57 for(size_t i=0;i<right.positionRecord->size();i++)
58 {
60 ((*(right.positionRecord))[i]);
61 positionRecord->push_back(new G4RayTrajectoryPoint(*rightPoint));
62 }
63}

◆ ~G4RayTrajectory()

G4RayTrajectory::~G4RayTrajectory ( )
virtual

Definition at line 65 of file G4RayTrajectory.cc.

66{
67 //positionRecord->clearAndDestroy();
68 for(size_t i=0;i<positionRecord->size();i++)
69 { delete (*positionRecord)[i]; }
70 positionRecord->clear();
71 delete positionRecord;
72}

Member Function Documentation

◆ AppendStep()

void G4RayTrajectory::AppendStep ( const G4Step aStep)
virtual

Implements G4VTrajectory.

Definition at line 74 of file G4RayTrajectory.cc.

75{
76 G4RayTrajectoryPoint* trajectoryPoint = new G4RayTrajectoryPoint();
77
78 trajectoryPoint->SetStepLength(aStep->GetStepLength());
79
80 G4Navigator* theNavigator
82 G4bool valid;
83 G4ThreeVector theLocalNormal = theNavigator->GetLocalExitNormal(&valid);
84 if(valid) { theLocalNormal = -theLocalNormal; }
85 G4ThreeVector theGrobalNormal
86 = theNavigator->GetLocalToGlobalTransform().TransformAxis(theLocalNormal);
87 trajectoryPoint->SetSurfaceNormal(theGrobalNormal);
88
90 const G4VisAttributes* preVisAtt = prePhys->GetLogicalVolume()->GetVisAttributes();
91 G4VisManager* visManager = G4VisManager::GetInstance();
92 if(visManager) {
93 G4VViewer* viewer = visManager->GetCurrentViewer();
94 if (viewer) {
95 preVisAtt = viewer->GetApplicableVisAttributes(preVisAtt);
96 }
97 }
98 trajectoryPoint->SetPreStepAtt(preVisAtt);
99
100 const G4VPhysicalVolume* postPhys = aStep->GetPostStepPoint()->GetPhysicalVolume();
101 const G4VisAttributes* postVisAtt = NULL;
102 if(postPhys) {
103 postVisAtt = postPhys->GetLogicalVolume()->GetVisAttributes();
104 if(visManager) {
105 G4VViewer* viewer = visManager->GetCurrentViewer();
106 if (viewer) {
107 postVisAtt = viewer->GetApplicableVisAttributes(postVisAtt);
108 }
109 }
110 }
111 trajectoryPoint->SetPostStepAtt(postVisAtt);
112
113 positionRecord->push_back(trajectoryPoint);
114}
bool G4bool
Definition: G4Types.hh:67
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
const G4VisAttributes * GetVisAttributes() const
virtual G4ThreeVector GetLocalExitNormal(G4bool *valid)
const G4AffineTransform GetLocalToGlobalTransform() const
void SetSurfaceNormal(G4ThreeVector val)
void SetStepLength(G4double val)
void SetPreStepAtt(const G4VisAttributes *val)
void SetPostStepAtt(const G4VisAttributes *val)
G4VPhysicalVolume * GetPhysicalVolume() const
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
G4StepPoint * GetPostStepPoint() const
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() const
G4LogicalVolume * GetLogicalVolume() const
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
Definition: G4VViewer.cc:78
G4VViewer * GetCurrentViewer() const

◆ DrawTrajectory() [1/2]

virtual void G4RayTrajectory::DrawTrajectory ( ) const
inlinevirtual

Definition at line 77 of file G4RayTrajectory.hh.

77{;}

◆ DrawTrajectory() [2/2]

virtual void G4RayTrajectory::DrawTrajectory ( G4int  ) const
inlinevirtual

Reimplemented from G4VTrajectory.

Definition at line 78 of file G4RayTrajectory.hh.

78{;}

◆ GetCharge()

G4double G4RayTrajectory::GetCharge ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 90 of file G4RayTrajectory.hh.

90{ return 0.; }

◆ GetInitialMomentum()

G4ThreeVector G4RayTrajectory::GetInitialMomentum ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 92 of file G4RayTrajectory.hh.

92{ return G4ThreeVector(); }
CLHEP::Hep3Vector G4ThreeVector

◆ GetParentID()

G4int G4RayTrajectory::GetParentID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 88 of file G4RayTrajectory.hh.

88{ return 0; }

◆ GetParticleName()

G4String G4RayTrajectory::GetParticleName ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 89 of file G4RayTrajectory.hh.

89{ return ""; }

◆ GetPDGEncoding()

G4int G4RayTrajectory::GetPDGEncoding ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 91 of file G4RayTrajectory.hh.

91{ return 0; }

◆ GetPoint()

virtual G4VTrajectoryPoint * G4RayTrajectory::GetPoint ( G4int  i) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 80 of file G4RayTrajectory.hh.

81 { return (*positionRecord)[i]; }

Referenced by MergeTrajectory().

◆ GetPointC()

G4RayTrajectoryPoint * G4RayTrajectory::GetPointC ( G4int  i) const
inline

Definition at line 82 of file G4RayTrajectory.hh.

83 { return (*positionRecord)[i]; }

Referenced by G4TheRayTracer::GenerateColour().

◆ GetPointEntries()

virtual int G4RayTrajectory::GetPointEntries ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 79 of file G4RayTrajectory.hh.

79{return positionRecord->size();}

Referenced by G4TheRayTracer::GenerateColour(), and MergeTrajectory().

◆ GetTrackID()

G4int G4RayTrajectory::GetTrackID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 87 of file G4RayTrajectory.hh.

87{ return 0; }

◆ MergeTrajectory()

void G4RayTrajectory::MergeTrajectory ( G4VTrajectory secondTrajectory)
virtual

Implements G4VTrajectory.

Definition at line 119 of file G4RayTrajectory.cc.

120{
121 if(!secondTrajectory) return;
122
123 G4RayTrajectory* seco = (G4RayTrajectory*)secondTrajectory;
124 G4int ent = seco->GetPointEntries();
125 for(G4int i=0;i<ent;i++)
126 { positionRecord->push_back((G4RayTrajectoryPoint*)seco->GetPoint(i)); }
127 seco->positionRecord->clear();
128}
int G4int
Definition: G4Types.hh:66
virtual G4VTrajectoryPoint * GetPoint(G4int i) const
virtual int GetPointEntries() const

◆ operator delete()

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

Definition at line 112 of file G4RayTrajectory.hh.

113{
114 G4RayTrajectoryAllocator.FreeSingle((G4RayTrajectory*)aTrajectory);
115}
G4DLLIMPORT G4Allocator< G4RayTrajectory > G4RayTrajectoryAllocator

◆ operator new()

void * G4RayTrajectory::operator new ( size_t  )
inline

Definition at line 105 of file G4RayTrajectory.hh.

106{
107 void* aTrajectory;
108 aTrajectory = (void*)G4RayTrajectoryAllocator.MallocSingle();
109 return aTrajectory;
110}

◆ ShowTrajectory()

void G4RayTrajectory::ShowTrajectory ( std::ostream &  ) const
virtual

Reimplemented from G4VTrajectory.

Definition at line 116 of file G4RayTrajectory.cc.

117{ }

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