ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4PrimaryVertex.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4PrimaryVertex.hh
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 //
28 //
29 // class description:
30 //
31 // This is the class which represents a primary vertex. The object of this
32 // class is set to G4Event object by G4VPrimaryGenerator concrete class.
33 // This class object has one or more G4PrimaryParticle objects as primary
34 // particles.
35 // --------------------------------------------------------------------
36 #ifndef G4PrimaryVertex_h
37 #define G4PrimaryVertex_h 1
38 
39 #include "globals.hh"
40 #include "pwdefs.hh"
41 #include "G4Allocator.hh"
42 #include "G4ThreeVector.hh"
43 #include "G4PrimaryParticle.hh"
44 
46 
48 {
49  public:
50  inline void *operator new(size_t);
51  inline void operator delete(void *aStackedTrack);
52 
53  public: // with description
57  virtual ~G4PrimaryVertex();
58 
59  public:
62 
63  G4bool operator==(const G4PrimaryVertex &right) const;
64  G4bool operator!=(const G4PrimaryVertex &right) const;
65 
66  public: // with description
67  G4ThreeVector GetPosition() const;
68  void SetPosition(G4double x0,G4double y0,G4double z0);
69  G4double GetX0() const;
70  G4double GetY0() const;
71  G4double GetZ0() const;
72  G4double GetT0() const;
73  void SetT0(G4double t0);
74  G4int GetNumberOfParticle() const;
77  void SetNext(G4PrimaryVertex* nv);
78  void ClearNext();
79  G4PrimaryVertex* GetNext() const;
80  G4double GetWeight() const;
81  void SetWeight(G4double w);
84 
85  void Print() const;
86 
87  private:
99 
100 };
101 
103 
104 inline void * G4PrimaryVertex::operator new(size_t)
105 {
107  {
109  }
110  return (void *) aPrimaryVertexAllocator()->MallocSingle();
111 }
112 
113 inline void G4PrimaryVertex::operator delete(void * aPrimaryVertex)
114 {
115  aPrimaryVertexAllocator()->FreeSingle((G4PrimaryVertex *) aPrimaryVertex);
116 }
117 
119 { return G4ThreeVector(X0,Y0,Z0); }
120 
122 { X0 = x0; Y0 = y0; Z0 = z0; }
123 
125 { return X0; }
126 
128 { return Y0; }
129 
131 { return Z0; }
132 
134 { return T0; }
135 
137 { T0 = t0; }
138 
140 { return numberOfParticle; }
141 
143 {
144  if(theParticle == 0) { theParticle = pp; }
145  else { theTail->SetNext(pp); }
146  theTail = pp;
148 }
149 
151 {
152  if(nextVertex == 0) { nextVertex = nv; }
153  else { tailVertex->SetNext(nv); }
154  tailVertex = nv;
155 }
156 
158 {
159  nextVertex = nullptr;
160  tailVertex = nullptr;
161 }
162 
164 { return nextVertex; }
165 
167 { return Weight0; }
168 
170 { Weight0 = w; }
171 
173 { userInfo = anInfo; }
174 
176 { return userInfo; }
177 
178 #endif
179