Geant4  10.02.p03
F04Trajectory Class Reference

#include <F04Trajectory.hh>

Inheritance diagram for F04Trajectory:
Collaboration diagram for F04Trajectory:

Public Member Functions

 F04Trajectory ()
 
 F04Trajectory (const G4Track *aTrack)
 
 F04Trajectory (F04Trajectory &)
 
virtual ~F04Trajectory ()
 
void * operator new (size_t)
 
void operator delete (void *)
 
int operator== (const F04Trajectory &right) const
 
G4int GetTrackID () const
 
G4int GetParentID () const
 
G4String GetParticleName () const
 
G4double GetCharge () const
 
G4int GetPDGEncoding () const
 
G4ThreeVector GetInitialMomentum () const
 
virtual void ShowTrajectory (std::ostream &os=G4cout) const
 
virtual void AppendStep (const G4Step *aStep)
 
virtual void MergeTrajectory (G4VTrajectory *secondTrajectory)
 
G4ParticleDefinition * GetParticleDefinition ()
 
virtual int GetPointEntries () const
 
virtual G4VTrajectoryPoint * GetPoint (G4int i) const
 
virtual const std::map< G4String, G4AttDef > * GetAttDefs () const
 
virtual std::vector< G4AttValue > * CreateAttValues () const
 
- Public Member Functions inherited from G4VTrajectory
 G4VTrajectory ()
 
virtual ~G4VTrajectory ()
 
G4bool operator== (const G4VTrajectory &right) const
 
virtual void DrawTrajectory () const
 

Private Attributes

TrajectoryPointContainer * fpPointsContainer
 
G4int fTrackID
 
G4int fParentID
 
G4double fPDGCharge
 
G4int fPDGEncoding
 
G4String fParticleName
 
G4ThreeVector fInitialMomentum
 

Detailed Description

Definition at line 50 of file F04Trajectory.hh.

Constructor & Destructor Documentation

◆ F04Trajectory() [1/3]

F04Trajectory::F04Trajectory ( )

Definition at line 52 of file F04Trajectory.cc.

TrajectoryPointContainer * fpPointsContainer
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector fInitialMomentum
G4String fParticleName
G4double fPDGCharge

◆ F04Trajectory() [2/3]

F04Trajectory::F04Trajectory ( const G4Track *  aTrack)

Definition at line 59 of file F04Trajectory.cc.

60 {
61  G4ParticleDefinition * particleDefinition = aTrack->GetDefinition();
62  fParticleName = particleDefinition->GetParticleName();
63  fPDGCharge = particleDefinition->GetPDGCharge();
64  fPDGEncoding = particleDefinition->GetPDGEncoding();
65  fTrackID = aTrack->GetTrackID();
66  fParentID = aTrack->GetParentID();
67  fInitialMomentum = aTrack->GetMomentum();
69  // Following is for the first trajectory point
70  fpPointsContainer->push_back(new F04TrajectoryPoint(aTrack));
71 }
TrajectoryPointContainer * fpPointsContainer
std::vector< G4VTrajectoryPoint * > TrajectoryPointContainer
G4ThreeVector fInitialMomentum
G4String fParticleName
G4double fPDGCharge
const G4String & GetParticleName() const
G4double GetPDGCharge() const
Here is the call graph for this function:

◆ F04Trajectory() [3/3]

F04Trajectory::F04Trajectory ( F04Trajectory &  right)

Definition at line 75 of file F04Trajectory.cc.

75  : G4VTrajectory()
76 {
78  fPDGCharge = right.fPDGCharge;
79  fPDGEncoding = right.fPDGEncoding;
80  fTrackID = right.fTrackID;
81  fParentID = right.fParentID;
84 
85  for(size_t i=0;i<right.fpPointsContainer->size();++i) {
86  F04TrajectoryPoint* rightPoint
87  = (F04TrajectoryPoint*)((*(right.fpPointsContainer))[i]);
88  fpPointsContainer->push_back(new F04TrajectoryPoint(*rightPoint));
89  }
90 }
TrajectoryPointContainer * fpPointsContainer
std::vector< G4VTrajectoryPoint * > TrajectoryPointContainer
G4ThreeVector fInitialMomentum
G4String fParticleName
G4double fPDGCharge

