Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MCTSimVertex.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4MCTSimVertex
27
28// Author: Youhei Morita, 12.09.2001
29// --------------------------------------------------------------------
30#ifndef G4MCTSIMVERTEX_HH
31#define G4MCTSIMVERTEX_HH 1
32
33#include <iostream>
34#include <vector>
35#include <string>
36
37#include "G4Types.hh"
38#include "G4ThreeVector.hh"
39#include "G4MCTSimParticle.hh"
40
42{
43 public:
44
48 const G4String& vname, G4int ncopy,
49 const G4String& pname);
51
52 inline G4MCTSimVertex(const G4MCTSimVertex& right);
53 inline G4MCTSimVertex& operator=(const G4MCTSimVertex& right);
54 // copy constructor and assignment operator
55
56 inline void SetID(G4int i);
57 inline G4int GetID() const;
58
59 inline void SetPosition(const G4ThreeVector& x);
60 inline const G4ThreeVector& GetPosition() const;
61
62 inline void SetTime(G4double t);
63 inline G4double GetTime() const;
64
65 inline void SetVolumeName(const G4String& vname);
66 inline const G4String& GetVolumeName() const;
67
68 inline void SetVolumeNumber(G4int n);
69 inline G4int GetVolumeNumber() const;
70
71 inline void SetCreatorProcessName(const G4String& pname);
72 inline const G4String& GetCreatorProcessName() const;
73
74 inline void SetStoreFlag(G4bool q);
75 inline G4bool GetStoreFlag() const;
76
77 inline void SetInParticle(const G4MCTSimParticle* in);
78 inline void SetInParticle(G4int in);
79 inline G4int GetInParticleTrackID() const;
80
81 inline G4int GetNofOutParticles() const;
82 inline G4int AddOutParticle(const G4MCTSimParticle* out);
83 inline G4int AddOutParticle(G4int out);
84 inline G4int GetOutParticleTrackID(G4int i) const;
85
86 void Print(std::ostream& ostr = std::cout) const;
87
88 private:
89
90 G4int inParticleTrackID = 0;
91 std::vector<G4int> outParticleTrackIDList;
92
93 G4String volumeName = "";
94 G4String creatorProcessName = "none";
96 G4double time = 0.0;
97 G4int id = -1; // assigned independently from G4
98 G4int volumeNumber = -1;
99 G4bool storeFlag = false;
100};
101
102// ====================================================================
103// inline methods
104// ====================================================================
105
107{
108 *this = right;
109}
110
112 const G4MCTSimVertex& right)
113{
114 inParticleTrackID = right.inParticleTrackID;
115 outParticleTrackIDList = right.outParticleTrackIDList;
116
117 id = right.id;
118 position = right.position;
119 time = right.time;
120 volumeName = right.volumeName;
121 volumeNumber = right.volumeNumber;
122 creatorProcessName = right.creatorProcessName;
123
124 return *this;
125}
126
128{
129 id = i;
130}
131
133{
134 return id;
135}
136
138{
139 position = x;
140}
141
143{
144 return position;
145}
146
148{
149 time = t;
150}
151
153{
154 return time;
155}
156
158{
159 volumeName = vname;
160}
161
163{
164 return volumeName;
165}
166
168{
169 volumeNumber = n;
170}
171
173{
174 return volumeNumber;
175}
176
178{
179 creatorProcessName = pname;
180}
181
183{
184 return creatorProcessName;
185}
186
188{
189 storeFlag = q;
190}
191
193{
194 return storeFlag;
195}
196
198{
199 inParticleTrackID = in->GetTrackID();
200}
201
203{
204 inParticleTrackID = in;
205}
206
208{
209 return inParticleTrackID;
210}
211
213{
214 return outParticleTrackIDList.size();
215}
216
218{
219 outParticleTrackIDList.push_back(out->GetTrackID());
220 return outParticleTrackIDList.size();
221}
222
224{
225 outParticleTrackIDList.push_back(out);
226 return outParticleTrackIDList.size();
227}
228
230{
231 G4int size = outParticleTrackIDList.size();
232 if(i >= 0 && i < size)
233 return outParticleTrackIDList[i];
234 else
235 return 0;
236}
237
238#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4int GetTrackID() const
void SetVolumeName(const G4String &vname)
void SetStoreFlag(G4bool q)
G4int AddOutParticle(const G4MCTSimParticle *out)
void SetVolumeNumber(G4int n)
G4int GetVolumeNumber() const
const G4ThreeVector & GetPosition() const
void SetID(G4int i)
G4double GetTime() const
void SetCreatorProcessName(const G4String &pname)
void Print(std::ostream &ostr=std::cout) const
const G4String & GetCreatorProcessName() const
G4int GetID() const
const G4String & GetVolumeName() const
void SetTime(G4double t)
G4bool GetStoreFlag() const
void SetInParticle(const G4MCTSimParticle *in)
G4int GetNofOutParticles() const
G4MCTSimVertex & operator=(const G4MCTSimVertex &right)
G4int GetOutParticleTrackID(G4int i) const
void SetPosition(const G4ThreeVector &x)
G4int GetInParticleTrackID() const