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

#include <G4PrimaryVertex.hh>

Public Member Functions

void * operator new (size_t)
 
void operator delete (void *aStackedTrack)
 
 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)
 
G4int operator== (const G4PrimaryVertex &right) const
 
G4int operator!= (const G4PrimaryVertex &right) const
 
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)
 
G4PrimaryVertexGetNext () const
 
G4double GetWeight () const
 
void SetWeight (G4double w)
 
void SetUserInformation (G4VUserPrimaryVertexInformation *anInfo)
 
G4VUserPrimaryVertexInformationGetUserInformation () const
 
void Print () const
 

Detailed Description

Definition at line 48 of file G4PrimaryVertex.hh.

Constructor & Destructor Documentation

◆ G4PrimaryVertex() [1/4]

G4PrimaryVertex::G4PrimaryVertex ( )

Definition at line 37 of file G4PrimaryVertex.cc.

38:X0(0.),Y0(0.),Z0(0.),T0(0.),theParticle(0),theTail(0),
39 nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
40{;}

Referenced by operator=().

◆ G4PrimaryVertex() [2/4]

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

Definition at line 42 of file G4PrimaryVertex.cc.

44:X0(x0),Y0(y0),Z0(z0),T0(t0),theParticle(0),theTail(0),
45 nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
46{;}

◆ G4PrimaryVertex() [3/4]

G4PrimaryVertex::G4PrimaryVertex ( G4ThreeVector  xyz0,
G4double  t0 
)

Definition at line 48 of file G4PrimaryVertex.cc.

49:T0(t0),theParticle(0),theTail(0),
50 nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
51{
52 X0=xyz0.x();
53 Y0=xyz0.y();
54 Z0=xyz0.z();
55}
double z() const
double x() const
double y() const

◆ ~G4PrimaryVertex()

G4PrimaryVertex::~G4PrimaryVertex ( )
virtual

Definition at line 65 of file G4PrimaryVertex.cc.

66{
67 if(theParticle != 0) {
68 delete theParticle;
69 theParticle = 0;
70 }
71 if(nextVertex != 0) {
72 delete nextVertex;
73 nextVertex =0;
74 }
75 if(userInfo != 0) {
76 delete userInfo;
77 userInfo = 0;
78 }
79}

◆ G4PrimaryVertex() [4/4]

G4PrimaryVertex::G4PrimaryVertex ( const G4PrimaryVertex right)

Definition at line 57 of file G4PrimaryVertex.cc.

58:theParticle(0),theTail(0),
59 nextVertex(0),tailVertex(0),userInfo(0)
60{
61 numberOfParticle = right.numberOfParticle;
62 *this = right;
63}

Member Function Documentation

◆ GetNext()

G4PrimaryVertex * G4PrimaryVertex::GetNext ( ) const
inline

Definition at line 159 of file G4PrimaryVertex.hh.

160{ return nextVertex; }

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

◆ GetNumberOfParticle()

G4int G4PrimaryVertex::GetNumberOfParticle ( ) const
inline

Definition at line 141 of file G4PrimaryVertex.hh.

142{ return numberOfParticle; }

◆ GetPosition()

G4ThreeVector G4PrimaryVertex::GetPosition ( ) const
inline

Definition at line 120 of file G4PrimaryVertex.hh.

121{ return G4ThreeVector(X0,Y0,Z0); }
CLHEP::Hep3Vector G4ThreeVector

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

◆ GetPrimary()

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

Definition at line 131 of file G4PrimaryVertex.cc.

132{
133 if( i >= 0 && i < numberOfParticle ) {
134 G4PrimaryParticle* particle = theParticle;
135 for( G4int j=0; j<i; j++ ){
136 if( particle == 0 ) return 0;
137 particle = particle->GetNext();
138 }
139 return particle;
140 } else {
141 return 0; }
142}
int G4int
Definition: G4Types.hh:66
G4PrimaryParticle * GetNext() const

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

◆ GetT0()

G4double G4PrimaryVertex::GetT0 ( ) const
inline

Definition at line 135 of file G4PrimaryVertex.hh.

136{ return T0; }

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ GetUserInformation()

G4VUserPrimaryVertexInformation * G4PrimaryVertex::GetUserInformation ( ) const
inline

Definition at line 171 of file G4PrimaryVertex.hh.

172{ return userInfo; }

◆ GetWeight()

G4double G4PrimaryVertex::GetWeight ( ) const
inline

Definition at line 162 of file G4PrimaryVertex.hh.

163{ return Weight0; }

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ GetX0()

G4double G4PrimaryVertex::GetX0 ( ) const
inline

Definition at line 126 of file G4PrimaryVertex.hh.

127{ return X0; }

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ GetY0()

G4double G4PrimaryVertex::GetY0 ( ) const
inline

Definition at line 129 of file G4PrimaryVertex.hh.

130{ return Y0; }

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ GetZ0()

G4double G4PrimaryVertex::GetZ0 ( ) const
inline

Definition at line 132 of file G4PrimaryVertex.hh.

133{ return Z0; }

