Geant4 11.3.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4MCTSimVertex Class Reference

#include <G4MCTSimVertex.hh>

Public Member Functions

 G4MCTSimVertex ()
 
 G4MCTSimVertex (const G4ThreeVector &x, G4double t)
 
 G4MCTSimVertex (const G4ThreeVector &x, G4double t, const G4String &vname, G4int ncopy, const G4String &pname)
 
 ~G4MCTSimVertex ()
 
 G4MCTSimVertex (const G4MCTSimVertex &right)
 
G4MCTSimVertexoperator= (const G4MCTSimVertex &right)
 
void SetID (G4int i)
 
G4int GetID () const
 
void SetPosition (const G4ThreeVector &x)
 
const G4ThreeVectorGetPosition () const
 
void SetTime (G4double t)
 
G4double GetTime () const
 
void SetVolumeName (const G4String &vname)
 
const G4StringGetVolumeName () const
 
void SetVolumeNumber (G4int n)
 
G4int GetVolumeNumber () const
 
void SetCreatorProcessName (const G4String &pname)
 
const G4StringGetCreatorProcessName () const
 
void SetStoreFlag (G4bool q)
 
G4bool GetStoreFlag () const
 
void SetInParticle (const G4MCTSimParticle *in)
 
void SetInParticle (G4int in)
 
G4int GetInParticleTrackID () const
 
G4int GetNofOutParticles () const
 
G4int AddOutParticle (const G4MCTSimParticle *out)
 
G4int AddOutParticle (G4int out)
 
G4int GetOutParticleTrackID (G4int i) const
 
void Print (std::ostream &ostr=std::cout) const
 

Detailed Description

Definition at line 40 of file G4MCTSimVertex.hh.

Constructor & Destructor Documentation

◆ G4MCTSimVertex() [1/4]

G4MCTSimVertex::G4MCTSimVertex ( )

Definition at line 42 of file G4MCTSimVertex.cc.

43{
44}

Referenced by G4MCTSimVertex(), and operator=().

◆ G4MCTSimVertex() [2/4]

G4MCTSimVertex::G4MCTSimVertex ( const G4ThreeVector & x,
G4double t )

Definition at line 47 of file G4MCTSimVertex.cc.

48 : position(x)
49 , time(t)
50{
51}

◆ G4MCTSimVertex() [3/4]

G4MCTSimVertex::G4MCTSimVertex ( const G4ThreeVector & x,
G4double t,
const G4String & vname,
G4int ncopy,
const G4String & pname )

Definition at line 54 of file G4MCTSimVertex.cc.

57 : volumeName(vname)
58 , creatorProcessName(pname)
59 , position(x)
60 , time(t)
61 , volumeNumber(ncopy)
62{
63}

◆ ~G4MCTSimVertex()

G4MCTSimVertex::~G4MCTSimVertex ( )

Definition at line 66 of file G4MCTSimVertex.cc.

67{
68 outParticleTrackIDList.clear();
69}

◆ G4MCTSimVertex() [4/4]

G4MCTSimVertex::G4MCTSimVertex ( const G4MCTSimVertex & right)
inline

Definition at line 105 of file G4MCTSimVertex.hh.

106{
107 *this = right;
108}

Member Function Documentation

◆ AddOutParticle() [1/2]

G4int G4MCTSimVertex::AddOutParticle ( const G4MCTSimParticle * out)
inline

Definition at line 216 of file G4MCTSimVertex.hh.

217{
218 outParticleTrackIDList.push_back(out->GetTrackID());
219 return (G4int)outParticleTrackIDList.size();
220}
int G4int
Definition G4Types.hh:85
G4int GetTrackID() const

◆ AddOutParticle() [2/2]

G4int G4MCTSimVertex::AddOutParticle ( G4int out)
inline

Definition at line 222 of file G4MCTSimVertex.hh.

223{
224 outParticleTrackIDList.push_back(out);
225 return (G4int)outParticleTrackIDList.size();
226}

◆ GetCreatorProcessName()

const G4String & G4MCTSimVertex::GetCreatorProcessName ( ) const
inline

Definition at line 181 of file G4MCTSimVertex.hh.

182{
183 return creatorProcessName;
184}

◆ GetID()

G4int G4MCTSimVertex::GetID ( ) const
inline

Definition at line 131 of file G4MCTSimVertex.hh.

132{
133 return id;
134}

Referenced by G4MCTSimEvent::BuildVertexContainer().

◆ GetInParticleTrackID()

G4int G4MCTSimVertex::GetInParticleTrackID ( ) const
inline

Definition at line 206 of file G4MCTSimVertex.hh.

207{
208 return inParticleTrackID;
209}

◆ GetNofOutParticles()

G4int G4MCTSimVertex::GetNofOutParticles ( ) const
inline

Definition at line 211 of file G4MCTSimVertex.hh.

212{
213 return (G4int)outParticleTrackIDList.size();
214}

◆ GetOutParticleTrackID()

G4int G4MCTSimVertex::GetOutParticleTrackID ( G4int i) const
inline

Definition at line 228 of file G4MCTSimVertex.hh.

229{
230 G4int size = (G4int)outParticleTrackIDList.size();
231 if(i >= 0 && i < size)
232 return outParticleTrackIDList[i];
233 else
234 return 0;
235}

