Geant4-11
Public Member Functions | Private Attributes
G4PrimaryVertex Class Reference

#include <G4PrimaryVertex.hh>

Public Member Functions

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

Private Attributes

G4PrimaryVertexnextVertex = nullptr
 
G4int numberOfParticle = 0
 
G4double T0 = 0.0
 
G4PrimaryVertextailVertex = nullptr
 
G4PrimaryParticletheParticle = nullptr
 
G4PrimaryParticletheTail = nullptr
 
G4VUserPrimaryVertexInformationuserInfo = nullptr
 
G4double Weight0 = 1.0
 
G4double X0 = 0.0
 
G4double Y0 = 0.0
 
G4double Z0 = 0.0
 

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 {
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
G4PrimaryParticle * theTail
G4VUserPrimaryVertexInformation * userInfo
G4PrimaryParticle * theParticle
G4PrimaryVertex * tailVertex
G4PrimaryVertex * nextVertex

References G4PrimaryParticle::ClearNext(), G4PrimaryParticle::GetNext(), nextVertex, tailVertex, theParticle, theTail, and userInfo.

◆ 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}

References nextVertex, and tailVertex.

Referenced by G4Event::~G4Event().

◆ GetNext()

G4PrimaryVertex * G4PrimaryVertex::GetNext ( ) const
inline

Definition at line 205 of file G4PrimaryVertex.hh.

206{
207 return nextVertex;
208}

References nextVertex.

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}

References numberOfParticle.

Referenced by export_G4PrimaryVertex().

◆ 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

References X0, Y0, and Z0.

Referenced by export_G4PrimaryVertex(), and 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

References G4PrimaryParticle::GetNext(), numberOfParticle, and theParticle.

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

◆ GetT0()

G4double G4PrimaryVertex::GetT0 ( ) const
inline

Definition at line 163 of file G4PrimaryVertex.hh.

164{
165 return T0;
166}

References T0.

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

◆ GetUserInformation()

G4VUserPrimaryVertexInformation * G4PrimaryVertex::GetUserInformation ( ) const
inline

Definition at line 229 of file G4PrimaryVertex.hh.

230{
231 return userInfo;
232}

References userInfo.

◆ GetWeight()

G4double G4PrimaryVertex::GetWeight ( ) const
inline

Definition at line 211 of file G4PrimaryVertex.hh.

212{
213 return Weight0;
214}

References Weight0.

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

◆ GetX0()

G4double G4PrimaryVertex::GetX0 ( ) const
inline

Definition at line 145 of file G4PrimaryVertex.hh.

146{
147 return X0;
148}

References X0.

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

◆ GetY0()

G4double G4PrimaryVertex::GetY0 ( ) const
inline

Definition at line 151 of file G4PrimaryVertex.hh.

152{
153 return Y0;
154}

References Y0.

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

◆ GetZ0()

G4double G4PrimaryVertex::GetZ0 ( ) const
inline

Definition at line 157 of file G4PrimaryVertex.hh.

158{
159 return Z0;
160}

References Z0.

Referenced by export_G4PrimaryVertex(), and 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()

References 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}

References aPrimaryVertexAllocator().

◆ 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;
103
104 if (theParticle != nullptr) delete theParticle;
105 theParticle = nullptr;
106 theTail = nullptr;
107 if (right.theParticle != nullptr )
108 {
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));
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

References G4PrimaryVertex(), G4PrimaryParticle::GetNext(), GetNext(), nextVertex, numberOfParticle, T0, tailVertex, theParticle, theTail, userInfo, Weight0, X0, Y0, and Z0.

◆ 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}
static constexpr double mm
Definition: G4SIunits.hh:95
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void Print() const
virtual void Print() const =0
#define ns
Definition: xmlparse.cc:614

References G4cout, G4endl, mm, nextVertex, ns, numberOfParticle, G4PrimaryParticle::Print(), Print(), G4VUserPrimaryVertexInformation::Print(), T0, theParticle, userInfo, Weight0, X0, Y0, and Z0.

Referenced by export_G4PrimaryVertex(), 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)

References nextVertex, SetNext(), and tailVertex.

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}

References X0, Y0, Z0, and G4InuclParticleNames::z0.

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

◆ SetPrimary()

void G4PrimaryVertex::SetPrimary ( G4PrimaryParticle pp)
inline

◆ SetT0()

void G4PrimaryVertex::SetT0 ( G4double  t0)
inline

Definition at line 169 of file G4PrimaryVertex.hh.

170{
171 T0 = t0;
172}

References T0.

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

◆ SetUserInformation()

void G4PrimaryVertex::SetUserInformation ( G4VUserPrimaryVertexInformation info)
inline

Definition at line 223 of file G4PrimaryVertex.hh.

224{
225 userInfo = info;
226}

References userInfo.

◆ SetWeight()

void G4PrimaryVertex::SetWeight ( G4double  w)
inline

Definition at line 217 of file G4PrimaryVertex.hh.

218{
219 Weight0 = w;
220}

References Weight0.

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

Field Documentation

◆ nextVertex

G4PrimaryVertex* G4PrimaryVertex::nextVertex = nullptr
private

Definition at line 103 of file G4PrimaryVertex.hh.

Referenced by ClearNext(), GetNext(), operator=(), Print(), SetNext(), and ~G4PrimaryVertex().

◆ numberOfParticle

G4int G4PrimaryVertex::numberOfParticle = 0
private

Definition at line 107 of file G4PrimaryVertex.hh.

Referenced by GetNumberOfParticle(), GetPrimary(), operator=(), Print(), and SetPrimary().

◆ T0

G4double G4PrimaryVertex::T0 = 0.0
private

Definition at line 100 of file G4PrimaryVertex.hh.

Referenced by GetT0(), operator=(), Print(), and SetT0().

◆ tailVertex

G4PrimaryVertex* G4PrimaryVertex::tailVertex = nullptr
private

Definition at line 104 of file G4PrimaryVertex.hh.

Referenced by ClearNext(), operator=(), SetNext(), and ~G4PrimaryVertex().

◆ theParticle

G4PrimaryParticle* G4PrimaryVertex::theParticle = nullptr
private

Definition at line 101 of file G4PrimaryVertex.hh.

Referenced by GetPrimary(), operator=(), Print(), SetPrimary(), and ~G4PrimaryVertex().

◆ theTail

G4PrimaryParticle* G4PrimaryVertex::theTail = nullptr
private

Definition at line 102 of file G4PrimaryVertex.hh.

Referenced by operator=(), SetPrimary(), and ~G4PrimaryVertex().

◆ userInfo

G4VUserPrimaryVertexInformation* G4PrimaryVertex::userInfo = nullptr
private

◆ Weight0

G4double G4PrimaryVertex::Weight0 = 1.0
private

Definition at line 105 of file G4PrimaryVertex.hh.

Referenced by GetWeight(), operator=(), Print(), and SetWeight().

◆ X0

G4double G4PrimaryVertex::X0 = 0.0
private

Definition at line 97 of file G4PrimaryVertex.hh.

Referenced by GetPosition(), GetX0(), operator=(), Print(), and SetPosition().

◆ Y0

G4double G4PrimaryVertex::Y0 = 0.0
private

Definition at line 98 of file G4PrimaryVertex.hh.

Referenced by GetPosition(), GetY0(), operator=(), Print(), and SetPosition().

◆ Z0

G4double G4PrimaryVertex::Z0 = 0.0
private

Definition at line 99 of file G4PrimaryVertex.hh.

Referenced by GetPosition(), GetZ0(), operator=(), Print(), and SetPosition().


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