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

#include <G4RichTrajectory.hh>

Inheritance diagram for G4RichTrajectory:
Collaboration diagram for G4RichTrajectory:

Public Member Functions

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

Detailed Description

Definition at line 65 of file G4RichTrajectory.hh.

Constructor & Destructor Documentation

G4RichTrajectory::G4RichTrajectory ( )

Definition at line 63 of file G4RichTrajectory.cc.

63  :
64  fpRichPointsContainer(0),
65  fpCreatorProcess(0),
66  fCreatorModelID(0),
67  fpEndingProcess(0),
68  fFinalKineticEnergy(0.)
69 {
70 }
G4RichTrajectory::G4RichTrajectory ( const G4Track *  aTrack)

Definition at line 72 of file G4RichTrajectory.cc.

72  :
73  G4Trajectory(aTrack) // Note: this initialises the base class data
74  // members and, unfortunately but never mind,
75  // creates a G4TrajectoryPoint in
76  // TrajectoryPointContainer that we cannot
77  // access because it's private. We store the
78  // same information (plus more) in a
79  // G4RichTrajectoryPoint in the
80  // RichTrajectoryPointsContainer
81 {
82  fpInitialVolume = aTrack->GetTouchableHandle();
83  fpInitialNextVolume = aTrack->GetNextTouchableHandle();
84  fpCreatorProcess = aTrack->GetCreatorProcess();
85  fCreatorModelID = aTrack->GetCreatorModelID();
86  // On construction, set final values to initial values.
87  // Final values are updated at the addition of every step - see AppendStep.
88  fpFinalVolume = aTrack->GetTouchableHandle();
89  fpFinalNextVolume = aTrack->GetNextTouchableHandle();
90  fpEndingProcess = aTrack->GetCreatorProcess();
91  fFinalKineticEnergy = aTrack->GetKineticEnergy();
92  // Insert the first rich trajectory point (see note above)...
93  fpRichPointsContainer = new RichTrajectoryPointsContainer;
94  fpRichPointsContainer->push_back(new G4RichTrajectoryPoint(aTrack));
95 }
G4int GetCreatorModelID() const
const G4VProcess * GetCreatorProcess() const
G4double GetKineticEnergy() const
std::vector< G4VTrajectoryPoint * > RichTrajectoryPointsContainer
const G4TouchableHandle & GetNextTouchableHandle() const
const G4TouchableHandle & GetTouchableHandle() const

Here is the call graph for this function:

G4RichTrajectory::G4RichTrajectory ( G4RichTrajectory &  right)

Definition at line 97 of file G4RichTrajectory.cc.

97  :
98  G4Trajectory(right)
99 {
100  fpInitialVolume = right.fpInitialVolume;
101  fpInitialNextVolume = right.fpInitialNextVolume;
102  fpCreatorProcess = right.fpCreatorProcess;
103  fCreatorModelID = right.fCreatorModelID;
104  fpFinalVolume = right.fpFinalVolume;
105  fpFinalNextVolume = right.fpFinalNextVolume;
106  fpEndingProcess = right.fpEndingProcess;
107  fFinalKineticEnergy = right.fFinalKineticEnergy;
108  fpRichPointsContainer = new RichTrajectoryPointsContainer;
109  for(size_t i=0;i<right.fpRichPointsContainer->size();i++)
110  {
111  G4RichTrajectoryPoint* rightPoint =
112  (G4RichTrajectoryPoint*)((*(right.fpRichPointsContainer))[i]);
113  fpRichPointsContainer->push_back(new G4RichTrajectoryPoint(*rightPoint));
114  }
115 }
std::vector< G4VTrajectoryPoint * > RichTrajectoryPointsContainer
G4RichTrajectory::~G4RichTrajectory ( )
virtual

Definition at line 117 of file G4RichTrajectory.cc.

118 {
119  if (fpRichPointsContainer) {
120  // fpRichPointsContainer->clearAndDestroy();
121  size_t i;
122  for(i=0;i<fpRichPointsContainer->size();i++){
123  delete (*fpRichPointsContainer)[i];
124  }
125  fpRichPointsContainer->clear();
126  delete fpRichPointsContainer;
127  }
128 }

Member Function Documentation

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

Reimplemented from G4Trajectory.

Definition at line 130 of file G4RichTrajectory.cc.