◆ GetPosition()

const G4ThreeVector & G4MCTSimVertex::GetPosition ( ) const
inline

Definition at line 141 of file G4MCTSimVertex.hh.

142{
143 return position;
144}

◆ GetStoreFlag()

G4bool G4MCTSimVertex::GetStoreFlag ( ) const
inline

Definition at line 191 of file G4MCTSimVertex.hh.

192{
193 return storeFlag;
194}

◆ GetTime()

G4double G4MCTSimVertex::GetTime ( ) const
inline

Definition at line 151 of file G4MCTSimVertex.hh.

152{
153 return time;
154}

◆ GetVolumeName()

const G4String & G4MCTSimVertex::GetVolumeName ( ) const
inline

Definition at line 161 of file G4MCTSimVertex.hh.

162{
163 return volumeName;
164}

◆ GetVolumeNumber()

G4int G4MCTSimVertex::GetVolumeNumber ( ) const
inline

Definition at line 171 of file G4MCTSimVertex.hh.

172{
173 return volumeNumber;
174}

◆ operator=()

G4MCTSimVertex & G4MCTSimVertex::operator= ( const G4MCTSimVertex & right)
inline

Definition at line 110 of file G4MCTSimVertex.hh.

112{
113 inParticleTrackID = right.inParticleTrackID;
114 outParticleTrackIDList = right.outParticleTrackIDList;
115
116 id = right.id;
117 position = right.position;
118 time = right.time;
119 volumeName = right.volumeName;
120 volumeNumber = right.volumeNumber;
121 creatorProcessName = right.creatorProcessName;
122
123 return *this;
124}

◆ Print()

void G4MCTSimVertex::Print ( std::ostream & ostr = std::cout) const

Definition at line 72 of file G4MCTSimVertex.cc.

73{
74 std::ostringstream os;
75 char cq = ' ';
76 if(storeFlag)
77 cq = '+';
78 os << cq << id << '\0';
79 std::string sid(os.str());
80
81 ostr.unsetf(std::ios::fixed);
82 ostr.setf(std::ios::scientific | std::ios::right | std::ios::showpoint);
83 // ostr << std::setw(4) << id;
84 ostr << std::setw(6) << sid;
85 ostr << " : X(" << std::setw(9) << std::setprecision(2) << position.x() / mm
86 << "," << std::setw(9) << std::setprecision(2) << position.y() / mm
87 << "," << std::setw(9) << std::setprecision(2) << position.z() / mm
88 << "," << std::setw(9) << std::setprecision(2) << time / ns << ")";
89 ostr.unsetf(std::ios::scientific);
90 ostr << "@" << volumeName << "-" << volumeNumber << "%" << creatorProcessName
91 << G4endl;
92
93 ostr << " " << std::setw(4) << inParticleTrackID << "-> ";
94 std::size_t np = outParticleTrackIDList.size();
95 for(std::size_t i = 0; i < np; ++i)
96 ostr << outParticleTrackIDList[i] << ", ";
97 ostr << G4endl;
98}
#define G4endl
Definition G4ios.hh:67
#define ns(x)
Definition xmltok.c:1649

◆ SetCreatorProcessName()

void G4MCTSimVertex::SetCreatorProcessName ( const G4String & pname)
inline

Definition at line 176 of file G4MCTSimVertex.hh.

177{
178 creatorProcessName = pname;
179}

◆ SetID()

void G4MCTSimVertex::SetID ( G4int i)
inline

Definition at line 126 of file G4MCTSimVertex.hh.

127{
128 id = i;
129}

Referenced by G4MCTSimEvent::BuildVertexContainer().

◆ SetInParticle() [1/2]

void G4MCTSimVertex::SetInParticle ( const G4MCTSimParticle * in)
inline

Definition at line 196 of file G4MCTSimVertex.hh.

197{
198 inParticleTrackID = in->GetTrackID();
199}

◆ SetInParticle() [2/2]

void G4MCTSimVertex::SetInParticle ( G4int in)
inline

Definition at line 201 of file G4MCTSimVertex.hh.

202{
203 inParticleTrackID = in;
204}

◆ SetPosition()

void G4MCTSimVertex::SetPosition ( const G4ThreeVector & x)
inline

Definition at line 136 of file G4MCTSimVertex.hh.

137{
138 position = x;
139}

◆ SetStoreFlag()

void G4MCTSimVertex::SetStoreFlag ( G4bool q)
inline

Definition at line 186 of file G4MCTSimVertex.hh.

187{
188 storeFlag = q;
189}

◆ SetTime()

void G4MCTSimVertex::SetTime ( G4double t)
inline

Definition at line 146 of file G4MCTSimVertex.hh.

147{
148 time = t;
149}

◆ SetVolumeName()

void G4MCTSimVertex::SetVolumeName ( const G4String & vname)
inline

Definition at line 156 of file G4MCTSimVertex.hh.

157{
158 volumeName = vname;
159}

◆ SetVolumeNumber()

void G4MCTSimVertex::SetVolumeNumber ( G4int n)
inline

Definition at line 166 of file G4MCTSimVertex.hh.

167{
168 volumeNumber = n;
169}

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