Geant4  10.02.p03
G4PrimaryParticle Class Reference

#include <G4PrimaryParticle.hh>

Collaboration diagram for G4PrimaryParticle:

Public Member Functions

void * operator new (size_t)
 
void operator delete (void *aStackedTrack)
 
 G4PrimaryParticle ()
 
 G4PrimaryParticle (G4int Pcode)
 
 G4PrimaryParticle (G4int Pcode, G4double px, G4double py, G4double pz)
 
 G4PrimaryParticle (G4int Pcode, G4double px, G4double py, G4double pz, G4double E)
 
 G4PrimaryParticle (const G4ParticleDefinition *Gcode)
 
 G4PrimaryParticle (const G4ParticleDefinition *Gcode, G4double px, G4double py, G4double pz)
 
 G4PrimaryParticle (const G4ParticleDefinition *Gcode, G4double px, G4double py, G4double pz, G4double E)
 
virtual ~G4PrimaryParticle ()
 
 G4PrimaryParticle (const G4PrimaryParticle &right)
 
G4PrimaryParticleoperator= (const G4PrimaryParticle &right)
 
G4int operator== (const G4PrimaryParticle &right) const
 
G4int operator!= (const G4PrimaryParticle &right) const
 
void Print () const
 
G4int GetPDGcode () const
 
void SetPDGcode (G4int Pcode)
 
G4ParticleDefinitionGetG4code () const
 
void SetG4code (const G4ParticleDefinition *Gcode)
 
const G4ParticleDefinitionGetParticleDefinition () const
 
void SetParticleDefinition (const G4ParticleDefinition *pdef)
 
G4double GetMass () const
 
void SetMass (G4double mas)
 
G4double GetCharge () const
 
void SetCharge (G4double chg)
 
G4double GetKineticEnergy () const
 
void SetKineticEnergy (G4double eKin)
 
const G4ThreeVectorGetMomentumDirection () const
 
void SetMomentumDirection (const G4ThreeVector &p)
 
G4double GetTotalMomentum () const
 
void Set4Momentum (G4double px, G4double py, G4double pz, G4double E)
 
G4double GetTotalEnergy () const
 
void SetTotalEnergy (G4double eTot)
 
G4ThreeVector GetMomentum () const
 
void SetMomentum (G4double px, G4double py, G4double pz)
 
G4double GetPx () const
 
G4double GetPy () const
 
G4double GetPz () const
 
G4PrimaryParticleGetNext () const
 
void SetNext (G4PrimaryParticle *np)
 
void ClearNext ()
 
G4PrimaryParticleGetDaughter () const
 
void SetDaughter (G4PrimaryParticle *np)
 
G4int GetTrackID () const
 
void SetTrackID (G4int id)
 
G4ThreeVector GetPolarization () const
 
void SetPolarization (const G4ThreeVector &pol)
 
void SetPolarization (G4double px, G4double py, G4double pz)
 
G4double GetPolX () const
 
G4double GetPolY () const
 
G4double GetPolZ () const
 
G4double GetWeight () const
 
void SetWeight (G4double w)
 
G4double GetProperTime () const
 
void SetProperTime (G4double t)
 
G4VUserPrimaryParticleInformationGetUserInformation () const
 
void SetUserInformation (G4VUserPrimaryParticleInformation *anInfo)
 

Private Attributes

G4int PDGcode
 
const G4ParticleDefinitionG4code
 
G4ThreeVector direction
 
G4double kinE
 
G4PrimaryParticlenextParticle
 
G4PrimaryParticledaughterParticle
 
G4int trackID
 
G4double mass
 
G4double charge
 
G4double polX
 
G4double polY
 
G4double polZ
 
G4double Weight0
 
G4double properTime
 
G4VUserPrimaryParticleInformationuserInfo
 

Detailed Description

Definition at line 68 of file G4PrimaryParticle.hh.

Constructor & Destructor Documentation

◆ G4PrimaryParticle() [1/8]

G4PrimaryParticle::G4PrimaryParticle ( )

Definition at line 39 of file G4PrimaryParticle.cc.

40 :PDGcode(0),G4code(0),
41  direction(0.,0.,1.),kinE(0.),
43  mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.),
44  Weight0(1.0),properTime(0.0),userInfo(0)
45 {;}
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
G4ThreeVector direction
G4VUserPrimaryParticleInformation * userInfo
Here is the caller graph for this function:

