53 : direction(0.,0.,1.), PDGcode(Pcode)
56 if (G4code !=
nullptr)
66 : direction(0.,0.,1.), PDGcode(Pcode)
69 if (G4code !=
nullptr)
81 : direction(0.,0.,1.), PDGcode(Pcode)
84 if (G4code !=
nullptr)
94 : G4code(Gcode), direction(0.,0.,1.)
96 if (G4code !=
nullptr)
107 : G4code(Gcode), direction(0.,0.,1.)
109 if (G4code !=
nullptr)
121 : G4code(Gcode), direction(0.,0.,1.)
123 if (G4code !=
nullptr)
144 PDGcode = right.PDGcode;
145 G4code = right.G4code;
146 direction = right.direction;
148 if (nextParticle !=
nullptr)
delete nextParticle;
149 if ( right.nextParticle ==
nullptr )
151 nextParticle =
nullptr;
157 if (daughterParticle !=
nullptr)
delete daughterParticle;
158 if ( right.daughterParticle ==
nullptr )
160 daughterParticle =
nullptr;
166 trackID = right.trackID;
168 charge = right.charge;
172 Weight0 = right.Weight0;
173 properTime = right.properTime;
185 return (
this==&right);
191 return (
this!=&right);
198 nextParticle =
nullptr;
200 delete daughterParticle;
201 daughterParticle =
nullptr;
210 if ((mass<0.)&&(G4code!=0))
214 G4double pmom = std::sqrt(px*px+py*py+pz*pz);
217 direction.
setX(px/pmom);
218 direction.
setY(py/pmom);
219 direction.
setZ(pz/pmom);
221 kinE = std::sqrt(px*px+py*py+pz*pz+mass*mass)-mass;
228 G4double pmom = std::sqrt(px*px+py*py+pz*pz);
231 direction.
setX(px/pmom);
232 direction.
setY(py/pmom);
233 direction.
setZ(pz/pmom);
238 mass = std::sqrt(mas2);
242 if (G4code !=
nullptr)
246 E = std::sqrt(pmom*pmom+mass*mass);
256 if (G4code !=
nullptr)
268 if (G4code !=
nullptr)
279 G4cout <<
"==== PDGcode " << PDGcode <<
" Particle name ";
280 if(G4code !=
nullptr)
288 G4cout <<
" Assigned charge : " << charge/eplus <<
G4endl;
293 G4cout <<
" kinetic Energy : " << kinE/GeV <<
" [GeV]" <<
G4endl;
302 G4cout <<
" Polarization ( "
310 G4cout <<
" PreAssigned proper decay time : "
311 << properTime/
ns <<
" [ns] " <<
G4endl;
313 if(userInfo != 0) { userInfo->
Print(); }
314 if(daughterParticle !=
nullptr)
317 daughterParticle->
Print();
319 if(nextParticle !=
nullptr)
321 nextParticle->
Print();
G4Allocator< G4PrimaryParticle > *& aPrimaryParticleAllocator()
G4GLOB_DLL std::ostream G4cout
G4double GetPDGMass() const
G4int GetPDGEncoding() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
void SetPDGcode(G4int Pcode)
G4bool operator==(const G4PrimaryParticle &right) const
G4PrimaryParticle & operator=(const G4PrimaryParticle &right)
G4bool operator!=(const G4PrimaryParticle &right) const
void Set4Momentum(G4double px, G4double py, G4double pz, G4double E)
void SetMomentum(G4double px, G4double py, G4double pz)
G4double GetTotalMomentum() const
void SetParticleDefinition(const G4ParticleDefinition *pdef)
virtual ~G4PrimaryParticle()
virtual void Print() const =0
#define G4ThreadLocalStatic