Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4MCTSimVertex.hh
이 파일의 문서화 페이지로 가기
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.hh
27 //
28 // ====================================================================
29 #ifndef MCT_SIM_VERTEX_H
30 #define MCT_SIM_VERTEX_H
31 
32 #include "G4Types.hh"
33 #include <iostream>
34 #include <vector>
35 #include <string>
36 #include "G4ThreeVector.hh"
37 #include "G4MCTSimParticle.hh"
38 
39 // ====================================================================
40 //
41 // class definition
42 //
43 // ====================================================================
44 
46 private:
48  std::vector<int> outParticleTrackIDList;
49 
50  int id; // assigned independently from G4
52  double time;
53  std::string volumeName;
55  std::string creatorProcessName;
57 
58 public:
60  G4MCTSimVertex(const G4ThreeVector& x, double t);
61  G4MCTSimVertex(const G4ThreeVector& x, double t,
62  std::string vname, int ncopy, std::string pname);
64 
65  // copy constructor and assignment operator
68 
69  // set/get functions
70  void SetID(int i);
71  int GetID() const;
72 
73  void SetPosition(const G4ThreeVector& x);
74  const G4ThreeVector& GetPosition() const;
75 
76  void SetTime(double t);
77  double GetTime() const;
78 
79  void SetVolumeName(std::string vname);
80  const std::string& GetVolumeName() const;
81 
82  void SetVolumeNumber(int n);
83  int GetVolumeNumber() const;
84 
85  void SetCreatorProcessName(std::string pname);
86  const std::string& GetCreatorProcessName() const;
87 
88  void SetStoreFlag(G4bool q);
89  G4bool GetStoreFlag() const;
90 
91  // methods...
92  void SetInParticle(const G4MCTSimParticle* in);
93  void SetInParticle(int in);
94  int GetInParticleTrackID() const;
95 
96  int GetNofOutParticles() const;
97  int AddOutParticle(const G4MCTSimParticle* out);
98  int AddOutParticle(int out);
99  int GetOutParticleTrackID(int i) const;
100 
101  void Print(std::ostream& ostr= std::cout) const;
102 };
103 
104 // ====================================================================
105 // inline functions
106 // ====================================================================
108 {
109  *this= right;
110 }
111 
112 inline const G4MCTSimVertex&
114 {
117 
118  id= right.id;
119  position= right.position;
120  time= right.time;
121  volumeName= right.volumeName;
122  volumeNumber= right.volumeNumber;
124 
125  return *this;
126 }
127 
128 inline void G4MCTSimVertex::SetID(int i) { id= i; }
129 inline int G4MCTSimVertex::GetID() const { return id; }
130 
132 { position= x; }
133 
135 { return position; }
136 
137 inline void G4MCTSimVertex::SetTime(double t)
138 { time= t; }
139 
140 inline double G4MCTSimVertex::GetTime() const
141 { return time; }
142 
143 inline void G4MCTSimVertex::SetVolumeName(std::string vname)
144 { volumeName= vname; }
145 
146 inline const std::string& G4MCTSimVertex::GetVolumeName() const
147 { return volumeName; }
148 
150 { volumeNumber= n; }
151 
153 { return volumeNumber; }
154 
155 inline void G4MCTSimVertex::SetCreatorProcessName(std::string pname)
156 { creatorProcessName= pname; }
157 
158 inline const std::string& G4MCTSimVertex::GetCreatorProcessName() const
159 { return creatorProcessName; }
160 
162 
164 
166 { inParticleTrackID= in-> GetTrackID(); }
167 
169 { inParticleTrackID= in; }
170 
172 { return inParticleTrackID; }
173 
175 { return outParticleTrackIDList.size(); }
176 
178 {
179  outParticleTrackIDList.push_back(out->GetTrackID());
180  return outParticleTrackIDList.size();
181 }
182 
184 {
185  outParticleTrackIDList.push_back(out);
186  return outParticleTrackIDList.size();
187 }
188 
190 {
191  int size= outParticleTrackIDList.size();
192  if(i>=0 && i< size) return outParticleTrackIDList[i];
193  else return 0;
194 }
195 
196 #endif
Float_t x
Definition: compare.C:6
const std::string & GetVolumeName() const
const std::string & GetCreatorProcessName() const
void SetTime(double t)
int AddOutParticle(const G4MCTSimParticle *out)
void SetInParticle(const G4MCTSimParticle *in)
std::string volumeName
G4ThreeVector position
int GetVolumeNumber() const
void SetCreatorProcessName(std::string pname)
const G4MCTSimVertex & operator=(const G4MCTSimVertex &right)
double GetTime() const
bool G4bool
Definition: G4Types.hh:79
void SetVolumeNumber(int n)
int GetTrackID() const
void SetStoreFlag(G4bool q)
void Print(std::ostream &ostr=std::cout) const
int GetInParticleTrackID() const
std::vector< int > outParticleTrackIDList
int GetOutParticleTrackID(int i) const
std::string creatorProcessName
int GetNofOutParticles() const
void SetID(int i)
G4bool GetStoreFlag() const
void SetVolumeName(std::string vname)
ifstream in
Definition: comparison.C:7
void SetPosition(const G4ThreeVector &x)
Char_t n[5]
int GetID() const
const G4ThreeVector & GetPosition() const