◆ G4PrimaryParticle() [2/8]

G4PrimaryParticle::G4PrimaryParticle ( G4int  Pcode)

Definition at line 47 of file G4PrimaryParticle.cc.

48 :PDGcode(Pcode),
49  direction(0.,0.,1.),kinE(0.),
51  mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.),
52  Weight0(1.0),properTime(0.0),userInfo(0)
53 {
55  if (G4code !=0) {
56  mass = G4code->GetPDGMass();
58  }
59 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
static G4ParticleTable * GetParticleTable()
G4ThreeVector direction
G4VUserPrimaryParticleInformation * userInfo
G4double GetPDGCharge() const
Here is the call graph for this function:

◆ G4PrimaryParticle() [3/8]

G4PrimaryParticle::G4PrimaryParticle ( G4int  Pcode,
G4double  px,
G4double  py,
G4double  pz 
)

Definition at line 61 of file G4PrimaryParticle.cc.

63 :PDGcode(Pcode),
64  direction(0.,0.,1.),kinE(0.),
66  mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.),
67  Weight0(1.0),properTime(0.0),userInfo(0)
68 {
70  if (G4code !=0) {
71  mass = G4code->GetPDGMass();
73  }
74  SetMomentum( px, py, pz);
75 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
static G4ParticleTable * GetParticleTable()
G4ThreeVector direction
G4VUserPrimaryParticleInformation * userInfo
void SetMomentum(G4double px, G4double py, G4double pz)
G4double GetPDGCharge() const
Here is the call graph for this function:

◆ G4PrimaryParticle() [4/8]

G4PrimaryParticle::G4PrimaryParticle ( G4int  Pcode,
G4double  px,
G4double  py,
G4double  pz,
G4double  E 
)

Definition at line 77 of file G4PrimaryParticle.cc.

79 :PDGcode(Pcode),
80  direction(0.,0.,1.),kinE(0.),
82  mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.),
83  Weight0(1.0),properTime(0.0),userInfo(0)
84 {
86  if (G4code !=0) {
87  mass = G4code->GetPDGMass();
89  }
90  Set4Momentum( px, py, pz, E);
91 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
static G4ParticleTable * GetParticleTable()
G4ThreeVector direction
G4VUserPrimaryParticleInformation * userInfo
void Set4Momentum(G4double px, G4double py, G4double pz, G4double E)
G4double GetPDGCharge() const
Here is the call graph for this function:

◆ G4PrimaryParticle() [5/8]

G4PrimaryParticle::G4PrimaryParticle ( const G4ParticleDefinition Gcode)

Definition at line 93 of file G4PrimaryParticle.cc.

94 :PDGcode(0),G4code(Gcode),
95  direction(0.,0.,1.),kinE(0.),
97  mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.),
98  Weight0(1.0),properTime(0.0),userInfo(0)
99 {
100  if (G4code !=0) {
101  PDGcode = Gcode->GetPDGEncoding();
102  mass = G4code->GetPDGMass();
104  }
105 }
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
G4ThreeVector direction
G4VUserPrimaryParticleInformation * userInfo
G4double GetPDGCharge() const
Here is the call graph for this function:

◆ G4PrimaryParticle() [6/8]

G4PrimaryParticle::G4PrimaryParticle ( const G4ParticleDefinition Gcode,
G4double  px,
G4double  py,
G4double  pz 
)

Definition at line 107 of file G4PrimaryParticle.cc.

109 :PDGcode(0),G4code(Gcode),
110  direction(0.,0.,1.),kinE(0.),
112  mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.),
113  Weight0(1.0),properTime(0.0),userInfo(0)
114 {
115  if (G4code !=0) {
116  PDGcode = Gcode->GetPDGEncoding();
117  mass = G4code->GetPDGMass();
119  }
120  SetMomentum( px, py, pz);
121 }
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
G4ThreeVector direction
G4VUserPrimaryParticleInformation * userInfo
void SetMomentum(G4double px, G4double py, G4double pz)
G4double GetPDGCharge() const
Here is the call graph for this function:

◆ G4PrimaryParticle() [7/8]

G4PrimaryParticle::G4PrimaryParticle ( const G4ParticleDefinition Gcode,
G4double  px,
G4double  py,
G4double  pz,
G4double  E 
)

