Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4RayTrajectory Class Reference

#include <G4RayTrajectory.hh>

Inheritance diagram for G4RayTrajectory:
Collaboration diagram for G4RayTrajectory:

Public Member Functions

 G4RayTrajectory ()
 
 G4RayTrajectory (G4RayTrajectory &right)
 
virtual ~G4RayTrajectory ()
 
voidoperator new (size_t)
 
void operator delete (void *)
 
virtual void AppendStep (const G4Step *)
 
virtual void ShowTrajectory (std::ostream &) const
 
virtual void DrawTrajectory () 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 const std::map
< G4String, G4AttDef > * 
GetAttDefs () const
 
virtual std::vector< G4AttValue > * CreateAttValues () const
 

Detailed Description

Definition at line 57 of file G4RayTrajectory.hh.

Constructor & Destructor Documentation

G4RayTrajectory::G4RayTrajectory ( )

Definition at line 48 of file G4RayTrajectory.cc.

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

Definition at line 53 of file G4RayTrajectory.cc.

54 : G4VTrajectory()
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 ( )
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

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();
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 }
G4double GetStepLength() const
void SetPostStepAtt(const G4VisAttributes *val)
G4Navigator * GetNavigatorForTracking() const
void SetStepLength(G4double val)
void SetSurfaceNormal(const G4ThreeVector &val)
const G4AffineTransform GetLocalToGlobalTransform() const
G4StepPoint * GetPreStepPoint() const
G4VPhysicalVolume * GetPhysicalVolume() const
virtual G4ThreeVector GetLocalExitNormal(G4bool *valid)
bool G4bool
Definition: G4Types.hh:79
static G4VisManager * GetInstance()
void SetPreStepAtt(const G4VisAttributes *val)
const G4VisAttributes * GetVisAttributes() const
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
static G4TransportationManager * GetTransportationManager()
G4LogicalVolume * GetLogicalVolume() const
G4StepPoint * GetPostStepPoint() const
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
G4VViewer * GetCurrentViewer() const

Here is the call graph for this function:

virtual void G4RayTrajectory::DrawTrajectory ( ) const
inlinevirtual

Reimplemented from G4VTrajectory.

Definition at line 77 of file G4RayTrajectory.hh.

77 {;}
G4double G4RayTrajectory::GetCharge ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 89 of file G4RayTrajectory.hh.

89 { return 0.; }
G4ThreeVector G4RayTrajectory::GetInitialMomentum ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 91 of file G4RayTrajectory.hh.

91 { return G4ThreeVector(); }
CLHEP::Hep3Vector G4ThreeVector
G4int G4RayTrajectory::GetParentID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 87 of file G4RayTrajectory.hh.

87 { return 0; }
G4String G4RayTrajectory::GetParticleName ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 88 of file G4RayTrajectory.hh.

88 { return ""; }
G4int G4RayTrajectory::GetPDGEncoding ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 90 of file G4RayTrajectory.hh.

90 { return 0; }
virtual G4VTrajectoryPoint* G4RayTrajectory::GetPoint ( G4int  i) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 79 of file G4RayTrajectory.hh.

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

Here is the caller graph for this function:

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

Definition at line 81 of file G4RayTrajectory.hh.

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

Here is the caller graph for this function:

virtual int G4RayTrajectory::GetPointEntries ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 78 of file G4RayTrajectory.hh.

78 {return positionRecord->size();}

Here is the caller graph for this function:

G4int G4RayTrajectory::GetTrackID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 86 of file G4RayTrajectory.hh.

86 { return 0; }
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:78
virtual int GetPointEntries() const
virtual G4VTrajectoryPoint * GetPoint(G4int i) const

Here is the call graph for this function:

void G4RayTrajectory::operator delete ( void aTrajectory)
inline

Definition at line 111 of file G4RayTrajectory.hh.

112 {
113  rayTrajectoryAllocator->FreeSingle((G4RayTrajectory*)aTrajectory);
114 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4RayTrajectory > * rayTrajectoryAllocator
void * G4RayTrajectory::operator new ( size_t  )
inline

Definition at line 104 of file G4RayTrajectory.hh.

105 {
108  return (void*)rayTrajectoryAllocator->MallocSingle();
109 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4RayTrajectory > * rayTrajectoryAllocator
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: