Geant4  10.02.p03
RE01Trajectory Class Reference

#include <RE01Trajectory.hh>

Inheritance diagram for RE01Trajectory:
Collaboration diagram for RE01Trajectory:

Public Member Functions

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

Private Attributes

RE01TrajectoryPointContainerfPositionRecord
 
G4int fTrackID
 
G4int fParentID
 
G4int fTrackStatus
 
G4ParticleDefinitionfParticleDefinition
 
G4String fParticleName
 
G4double fPDGCharge
 
G4int fPDGEncoding
 
G4ThreeVector fMomentum
 
G4ThreeVector fVertexPosition
 
G4double fGlobalTime
 

Detailed Description

Definition at line 54 of file RE01Trajectory.hh.

Constructor & Destructor Documentation

◆ RE01Trajectory()

RE01Trajectory::RE01Trajectory ( const G4Track *  aTrack)

Definition at line 53 of file RE01Trajectory.cc.

54 :G4VTrajectory(),
56 {
57  fParticleDefinition = aTrack->GetDefinition();
61  if(fParticleName=="unknown")
62  {
63  G4PrimaryParticle*pp = aTrack->GetDynamicParticle()->GetPrimaryParticle();
64  if(pp)
65  {
66  if(pp->GetCharge()<DBL_MAX) fPDGCharge = pp->GetCharge();
67  fPDGEncoding = pp->GetPDGcode();
68  if(pp->GetG4code()!=0)
69  {
70  fParticleName += " : ";
72  }
73  }
74  }
75  fTrackID = aTrack->GetTrackID();
76  RE01TrackInformation* trackInfo
77  = (RE01TrackInformation*)(aTrack->GetUserInformation());
78  fTrackStatus = trackInfo->GetTrackingStatus();
79  if(fTrackStatus == 1)
80  { fParentID = aTrack->GetParentID(); }
81  else if(fTrackStatus == 2)
82  { fParentID = trackInfo->GetSourceTrackID(); }
83  else
84  { fParentID = -1; }
86  fPositionRecord->push_back(new G4TrajectoryPoint(aTrack->GetPosition()));
87  fMomentum = aTrack->GetMomentum();
88  fVertexPosition = aTrack->GetPosition();
89  fGlobalTime = aTrack->GetGlobalTime();
90 }
G4ParticleDefinition * GetG4code() const
G4double fGlobalTime
G4ParticleDefinition * fParticleDefinition
G4ThreeVector fVertexPosition
G4int GetPDGcode() const
G4ThreeVector fMomentum
G4double fPDGCharge
const G4String & GetParticleName() const
G4String fParticleName
G4double GetCharge() const
RE01TrajectoryPointContainer * fPositionRecord
std::vector< G4VTrajectoryPoint * > RE01TrajectoryPointContainer
#define DBL_MAX
Definition: templates.hh:83
G4double GetPDGCharge() const
Here is the call graph for this function:

◆ ~RE01Trajectory()

RE01Trajectory::~RE01Trajectory ( )
virtual

Definition at line 93 of file RE01Trajectory.cc.

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

Member Function Documentation

◆ AppendStep()

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

Implements G4VTrajectory.

Definition at line 254 of file RE01Trajectory.cc.

255 {
256  fPositionRecord->push_back(
257  new G4TrajectoryPoint(aStep->GetPostStepPoint()->GetPosition() ));
258 }
RE01TrajectoryPointContainer * fPositionRecord

◆ CreateAttValues()

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

Reimplemented from G4VTrajectory.

Definition at line 217 of file RE01Trajectory.cc.

218 {
219  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
220 
221  values->push_back
223 
224  values->push_back
226 
227  values->push_back
229 
230  values->push_back(G4AttValue("PN",fParticleName,""));
231 
232  values->push_back
234 
235  values->push_back
237 
238  values->push_back
239  (G4AttValue("IMom",G4BestUnit(fMomentum,"Energy"),""));
240 
241  values->push_back
242  (G4AttValue("IMag",G4BestUnit(fMomentum.mag(),"Energy"),""));
243 
244  values->push_back
245  (G4AttValue("VtxPos",G4BestUnit(fVertexPosition,"Length"),""));
246 
247  values->push_back
249 
250  return values;
251 }
G4ThreeVector fVertexPosition
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
virtual int GetPointEntries() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4ThreeVector fMomentum
G4double fPDGCharge
G4String fParticleName
double mag() const
Here is the call graph for this function:

◆ DrawTrajectory()

void RE01Trajectory::DrawTrajectory ( ) const
virtual

Reimplemented from G4VTrajectory.

Definition at line 127 of file RE01Trajectory.cc.

