Public Member Functions | Private Attributes | List of all members
EDepSim::TrajectoryPoint Class Reference

#include <EDepSimTrajectoryPoint.hh>

Inheritance diagram for EDepSim::TrajectoryPoint:

Public Member Functions

 TrajectoryPoint ()
 
 TrajectoryPoint (const G4Track *aTrack)
 
 TrajectoryPoint (const G4Step *aStep)
 
 TrajectoryPoint (const EDepSim::TrajectoryPoint &right)
 
virtual ~TrajectoryPoint ()
 
void * operator new (size_t)
 
void operator delete (void *aTrajectoryPoint)
 
int operator== (const EDepSim::TrajectoryPoint &right) const
 
G4double GetTime () const
 Get the time that the particle passed this trajectory point. More...
 
const G4ThreeVector GetMomentum () const
 Get the 3-momentum of the particle at this trajectory point. More...
 
G4StepStatus GetStepStatus () const
 
G4ProcessType GetProcessType () const
 
G4int GetProcessSubType () const
 
G4String GetProcessName () const
 Get the process name for this point. More...
 
G4double GetProcessDeposit () const
 
G4String GetPhysVolName () const
 
int GetVolumeNode () const
 
virtual const std::map< G4String, G4AttDef > * GetAttDefs () const
 
virtual std::vector< G4AttValue > * CreateAttValues () const
 

Private Attributes

G4double fTime
 
G4ThreeVector fMomentum
 
G4StepStatus fStepStatus
 
G4ProcessType fProcessType
 
G4int fProcessSubType
 
G4String fProcessName
 
G4double fProcessDeposit
 
G4String fPhysVolName
 
G4ThreeVector fPrevPosition
 

Detailed Description

Definition at line 21 of file EDepSimTrajectoryPoint.hh.

Constructor & Destructor Documentation

EDepSim::TrajectoryPoint::TrajectoryPoint ( )

Definition at line 21 of file EDepSimTrajectoryPoint.cc.

EDepSim::TrajectoryPoint::TrajectoryPoint ( const G4Track *  aTrack)

Definition at line 55 of file EDepSimTrajectoryPoint.cc.

56  : G4TrajectoryPoint(aTrack->GetPosition()) {
57  fTime = aTrack->GetGlobalTime();
58  fMomentum = aTrack->GetMomentum();
59  fStepStatus = fUndefined;
60  if (aTrack->GetVolume()) {
61  fPhysVolName = aTrack->GetVolume()->GetName();
62  }
63  else {
64  fPhysVolName == "OutOfWorld";
65  }
66  fPrevPosition = aTrack->GetPosition();
67  const G4VProcess* proc = aTrack->GetCreatorProcess();
68  if (proc) {
69  fProcessType = proc->GetProcessType();
70  fProcessSubType = proc->GetProcessSubType();
71  fProcessName = proc->GetProcessName();
72  fProcessDeposit = 0.0;
73  }
74 }
EDepSim::TrajectoryPoint::TrajectoryPoint ( const G4Step *  aStep)

Definition at line 28 of file EDepSimTrajectoryPoint.cc.

29  : G4TrajectoryPoint(aStep->GetPostStepPoint()->GetPosition()) {
30  fTime = aStep->GetPostStepPoint()->GetGlobalTime();
31  fMomentum = aStep->GetPostStepPoint()->GetMomentum();
32  fStepStatus = aStep->GetPostStepPoint()->GetStepStatus();
33  if (aStep->GetPostStepPoint()->GetPhysicalVolume()) {
35  = aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
36  }
37  else {
38  fPhysVolName == "OutOfWorld";
39  }
40  fPrevPosition = aStep->GetPreStepPoint()->GetPosition();
41  // Check if the G4VProcess for the defining process is available. It
42  // isn't available for steps defined by the user, step limits, or some
43  // other "bookkeeping" pseudo interactions.
44  if (aStep->GetPostStepPoint()->GetProcessDefinedStep()) {
45  fProcessType = aStep->GetPostStepPoint()->
46  GetProcessDefinedStep()->GetProcessType();
47  fProcessSubType = aStep->GetPostStepPoint()->
48  GetProcessDefinedStep()->GetProcessSubType();
49  fProcessName = aStep->GetPostStepPoint()->
50  GetProcessDefinedStep()->GetProcessName();
51  fProcessDeposit = aStep->GetTotalEnergyDeposit();
52  }
53 }
EDepSim::TrajectoryPoint::TrajectoryPoint ( const EDepSim::TrajectoryPoint right)
EDepSim::TrajectoryPoint::~TrajectoryPoint ( )
virtual

