Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PrimaryVertex Class Reference

#include <G4PrimaryVertex.hh>

Public Member Functions

 G4PrimaryVertex ()
 
 G4PrimaryVertex (G4double x0, G4double y0, G4double z0, G4double t0)
 
 G4PrimaryVertex (G4ThreeVector xyz0, G4double t0)
 
virtual ~G4PrimaryVertex ()
 
 G4PrimaryVertex (const G4PrimaryVertex &right)
 
G4PrimaryVertexoperator= (const G4PrimaryVertex &right)
 
G4bool operator== (const G4PrimaryVertex &right) const
 
G4bool operator!= (const G4PrimaryVertex &right) const
 
void * operator new (size_t)
 
void operator delete (void *aPrimaryVertex)
 
G4ThreeVector GetPosition () const
 
void SetPosition (G4double x0, G4double y0, G4double z0)
 
G4double GetX0 () const
 
G4double GetY0 () const
 
G4double GetZ0 () const
 
G4double GetT0 () const
 
void SetT0 (G4double t0)
 
G4int GetNumberOfParticle () const
 
void SetPrimary (G4PrimaryParticle *pp)
 
G4PrimaryParticleGetPrimary (G4int i=0) const
 
void SetNext (G4PrimaryVertex *nv)
 
void ClearNext ()
 
G4PrimaryVertexGetNext () const
 
G4double GetWeight () const
 
void SetWeight (G4double w)
 
void SetUserInformation (G4VUserPrimaryVertexInformation *info)
 
G4VUserPrimaryVertexInformationGetUserInformation () const
 
void Print () const
 

Detailed Description

Definition at line 49 of file G4PrimaryVertex.hh.

Constructor & Destructor Documentation

◆ G4PrimaryVertex() [1/4]

G4PrimaryVertex::G4PrimaryVertex ( )

Definition at line 44 of file G4PrimaryVertex.cc.

45{
46}

Referenced by operator=().

◆ G4PrimaryVertex() [2/4]

G4PrimaryVertex::G4PrimaryVertex ( G4double  x0,
G4double  y0,
G4double  z0,
G4double  t0 
)

Definition at line 49 of file G4PrimaryVertex.cc.

51 : X0(x0), Y0(y0), Z0(z0), T0(t0)
52{
53}

◆ G4PrimaryVertex() [3/4]

G4PrimaryVertex::G4PrimaryVertex ( G4ThreeVector  xyz0,
G4double  t0 
)

Definition at line 56 of file G4PrimaryVertex.cc.

57 : X0(xyz0.x()), Y0(xyz0.y()), Z0(xyz0.z()), T0(t0)
58{
59}
double z() const
double x() const
double y() const

◆ ~G4PrimaryVertex()

G4PrimaryVertex::~G4PrimaryVertex ( )
virtual

Definition at line 68 of file G4PrimaryVertex.cc.

69{
70 if(theParticle != nullptr)
71 {
72 G4PrimaryParticle* theNext = theParticle;
73 while(theNext != nullptr)
74 {
75 G4PrimaryParticle* thisPrimary = theNext;
76 theNext = thisPrimary->GetNext();
77 thisPrimary->ClearNext();
78 delete thisPrimary;
79 }
80 theParticle = nullptr;
81 }
82 delete nextVertex;
83 nextVertex = nullptr;
84
85 theTail = nullptr;
86 tailVertex = nullptr;
87
88 delete userInfo;
89 userInfo = nullptr;
90}
G4PrimaryParticle * GetNext() const

◆ G4PrimaryVertex() [4/4]

G4PrimaryVertex::G4PrimaryVertex ( const G4PrimaryVertex right)

Definition at line 62 of file G4PrimaryVertex.cc.

63{
64 *this = right;
65}

Member Function Documentation

◆ ClearNext()

void G4PrimaryVertex::ClearNext ( )
inline

Definition at line 198 of file G4PrimaryVertex.hh.

199{
200 nextVertex = nullptr;
201 tailVertex = nullptr;
202}

Referenced by G4Event::~G4Event().

◆ GetNext()

G4PrimaryVertex * G4PrimaryVertex::GetNext ( ) const
inline

Definition at line 205 of file G4PrimaryVertex.hh.