128 {
129 
132 
133  G4Polyline pPolyline;
134  for (size_t i = 0; i < fPositionRecord->size() ; i++) {
135  G4TrajectoryPoint* aTrajectoryPoint =
137  pos = aTrajectoryPoint->GetPosition();
138  pPolyline.push_back( pos );
139  }
140 
141  G4Colour colour(0.2,0.2,0.2);
143  colour = G4Colour(0.,0.,1.);
146  colour = G4Colour(1.,1.,0.);
149  colour = G4Colour(0.,1.,0.);
150  else if(fParticleDefinition->GetParticleType()=="meson")
151  {
152  if(fPDGCharge!=0.)
153  colour = G4Colour(1.,0.,0.);
154  else
155  colour = G4Colour(0.5,0.,0.);
156  }
157  else if(fParticleDefinition->GetParticleType()=="baryon")
158  {
159  if(fPDGCharge!=0.)
160  colour = G4Colour(0.,1.,1.);
161  else
162  colour = G4Colour(0.,0.5,0.5);
163  }
164 
165  G4VisAttributes attribs(colour);
166  pPolyline.SetVisAttributes(attribs);
167  if(pVVisManager) pVVisManager->Draw(pPolyline);
168 }
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
G4ParticleDefinition * fParticleDefinition
static G4VVisManager * GetConcreteInstance()
const G4String & GetParticleType() const
G4double fPDGCharge
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:80
const G4ThreeVector GetPosition() const
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
RE01TrajectoryPointContainer * fPositionRecord
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
static const G4double pos
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81
Here is the call graph for this function:

◆ GetAttDefs()

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

Reimplemented from G4VTrajectory.

Definition at line 171 of file RE01Trajectory.cc.

172 {
173  G4bool isNew;
174  std::map<G4String,G4AttDef>* store
175  = G4AttDefStore::GetInstance("RE01Trajectory",isNew);
176  if (isNew) {
177 
178  G4String id("ID");
179  (*store)[id] = G4AttDef(id,"Track ID","Bookkeeping","","G4int");
180 
181  G4String pid("PID");
182  (*store)[pid] = G4AttDef(pid,"Parent ID","Bookkeeping","","G4int");
183 
184  G4String status("Status");
185  (*store)[status] = G4AttDef(status,"Track Status","Bookkeeping","","G4int");
186 
187  G4String pn("PN");
188  (*store)[pn] = G4AttDef(pn,"Particle Name","Bookkeeping","","G4String");
189 
190  G4String ch("Ch");
191  (*store)[ch] = G4AttDef(ch,"Charge","Physics","e+","G4double");
192 
193  G4String pdg("PDG");
194  (*store)[pdg] = G4AttDef(pdg,"PDG Encoding","Bookkeeping","","G4int");
195 
196  G4String imom("IMom");
197  (*store)[imom] = G4AttDef(imom, "Momentum of track at start of trajectory",
198  "Physics","G4BestUnit","G4ThreeVector");
199 
200  G4String imag("IMag");
201  (*store)[imag] =
202  G4AttDef(imag, "Magnitude of momentum of track at start of trajectory",
203  "Physics","G4BestUnit","G4double");
204 
205  G4String vtxPos("VtxPos");
206  (*store)[vtxPos] = G4AttDef(vtxPos, "Vertex position",
207  "Physics","G4BestUnit","G4ThreeVector");
208 
209  G4String ntp("NTP");
210  (*store)[ntp] = G4AttDef(ntp,"No. of points","Bookkeeping","","G4int");
211 
212  }
213  return store;
214 }
bool G4bool
Definition: G4Types.hh:79
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
Here is the call graph for this function:

◆ GetCharge()

virtual G4double RE01Trajectory::GetCharge ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 75 of file RE01Trajectory.hh.

75 { return fPDGCharge; }
G4double fPDGCharge

◆ GetInitialMomentum()

virtual G4ThreeVector RE01Trajectory::GetInitialMomentum ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 77 of file RE01Trajectory.hh.

77 { return fMomentum; }
G4ThreeVector fMomentum

◆ GetParentID()

virtual G4int RE01Trajectory::GetParentID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 73 of file RE01Trajectory.hh.

73 { return fParentID; }

◆ GetParticleName()

virtual G4String RE01Trajectory::GetParticleName ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 74 of file RE01Trajectory.hh.

74 { return fParticleName; }
G4String fParticleName

◆ GetPDGEncoding()

virtual G4int RE01Trajectory::GetPDGEncoding ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 76 of file RE01Trajectory.hh.

76 { return fPDGEncoding; }

◆ GetPoint()

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

Implements G4VTrajectory.

Definition at line 79 of file RE01Trajectory.hh.

80  { return (*fPositionRecord)[i]; }
RE01TrajectoryPointContainer * fPositionRecord

◆ GetPointEntries()

virtual int RE01Trajectory::GetPointEntries ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 78 of file RE01Trajectory.hh.

78 { return fPositionRecord->size(); }
RE01TrajectoryPointContainer * fPositionRecord
Here is the caller graph for this function:

◆ GetTrackID()

