QwGeant4
QweakSimTrajectory.hh
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 /**
7 
8  \file QweakSimTrajectory.hh
9  $Revision: 1.3 $
10  $Date: 2005/12/28 23:09:41 $
11  \author Klaus Hans Grimm
12 
13 */
14 //=============================================================================
15 //
16 //=============================================================================
17 //
18 // ---------------------------
19 // | Doxygen Class Information |
20 // ---------------------------
21 /**
22  \class QweakSimTrajectory
23 
24  \brief Stores the information about the various tracks.
25 
26  It can be viewed as a perfect track reconstruction in a hypothetical perfect Qweak setup
27 
28  Placeholder for a long explaination
29 
30  */
31 //=============================================================================
32 //
33 //=============================================================================
34 // -----------------------
35 // | CVS File Information |
36 // -----------------------
37 //
38 // Last Update: $Author: grimm $
39 // Update Date: $Date: 2005/12/28 23:09:41 $
40 // CVS/RCS Revision: $Revision: 1.3 $
41 // Status: $State: Exp $
42 //
43 // ===================================
44 // CVS Revision Log at end of file !!
45 // ===================================
46 //
47 //=============================================================================
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 #ifndef QweakSimTrajectory_h
51 #define QweakSimTrajectory_h 1
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
54 // system includes
55 #include <vector>
56 
57 // geant4 includes
58 #include "G4Version.hh"
59 #include "G4Allocator.hh"
60 #include "G4VTrajectory.hh"
61 
62 // geant4 classes
63 class G4Track;
64 class G4ParticleDefinition;
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
68 typedef std::vector<G4VTrajectoryPoint*> QweakSimTrajectoryPointContainer;
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
71 class QweakSimTrajectory : public G4VTrajectory
72 {
73 
74 //--------
75  public:
76 //--------
77 
78 // Constructor/Destructor
79 
81 
82  QweakSimTrajectory(const G4Track* aTrack);
84  virtual ~QweakSimTrajectory();
85 
86 // Operators
87  inline void* operator new(size_t);
88  inline void operator delete(void*);
89  inline int operator == (const QweakSimTrajectory& right) const
90  {return (this==&right);}
91 
92 // Get/Set functions
93  inline G4int GetTrackID() const
94  { return fTrackID; }
95  inline G4int GetParentID() const
96  { return fParentID; }
97  inline G4String GetParticleName() const
98  { return ParticleName; }
99  inline G4double GetCharge() const
100  { return PDGCharge; }
101  inline G4int GetPDGEncoding() const
102  { return PDGEncoding; }
103  inline G4ThreeVector GetInitialMomentum() const
104  { return InitialMomentum; }
105 
106  virtual int GetPointEntries() const
107  { return positionRecord->size(); }
108  virtual G4VTrajectoryPoint* GetPoint(G4int i) const
109  { return (*positionRecord)[i]; }
110 
111 // Other member functions
112 // virtual void ShowTrajectory() const;
113  virtual void ShowTrajectory(std::ostream& os=G4cout) const;
114  #if G4VERSION_NUMBER < 1000
115  virtual void DrawTrajectory(G4int i_mode=0) const;
116  #else
117  virtual void DrawTrajectory() const;
118  #endif
119  virtual void AppendStep(const G4Step* aStep);
120  virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
121 
122  // From LXe example
123  void SetDrawTrajectory(G4bool b){drawit=b;}
126 
127  G4ParticleDefinition* GetParticleDefinition();
128 
129 //---------
130  private:
131 //---------
132 
134  G4int fTrackID;
135  G4int fParentID;
136  G4ParticleDefinition* fpParticleDefinition;
137  G4String ParticleName;
138  G4double PDGCharge;
139  G4int PDGEncoding;
140 // FIXME not initialized !!!
141  G4ThreeVector InitialMomentum;
142 
143  G4ThreeVector momentum;
144  G4ThreeVector vertexPosition;
145  G4double globalTime;
146 
147 // From LXe example
148  G4bool drawit;
149  G4bool forceNoDraw;
150  G4bool forceDraw;
151 
152 };
153 
154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155 extern G4Allocator<QweakSimTrajectory> myTrajectoryAllocator;
156 
157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
158 inline void* QweakSimTrajectory::operator new(size_t)
159 {
160  void* aTrajectory;
161  aTrajectory = (void*)myTrajectoryAllocator.MallocSingle();
162  return aTrajectory;
163 }
164 
165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
166 inline void QweakSimTrajectory::operator delete(void* aTrajectory)
167 {
168  myTrajectoryAllocator.FreeSingle((QweakSimTrajectory*)aTrajectory);
169 }
170 
171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
172 
173 #endif
174 
175 //=======================================================================================
176 // -----------------------
177 // | CVS File Information |
178 // -----------------------
179 //
180 // $Revisions$
181 // $Log: QweakSimTrajectory.hh,v $
182 // Revision 1.3 2005/12/28 23:09:41 grimm
183 // Testing: added some bool variables taken from the LXe example for dis/enabling user trajectory storage
184 //
185 // Revision 1.2 2005/12/27 19:27:38 grimm
186 // - Redesign of Doxygen header containing CVS info like revision and date
187 // - Added CVS revision log at the end of file
188 //
189 //
Stores the information about the various tracks.
G4ThreeVector vertexPosition
G4ParticleDefinition * fpParticleDefinition
G4ThreeVector GetInitialMomentum() const
G4int GetTrackID() const
virtual G4VTrajectoryPoint * GetPoint(G4int i) const
virtual void MergeTrajectory(G4VTrajectory *secondTrajectory)
G4int GetParentID() const
void SetForceNoDrawTrajectory(G4bool b)
std::vector< G4VTrajectoryPoint * > QweakSimTrajectoryPointContainer
void SetDrawTrajectory(G4bool b)
virtual void DrawTrajectory(G4int i_mode=0) const
G4double GetCharge() const
G4ParticleDefinition * GetParticleDefinition()
G4Allocator< QweakSimTrajectory > myTrajectoryAllocator
int operator==(const QweakSimTrajectory &right) const
virtual void AppendStep(const G4Step *aStep)
G4int GetPDGEncoding() const
G4String GetParticleName() const
void SetForceDrawTrajectory(G4bool b)
virtual int GetPointEntries() const
G4ThreeVector InitialMomentum
virtual void ShowTrajectory(std::ostream &os=G4cout) const
QweakSimTrajectoryPointContainer * positionRecord