Definition at line 89 of file EDepSimTrajectoryPoint.cc.

89 { }

Member Function Documentation

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

Definition at line 124 of file EDepSimTrajectoryPoint.cc.

124  {
125  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
126 
127  values->push_back(G4AttValue("Time",G4BestUnit(fTime,"Time"),""));
128 
129  values->push_back(G4AttValue("Momentum",
130  G4BestUnit(fMomentum,"Momentum"),""));
131  values->push_back(G4AttValue("StepStatus",fStepStatus,""));
132 
133  values->push_back(G4AttValue("PhysVolName",fPhysVolName,""));
134 
135 #ifdef G4ATTDEBUG
136  EDepSimInfo(G4AttCheck(values,GetAttDefs()));
137 #endif
138 
139  return values;
140 }
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
#define EDepSimInfo(outStream)
Definition: EDepSimLog.hh:752
Q_UINT16 values[128]
const std::map< G4String, G4AttDef > * EDepSim::TrajectoryPoint::GetAttDefs ( ) const
virtual

Definition at line 91 of file EDepSimTrajectoryPoint.cc.

91  {
92  G4bool isNew;
93 
94  std::map<G4String,G4AttDef>* store
95  = G4AttDefStore::GetInstance("EDepSim::TrajectoryPoint",isNew);
96 
97  if (isNew) {
98 
99  G4String Time("Time");
100  (*store)[Time] =
101  G4AttDef(Time, "Time", "Physics","G4BestUnit","G4double");
102 
103  G4String Momentum("Momentum");
104  (*store)[Momentum] =
105  G4AttDef(Momentum, "Momentum", "Physics",
106  "G4BestUnit","G4ThreeVector");
107 
108  G4String StepStatus("StepStatus");
109  (*store)[StepStatus] =
110  G4AttDef(StepStatus, "StepStatus", "Physics", "", "G4StepStatus");
111 
112  G4String VolumeName("VolumeName");
113  (*store)[VolumeName] =
114  G4AttDef(VolumeName, "VolumeName", "Physics", "", "G4String");
115 
116  G4String VolumeNode("VolumeNode");
117  (*store)[VolumeNode] =
118  G4AttDef(VolumeNode, "VolumeNode", "Physics", "", "G4int");
119 
120  }
121  return store;
122 }
const G4ThreeVector EDepSim::TrajectoryPoint::GetMomentum ( ) const
inline

Get the 3-momentum of the particle at this trajectory point.

Definition at line 38 of file EDepSimTrajectoryPoint.hh.

38 { return fMomentum; }
G4String EDepSim::TrajectoryPoint::GetPhysVolName ( ) const
inline

The name of the physical volume containing the stopping point of the current step. This may (often) be a different volume than the volume referenced by GetVolumeNode().

Definition at line 66 of file EDepSimTrajectoryPoint.hh.

G4double EDepSim::TrajectoryPoint::GetProcessDeposit ( ) const
inline

Get the energy deposit by this process for this point. This is NOT enough information to calculate the total energy deposit for the track, but can be used to help decide which trajectory points are interesting to save to the output file.

Definition at line 61 of file EDepSimTrajectoryPoint.hh.

G4String EDepSim::TrajectoryPoint::GetProcessName ( ) const
inline

Get the process name for this point.

Definition at line 55 of file EDepSimTrajectoryPoint.hh.

G4int EDepSim::TrajectoryPoint::GetProcessSubType ( ) const
inline