Definition at line 123 of file G4PrimaryParticle.cc.

125 :PDGcode(0),G4code(Gcode),
126  direction(0.,0.,1.),kinE(0.),
128  mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.),
129  Weight0(1.0),properTime(0.0),userInfo(0)
130 {
131  if (G4code !=0) {
132  PDGcode = Gcode->GetPDGEncoding();
133  mass = G4code->GetPDGMass();
135  }
136  Set4Momentum( px, py, pz, E);
137 }
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
G4ThreeVector direction
G4VUserPrimaryParticleInformation * userInfo
void Set4Momentum(G4double px, G4double py, G4double pz, G4double E)
G4double GetPDGCharge() const
Here is the call graph for this function:

◆ ~G4PrimaryParticle()

G4PrimaryParticle::~G4PrimaryParticle ( )
virtual

Definition at line 190 of file G4PrimaryParticle.cc.

191 {
192  if(nextParticle != 0){
193  delete nextParticle;
194  nextParticle = 0;
195  }
196  if(daughterParticle != 0){
197  delete daughterParticle;
198  daughterParticle =0;
199  }
200  if(userInfo!=0) {
201  delete userInfo;
202  userInfo=0;
203  }
204 }
G4PrimaryParticle * daughterParticle
G4PrimaryParticle * nextParticle
G4VUserPrimaryParticleInformation * userInfo

◆ G4PrimaryParticle() [8/8]

G4PrimaryParticle::G4PrimaryParticle ( const G4PrimaryParticle right)

Definition at line 139 of file G4PrimaryParticle.cc.

140 :PDGcode(0),G4code(0),
141  direction(0.,0.,1.),kinE(0.),
143  mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.),
144  Weight0(1.0),properTime(0.0),userInfo(0)
145 {
146  *this = right;
147 }
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
G4ThreeVector direction
G4VUserPrimaryParticleInformation * userInfo

Member Function Documentation

◆ ClearNext()

void G4PrimaryParticle::ClearNext ( )
inline

Definition at line 305 of file G4PrimaryParticle.hh.

306 {
307  nextParticle = nullptr;
308 }
G4PrimaryParticle * nextParticle
Here is the caller graph for this function:

◆ GetCharge()

G4double G4PrimaryParticle::GetCharge ( ) const
inline

Definition at line 201 of file G4PrimaryParticle.hh.

202 { return charge; }
Here is the caller graph for this function:

◆ GetDaughter()

G4PrimaryParticle * G4PrimaryParticle::GetDaughter ( ) const
inline

Definition at line 258 of file G4PrimaryParticle.hh.

259 { return daughterParticle; }
G4PrimaryParticle * daughterParticle
Here is the caller graph for this function:

◆ GetG4code()

G4ParticleDefinition * G4PrimaryParticle::GetG4code ( ) const
inline

Definition at line 207 of file G4PrimaryParticle.hh.

208 { return const_cast<G4ParticleDefinition*>(G4code); }
const G4ParticleDefinition * G4code
Here is the caller graph for this function:

◆ GetKineticEnergy()

G4double G4PrimaryParticle::GetKineticEnergy ( ) const
inline

Definition at line 249 of file G4PrimaryParticle.hh.

250 { return kinE; }
Here is the caller graph for this function:

◆ GetMass()

G4double G4PrimaryParticle::GetMass ( ) const
inline

Definition at line 198 of file G4PrimaryParticle.hh.

199 { return mass; }
Here is the caller graph for this function:

◆ GetMomentum()

G4ThreeVector G4PrimaryParticle::GetMomentum ( ) const
inline

Definition at line 219 of file G4PrimaryParticle.hh.

220 { return GetTotalMomentum()*direction;}
G4ThreeVector direction
G4double GetTotalMomentum() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMomentumDirection()

const G4ThreeVector & G4PrimaryParticle::GetMomentumDirection ( ) const
inline

Definition at line 222 of file G4PrimaryParticle.hh.

223 { return direction;}
G4ThreeVector direction
Here is the caller graph for this function:

◆ GetNext()

G4PrimaryParticle * G4PrimaryParticle::GetNext ( ) const
inline

Definition at line 255 of file G4PrimaryParticle.hh.

256 { return nextParticle; }
G4PrimaryParticle * nextParticle
Here is the caller graph for this function:

