Geant4_10
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 //
26 // $Id: WLSTrajectory.hh 72065 2013-07-05 09:54:59Z gcosmo $
27 //
30 //
31 
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
34 
35 #ifndef WLSTrajectory_h_seen
36 #define WLSTrajectory_h_seen 1
37 
38 #include <vector>
39 #include <stdlib.h>
40 
41 #include "globals.hh"
42 
43 #include "G4ios.hh"
44 #include "G4Step.hh"
45 #include "G4Track.hh"
46 #include "G4Allocator.hh"
47 #include "G4VTrajectory.hh"
48 #include "G4ParticleDefinition.hh"
49 #include "G4TrajectoryPoint.hh"
50 
51 typedef std::vector<G4VTrajectoryPoint*> WLSTrajectoryPointContainer;
52 
54 {
55 
56 //--------
57  public: // without description
58 //--------
59 
60 // Constructor/Destructor
61 
62  WLSTrajectory();
63  WLSTrajectory(const G4Track* );
65  virtual ~WLSTrajectory();
66 
67 // Operators
68 
69  inline void* operator new(size_t);
70  inline void operator delete(void*);
71  inline int operator == (const WLSTrajectory& right) const
72  { return (this==&right); }
73 
74 // Get/Set functions
75 
76  inline virtual G4int GetTrackID() const { return fTrackID; }
77  inline virtual G4int GetParentID() const { return fParentID; }
78  inline virtual G4String GetParticleName() const { return fParticleName; }
79  inline virtual G4double GetCharge() const { return fPDGCharge; }
80  inline virtual G4int GetPDGEncoding() const { return fPDGEncoding; }
81  inline virtual G4ThreeVector GetInitialMomentum() const
82  {return fInitialMomentum;}
83 
84 // Other member functions
85 
86  virtual void ShowTrajectory(std::ostream& os=G4cout) const;
87  virtual void DrawTrajectory() const;
88  virtual void AppendStep(const G4Step* aStep);
89  virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
90 
92 
93  virtual int GetPointEntries() const
94  { return fpPointsContainer->size(); }
95  virtual G4VTrajectoryPoint* GetPoint(G4int i) const
96  { return (*fpPointsContainer)[i]; }
97 
98  virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
99  virtual std::vector<G4AttValue>* CreateAttValues() const;
100 
101  void SetDrawTrajectory(G4bool b){fDrawIt=b;}
102  void WLS(){fWLS=true;}
103  void SetForceDrawTrajectory(G4bool b){fForceDraw=b;}
104  void SetForceNoDrawTrajectory(G4bool b){fForceNoDraw=b;}
105 
106 //---------
107  private:
108 //---------
109 
110 // Member data
111 
112  WLSTrajectoryPointContainer* fpPointsContainer;
113 
114  G4int fTrackID;
115  G4int fParentID;
116  G4double fPDGCharge;
117  G4int fPDGEncoding;
118  G4String fParticleName;
119  G4ThreeVector fInitialMomentum;
120 
121  G4bool fWLS;
122  G4bool fDrawIt;
123  G4bool fForceNoDraw;
124  G4bool fForceDraw;
125 
126  G4ParticleDefinition* fParticleDefinition;
127 
128 };
129 
131 
132 inline void* WLSTrajectory::operator new(size_t) {
135  return (void*) WLSTrajectoryAllocator->MallocSingle();
136 }
137 
138 inline void WLSTrajectory::operator delete(void* aTrajectory) {
139  WLSTrajectoryAllocator->FreeSingle((WLSTrajectory*)aTrajectory);
140 }
141 
142 #endif
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual G4int GetPDGEncoding() const
virtual void AppendStep(const G4Step *aStep)
virtual G4VTrajectoryPoint * GetPoint(G4int i) const
virtual G4String GetParticleName() const
virtual void MergeTrajectory(G4VTrajectory *secondTrajectory)
#define G4ThreadLocal
Definition: tls.hh:52
int G4int
Definition: G4Types.hh:78
G4ParticleDefinition * GetParticleDefinition()
virtual G4int GetParentID() const
tuple b
Definition: test.py:12
void SetDrawTrajectory(G4bool b)
virtual int GetPointEntries() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
virtual G4double GetCharge() const
virtual std::vector< G4AttValue > * CreateAttValues() const
Definition: G4Step.hh:76
virtual void ShowTrajectory(std::ostream &os=G4cout) const
void SetForceNoDrawTrajectory(G4bool b)
G4ThreadLocal G4Allocator< WLSTrajectory > * WLSTrajectoryAllocator
void SetForceDrawTrajectory(G4bool b)
virtual G4int GetTrackID() const
std::vector< G4VTrajectoryPoint * > WLSTrajectoryPointContainer
int operator==(const WLSTrajectory &right) const
double G4double
Definition: G4Types.hh:76
virtual ~WLSTrajectory()
virtual void DrawTrajectory() const
virtual G4ThreeVector GetInitialMomentum() const