ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4SmoothTrajectory.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4SmoothTrajectory.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 // G4SmoothTrajectory
27 //
28 // class description:
29 //
30 // This class represents the trajectory of a particle tracked.
31 // It includes information of
32 // 1) List of trajectory points which compose the trajectory,
33 // 2) static information of particle which generated the
34 // trajectory,
35 // 3) trackID and parent particle ID of the trajectory,
36 // 4) Auxiliary points will be associated to G4SmoothTrajectoryPoint
37 // to assist drawing smoothly curved trajectory.
38 
39 // --------------------------------------------------------------------
40 #ifndef G4SmoothTrajectory_hh
41 #define G4SmoothTrajectory_hh 1
42 
43 #include <stdlib.h> // Include from 'system'
44 #include <vector>
45 
46 #include "trkgdefs.hh"
47 #include "G4VTrajectory.hh"
48 #include "G4Allocator.hh"
49 #include "G4ios.hh" // Include from 'system'
50 #include "globals.hh" // Include from 'global'
51 #include "G4ParticleDefinition.hh" // Include from 'particle+matter'
52 #include "G4SmoothTrajectoryPoint.hh" // Include from 'tracking'
53 #include "G4Track.hh"
54 #include "G4Step.hh"
55 
56 class G4Polyline;
57 
59 {
60 
61  using TrajectoryPointContainer = std::vector<G4VTrajectoryPoint*>;
62 
63  //--------
64  public: // with description
65  //--------
66 
67  // Constructor/Destructor
68 
70  G4SmoothTrajectory(const G4Track* aTrack);
72  virtual ~G4SmoothTrajectory();
73 
74  // Operators
75 
77  G4int operator == (const G4SmoothTrajectory& r) const {return (this==&r);}
78 
79  inline void* operator new(size_t);
80  inline void operator delete(void*);
81 
82  // Get/Set functions
83  inline G4int GetTrackID() const
84  { return fTrackID; }
85  inline G4int GetParentID() const
86  { return fParentID; }
87  inline G4String GetParticleName() const
88  { return ParticleName; }
89  inline G4double GetCharge() const
90  { return PDGCharge; }
91  inline G4int GetPDGEncoding() const
92  { return PDGEncoding; }
94  { return initialKineticEnergy; }
96  { return initialMomentum; }
97 
98  // Other member functions
99  virtual void ShowTrajectory(std::ostream& os=G4cout) const;
100  virtual void DrawTrajectory() const;
101  virtual void AppendStep(const G4Step* aStep);
102  virtual int GetPointEntries() const { return positionRecord->size(); }
103  virtual G4VTrajectoryPoint* GetPoint(G4int i) const { return (*positionRecord)[i]; }
104  virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
105 
107 
108  // Get method for HEPRep style attributes
109  virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
110  virtual std::vector<G4AttValue>* CreateAttValues() const;
111 
112  //---------
113  private:
114  //---------
115 
124 };
125 
127 
128 inline void* G4SmoothTrajectory::operator new(size_t)
129 {
132  return (void*)aSmoothTrajectoryAllocator()->MallocSingle();
133 }
134 
135 inline void G4SmoothTrajectory::operator delete(void* aTrajectory)
136 {
137  aSmoothTrajectoryAllocator()->FreeSingle((G4SmoothTrajectory*)aTrajectory);
138 }
139 
140 #endif