206{
207 return nextVertex;
208}

Referenced by G4Event::GetPrimaryVertex(), G4PrimaryTransformer::GimmePrimaries(), operator=(), and G4Event::~G4Event().

◆ GetNumberOfParticle()

G4int G4PrimaryVertex::GetNumberOfParticle ( ) const
inline

Definition at line 175 of file G4PrimaryVertex.hh.

176{
177 return numberOfParticle;
178}

◆ GetPosition()

G4ThreeVector G4PrimaryVertex::GetPosition ( ) const
inline

Definition at line 133 of file G4PrimaryVertex.hh.

134{
135 return G4ThreeVector(X0,Y0,Z0);
136}
CLHEP::Hep3Vector G4ThreeVector

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

◆ GetPrimary()

G4PrimaryParticle * G4PrimaryVertex::GetPrimary ( G4int  i = 0) const

Definition at line 153 of file G4PrimaryVertex.cc.

154{
155 if( i >= 0 && i < numberOfParticle )
156 {
157 G4PrimaryParticle* particle = theParticle;
158 for( G4int j=0; j<i; ++j )
159 {
160 if( particle == nullptr ) return nullptr;
161 particle = particle->GetNext();
162 }
163 return particle;
164 }
165 else
166 {
167 return nullptr;
168 }
169}
int G4int
Definition: G4Types.hh:85

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), and G4PrimaryTransformer::GenerateTracks().

◆ GetT0()

G4double G4PrimaryVertex::GetT0 ( ) const
inline

Definition at line 163 of file G4PrimaryVertex.hh.

164{
165 return T0;
166}

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ GetUserInformation()

G4VUserPrimaryVertexInformation * G4PrimaryVertex::GetUserInformation ( ) const
inline

Definition at line 229 of file G4PrimaryVertex.hh.

230{
231 return userInfo;
232}

◆ GetWeight()

G4double G4PrimaryVertex::GetWeight ( ) const
inline

Definition at line 211 of file G4PrimaryVertex.hh.

212{
213 return Weight0;
214}

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ GetX0()

G4double G4PrimaryVertex::GetX0 ( ) const
inline

Definition at line 145 of file G4PrimaryVertex.hh.

146{
147 return X0;
148}

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ GetY0()

G4double G4PrimaryVertex::GetY0 ( ) const
inline

Definition at line 151 of file G4PrimaryVertex.hh.

152{
153 return Y0;
154}

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ GetZ0()

G4double G4PrimaryVertex::GetZ0 ( ) const
inline

Definition at line 157 of file G4PrimaryVertex.hh.

158{
159 return Z0;
160}

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ operator delete()

void G4PrimaryVertex::operator delete ( void *  aPrimaryVertex)
inline

Definition at line 127 of file G4PrimaryVertex.hh.

128{
129 aPrimaryVertexAllocator()->FreeSingle((G4PrimaryVertex*) aPrimaryVertex);
130}
G4PART_DLL G4Allocator< G4PrimaryVertex > *& aPrimaryVertexAllocator()

◆ operator new()

void * G4PrimaryVertex::operator new ( size_t  )
inline

Definition at line 117 of file G4PrimaryVertex.hh.

118{
119 if (aPrimaryVertexAllocator() == nullptr)
120 {
122 }
123 return (void*) aPrimaryVertexAllocator()->MallocSingle();
124}

◆ operator!=()

G4bool G4PrimaryVertex::operator!= ( const G4PrimaryVertex right) const

Definition at line 147 of file G4PrimaryVertex.cc.

148{
149 return (this!=&right);
150}

◆ operator=()

G4PrimaryVertex & G4PrimaryVertex::operator= ( const G4PrimaryVertex right)

Definition at line 93 of file G4PrimaryVertex.cc.

