Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RichTrajectory.hh
Go to the documentation of this file.
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 //
27 // $Id: G4RichTrajectory.hh 67009 2013-01-29 16:00:21Z gcosmo $
28 //
29 //---------------------------------------------------------------
30 //
31 // G4RichTrajectory.hh
32 //
33 // class description:
34 // This class extends G4Trajectory, which includes the following:
35 // 1) List of trajectory points which compose the trajectory,
36 // 2) static information of particle which generated the
37 // trajectory,
38 // 3) trackID and parent particle ID of the trajectory.
39 // The extended information, only publicly accessible through AttValues,
40 // includes:
41 // 4) physical volume and next physical volume;
42 // 5) creator process;
43 // ...and much more.
44 //
45 // Contact:
46 // Questions and comments on G4Trajectory should be sent to
47 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
48 // Makoto Asai (e-mail: asai@kekvax.kek.jp)
49 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
50 // and on the extended code to:
51 // John Allison (e-mail: John.Allison@manchester.ac.uk)
52 // Joseph Perl (e-mail: perl@slac.stanford.edu)
53 //
54 // ---------------------------------------------------------------
55 
56 #ifndef G4RICHTRAJECTORY_HH
57 #define G4RICHTRAJECTORY_HH
58 
59 #include "G4Trajectory.hh"
60 
61 #include "G4TouchableHandle.hh"
62 
63 typedef std::vector<G4VTrajectoryPoint*> RichTrajectoryPointsContainer;
64 
66 
67 public: // with description
68 
69  // Constructors/destructors
71  G4RichTrajectory(const G4Track* aTrack);
73  virtual ~G4RichTrajectory();
74 
75 private:
76  G4RichTrajectory& operator= (const G4RichTrajectory &);
77 
78  // Operators
79 public:
80  inline void* operator new(size_t);
81  inline void operator delete(void*);
82  inline int operator == (const G4RichTrajectory& right) const
83  {return (this==&right);}
84 
85  // Other (virtual) member functions
86  void AppendStep(const G4Step* aStep);
87  void MergeTrajectory(G4VTrajectory* secondTrajectory);
88  int GetPointEntries() const { return fpRichPointsContainer->size(); }
90  { return (*fpRichPointsContainer)[i]; }
91 
92  // Get methods for HepRep style attributes
93  virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
94  virtual std::vector<G4AttValue>* CreateAttValues() const;
95 
96 private:
97 
98  // Extended information (only publicly accessible through AttValues)...
99  RichTrajectoryPointsContainer* fpRichPointsContainer;
100  G4TouchableHandle fpInitialVolume;
101  G4TouchableHandle fpInitialNextVolume;
102  const G4VProcess* fpCreatorProcess;
103  G4TouchableHandle fpFinalVolume;
104  G4TouchableHandle fpFinalNextVolume;
105  const G4VProcess* fpEndingProcess;
106  G4double fFinalKineticEnergy;
107 
108 };
109 
110 #if defined G4TRACKING_ALLOC_EXPORT
113 #else
116 #endif
117 
118 inline void* G4RichTrajectory::operator new(size_t)
119 {
120  void* aRichTrajectory;
121  aRichTrajectory = (void*)aRichTrajectoryAllocator.MallocSingle();
122  return aRichTrajectory;
123 }
124 
125 inline void G4RichTrajectory::operator delete(void* aRichTrajectory)
126 {
127  aRichTrajectoryAllocator.FreeSingle
128  ((G4RichTrajectory*)aRichTrajectory);
129 }
130 
131 #endif