131 {
132  fpRichPointsContainer->push_back(new G4RichTrajectoryPoint(aStep));
133  // Except for first step, which is a sort of virtual step to start
134  // the track, compute the final values...
135  const G4Track* track = aStep->GetTrack();
136  const G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
137  if (track->GetCurrentStepNumber() > 0) {
138  fpFinalVolume = track->GetTouchableHandle();
139  fpFinalNextVolume = track->GetNextTouchableHandle();
140  fpEndingProcess = postStepPoint->GetProcessDefinedStep();
141  fFinalKineticEnergy =
142  aStep->GetPreStepPoint()->GetKineticEnergy() -
143  aStep->GetTotalEnergyDeposit();
144  }
145 }
G4StepPoint * GetPreStepPoint() const
G4int GetCurrentStepNumber() const
const G4TouchableHandle & GetNextTouchableHandle() const
const G4TouchableHandle & GetTouchableHandle() const
G4double GetTotalEnergyDeposit() const
const G4VProcess * GetProcessDefinedStep() const
G4StepPoint * GetPostStepPoint() const
G4double GetKineticEnergy() const
G4Track * GetTrack() const

Here is the call graph for this function:

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

Reimplemented from G4Trajectory.

Definition at line 249 of file G4RichTrajectory.cc.

250 {
251  // Create base class att values...
252  std::vector<G4AttValue>* values = G4Trajectory::CreateAttValues();
253 
254  if (fpInitialVolume && fpInitialVolume->GetVolume()) {
255  values->push_back(G4AttValue("IVPath",Path(fpInitialVolume),""));
256  } else {
257  values->push_back(G4AttValue("IVPath","None",""));
258  }
259 
260  if (fpInitialNextVolume && fpInitialNextVolume->GetVolume()) {
261  values->push_back(G4AttValue("INVPath",Path(fpInitialNextVolume),""));
262  } else {
263  values->push_back(G4AttValue("INVPath","None",""));
264  }
265 
266  if (fpCreatorProcess) {
267  values->push_back
268  (G4AttValue("CPN",fpCreatorProcess->GetProcessName(),""));
269  G4ProcessType type = fpCreatorProcess->GetProcessType();
270  values->push_back
271  (G4AttValue("CPTN",G4VProcess::GetProcessTypeName(type),""));
272  values->push_back
273  (G4AttValue("CMID",G4UIcommand::ConvertToString(fCreatorModelID),""));
274  const G4String& creatorModelName =
275  G4PhysicsModelCatalog::GetModelName(fCreatorModelID);
276  values->push_back(G4AttValue("CMN",creatorModelName,""));
277  } else {
278  values->push_back(G4AttValue("CPN","None",""));
279  values->push_back(G4AttValue("CPTN","None",""));
280  values->push_back(G4AttValue("CMID","None",""));
281  values->push_back(G4AttValue("CMN","None",""));
282  }
283 
284  if (fpFinalVolume && fpFinalVolume->GetVolume()) {
285  values->push_back(G4AttValue("FVPath",Path(fpFinalVolume),""));
286  } else {
287  values->push_back(G4AttValue("FVPath","None",""));
288  }
289 
290  if (fpFinalNextVolume && fpFinalNextVolume->GetVolume()) {
291  values->push_back(G4AttValue("FNVPath",Path(fpFinalNextVolume),""));
292  } else {
293  values->push_back(G4AttValue("FNVPath","None",""));
294  }
295 
296  if (fpEndingProcess) {
297  values->push_back(G4AttValue("EPN",fpEndingProcess->GetProcessName(),""));
298  G4ProcessType type = fpEndingProcess->GetProcessType();
299  values->push_back(G4AttValue("EPTN",G4VProcess::GetProcessTypeName(type),""));
300  } else {
301  values->push_back(G4AttValue("EPN","None",""));
302  values->push_back(G4AttValue("EPTN","None",""));
303  }
304 
305  values->push_back
306  (G4AttValue("FKE",G4BestUnit(fFinalKineticEnergy,"Energy"),""));
307 
308 #ifdef G4ATTDEBUG
309  G4cout << G4AttCheck(values,GetAttDefs());
310 #endif
311 
312  return values;
313 }
static const G4String & GetProcessTypeName(G4ProcessType)
Definition: G4VProcess.cc:141
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372
static const G4String & GetModelName(G4int)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4ProcessType GetProcessType() const
Definition: G4VProcess.hh:414
static G4String Path(const G4TouchableHandle &th)
G4GLOB_DLL std::ostream G4cout
virtual std::vector< G4AttValue > * CreateAttValues() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:44
G4ProcessType

Here is the call graph for this function:

void G4RichTrajectory::DrawTrajectory ( ) const
virtual

Reimplemented from G4Trajectory.

Definition at line 169 of file G4RichTrajectory.cc.

170 {
171  // Invoke the default implementation in G4VTrajectory...
173  // ... or override with your own code here.
174 }
virtual void DrawTrajectory() const

Here is the call graph for this function:

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

Reimplemented from G4Trajectory.

Definition at line 176 of file G4RichTrajectory.cc.