◆ GetParticleDefinition()

const G4ParticleDefinition * G4PrimaryParticle::GetParticleDefinition ( ) const
inline

Definition at line 210 of file G4PrimaryParticle.hh.

211 { return G4code; }
const G4ParticleDefinition * G4code

◆ GetPDGcode()

G4int G4PrimaryParticle::GetPDGcode ( ) const
inline

Definition at line 204 of file G4PrimaryParticle.hh.

205 { return PDGcode; }
Here is the caller graph for this function:

◆ GetPolarization()

G4ThreeVector G4PrimaryParticle::GetPolarization ( ) const
inline

Definition at line 264 of file G4PrimaryParticle.hh.

265 { return G4ThreeVector(polX,polY,polZ); }
CLHEP::Hep3Vector G4ThreeVector
Here is the caller graph for this function:

◆ GetPolX()

G4double G4PrimaryParticle::GetPolX ( ) const
inline

Definition at line 267 of file G4PrimaryParticle.hh.

268 { return polX; }
Here is the caller graph for this function:

◆ GetPolY()

G4double G4PrimaryParticle::GetPolY ( ) const
inline

Definition at line 270 of file G4PrimaryParticle.hh.

271 { return polY; }
Here is the caller graph for this function:

◆ GetPolZ()

G4double G4PrimaryParticle::GetPolZ ( ) const
inline

Definition at line 273 of file G4PrimaryParticle.hh.

274 { return polZ; }
Here is the caller graph for this function:

◆ GetProperTime()

G4double G4PrimaryParticle::GetProperTime ( ) const
inline

Definition at line 285 of file G4PrimaryParticle.hh.

286 { return properTime; }
Here is the caller graph for this function:

◆ GetPx()

G4double G4PrimaryParticle::GetPx ( ) const
inline

Definition at line 228 of file G4PrimaryParticle.hh.

229 { return GetTotalMomentum()*direction.x();}
double x() const
G4ThreeVector direction
G4double GetTotalMomentum() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPy()

G4double G4PrimaryParticle::GetPy ( ) const
inline

Definition at line 231 of file G4PrimaryParticle.hh.

232 { return GetTotalMomentum()*direction.y();}
double y() const
G4ThreeVector direction
G4double GetTotalMomentum() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPz()

G4double G4PrimaryParticle::GetPz ( ) const
inline

Definition at line 234 of file G4PrimaryParticle.hh.

235 { return GetTotalMomentum()*direction.z();}
G4ThreeVector direction
double z() const
G4double GetTotalMomentum() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTotalEnergy()

G4double G4PrimaryParticle::GetTotalEnergy ( ) const
inline

Definition at line 237 of file G4PrimaryParticle.hh.

238 {
239  if (mass<0.) return kinE;
240  else return kinE+mass;
241 }

◆ GetTotalMomentum()

G4double G4PrimaryParticle::GetTotalMomentum ( ) const
inline

Definition at line 213 of file G4PrimaryParticle.hh.

214 {
215  if (mass<0.) return kinE;
216  else return std::sqrt(kinE*(kinE+2.*mass));
217 }
Here is the caller graph for this function:

◆ GetTrackID()

G4int G4PrimaryParticle::GetTrackID ( ) const
inline

Definition at line 261 of file G4PrimaryParticle.hh.

262 { return trackID; }
Here is the caller graph for this function:

◆ GetUserInformation()

G4VUserPrimaryParticleInformation * G4PrimaryParticle::GetUserInformation ( ) const
inline

Definition at line 291 of file G4PrimaryParticle.hh.

292 { return userInfo; }
G4VUserPrimaryParticleInformation * userInfo

◆ GetWeight()

G4double G4PrimaryParticle::GetWeight ( ) const
inline

Definition at line 276 of file G4PrimaryParticle.hh.

277 { return Weight0; }
Here is the caller graph for this function:

◆ operator delete()

void G4PrimaryParticle::operator delete ( void *  aStackedTrack)
inline

Definition at line 193 of file G4PrimaryParticle.hh.

194 {
195  aPrimaryParticleAllocator->FreeSingle((G4PrimaryParticle *) aPrimaryParticle);
196 }
G4PART_DLL G4ThreadLocal G4Allocator< G4PrimaryParticle > * aPrimaryParticleAllocator

◆ operator new()