◆ ~F04Trajectory()

F04Trajectory::~F04Trajectory ( )
virtual

Definition at line 94 of file F04Trajectory.cc.

95 {
96  for(size_t i=0;i<fpPointsContainer->size();++i){
97  delete (*fpPointsContainer)[i];
98  }
99  fpPointsContainer->clear();
100 
101  delete fpPointsContainer;
102 }
TrajectoryPointContainer * fpPointsContainer

Member Function Documentation

◆ AppendStep()

void F04Trajectory::AppendStep ( const G4Step *  aStep)
virtual

Implements G4VTrajectory.

Definition at line 115 of file F04Trajectory.cc.

116 {
117  fpPointsContainer->push_back(new F04TrajectoryPoint(aStep));
118 }
TrajectoryPointContainer * fpPointsContainer
Here is the caller graph for this function:

◆ CreateAttValues()

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

Reimplemented from G4VTrajectory.

Definition at line 187 of file F04Trajectory.cc.

188 {
189  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
190 
191  values->push_back
193 
194  values->push_back
196 
197  values->push_back(G4AttValue("PN",fParticleName,""));
198 
199  values->push_back
201 
202  values->push_back
204 
205  values->push_back
206  (G4AttValue("IMom",G4BestUnit(fInitialMomentum,"Energy"),""));
207 
208  values->push_back
209  (G4AttValue("IMag",G4BestUnit(fInitialMomentum.mag(),"Energy"),""));
210 
211  values->push_back
213 
214 #ifdef G4ATTDEBUG
215  G4cout << G4AttCheck(values,GetAttDefs());
216 #endif
217  return values;
218 }
virtual int GetPointEntries() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4ThreeVector fInitialMomentum
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4String fParticleName
G4double fPDGCharge
G4GLOB_DLL std::ostream G4cout
double mag() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAttDefs()

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

Reimplemented from G4VTrajectory.

Definition at line 145 of file F04Trajectory.cc.

146 {
147  G4bool isNew;
148  std::map<G4String,G4AttDef>* store
149  = G4AttDefStore::GetInstance("Trajectory",isNew);
150 
151  if (isNew) {
152 
153  G4String ID("ID");
154  (*store)[ID] = G4AttDef(ID,"Track ID","Bookkeeping","","G4int");
155 
156  G4String PID("PID");
157  (*store)[PID] = G4AttDef(PID,"Parent ID","Bookkeeping","","G4int");
158 
159  G4String PN("PN");
160  (*store)[PN] = G4AttDef(PN,"Particle Name","Physics","","G4String");
161 
162  G4String Ch("Ch");
163  (*store)[Ch] = G4AttDef(Ch,"Charge","Physics","e+","G4double");
164 
165  G4String PDG("PDG");
166  (*store)[PDG] = G4AttDef(PDG,"PDG Encoding","Physics","","G4int");
167 
168  G4String IMom("IMom");
169  (*store)[IMom] = G4AttDef(IMom,
170  "Momentum of track at start of trajectory",
171  "Physics","G4BestUnit","G4ThreeVector");
172 
173  G4String IMag("IMag");
174  (*store)[IMag] = G4AttDef(IMag,
175  "Magnitude of momentum of track at start of trajectory",
176  "Physics","G4BestUnit","G4double");
177 
178  G4String NTP("NTP");
179  (*store)[NTP] = G4AttDef(NTP,"No. of points","Bookkeeping","","G4int");
180 
181  }
182  return store;
183 }
bool G4bool
Definition: G4Types.hh:79
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCharge()

G4double F04Trajectory::GetCharge ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 76 of file F04Trajectory.hh.

76 { return fPDGCharge; }
G4double fPDGCharge

◆ GetInitialMomentum()

G4ThreeVector F04Trajectory::GetInitialMomentum ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 78 of file F04Trajectory.hh.

78 {return fInitialMomentum;}
G4ThreeVector fInitialMomentum
Here is the call graph for this function:

◆ GetParentID()

G4int F04Trajectory::GetParentID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 74 of file F04Trajectory.hh.

74 { return fParentID; }

◆ GetParticleDefinition()

G4ParticleDefinition * F04Trajectory::GetParticleDefinition ( )