virtual G4int RE01Trajectory::GetTrackID ( ) const
inlinevirtual

Implements G4VTrajectory.

Definition at line 72 of file RE01Trajectory.hh.

72 { return fTrackID; }

◆ MergeTrajectory()

void RE01Trajectory::MergeTrajectory ( G4VTrajectory secondTrajectory)
virtual

Implements G4VTrajectory.

Definition at line 261 of file RE01Trajectory.cc.

262 {
263  if(!secondTrajectory) return;
264 
265  RE01Trajectory* seco = (RE01Trajectory*)secondTrajectory;
266  G4int ent = seco->GetPointEntries();
267  //
268  // initial point of the second trajectory should not be merged
269  for(int i=1;i<ent;i++)
270  {
271  fPositionRecord->push_back((*(seco->fPositionRecord))[i]);
272  }
273  delete (*seco->fPositionRecord)[0];
274  seco->fPositionRecord->clear();
275 
276 }
virtual int GetPointEntries() const
int G4int
Definition: G4Types.hh:78
RE01TrajectoryPointContainer * fPositionRecord
Here is the call graph for this function:

◆ operator delete()

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

Definition at line 106 of file RE01Trajectory.hh.

107 {
108  myTrajectoryAllocator->FreeSingle((RE01Trajectory*)aTrajectory);
109 }
G4ThreadLocal G4Allocator< RE01Trajectory > * myTrajectoryAllocator

◆ operator new()

void * RE01Trajectory::operator new ( size_t  )
inline

Definition at line 99 of file RE01Trajectory.hh.

100 {
103  return (void*)myTrajectoryAllocator->MallocSingle();
104 }
G4ThreadLocal G4Allocator< RE01Trajectory > * myTrajectoryAllocator

◆ operator==()

int RE01Trajectory::operator== ( const RE01Trajectory right) const
inline

Definition at line 69 of file RE01Trajectory.hh.

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

◆ ShowTrajectory()

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

Reimplemented from G4VTrajectory.

Definition at line 105 of file RE01Trajectory.cc.

106 {
107  os << G4endl << "TrackID =" << fTrackID
108  << " : ParentID=" << fParentID << " : TrackStatus=" << fTrackStatus << G4endl;
109  os << "Particle name : " << fParticleName << " PDG code : " << fPDGEncoding
110  << " Charge : " << fPDGCharge << G4endl;
111  os << "Original momentum : " <<
112  G4BestUnit(fMomentum,"Energy") << G4endl;
113  os << "Vertex : " << G4BestUnit(fVertexPosition,"Length")
114  << " Global time : " << G4BestUnit(fGlobalTime,"Time") << G4endl;
115  os << " Current trajectory has " << fPositionRecord->size()
116  << " points." << G4endl;
117 
118  for( size_t i=0 ; i < fPositionRecord->size() ; i++){
119  G4TrajectoryPoint* aTrajectoryPoint =
121  os << "Point[" << i << "]"
122  << " Position= " << aTrajectoryPoint->GetPosition() << G4endl;
123  }
124 }
G4double fGlobalTime
G4ThreeVector fVertexPosition
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4ThreeVector fMomentum
G4double fPDGCharge
G4String fParticleName
const G4ThreeVector GetPosition() const
RE01TrajectoryPointContainer * fPositionRecord
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fGlobalTime

G4double RE01Trajectory::fGlobalTime
private

Definition at line 93 of file RE01Trajectory.hh.

◆ fMomentum

G4ThreeVector RE01Trajectory::fMomentum
private

Definition at line 91 of file RE01Trajectory.hh.

◆ fParentID

G4int RE01Trajectory::fParentID
private

Definition at line 85 of file RE01Trajectory.hh.

◆ fParticleDefinition

G4ParticleDefinition* RE01Trajectory::fParticleDefinition
private

Definition at line 87 of file RE01Trajectory.hh.

◆ fParticleName

G4String RE01Trajectory::fParticleName
private

Definition at line 88 of file RE01Trajectory.hh.

◆ fPDGCharge

G4double RE01Trajectory::fPDGCharge
private

Definition at line 89 of file RE01Trajectory.hh.

◆ fPDGEncoding

G4int RE01Trajectory::fPDGEncoding
private

Definition at line 90 of file RE01Trajectory.hh.

◆ fPositionRecord

RE01TrajectoryPointContainer* RE01Trajectory::fPositionRecord
private

Definition at line 83 of file RE01Trajectory.hh.

◆ fTrackID

G4int RE01Trajectory::fTrackID
private

Definition at line 84 of file RE01Trajectory.hh.

◆ fTrackStatus

G4int RE01Trajectory::fTrackStatus
private

Definition at line 86 of file RE01Trajectory.hh.

◆ fVertexPosition

G4ThreeVector RE01Trajectory::fVertexPosition
private

Definition at line 92 of file RE01Trajectory.hh.


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