void * G4PrimaryParticle::operator new ( size_t  )
inline

Definition at line 184 of file G4PrimaryParticle.hh.

185 {
187  {
189  }
190  return (void *) aPrimaryParticleAllocator->MallocSingle();
191 }
G4PART_DLL G4ThreadLocal G4Allocator< G4PrimaryParticle > * aPrimaryParticleAllocator

◆ operator!=()

G4int G4PrimaryParticle::operator!= ( const G4PrimaryParticle right) const

Definition at line 187 of file G4PrimaryParticle.cc.

188 { return (this!=&right); }

◆ operator=()

G4PrimaryParticle & G4PrimaryParticle::operator= ( const G4PrimaryParticle right)

Definition at line 149 of file G4PrimaryParticle.cc.

150 {
151  if (this != &right) {
152  PDGcode = right.PDGcode;
153  G4code = right.G4code;
154  direction = right.direction;
155  kinE = right.kinE;
156  if (nextParticle !=0) delete nextParticle;
157  if ( right.nextParticle ==0 ){
158  nextParticle = 0;
159  } else {
161  }
162  if (daughterParticle !=0) delete daughterParticle;
163  if ( right.daughterParticle ==0 ){
164  daughterParticle = 0;
165  } else {
167  }
168  trackID = right.trackID;
169  mass = right.mass;
170  charge = right.charge;
171  polX = right.polX;
172  polY = right.polY;
173  polZ = right.polZ;
174  Weight0 = right.Weight0;
175  properTime = right.properTime;
176 
177  // userInfo can not be copied
178  userInfo = 0;
179  }
180 
181  return *this;
182 }
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
G4ThreeVector direction
G4VUserPrimaryParticleInformation * userInfo
Here is the call graph for this function:

◆ operator==()

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

Definition at line 184 of file G4PrimaryParticle.cc.

185 { return (this==&right); }

◆ Print()

void G4PrimaryParticle::Print ( void  ) const

Definition at line 260 of file G4PrimaryParticle.cc.

261 {
262  G4cout << "==== PDGcode " << PDGcode << " Particle name ";
263  if(G4code != 0)
264  { G4cout << G4code->GetParticleName() << G4endl; }
265  else
266  { G4cout << " is not defined in G4." << G4endl; }
267  G4cout << " Assigned charge : " << charge/eplus << G4endl;
268  G4cout << " Momentum ( "
269  << GetTotalMomentum()*direction.x()/GeV << "[GeV/c], "
270  << GetTotalMomentum()*direction.y()/GeV << "[GeV/c], "
271  << GetTotalMomentum()*direction.z()/GeV << "[GeV/c] )" << G4endl;
272  G4cout << " kinetic Energy : " << kinE/GeV << " [GeV]" << G4endl;
273  if(mass>=0.){
274  G4cout << " Mass : " << mass/GeV << " [GeV]" << G4endl;
275  } else {
276  G4cout << " Mass is not assigned " << G4endl;
277  }
278  G4cout << " Polarization ( "
279  << polX << ", "
280  << polY << ", "
281  << polZ << " )"
282  << G4endl;
283  G4cout << " Weight : " << Weight0 << G4endl;
284  if(properTime>0.0) {
285  G4cout << " PreAssigned proper decay time : " << properTime/ns << " [ns] " << G4endl;
286  }
287  if(userInfo != 0) { userInfo->Print(); }
288  if(daughterParticle != 0) {
289  G4cout << ">>>> Daughters" << G4endl;
291  }
292  if(nextParticle != 0) {
293  nextParticle->Print();
294  } else {
295  G4cout << "<<<< End of link" << G4endl;
296  }
297 }
G4PrimaryParticle * daughterParticle
const G4ParticleDefinition * G4code
G4PrimaryParticle * nextParticle
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
virtual void Print() const =0
static const double GeV
Definition: G4SIunits.hh:214
double x() const
double y() const
G4ThreeVector direction
double z() const
G4VUserPrimaryParticleInformation * userInfo
#define G4endl
Definition: G4ios.hh:61
static const double eplus
Definition: G4SIunits.hh:196
#define ns
Definition: xmlparse.cc:614
G4double GetTotalMomentum() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Set4Momentum()

void G4PrimaryParticle::Set4Momentum ( G4double  px,
G4double  py,
G4double  pz,
G4double  E 
)