177 {
178  G4bool isNew;
179  std::map<G4String,G4AttDef>* store
180  = G4AttDefStore::GetInstance("G4RichTrajectory",isNew);
181  if (isNew) {
182 
183  // Get att defs from base class...
184  *store = *(G4Trajectory::GetAttDefs());
185 
186  G4String ID;
187 
188  ID = "IVPath";
189  (*store)[ID] = G4AttDef(ID,"Initial Volume Path",
190  "Physics","","G4String");
191 
192  ID = "INVPath";
193  (*store)[ID] = G4AttDef(ID,"Initial Next Volume Path",
194  "Physics","","G4String");
195 
196  ID = "CPN";
197  (*store)[ID] = G4AttDef(ID,"Creator Process Name",
198  "Physics","","G4String");
199 
200  ID = "CPTN";
201  (*store)[ID] = G4AttDef(ID,"Creator Process Type Name",
202  "Physics","","G4String");
203 
204  ID = "CMID";
205  (*store)[ID] = G4AttDef(ID,"Creator Model ID",
206  "Physics","","G4int");
207 
208  ID = "CMN";
209  (*store)[ID] = G4AttDef(ID,"Creator Model Name",
210  "Physics","","G4String");
211 
212  ID = "FVPath";
213  (*store)[ID] = G4AttDef(ID,"Final Volume Path",
214  "Physics","","G4String");
215 
216  ID = "FNVPath";
217  (*store)[ID] = G4AttDef(ID,"Final Next Volume Path",
218  "Physics","","G4String");
219 
220  ID = "EPN";
221  (*store)[ID] = G4AttDef(ID,"Ending Process Name",
222  "Physics","","G4String");
223 
224  ID = "EPTN";
225  (*store)[ID] = G4AttDef(ID,"Ending Process Type Name",
226  "Physics","","G4String");
227 
228  ID = "FKE";
229  (*store)[ID] = G4AttDef(ID,"Final kinetic energy",
230  "Physics","G4BestUnit","G4double");
231 
232  }
233 
234  return store;
235 }
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
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:

G4VTrajectoryPoint* G4RichTrajectory::GetPoint ( G4int  i) const
inlinevirtual

Reimplemented from G4Trajectory.

Definition at line 91 of file G4RichTrajectory.hh.

92  { return (*fpRichPointsContainer)[i]; }

Here is the caller graph for this function:

int G4RichTrajectory::GetPointEntries ( ) const
inlinevirtual

Reimplemented from G4Trajectory.

Definition at line 90 of file G4RichTrajectory.hh.

90 { return fpRichPointsContainer->size(); }

Here is the caller graph for this function:

void G4RichTrajectory::MergeTrajectory ( G4VTrajectory *  secondTrajectory)
virtual

Reimplemented from G4Trajectory.

Definition at line 147 of file G4RichTrajectory.cc.

148 {
149  if(!secondTrajectory) return;
150 
151  G4RichTrajectory* seco = (G4RichTrajectory*)secondTrajectory;
152  G4int ent = seco->GetPointEntries();
153  for(G4int i=1;i<ent;i++) {
154  // initial point of the second trajectory should not be merged
155  fpRichPointsContainer->push_back((*(seco->fpRichPointsContainer))[i]);
156  // fpRichPointsContainer->push_back(seco->fpRichPointsContainer->removeAt(1));
157  }
158  delete (*seco->fpRichPointsContainer)[0];
159  seco->fpRichPointsContainer->clear();
160 }
int GetPointEntries() const
int G4int
Definition: G4Types.hh:78

Here is the call graph for this function:

void G4RichTrajectory::operator delete ( void *  aRichTrajectory)
inline

Definition at line 123 of file G4RichTrajectory.hh.

124 {
125  aRichTrajectoryAllocator->FreeSingle((G4RichTrajectory*)aRichTrajectory);
126 }
G4TRACKING_DLL G4ThreadLocal G4Allocator< G4RichTrajectory > * aRichTrajectoryAllocator
void * G4RichTrajectory::operator new ( size_t  )
inline

Definition at line 116 of file G4RichTrajectory.hh.

117 {
120  return (void*)aRichTrajectoryAllocator->MallocSingle();
121 }
G4TRACKING_DLL G4ThreadLocal G4Allocator< G4RichTrajectory > * aRichTrajectoryAllocator
int G4RichTrajectory::operator== ( const G4RichTrajectory &  right) const
inline

Definition at line 82 of file G4RichTrajectory.hh.

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

Reimplemented from G4Trajectory.

Definition at line 162 of file G4RichTrajectory.cc.

163 {
164  // Invoke the default implementation in G4VTrajectory...
166  // ... or override with your own code here.
167 }
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: