Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WLSTrajectory.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 //
28 //
29 //
30 //
31 //
32 
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
35 
36 #ifndef WLSTrajectory_h_seen
37 #define WLSTrajectory_h_seen 1
38 
39 #include <vector>
40 #include <stdlib.h>
41 
42 #include "globals.hh"
43 
44 #include "G4ios.hh"
45 #include "G4Step.hh"
46 #include "G4Track.hh"
47 #include "G4Allocator.hh"
48 #include "G4VTrajectory.hh"
49 #include "G4ParticleDefinition.hh"
50 #include "G4TrajectoryPoint.hh"
51 
52 typedef std::vector<G4VTrajectoryPoint*> WLSTrajectoryPointContainer;
53 
55 {
56 
57 //--------
58  public: // without description
59 //--------
60 
61 // Constructor/Destructor
62 
63  WLSTrajectory();
64  WLSTrajectory(const G4Track* aTrack);
66  virtual ~WLSTrajectory();
67 
68 // Operators
69 
70  inline void* operator new(size_t);
71  inline void operator delete(void*);
72  inline int operator == (const WLSTrajectory& right) const
73  { return (this==&right); }
74 
75 // Get/Set functions
76 
77  inline G4int GetTrackID() const { return fTrackID; }
78  inline G4int GetParentID() const { return fParentID; }
79  inline G4String GetParticleName() const { return ParticleName; }
80  inline G4double GetCharge() const { return PDGCharge; }
81  inline G4int GetPDGEncoding() const { return PDGEncoding; }
82  inline G4ThreeVector GetInitialMomentum() const { return initialMomentum; }
83 
84 // Other member functions
85 
86  virtual void ShowTrajectory(std::ostream& os=G4cout) const;
87  virtual void DrawTrajectory() const;
88  virtual void DrawTrajectory(G4int i_mode=0) const;
89  virtual void AppendStep(const G4Step* aStep);
90  virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
91 
93 
94  virtual int GetPointEntries() const
95  { return fpPointsContainer->size(); }
96  virtual G4VTrajectoryPoint* GetPoint(G4int i) const
97  { return (*fpPointsContainer)[i]; }
98 
99  virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
100  virtual std::vector<G4AttValue>* CreateAttValues() const;
101 
102  void SetDrawTrajectory(G4bool b){drawit=b;}
103  void WLS(){wls=true;}
104  void SetForceDrawTrajectory(G4bool b){forceDraw=b;}
105  void SetForceNoDrawTrajectory(G4bool b){forceNoDraw=b;}
106 
107 //---------
108  private:
109 //---------
110 
111 // Member data
112 
113  WLSTrajectoryPointContainer* fpPointsContainer;
114 
115  G4int fTrackID;
116  G4int fParentID;
117  G4double PDGCharge;
118  G4int PDGEncoding;
119  G4String ParticleName;
120  G4ThreeVector initialMomentum;
121 
122  G4bool wls;
123  G4bool drawit;
124  G4bool forceNoDraw;
125  G4bool forceDraw;
126 
127  G4ParticleDefinition* particleDefinition;
128 
129 };
130 
132 
133 inline void* WLSTrajectory::operator new(size_t) {
134  void* aTrajectory = (void*) WLSTrajectoryAllocator.MallocSingle();
135  return aTrajectory;
136 }
137 
138 inline void WLSTrajectory::operator delete(void* aTrajectory) {
139  WLSTrajectoryAllocator.FreeSingle((WLSTrajectory*)aTrajectory);
140 }
141 
142 #endif