Referenced by G4PrimaryTransformer::GenerateTracks().

◆ operator delete()

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

Definition at line 115 of file G4PrimaryVertex.hh.

116{
117 aPrimaryVertexAllocator.FreeSingle((G4PrimaryVertex *) aPrimaryVertex);
118}
G4DLLIMPORT G4Allocator< G4PrimaryVertex > aPrimaryVertexAllocator

◆ operator new()

void * G4PrimaryVertex::operator new ( size_t  )
inline

Definition at line 108 of file G4PrimaryVertex.hh.

109{
110 void * aPrimaryVertex;
111 aPrimaryVertex = (void *) aPrimaryVertexAllocator.MallocSingle();
112 return aPrimaryVertex;
113}

◆ operator!=()

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

Definition at line 128 of file G4PrimaryVertex.cc.

129{ return (this!=&right); }

◆ operator=()

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

Definition at line 81 of file G4PrimaryVertex.cc.

82{
83 if (this != &right) {
84 X0 = right.X0;
85 Y0 = right.Y0;
86 Z0 = right.Z0;
87 T0 = right.T0;
88 Weight0 = right.Weight0;
89
90 numberOfParticle = 0;
91 if (theParticle !=0) delete theParticle;
92 theParticle =0;
93 theTail =0;
94 if (right.theParticle !=0 ) {
95 theParticle = new G4PrimaryParticle(*(right.theParticle));
96 numberOfParticle += 1;
97 theTail = theParticle;
98 G4PrimaryParticle * np = theParticle->GetNext();
99 while (np !=0) {
100 numberOfParticle += 1;
101 theTail = np;
102 np = np->GetNext();
103 }
104 }
105
106 if (nextVertex !=0 ) delete nextVertex;
107 nextVertex = 0;
108 tailVertex =0;
109 if (right.nextVertex !=0 ) {
110 nextVertex = new G4PrimaryVertex(*(right.nextVertex));
111 tailVertex = nextVertex;
112 G4PrimaryVertex* nv = nextVertex->GetNext();
113 while (nv !=0) {
114 tailVertex = nv;
115 nv = nv->GetNext();
116 }
117 }
118
119 // userInfo can not be copied
120 userInfo = 0;
121 }
122 return *this;
123}
G4PrimaryVertex * GetNext() const

◆ operator==()

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

Definition at line 125 of file G4PrimaryVertex.cc.

126{ return (this==&right); }

◆ Print()

void G4PrimaryVertex::Print ( ) const

Definition at line 144 of file G4PrimaryVertex.cc.

145{
146 G4cout << "Vertex ( "
147 << X0/mm << "[mm], "
148 << Y0/mm << "[mm], "
149 << Z0/mm << "[mm], "
150 << T0/ns << "[ns] )"
151 << " Weight " << Weight0 << G4endl;
152 if(userInfo!=0) userInfo->Print();
153 G4cout << " -- Primary particles :: "
154 << " # of primaries =" << numberOfParticle << G4endl;
155 if( theParticle != 0) theParticle->Print();
156 if (nextVertex !=0 ) {
157 G4cout << "Next Vertex " << G4endl;
158 nextVertex->Print();
159 }
160}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void Print() const
virtual void Print() const =0
#define ns
Definition: xmlparse.cc:597

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

◆ SetNext()

void G4PrimaryVertex::SetNext ( G4PrimaryVertex nv)
inline

Definition at line 153 of file G4PrimaryVertex.hh.

153 {
154 if(nextVertex == 0) { nextVertex = nv; }
155 else { tailVertex->SetNext(nv); }
156 tailVertex = nv;
157}
void SetNext(G4PrimaryVertex *nv)

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

◆ SetPosition()

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

Definition at line 123 of file G4PrimaryVertex.hh.

124{ X0 = x0; Y0 = y0; Z0 = z0; }

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

◆ SetPrimary()

void G4PrimaryVertex::SetPrimary ( G4PrimaryParticle pp)
inline

Definition at line 144 of file G4PrimaryVertex.hh.

145{
146 if(theParticle == 0) { theParticle = pp; }
147 else { theTail->SetNext(pp); }
148 theTail = pp;
149 numberOfParticle++;
150}
void SetNext(G4PrimaryParticle *np)

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), G4HEPEvtInterface::GeneratePrimaryVertex(), G4ParticleGun::GeneratePrimaryVertex(), G4SingleParticleSource::GeneratePrimaryVertex(), and G4RayShooter::Shoot().

◆ SetT0()

void G4PrimaryVertex::SetT0 ( G4double  t0)
inline

Definition at line 138 of file G4PrimaryVertex.hh.

139{ T0 = t0; }

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

◆ SetUserInformation()

void G4PrimaryVertex::SetUserInformation ( G4VUserPrimaryVertexInformation anInfo)
inline

Definition at line 168 of file G4PrimaryVertex.hh.

169{ userInfo = anInfo; }

◆ SetWeight()

void G4PrimaryVertex::SetWeight ( G4double  w)
inline

Definition at line 165 of file G4PrimaryVertex.hh.

166{ Weight0 = w; }

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().


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