Definition at line 220 of file G4PrimaryParticle.cc.

221 {
222  G4double pmom = std::sqrt(px*px+py*py+pz*pz);
223  if (pmom>0.0) {
224  direction.setX(px/pmom);
225  direction.setY(py/pmom);
226  direction.setZ(pz/pmom);
227  }
228  G4double mas2 = E*E - pmom*pmom;
229  if(mas2>=0.){
230  mass = std::sqrt(mas2);
231  } else {
232  if (G4code!=0){
233  mass = G4code->GetPDGMass();
234  }
235  E = std::sqrt(pmom*pmom+mass*mass);
236  }
237  kinE = E - mass;
238 }
const G4ParticleDefinition * G4code
void setY(double)
void setZ(double)
void setX(double)
G4ThreeVector direction
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCharge()

void G4PrimaryParticle::SetCharge ( G4double  chg)
inline

Definition at line 322 of file G4PrimaryParticle.hh.

323 { charge = chg; }
Here is the caller graph for this function:

◆ SetDaughter()

void G4PrimaryParticle::SetDaughter ( G4PrimaryParticle np)
inline

Definition at line 310 of file G4PrimaryParticle.hh.

311 {
312  if(daughterParticle == 0) { daughterParticle = np; }
313  else { daughterParticle->SetNext(np); }
314 }
void SetNext(G4PrimaryParticle *np)
G4PrimaryParticle * daughterParticle
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetG4code()

void G4PrimaryParticle::SetG4code ( const G4ParticleDefinition Gcode)
inline

Definition at line 294 of file G4PrimaryParticle.hh.

295 {
296  SetParticleDefinition(Gcode);
297 }
void SetParticleDefinition(const G4ParticleDefinition *pdef)
Here is the call graph for this function:

◆ SetKineticEnergy()

void G4PrimaryParticle::SetKineticEnergy ( G4double  eKin)
inline

Definition at line 252 of file G4PrimaryParticle.hh.

253 { kinE = eKin; }
Here is the caller graph for this function:

◆ SetMass()

void G4PrimaryParticle::SetMass ( G4double  mas)
inline

Definition at line 319 of file G4PrimaryParticle.hh.

320 { mass = mas; }
Here is the caller graph for this function:

◆ SetMomentum()

void G4PrimaryParticle::SetMomentum ( G4double  px,
G4double  py,
G4double  pz 
)

Definition at line 206 of file G4PrimaryParticle.cc.

207 {
208  if ((mass<0.)&&(G4code!=0)){
209  mass = G4code->GetPDGMass();
210  }
211  G4double pmom = std::sqrt(px*px+py*py+pz*pz);
212  if (pmom>0.0) {
213  direction.setX(px/pmom);
214  direction.setY(py/pmom);
215  direction.setZ(pz/pmom);
216  }
217  kinE = std::sqrt(px*px+py*py+pz*pz+mass*mass)-mass;
218 }
const G4ParticleDefinition * G4code
void setY(double)
void setZ(double)
void setX(double)
G4ThreeVector direction
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetMomentumDirection()

void G4PrimaryParticle::SetMomentumDirection ( const G4ThreeVector p)
inline

Definition at line 225 of file G4PrimaryParticle.hh.

226 { direction = p;}
G4ThreeVector direction
Here is the caller graph for this function:

◆ SetNext()

void G4PrimaryParticle::SetNext ( G4PrimaryParticle np)
inline

Definition at line 299 of file G4PrimaryParticle.hh.

300 {
301  if (nextParticle == 0) { nextParticle = np; }
302  else { nextParticle->SetNext(np); }
303 }
void SetNext(G4PrimaryParticle *np)
G4PrimaryParticle * nextParticle
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetParticleDefinition()

void G4PrimaryParticle::SetParticleDefinition ( const G4ParticleDefinition pdef)

Definition at line 250 of file G4PrimaryParticle.cc.

251 {
252  G4code = Gcode;
253  if (G4code!=0){
254  PDGcode = Gcode->GetPDGEncoding();
255  mass = G4code->GetPDGMass();
257  }
258 }
const G4ParticleDefinition * G4code
G4double GetPDGCharge() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPDGcode()

void G4PrimaryParticle::SetPDGcode ( G4int  Pcode)

Definition at line 240 of file G4PrimaryParticle.cc.

