Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4PrimaryVertex Class Reference

#include <G4PrimaryVertex.hh>

Public Member Functions

voidoperator 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)
 
void ClearNext ()
 
G4PrimaryVertexGetNext () const
 
G4double GetWeight () const
 
void SetWeight (G4double w)
 
void SetUserInformation (G4VUserPrimaryVertexInformation *anInfo)
 
G4VUserPrimaryVertexInformationGetUserInformation () const
 
void Print () const
 

Detailed Description

Definition at line 50 of file G4PrimaryVertex.hh.

Constructor & Destructor Documentation

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 {
41 }

Here is the caller graph for this function:

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

Definition at line 43 of file G4PrimaryVertex.cc.

45 :X0(x0),Y0(y0),Z0(z0),T0(t0),theParticle(0),theTail(0),
46  nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
47 {
48 }
G4PrimaryVertex::G4PrimaryVertex ( G4ThreeVector  xyz0,
G4double  t0 
)

Definition at line 50 of file G4PrimaryVertex.cc.

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

Here is the call graph for this function:

G4PrimaryVertex::~G4PrimaryVertex ( )
virtual

Definition at line 67 of file G4PrimaryVertex.cc.

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

Here is the call graph for this function:

G4PrimaryVertex::G4PrimaryVertex ( const G4PrimaryVertex right)

Definition at line 59 of file G4PrimaryVertex.cc.

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

Member Function Documentation

void G4PrimaryVertex::ClearNext ( )
inline

Definition at line 160 of file G4PrimaryVertex.hh.

161 {
162  nextVertex = nullptr;
163  tailVertex = nullptr;
164 }

Here is the caller graph for this function:

G4PrimaryVertex * G4PrimaryVertex::GetNext ( ) const
inline

Definition at line 166 of file G4PrimaryVertex.hh.

167 { return nextVertex; }

Here is the caller graph for this function:

G4int G4PrimaryVertex::GetNumberOfParticle ( ) const
inline

Definition at line 142 of file G4PrimaryVertex.hh.

143 { return numberOfParticle; }
G4ThreeVector G4PrimaryVertex::GetPosition ( ) const
inline

Definition at line 121 of file G4PrimaryVertex.hh.

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

Here is the caller graph for this function:

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

Definition at line 140 of file G4PrimaryVertex.cc.

141 {
142  if( i >= 0 && i < numberOfParticle ) {
143  G4PrimaryParticle* particle = theParticle;
144  for( G4int j=0; j<i; j++ ){
145  if( particle == 0 ) return 0;
146  particle = particle->GetNext();
147  }
148  return particle;
149  } else {
150  return 0; }
151 }
int G4int
Definition: G4Types.hh:78
G4PrimaryParticle * GetNext() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4PrimaryVertex::GetT0 ( ) const
inline

Definition at line 136 of file G4PrimaryVertex.hh.

137 { return T0; }

Here is the caller graph for this function:

G4VUserPrimaryVertexInformation * G4PrimaryVertex::GetUserInformation ( ) const
inline

Definition at line 178 of file G4PrimaryVertex.hh.

179 { return userInfo; }
G4double G4PrimaryVertex::GetWeight ( ) const
inline

Definition at line 169 of file G4PrimaryVertex.hh.

170 { return Weight0; }

Here is the caller graph for this function:

G4double G4PrimaryVertex::GetX0 ( ) const
inline

Definition at line 127 of file G4PrimaryVertex.hh.

128 { return X0; }

Here is the caller graph for this function:

G4double G4PrimaryVertex::GetY0 ( ) const
inline

Definition at line 130 of file G4PrimaryVertex.hh.

131 { return Y0; }

Here is the caller graph for this function:

G4double G4PrimaryVertex::GetZ0 ( ) const
inline

Definition at line 133 of file G4PrimaryVertex.hh.

134 { return Z0; }

Here is the caller graph for this function:

void G4PrimaryVertex::operator delete ( void aStackedTrack)
inline

Definition at line 116 of file G4PrimaryVertex.hh.

117 {
118  aPrimaryVertexAllocator->FreeSingle((G4PrimaryVertex *) aPrimaryVertex);
119 }
G4PART_DLL G4ThreadLocal G4Allocator< G4PrimaryVertex > * aPrimaryVertexAllocator
void * G4PrimaryVertex::operator new ( size_t  )
inline

Definition at line 107 of file G4PrimaryVertex.hh.

108 {
110  {
112  }
113  return (void *) aPrimaryVertexAllocator->MallocSingle();
114 }
G4PART_DLL G4ThreadLocal G4Allocator< G4PrimaryVertex > * aPrimaryVertexAllocator
G4int G4PrimaryVertex::operator!= ( const G4PrimaryVertex right) const

Definition at line 137 of file G4PrimaryVertex.cc.

138 { return (this!=&right); }
G4PrimaryVertex & G4PrimaryVertex::operator= ( const G4PrimaryVertex right)

Definition at line 90 of file G4PrimaryVertex.cc.

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

Here is the call graph for this function:

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

Definition at line 134 of file G4PrimaryVertex.cc.

135 { return (this==&right); }
void G4PrimaryVertex::Print ( ) const

Definition at line 153 of file G4PrimaryVertex.cc.

154 {
155  G4cout << "Vertex ( "
156  << X0/mm << "[mm], "
157  << Y0/mm << "[mm], "
158  << Z0/mm << "[mm], "
159  << T0/ns << "[ns] )"
160  << " Weight " << Weight0 << G4endl;
161  if(userInfo!=0) userInfo->Print();
162  G4cout << " -- Primary particles :: "
163  << " # of primaries =" << numberOfParticle << G4endl;
164  if( theParticle != 0) theParticle->Print();
165  if (nextVertex !=0 ) {
166  G4cout << "Next Vertex " << G4endl;
167  nextVertex->Print();
168  }
169 }
static constexpr double mm
Definition: G4SIunits.hh:115
void Print() const
G4GLOB_DLL std::ostream G4cout
virtual void Print() const =0
#define G4endl
Definition: G4ios.hh:61
#define ns
Definition: xmlparse.cc:614

Here is the call graph for this function:

Here is the caller graph for this function:

void G4PrimaryVertex::SetNext ( G4PrimaryVertex nv)
inline

Definition at line 153 of file G4PrimaryVertex.hh.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 124 of file G4PrimaryVertex.hh.

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

Here is the caller graph for this function:

void G4PrimaryVertex::SetPrimary ( G4PrimaryParticle pp)
inline

Definition at line 145 of file G4PrimaryVertex.hh.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void G4PrimaryVertex::SetT0 ( G4double  t0)
inline

Definition at line 139 of file G4PrimaryVertex.hh.

140 { T0 = t0; }

Here is the caller graph for this function:

void G4PrimaryVertex::SetUserInformation ( G4VUserPrimaryVertexInformation anInfo)
inline

Definition at line 175 of file G4PrimaryVertex.hh.

176 { userInfo = anInfo; }
void G4PrimaryVertex::SetWeight ( G4double  w)
inline

Definition at line 172 of file G4PrimaryVertex.hh.

173 { Weight0 = w; }

Here is the caller graph for this function:


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