Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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$
28 //
29 //
30 
31 
32 #ifndef G4PrimaryVertex_h
33 #define G4PrimaryVertex_h 1
34 
35 #include "globals.hh"
36 #include "G4Allocator.hh"
37 #include "G4ThreeVector.hh"
38 #include "G4PrimaryParticle.hh"
40 
41 // class description:
42 //
43 // This is the class which represents a primary vertex. The ofject of this
44 // class is set to G4Event objct by G4VPrimaryGenerator concrete class.
45 // This class object has one or more G4PrimaryParticle objects as primary
46 // particles.
47 
49 {
50  public:
51  inline void *operator new(size_t);
52  inline void operator delete(void *aStackedTrack);
53 
54  public: // with description
58  virtual ~G4PrimaryVertex();
59 
60  public:
63 
64  G4int operator==(const G4PrimaryVertex &right) const;
65  G4int operator!=(const G4PrimaryVertex &right) const;
66 
67  public: // with description
68  G4ThreeVector GetPosition() const;
69  void SetPosition(G4double x0,G4double y0,G4double z0);
70  G4double GetX0() const;
71  G4double GetY0() const;
72  G4double GetZ0() const;
73  G4double GetT0() const;
74  void SetT0(G4double t0);
75  G4int GetNumberOfParticle() const;
78  void SetNext(G4PrimaryVertex* nv);
79  G4PrimaryVertex* GetNext() const;
80  G4double GetWeight() const;
81  void SetWeight(G4double w);
84 
85  void Print() const;
86 
87  private:
88  G4double X0;
89  G4double Y0;
90  G4double Z0;
91  G4double T0;
92  G4PrimaryParticle * theParticle;
93  G4PrimaryParticle * theTail;
94  G4PrimaryVertex* nextVertex;
95  G4PrimaryVertex* tailVertex;
96  G4int numberOfParticle;
97  G4double Weight0;
99 
100 };
101 
102 #if defined G4PARTICLES_ALLOC_EXPORT
104 #else
106 #endif
107 
108 inline void * G4PrimaryVertex::operator new(size_t)
109 {
110  void * aPrimaryVertex;
111  aPrimaryVertex = (void *) aPrimaryVertexAllocator.MallocSingle();
112  return aPrimaryVertex;
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;
149  numberOfParticle++;
150 }
151 
152 
154  if(nextVertex == 0) { nextVertex = nv; }
155  else { tailVertex->SetNext(nv); }
156  tailVertex = nv;
157 }
158 
160 { return nextVertex; }
161 
163 { return Weight0; }
164 
166 { Weight0 = w; }
167 
169 { userInfo = anInfo; }
170 
172 { return userInfo; }
173 
174 #endif
175