Definition at line 122 of file F04Trajectory.cc.

123 {
124  return (G4ParticleTable::GetParticleTable()->FindParticle(fParticleName));
125 }
G4String fParticleName
static G4ParticleTable * GetParticleTable()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetParticleName()

G4String F04Trajectory::GetParticleName ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 75 of file F04Trajectory.hh.

75 { return fParticleName; }
G4String fParticleName

◆ GetPDGEncoding()

G4int F04Trajectory::GetPDGEncoding ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 77 of file F04Trajectory.hh.

77 { return fPDGEncoding; }

◆ GetPoint()

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

Implements G4VTrajectory.

Definition at line 90 of file F04Trajectory.hh.

91  { return (*fpPointsContainer)[i]; }
TrajectoryPointContainer * fpPointsContainer
Here is the call graph for this function:

◆ GetPointEntries()

virtual int F04Trajectory::GetPointEntries ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 88 of file F04Trajectory.hh.

89  { return fpPointsContainer->size(); }
TrajectoryPointContainer * fpPointsContainer
Here is the caller graph for this function:

◆ GetTrackID()

G4int F04Trajectory::GetTrackID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 73 of file F04Trajectory.hh.

73 { return fTrackID; }

◆ MergeTrajectory()

void F04Trajectory::MergeTrajectory ( G4VTrajectory *  secondTrajectory)
virtual

Implements G4VTrajectory.

Definition at line 129 of file F04Trajectory.cc.

130 {
131  if(!secondTrajectory) return;
132 
133  F04Trajectory* second = (F04Trajectory*)secondTrajectory;
134  G4int ent = second->GetPointEntries();
135  // initial point of the second trajectory should not be merged
136  for(G4int i=1; i<ent; ++i) {
137  fpPointsContainer->push_back((*(second->fpPointsContainer))[i]);
138  }
139  delete (*second->fpPointsContainer)[0];
140  second->fpPointsContainer->clear();
141 }
TrajectoryPointContainer * fpPointsContainer
virtual int GetPointEntries() const
int G4int
Definition: G4Types.hh:78
static const double second
Definition: G4SIunits.hh:156
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator delete()

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

Definition at line 121 of file F04Trajectory.hh.

121  {
122  F04TrajectoryAllocator->FreeSingle((F04Trajectory*)aTrajectory);
123 }
G4ThreadLocal G4Allocator< F04Trajectory > * F04TrajectoryAllocator

◆ operator new()

void * F04Trajectory::operator new ( size_t  )
inline

Definition at line 115 of file F04Trajectory.hh.

115  {
118  return (void*) F04TrajectoryAllocator->MallocSingle();
119 }
G4ThreadLocal G4Allocator< F04Trajectory > * F04TrajectoryAllocator

◆ operator==()

int F04Trajectory::operator== ( const F04Trajectory &  right) const
inline

Definition at line 68 of file F04Trajectory.hh.

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

◆ ShowTrajectory()

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

Reimplemented from G4VTrajectory.

Definition at line 106 of file F04Trajectory.cc.

107 {
108  // Invoke the default implementation in G4VTrajectory...
110  // ... or override with your own code here.
111 }
virtual void ShowTrajectory(std::ostream &os=G4cout) const
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fInitialMomentum

G4ThreeVector F04Trajectory::fInitialMomentum
private

Definition at line 109 of file F04Trajectory.hh.

◆ fParentID

G4int F04Trajectory::fParentID
private

Definition at line 105 of file F04Trajectory.hh.

◆ fParticleName

G4String F04Trajectory::fParticleName
private

Definition at line 108 of file F04Trajectory.hh.

◆ fPDGCharge

G4double F04Trajectory::fPDGCharge
private

Definition at line 106 of file F04Trajectory.hh.

◆ fPDGEncoding

G4int F04Trajectory::fPDGEncoding
private

Definition at line 107 of file F04Trajectory.hh.

◆ fpPointsContainer

TrajectoryPointContainer* F04Trajectory::fpPointsContainer
private

Definition at line 102 of file F04Trajectory.hh.

◆ fTrackID

G4int F04Trajectory::fTrackID
private

Definition at line 104 of file F04Trajectory.hh.


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