Get the process sub type for this point. The sub-types depend on the specific processes and are defined in a few different include files. For EM and hadronic interacitons, see G4EmProcessSubType.hh, and G4HadronicProcessType.hh.

Definition at line 52 of file EDepSimTrajectoryPoint.hh.

G4ProcessType EDepSim::TrajectoryPoint::GetProcessType ( ) const
inline

Get the process type for this point (the process types are defined in G4ProcessType.hh).

Definition at line 46 of file EDepSimTrajectoryPoint.hh.

46 { return fProcessType; }
G4StepStatus EDepSim::TrajectoryPoint::GetStepStatus ( ) const
inline

Get the G4 stepping status of the interaction that instigated this trajectory point.

Definition at line 42 of file EDepSimTrajectoryPoint.hh.

42 { return fStepStatus; }
G4double EDepSim::TrajectoryPoint::GetTime ( ) const
inline

Get the time that the particle passed this trajectory point.

Definition at line 35 of file EDepSimTrajectoryPoint.hh.

35 { return fTime; }
int EDepSim::TrajectoryPoint::GetVolumeNode ( ) const

Get the node for the volume containing the stopping point. If the stopping point is on a geometric boundary, this is the volume that the track is just exiting.

Definition at line 142 of file EDepSimTrajectoryPoint.cc.

142  {
143  gGeoManager->PushPath();
144  int node
145  = EDepSim::RootGeometryManager::Get()->GetNodeId(0.5*(GetPosition()
146  +fPrevPosition));
147  gGeoManager->PopPath();
148  return node;
149 }
int GetNodeId(const G4ThreeVector &pos)
Get a volume ID base on the volume position.
static EDepSim::RootGeometryManager * Get(void)
If a persistency manager has not been created, create one.
void EDepSim::TrajectoryPoint::operator delete ( void *  aTrajectoryPoint)
inline

Definition at line 106 of file EDepSimTrajectoryPoint.hh.

106  {
107  aTrajPointAllocator.FreeSingle(
108  (EDepSim::TrajectoryPoint *) aTrajectoryPoint);
109 }
G4DLLIMPORT G4Allocator< EDepSim::TrajectoryPoint > aTrajPointAllocator
void * EDepSim::TrajectoryPoint::operator new ( size_t  )
inline

Definition at line 101 of file EDepSimTrajectoryPoint.hh.

101  {
102  void *aTrajectoryPoint = (void *) aTrajPointAllocator.MallocSingle();
103  return aTrajectoryPoint;
104 }
G4DLLIMPORT G4Allocator< EDepSim::TrajectoryPoint > aTrajPointAllocator
int EDepSim::TrajectoryPoint::operator== ( const EDepSim::TrajectoryPoint right) const
inline

Definition at line 31 of file EDepSimTrajectoryPoint.hh.

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

Member Data Documentation

G4ThreeVector EDepSim::TrajectoryPoint::fMomentum
private

Definition at line 85 of file EDepSimTrajectoryPoint.hh.

G4String EDepSim::TrajectoryPoint::fPhysVolName
private

Definition at line 91 of file EDepSimTrajectoryPoint.hh.

G4ThreeVector EDepSim::TrajectoryPoint::fPrevPosition
private

Definition at line 92 of file EDepSimTrajectoryPoint.hh.

G4double EDepSim::TrajectoryPoint::fProcessDeposit
private

Definition at line 90 of file EDepSimTrajectoryPoint.hh.

G4String EDepSim::TrajectoryPoint::fProcessName
private

Definition at line 89 of file EDepSimTrajectoryPoint.hh.

G4int EDepSim::TrajectoryPoint::fProcessSubType
private

Definition at line 88 of file EDepSimTrajectoryPoint.hh.

G4ProcessType EDepSim::TrajectoryPoint::fProcessType
private

Definition at line 87 of file EDepSimTrajectoryPoint.hh.

G4StepStatus EDepSim::TrajectoryPoint::fStepStatus
private

Definition at line 86 of file EDepSimTrajectoryPoint.hh.

G4double EDepSim::TrajectoryPoint::fTime
private

Definition at line 84 of file EDepSimTrajectoryPoint.hh.


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