Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ()
 
voidoperator 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)
 
G4ParticleDefinitionGetParticleDefinition ()
 
virtual int GetPointEntries () const
 
virtual G4VTrajectoryPointGetPoint (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
 

Detailed Description

Definition at line 50 of file F04Trajectory.hh.

Constructor & Destructor Documentation

F04Trajectory::F04Trajectory ( )

Definition at line 52 of file F04Trajectory.cc.

53  : fpPointsContainer(0), fTrackID(0), fParentID(0),
54  fPDGCharge(0.0), fPDGEncoding(0), fParticleName(""),
55  fInitialMomentum(G4ThreeVector()) {;}
CLHEP::Hep3Vector G4ThreeVector
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();
68  fpPointsContainer = new TrajectoryPointContainer();
69  // Following is for the first trajectory point
70  fpPointsContainer->push_back(new F04TrajectoryPoint(aTrack));
71 }
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
std::vector< G4VTrajectoryPoint * > TrajectoryPointContainer
const G4String & GetParticleName() const
G4int GetTrackID() const
G4ThreeVector GetMomentum() const
G4double GetPDGCharge() const

Here is the call graph for this function:

F04Trajectory::F04Trajectory ( F04Trajectory right)

Definition at line 75 of file F04Trajectory.cc.

75  : G4VTrajectory()
76 {
77  fParticleName = right.fParticleName;
78  fPDGCharge = right.fPDGCharge;
79  fPDGEncoding = right.fPDGEncoding;
80  fTrackID = right.fTrackID;
81  fParentID = right.fParentID;
82  fInitialMomentum = right.fInitialMomentum;
83  fpPointsContainer = new TrajectoryPointContainer();
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 }
std::vector< G4VTrajectoryPoint * > TrajectoryPointContainer
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 }

Member Function Documentation

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 }
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
192  (G4AttValue("ID",G4UIcommand::ConvertToString(fTrackID),""));
193 
194  values->push_back
195  (G4AttValue("PID",G4UIcommand::ConvertToString(fParentID),""));
196 
197  values->push_back(G4AttValue("PN",fParticleName,""));
198 
199  values->push_back
200  (G4AttValue("Ch",G4UIcommand::ConvertToString(fPDGCharge),""));
201 
202  values->push_back
203  (G4AttValue("PDG",G4UIcommand::ConvertToString(fPDGEncoding),""));
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
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4GLOB_DLL std::ostream G4cout
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
double mag() const

Here is the call graph for this function:

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:

G4double F04Trajectory::GetCharge ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 76 of file F04Trajectory.hh.

76 { return fPDGCharge; }
G4ThreeVector F04Trajectory::GetInitialMomentum ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 78 of file F04Trajectory.hh.

78 {return fInitialMomentum;}
G4int F04Trajectory::GetParentID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 74 of file F04Trajectory.hh.

74 { return fParentID; }
G4ParticleDefinition * F04Trajectory::GetParticleDefinition ( )

Definition at line 122 of file F04Trajectory.cc.

123 {
124  return (G4ParticleTable::GetParticleTable()->FindParticle(fParticleName));
125 }
static G4ParticleTable * GetParticleTable()

Here is the call graph for this function:

G4String F04Trajectory::GetParticleName ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 75 of file F04Trajectory.hh.

75 { return fParticleName; }
G4int F04Trajectory::GetPDGEncoding ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 77 of file F04Trajectory.hh.

77 { return fPDGEncoding; }
virtual G4VTrajectoryPoint* F04Trajectory::GetPoint ( G4int  i) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 90 of file F04Trajectory.hh.

91  { return (*fpPointsContainer)[i]; }
virtual int F04Trajectory::GetPointEntries ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 88 of file F04Trajectory.hh.

89  { return fpPointsContainer->size(); }

Here is the caller graph for this function:

G4int F04Trajectory::GetTrackID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 73 of file F04Trajectory.hh.

73 { return fTrackID; }
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 }
virtual int GetPointEntries() const
static constexpr double second
Definition: G4SIunits.hh:157
int G4int
Definition: G4Types.hh:78

Here is the call graph for this function:

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
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
int F04Trajectory::operator== ( const F04Trajectory right) const
inline

Definition at line 68 of file F04Trajectory.hh.

69  { return (this==&right); }
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:


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