241 {
242  PDGcode = Pcode;
244  if (G4code!=0){
245  mass = G4code->GetPDGMass();
247  }
248 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
const G4ParticleDefinition * G4code
static G4ParticleTable * GetParticleTable()
G4double GetPDGCharge() const
Here is the call graph for this function:

◆ SetPolarization() [1/2]

void G4PrimaryParticle::SetPolarization ( const G4ThreeVector pol)
inline

Definition at line 332 of file G4PrimaryParticle.hh.

333 {
334  polX = pol.x();
335  polY = pol.y();
336  polZ = pol.z();
337 }
double x() const
double y() const
double z() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPolarization() [2/2]

void G4PrimaryParticle::SetPolarization ( G4double  px,
G4double  py,
G4double  pz 
)
inline

Definition at line 325 of file G4PrimaryParticle.hh.

326 {
327  polX = px;
328  polY = py;
329  polZ = pz;
330 }

◆ SetProperTime()

void G4PrimaryParticle::SetProperTime ( G4double  t)
inline

Definition at line 282 of file G4PrimaryParticle.hh.

283 { properTime = t; }

◆ SetTotalEnergy()

void G4PrimaryParticle::SetTotalEnergy ( G4double  eTot)
inline

Definition at line 243 of file G4PrimaryParticle.hh.

244 {
245  if (mass<0.) kinE = eTot;
246  else kinE = eTot - mass;
247 }

◆ SetTrackID()

void G4PrimaryParticle::SetTrackID ( G4int  id)
inline

Definition at line 316 of file G4PrimaryParticle.hh.

317 { trackID = id; }
Here is the caller graph for this function:

◆ SetUserInformation()

void G4PrimaryParticle::SetUserInformation ( G4VUserPrimaryParticleInformation anInfo)
inline

Definition at line 288 of file G4PrimaryParticle.hh.

289 { userInfo = anInfo; }
G4VUserPrimaryParticleInformation * userInfo
Here is the caller graph for this function:

◆ SetWeight()

void G4PrimaryParticle::SetWeight ( G4double  w)
inline

Definition at line 279 of file G4PrimaryParticle.hh.

280 { Weight0 = w; }
Here is the caller graph for this function:

Member Data Documentation

◆ charge

G4double G4PrimaryParticle::charge
private

Definition at line 172 of file G4PrimaryParticle.hh.

◆ daughterParticle

G4PrimaryParticle* G4PrimaryParticle::daughterParticle
private

Definition at line 165 of file G4PrimaryParticle.hh.

◆ direction

G4ThreeVector G4PrimaryParticle::direction
private

Definition at line 161 of file G4PrimaryParticle.hh.

◆ G4code

const G4ParticleDefinition* G4PrimaryParticle::G4code
private

Definition at line 159 of file G4PrimaryParticle.hh.

◆ kinE

G4double G4PrimaryParticle::kinE
private

Definition at line 162 of file G4PrimaryParticle.hh.

◆ mass

G4double G4PrimaryParticle::mass
private

Definition at line 171 of file G4PrimaryParticle.hh.

◆ nextParticle

G4PrimaryParticle* G4PrimaryParticle::nextParticle
private

Definition at line 164 of file G4PrimaryParticle.hh.

◆ PDGcode

G4int G4PrimaryParticle::PDGcode
private

Definition at line 158 of file G4PrimaryParticle.hh.

◆ polX

G4double G4PrimaryParticle::polX
private

Definition at line 173 of file G4PrimaryParticle.hh.

◆ polY

G4double G4PrimaryParticle::polY
private

Definition at line 174 of file G4PrimaryParticle.hh.

◆ polZ

G4double G4PrimaryParticle::polZ
private

Definition at line 175 of file G4PrimaryParticle.hh.

◆ properTime

G4double G4PrimaryParticle::properTime
private

Definition at line 177 of file G4PrimaryParticle.hh.

◆ trackID

G4int G4PrimaryParticle::trackID
private

Definition at line 167 of file G4PrimaryParticle.hh.

◆ userInfo

G4VUserPrimaryParticleInformation* G4PrimaryParticle::userInfo
private

Definition at line 178 of file G4PrimaryParticle.hh.

◆ Weight0

G4double G4PrimaryParticle::Weight0
private

Definition at line 176 of file G4PrimaryParticle.hh.


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