Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
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)
 
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.

Referenced by operator=().

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

References CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

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
G4PrimaryVertex::~G4PrimaryVertex ( )
virtual

Definition at line 67 of file G4PrimaryVertex.cc.

68 {
69  if(theParticle != 0) {
70  delete theParticle;
71  theParticle = 0;
72  }
73  if(nextVertex != 0) {
74  delete nextVertex;
75  nextVertex =0;
76  }
77  if(userInfo != 0) {
78  delete userInfo;
79  userInfo = 0;
80  }
81 }
G4PrimaryVertex::G4PrimaryVertex ( const G4PrimaryVertex right)

Definition at line 59 of file G4PrimaryVertex.cc.

References right.

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

Member Function Documentation

G4PrimaryVertex * G4PrimaryVertex::GetNext ( ) const
inline

Definition at line 160 of file G4PrimaryVertex.hh.

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

161 { return nextVertex; }
G4int G4PrimaryVertex::GetNumberOfParticle ( ) const
inline

Definition at line 141 of file G4PrimaryVertex.hh.

Referenced by exGPSEventAction::EndOfEventAction(), and export_G4PrimaryVertex().

142 { return numberOfParticle; }
G4ThreeVector G4PrimaryVertex::GetPosition ( ) const
inline
G4PrimaryParticle * G4PrimaryVertex::GetPrimary ( G4int  i = 0) const

Definition at line 133 of file G4PrimaryVertex.cc.

References G4PrimaryParticle::GetNext().

Referenced by ExGflashEventAction::EndOfEventAction(), RE01EventAction::EndOfEventAction(), exGPSEventAction::EndOfEventAction(), export_G4PrimaryVertex(), G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), and G4PrimaryTransformer::GenerateTracks().

134 {
135  if( i >= 0 && i < numberOfParticle ) {
136  G4PrimaryParticle* particle = theParticle;
137  for( G4int j=0; j<i; j++ ){
138  if( particle == 0 ) return 0;
139  particle = particle->GetNext();
140  }
141  return particle;
142  } else {
143  return 0; }
144 }
int G4int
Definition: G4Types.hh:78
G4PrimaryParticle * GetNext() const
G4double G4PrimaryVertex::GetT0 ( ) const
inline
G4VUserPrimaryVertexInformation * G4PrimaryVertex::GetUserInformation ( ) const
inline

Definition at line 172 of file G4PrimaryVertex.hh.

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

Definition at line 163 of file G4PrimaryVertex.hh.

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

164 { return Weight0; }
G4double G4PrimaryVertex::GetX0 ( ) const
inline
G4double G4PrimaryVertex::GetY0 ( ) const
inline
G4double G4PrimaryVertex::GetZ0 ( ) const
inline
void G4PrimaryVertex::operator delete ( void aStackedTrack)
inline

Definition at line 115 of file G4PrimaryVertex.hh.

References aPrimaryVertexAllocator.

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

Definition at line 106 of file G4PrimaryVertex.hh.

References aPrimaryVertexAllocator.

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

Definition at line 130 of file G4PrimaryVertex.cc.

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

Definition at line 83 of file G4PrimaryVertex.cc.

References G4PrimaryVertex(), GetNext(), and G4PrimaryParticle::GetNext().

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

Definition at line 127 of file G4PrimaryVertex.cc.

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

Definition at line 146 of file G4PrimaryVertex.cc.

References G4cout, G4endl, python.hepunit::mm, ns, G4VUserPrimaryVertexInformation::Print(), Print(), and G4PrimaryParticle::Print().

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

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

Definition at line 153 of file G4PrimaryVertex.hh.

References SetNext().

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

154 {
155  if(nextVertex == 0) { nextVertex = nv; }
156  else { tailVertex->SetNext(nv); }
157  tailVertex = nv;
158 }
void SetNext(G4PrimaryVertex *nv)
void G4PrimaryVertex::SetPosition ( G4double  x0,
G4double  y0,
G4double  z0 
)
inline

Definition at line 123 of file G4PrimaryVertex.hh.

References G4InuclParticleNames::z0.

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

124 { X0 = x0; Y0 = y0; Z0 = z0; }
void G4PrimaryVertex::SetPrimary ( G4PrimaryParticle pp)
inline
void G4PrimaryVertex::SetT0 ( G4double  t0)
inline

Definition at line 138 of file G4PrimaryVertex.hh.

Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries().

139 { T0 = t0; }
void G4PrimaryVertex::SetUserInformation ( G4VUserPrimaryVertexInformation anInfo)
inline

Definition at line 169 of file G4PrimaryVertex.hh.

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

Definition at line 166 of file G4PrimaryVertex.hh.

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

167 { Weight0 = w; }

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