Geant4  10.01.p02
G4PrimaryVertex.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: G4PrimaryVertex.hh 67971 2013-03-13 10:13:24Z gcosmo $
28 //
29 //
30 
31 
32 #ifndef G4PrimaryVertex_h
33 #define G4PrimaryVertex_h 1
34 
35 #include "globals.hh"
36 #include "pwdefs.hh"
37 #include "G4Allocator.hh"
38 #include "G4ThreeVector.hh"
39 #include "G4PrimaryParticle.hh"
40 
42 
43 // class description:
44 //
45 // This is the class which represents a primary vertex. The ofject of this
46 // class is set to G4Event objct by G4VPrimaryGenerator concrete class.
47 // This class object has one or more G4PrimaryParticle objects as primary
48 // particles.
49 
51 {
52  public:
53  inline void *operator new(size_t);
54  inline void operator delete(void *aStackedTrack);
55 
56  public: // with description
60  virtual ~G4PrimaryVertex();
61 
62  public:
65 
66  G4int operator==(const G4PrimaryVertex &right) const;
67  G4int operator!=(const G4PrimaryVertex &right) const;
68 
69  public: // with description
70  G4ThreeVector GetPosition() const;
71  void SetPosition(G4double x0,G4double y0,G4double z0);
72  G4double GetX0() const;
73  G4double GetY0() const;
74  G4double GetZ0() const;
75  G4double GetT0() const;
76  void SetT0(G4double t0);
77  G4int GetNumberOfParticle() const;
80  void SetNext(G4PrimaryVertex* nv);
81  G4PrimaryVertex* GetNext() const;
82  G4double GetWeight() const;
83  void SetWeight(G4double w);
86 
87  void Print() const;
88 
89  private:
101 
102 };
103 
105 
106 inline void * G4PrimaryVertex::operator new(size_t)
107 {
109  {
111  }
112  return (void *) aPrimaryVertexAllocator->MallocSingle();
113 }
114 
115 inline void G4PrimaryVertex::operator delete(void * aPrimaryVertex)
116 {
117  aPrimaryVertexAllocator->FreeSingle((G4PrimaryVertex *) aPrimaryVertex);
118 }
119 
121 { return G4ThreeVector(X0,Y0,Z0); }
122 
124 { X0 = x0; Y0 = y0; Z0 = z0; }
125 
127 { return X0; }
128 
130 { return Y0; }
131 
133 { return Z0; }
134 
136 { return T0; }
137 
139 { T0 = t0; }
140 
142 { return numberOfParticle; }
143 
145 {
146  if(theParticle == 0) { theParticle = pp; }
147  else { theTail->SetNext(pp); }
148  theTail = pp;
150 }
151 
152 
154 {
155  if(nextVertex == 0) { nextVertex = nv; }
156  else { tailVertex->SetNext(nv); }
157  tailVertex = nv;
158 }
159 
161 { return nextVertex; }
162 
164 { return Weight0; }
165 
167 { Weight0 = w; }
168 
170 { userInfo = anInfo; }
171 
173 { return userInfo; }
174 
175 #endif
176 
G4PrimaryVertex & operator=(const G4PrimaryVertex &right)
G4double GetX0() const
void SetNext(G4PrimaryParticle *np)
G4int GetNumberOfParticle() const
G4ThreeVector GetPosition() const
G4PART_DLL G4ThreadLocal G4Allocator< G4PrimaryVertex > * aPrimaryVertexAllocator
CLHEP::Hep3Vector G4ThreeVector
G4int operator==(const G4PrimaryVertex &right) const
void SetWeight(G4double w)
void Print() const
G4double GetT0() const
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
void SetUserInformation(G4VUserPrimaryVertexInformation *anInfo)
G4double GetWeight() const
G4PrimaryParticle * GetPrimary(G4int i=0) const
G4VUserPrimaryVertexInformation * GetUserInformation() const
G4PrimaryVertex * nextVertex
G4PrimaryParticle * theTail
G4double GetZ0() const
void SetNext(G4PrimaryVertex *nv)
G4PrimaryVertex * GetNext() const
G4PrimaryParticle * theParticle
virtual ~G4PrimaryVertex()
G4VUserPrimaryVertexInformation * userInfo
void SetT0(G4double t0)
G4double GetY0() const
void SetPrimary(G4PrimaryParticle *pp)
void SetPosition(G4double x0, G4double y0, G4double z0)
G4int operator!=(const G4PrimaryVertex &right) const
#define G4PART_DLL
Definition: pwdefs.hh:48
double G4double
Definition: G4Types.hh:76
G4PrimaryVertex * tailVertex