Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE04Trajectory Class Reference

#include <RE04Trajectory.hh>

Inheritance diagram for RE04Trajectory:
Collaboration diagram for RE04Trajectory:

Public Member Functions

 RE04Trajectory ()
 
 RE04Trajectory (const G4Track *aTrack)
 
 RE04Trajectory (RE04Trajectory &)
 
virtual ~RE04Trajectory ()
 
voidoperator new (size_t)
 
void operator delete (void *)
 
int operator== (const RE04Trajectory &right) const
 
virtual G4int GetTrackID () const
 
virtual G4int GetParentID () const
 
virtual G4String GetParticleName () const
 
virtual G4double GetCharge () const
 
virtual G4int GetPDGEncoding () const
 
virtual G4double GetInitialKineticEnergy () const
 
virtual G4ThreeVector GetInitialMomentum () const
 
virtual void ShowTrajectory (std::ostream &os=G4cout) const
 
virtual void DrawTrajectory () const
 
virtual void AppendStep (const G4Step *aStep)
 
virtual int GetPointEntries () const
 
virtual G4VTrajectoryPointGetPoint (G4int i) const
 
virtual void MergeTrajectory (G4VTrajectory *secondTrajectory)
 
G4ParticleDefinitionGetParticleDefinition ()
 
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
 

Detailed Description

User trajectory class

Definition at line 90 of file RE04Trajectory.hh.

Constructor & Destructor Documentation

RE04Trajectory::RE04Trajectory ( )

Definition at line 48 of file RE04Trajectory.cc.

49 : G4VTrajectory(),
50  fPositionRecord(0), fTrackID(0), fParentID(0),
51  fPDGEncoding( 0 ), fPDGCharge(0.0), fParticleName(""),
52  fInitialKineticEnergy( 0. ), fInitialMomentum( G4ThreeVector() )
53 {;}
CLHEP::Hep3Vector G4ThreeVector
RE04Trajectory::RE04Trajectory ( const G4Track aTrack)

Definition at line 56 of file RE04Trajectory.cc.

57 {
58  G4ParticleDefinition * fpParticleDefinition = aTrack->GetDefinition();
59  fParticleName = fpParticleDefinition->GetParticleName();
60  fPDGCharge = fpParticleDefinition->GetPDGCharge();
61  fPDGEncoding = fpParticleDefinition->GetPDGEncoding();
62  fTrackID = aTrack->GetTrackID();
63  fParentID = aTrack->GetParentID();
64  fInitialKineticEnergy = aTrack->GetKineticEnergy();
65  fInitialMomentum = aTrack->GetMomentum();
66  fPositionRecord = new TrajectoryPointContainer();
67  // Following is for the first trajectory point
68  fPositionRecord->push_back(new RE04TrajectoryPoint(
69  aTrack->GetPosition(),aTrack->GetMaterial()));
70 }
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
std::vector< G4VTrajectoryPoint * > TrajectoryPointContainer
const G4ThreeVector & GetPosition() const
const G4String & GetParticleName() const
G4double GetKineticEnergy() const
G4int GetTrackID() const
G4Material * GetMaterial() const
G4ThreeVector GetMomentum() const
G4double GetPDGCharge() const

Here is the call graph for this function:

RE04Trajectory::RE04Trajectory ( RE04Trajectory right)

Definition at line 73 of file RE04Trajectory.cc.

73  :G4VTrajectory()
74 {
75  fParticleName = right.fParticleName;
76  fPDGCharge = right.fPDGCharge;
77  fPDGEncoding = right.fPDGEncoding;
78  fTrackID = right.fTrackID;
79  fParentID = right.fParentID;
80  fInitialKineticEnergy = right.fInitialKineticEnergy;
81  fInitialMomentum = right.fInitialMomentum;
82  fPositionRecord = new TrajectoryPointContainer();
83 
84  for(size_t i=0;i<right.fPositionRecord->size();i++)
85  {
86  RE04TrajectoryPoint* rightPoint
87  = (RE04TrajectoryPoint*)((*(right.fPositionRecord))[i]);
88  fPositionRecord->push_back(new RE04TrajectoryPoint(*rightPoint));
89  }
90 }
std::vector< G4VTrajectoryPoint * > TrajectoryPointContainer
RE04Trajectory::~RE04Trajectory ( )
virtual

