ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Trajectory.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4Trajectory.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // G4Trajectory
27 //
28 // class description:
29 // This class represents the trajectory of a particle tracked.
30 // It includes information of
31 // 1) List of trajectory points which compose the trajectory,
32 // 2) static information of particle which generated the
33 // trajectory,
34 // 3) trackID and parent particle ID of the trajectory,
35 
36 // Contact:
37 // Questions and comments to this code should be sent to
38 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
39 // Makoto Asai (e-mail: asai@kekvax.kek.jp)
40 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
41 //
42 // --------------------------------------------------------------------
43 #ifndef G4Trajectory_hh
44 #define G4Trajectory_hh 1
45 
46 #include <stdlib.h> // Include from 'system'
47 #include <vector>
48 
49 #include "trkgdefs.hh"
50 #include "G4VTrajectory.hh"
51 #include "G4Allocator.hh"
52 #include "G4ios.hh" // Include from 'system'
53 #include "globals.hh" // Include from 'global'
54 #include "G4ParticleDefinition.hh" // Include from 'particle+matter'
55 #include "G4TrajectoryPoint.hh" // Include from 'tracking'
56 #include "G4Track.hh"
57 #include "G4Step.hh"
58 
59 class G4Polyline;
60 
64 {
65 
66  using TrajectoryPointContainer = std::vector<G4VTrajectoryPoint*>;
67 
68  //--------
69  public: // with description
70  //--------
71 
72  // Constructor/Destructor
73 
74  G4Trajectory();
75  G4Trajectory(const G4Track* aTrack);
77  virtual ~G4Trajectory();
78 
79  // Operators
80 
81  inline void* operator new(size_t);
82  inline void operator delete(void*);
83  G4int operator == (const G4Trajectory& r) const {return (this==&r);}
84 
85  // Get/Set functions
86 
87  inline G4int GetTrackID() const
88  { return fTrackID; }
89  inline G4int GetParentID() const
90  { return fParentID; }
91  inline G4String GetParticleName() const
92  { return ParticleName; }
93  inline G4double GetCharge() const
94  { return PDGCharge; }
95  inline G4int GetPDGEncoding() const
96  { return PDGEncoding; }
98  { return initialKineticEnergy; }
100  { return initialMomentum; }
101 
102  // Other member functions
103 
104  virtual void ShowTrajectory(std::ostream& os=G4cout) const;
105  virtual void DrawTrajectory() const;
106  virtual void AppendStep(const G4Step* aStep);
107  virtual G4int GetPointEntries() const {return G4int(positionRecord->size());}
108  virtual G4VTrajectoryPoint* GetPoint(G4int i) const { return (*positionRecord)[i]; }
109  virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
110 
112 
113  virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
114  virtual std::vector<G4AttValue>* CreateAttValues() const;
115 
116  //---------
117  private:
118  //---------
119 
128 
129 };
130 
132 
133 inline void* G4Trajectory::operator new(size_t)
134 {
135  if (!aTrajectoryAllocator())
137  return (void*)aTrajectoryAllocator()->MallocSingle();
138 }
139 
140 inline void G4Trajectory::operator delete(void* aTrajectory)
141 {
142  aTrajectoryAllocator()->FreeSingle((G4Trajectory*)aTrajectory);
143 }
144 
145 #endif