Geant4  10.03.p03
 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 //
26 // $Id: WLSTrajectory.hh 90240 2015-05-21 09:08:13Z 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 AppendStep(const G4Step* aStep);
88  virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
89 
91 
92  virtual int GetPointEntries() const
93  { return fpPointsContainer->size(); }
94  virtual G4VTrajectoryPoint* GetPoint(G4int i) const
95  { return (*fpPointsContainer)[i]; }
96 
97  virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
98  virtual std::vector<G4AttValue>* CreateAttValues() const;
99 
100 //---------
101  private:
102 //---------
103 
104 // Member data
105 
106  WLSTrajectoryPointContainer* fpPointsContainer;
107 
108  G4int fTrackID;
109  G4int fParentID;
110  G4double fPDGCharge;
111  G4int fPDGEncoding;
112  G4String fParticleName;
113  G4ThreeVector fInitialMomentum;
114 
115  G4ParticleDefinition* fParticleDefinition;
116 
117 };
118 
120 
121 inline void* WLSTrajectory::operator new(size_t) {
124  return (void*) WLSTrajectoryAllocator->MallocSingle();
125 }
126 
127 inline void WLSTrajectory::operator delete(void* aTrajectory) {
128  WLSTrajectoryAllocator->FreeSingle((WLSTrajectory*)aTrajectory);
129 }
130 
131 #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:89
int G4int
Definition: G4Types.hh:78
G4ParticleDefinition * GetParticleDefinition()
virtual G4int GetParentID() const
virtual int GetPointEntries() const
G4GLOB_DLL std::ostream G4cout
virtual G4double GetCharge() const
virtual std::vector< G4AttValue > * CreateAttValues() const
Definition: G4Step.hh:76
virtual void ShowTrajectory(std::ostream &os=G4cout) const
G4ThreadLocal G4Allocator< WLSTrajectory > * WLSTrajectoryAllocator
virtual G4int GetTrackID() const
std::vector< G4VTrajectoryPoint * > WLSTrajectoryPointContainer
int operator==(const WLSTrajectory &right) const
double G4double
Definition: G4Types.hh:76
virtual ~WLSTrajectory()
virtual G4ThreeVector GetInitialMomentum() const