Definition at line 93 of file RE04Trajectory.cc.

94 {
95  if (fPositionRecord) {
96  // fPositionRecord->clearAndDestroy();
97  size_t i;
98  for(i=0;i<fPositionRecord->size();i++){
99  delete (*fPositionRecord)[i];
100  }
101  fPositionRecord->clear();
102  delete fPositionRecord;
103  }
104 }

Member Function Documentation

void RE04Trajectory::AppendStep ( const G4Step aStep)
virtual

Implements G4VTrajectory.

Definition at line 205 of file RE04Trajectory.cc.

206 {
207  fPositionRecord->push_back( new RE04TrajectoryPoint(
208  aStep->GetPostStepPoint()->GetPosition(),
209  aStep->GetPreStepPoint()->GetMaterial() ));
210 }
G4Material * GetMaterial() const
G4StepPoint * GetPreStepPoint() const
const G4ThreeVector & GetPosition() const
G4StepPoint * GetPostStepPoint() const

Here is the call graph for this function:

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

Reimplemented from G4VTrajectory.

Definition at line 167 of file RE04Trajectory.cc.

168 {
169  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
170 
171  values->push_back
172  (G4AttValue("ID",G4UIcommand::ConvertToString(fTrackID),""));
173 
174  values->push_back
175  (G4AttValue("PID",G4UIcommand::ConvertToString(fParentID),""));
176 
177  values->push_back(G4AttValue("PN",fParticleName,""));
178 
179  values->push_back
180  (G4AttValue("Ch",G4UIcommand::ConvertToString(fPDGCharge),""));
181 
182  values->push_back
183  (G4AttValue("PDG",G4UIcommand::ConvertToString(fPDGEncoding),""));
184 
185  values->push_back
186  (G4AttValue("IKE",G4BestUnit(fInitialKineticEnergy,"Energy"),""));
187 
188  values->push_back
189  (G4AttValue("IMom",G4BestUnit(fInitialMomentum,"Energy"),""));
190 
191  values->push_back
192  (G4AttValue("IMag",G4BestUnit(fInitialMomentum.mag(),"Energy"),""));
193 
194  values->push_back
196 
197 #ifdef G4ATTDEBUG
198  G4cout << G4AttCheck(values,GetAttDefs());
199 #endif
200 
201  return values;
202 }
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 int GetPointEntries() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
double mag() const

Here is the call graph for this function:

void RE04Trajectory::DrawTrajectory ( ) const
virtual

Reimplemented from G4VTrajectory.

Definition at line 115 of file RE04Trajectory.cc.

116 {
117  // Invoke the default implementation in G4VTrajectory...
119  // ... or override with your own code here.
120 }
virtual void DrawTrajectory() const

Here is the call graph for this function:

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

Reimplemented from G4VTrajectory.

Definition at line 123 of file RE04Trajectory.cc.

124 {
125  G4bool isNew;
126  std::map<G4String,G4AttDef>* store
127  = G4AttDefStore::GetInstance("RE04Trajectory",isNew);
128  if (isNew) {
129 
130  G4String id("ID");
131  (*store)[id] = G4AttDef(id,"Track ID","Physics","","G4int");
132 
133  G4String pid("PID");
134  (*store)[pid] = G4AttDef(pid,"Parent ID","Physics","","G4int");
135 
136  G4String pn("PN");
137  (*store)[pn] = G4AttDef(pn,"Particle Name","Physics","","G4String");
138 
139  G4String ch("Ch");
140  (*store)[ch] = G4AttDef(ch,"Charge","Physics","e+","G4double");
141 
142  G4String pdg("PDG");
143  (*store)[pdg] = G4AttDef(pdg,"PDG Encoding","Physics","","G4int");
144 
145  G4String ike("IKE");
146  (*store)[ike] =
147  G4AttDef(ike, "Initial kinetic energy",
148  "Physics","G4BestUnit","G4double");
149 
150  G4String iMom("IMom");
151  (*store)[iMom] = G4AttDef(iMom, "Initial momentum",
152  "Physics","G4BestUnit","G4ThreeVector");
153 
154  G4String iMag("IMag");
155  (*store)[iMag] =
156  G4AttDef(iMag, "Initial momentum magnitude",
157  "Physics","G4BestUnit","G4double");
158 
159  G4String ntp("NTP");
160  (*store)[ntp] = G4AttDef(ntp,"No. of points","Physics","","G4int");
161 
162  }
163  return store;
164 }
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:

virtual G4double RE04Trajectory::GetCharge ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 119 of file RE04Trajectory.hh.

120  { return fPDGCharge; }
virtual G4double RE04Trajectory::GetInitialKineticEnergy ( ) const
inlinevirtual

Definition at line 123 of file RE04Trajectory.hh.

124  { return fInitialKineticEnergy; }
virtual G4ThreeVector RE04Trajectory::GetInitialMomentum ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 125 of file RE04Trajectory.hh.

126  { return fInitialMomentum; }
virtual G4int RE04Trajectory::GetParentID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 115 of file RE04Trajectory.hh.

116  { return fParentID; }
G4ParticleDefinition * RE04Trajectory::GetParticleDefinition ( )

Definition at line 213 of file RE04Trajectory.cc.

214 {
215  return (G4ParticleTable::GetParticleTable()->FindParticle(fParticleName));
216 }
static G4ParticleTable * GetParticleTable()

Here is the call graph for this function:

virtual G4String RE04Trajectory::GetParticleName ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 117 of file RE04Trajectory.hh.

118  { return fParticleName; }
virtual G4int RE04Trajectory::GetPDGEncoding ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 121 of file RE04Trajectory.hh.

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

Implements G4VTrajectory.

Definition at line 134 of file RE04Trajectory.hh.

135  { return (*fPositionRecord)[i]; }
virtual int RE04Trajectory::GetPointEntries ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 133 of file RE04Trajectory.hh.

133 { return fPositionRecord->size(); }

Here is the caller graph for this function:

virtual G4int RE04Trajectory::GetTrackID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 113 of file RE04Trajectory.hh.

114  { return fTrackID; }
void RE04Trajectory::MergeTrajectory ( G4VTrajectory secondTrajectory)
virtual

Implements G4VTrajectory.

Definition at line 219 of file RE04Trajectory.cc.

220 {
221  if(!secondTrajectory) return;
222 
223  RE04Trajectory* seco = (RE04Trajectory*)secondTrajectory;
224  G4int ent = seco->GetPointEntries();
225  for(G4int i=1;i<ent;i++) // initial point of the second trajectory
226  // should not be merged
227  {
228  fPositionRecord->push_back((*(seco->fPositionRecord))[i]);
229  // fPositionRecord->push_back(seco->fPositionRecord->removeAt(1));
230  }
231  delete (*seco->fPositionRecord)[0];
232  seco->fPositionRecord->clear();
233 }
int G4int
Definition: G4Types.hh:78
virtual int GetPointEntries() const

Here is the call graph for this function:

void RE04Trajectory::operator delete ( void aTrajectory)
inline

Definition at line 166 of file RE04Trajectory.hh.

167 {
168  faTrajAllocator->FreeSingle((RE04Trajectory*)aTrajectory);
169 }
G4ThreadLocal G4Allocator< RE04Trajectory > * faTrajAllocator
void * RE04Trajectory::operator new ( size_t  )
inline

Definition at line 160 of file RE04Trajectory.hh.

161 {
163  return (void*)faTrajAllocator->MallocSingle();
164 }
G4ThreadLocal G4Allocator< RE04Trajectory > * faTrajAllocator
int RE04Trajectory::operator== ( const RE04Trajectory right) const
inline

Definition at line 109 of file RE04Trajectory.hh.

110  {return (this==&right);}
void RE04Trajectory::ShowTrajectory ( std::ostream &  os = G4cout) const
virtual

Reimplemented from G4VTrajectory.

Definition at line 107 of file RE04Trajectory.cc.

108 {
109  // Invoke the default implementation in G4VTrajectory...
111  // ... or override with your own code here.
112 }
virtual void ShowTrajectory(std::ostream &os=G4cout) const

Here is the call graph for this function:

Here is the caller graph for this function:


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