94{
95 if (this != &right)
96 {
97 X0 = right.X0;
98 Y0 = right.Y0;
99 Z0 = right.Z0;
100 T0 = right.T0;
101 Weight0 = right.Weight0;
102 numberOfParticle = right.numberOfParticle;
103
104 if (theParticle != nullptr) delete theParticle;
105 theParticle = nullptr;
106 theTail = nullptr;
107 if (right.theParticle != nullptr )
108 {
109 theParticle = new G4PrimaryParticle(*(right.theParticle));
110 theTail = theParticle;
111 G4PrimaryParticle* np = theParticle->GetNext();
112 while (np != nullptr) // Loop checking, 09.08.2015, K.Kurashige
113 {
114 theTail = np;
115 np = np->GetNext();
116 }
117 }
118
119 if (nextVertex != nullptr ) delete nextVertex;
120 nextVertex = nullptr;
121 tailVertex = nullptr;
122 if (right.nextVertex != nullptr )
123 {
124 nextVertex = new G4PrimaryVertex(*(right.nextVertex));
125 tailVertex = nextVertex;
126 G4PrimaryVertex* nv = nextVertex->GetNext();
127 while (nv != nullptr) // Loop checking, 09.08.2015, K.Kurashige
128 {
129 tailVertex = nv;
130 nv = nv->GetNext();
131 }
132 }
133
134 // userInfo cannot be copied
135 userInfo = nullptr;
136 }
137 return *this;
138}
G4PrimaryVertex * GetNext() const

◆ operator==()

G4bool G4PrimaryVertex::operator== ( const G4PrimaryVertex right) const

Definition at line 141 of file G4PrimaryVertex.cc.

142{
143 return (this==&right);
144}

◆ Print()

void G4PrimaryVertex::Print ( ) const

Definition at line 172 of file G4PrimaryVertex.cc.

173{
174 G4cout << "Vertex ( "
175 << X0/mm << "[mm], "
176 << Y0/mm << "[mm], "
177 << Z0/mm << "[mm], "
178 << T0/ns << "[ns] )"
179 << " Weight " << Weight0 << G4endl;
180 if(userInfo != nullptr) userInfo->Print();
181 G4cout << " -- Primary particles :: "
182 << " # of primaries =" << numberOfParticle << G4endl;
183 if( theParticle != nullptr) theParticle->Print();
184 if (nextVertex != nullptr )
185 {
186 G4cout << "Next Vertex " << G4endl;
187 nextVertex->Print();
188 }
189}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void Print() const
virtual void Print() const =0
#define ns(x)
Definition: xmltok.c:1649

Referenced by G4PrimaryTransformer::GenerateTracks(), and Print().

◆ SetNext()

void G4PrimaryVertex::SetNext ( G4PrimaryVertex nv)
inline

Definition at line 190 of file G4PrimaryVertex.hh.

191{
192 if(nextVertex == nullptr) { nextVertex = nv; }
193 else { tailVertex->SetNext(nv); }
194 tailVertex = nv;
195}
void SetNext(G4PrimaryVertex *nv)

Referenced by G4Event::AddPrimaryVertex(), and SetNext().

◆ SetPosition()

void G4PrimaryVertex::SetPosition ( G4double  x0,
G4double  y0,
G4double  z0 
)
inline

Definition at line 139 of file G4PrimaryVertex.hh.

140{
141 X0 = x0; Y0 = y0; Z0 = z0;
142}

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

◆ SetPrimary()

void G4PrimaryVertex::SetPrimary ( G4PrimaryParticle pp)
inline

Definition at line 181 of file G4PrimaryVertex.hh.

182{
183 if(theParticle == nullptr) { theParticle = pp; }
184 else { theTail->SetNext(pp); }
185 theTail = pp;
186 ++numberOfParticle;
187}
void SetNext(G4PrimaryParticle *np)

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), and G4RTPrimaryGeneratorAction::GeneratePrimaries().

◆ SetT0()

void G4PrimaryVertex::SetT0 ( G4double  t0)
inline

Definition at line 169 of file G4PrimaryVertex.hh.

170{
171 T0 = t0;
172}

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

◆ SetUserInformation()

void G4PrimaryVertex::SetUserInformation ( G4VUserPrimaryVertexInformation info)
inline

Definition at line 223 of file G4PrimaryVertex.hh.

224{
225 userInfo = info;
226}

◆ SetWeight()

void G4PrimaryVertex::SetWeight ( G4double  w)
inline

Definition at line 217 of file G4PrimaryVertex.hh.

218{
219 Weight0 = w;
220}

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().


The documentation for this class was generated from the following files: