#include <G4PrimaryParticle.hh>
Definition at line 66 of file G4PrimaryParticle.hh.
G4PrimaryParticle::G4PrimaryParticle | ( | ) |
Definition at line 39 of file G4PrimaryParticle.cc.
Referenced by operator=().
00040 :PDGcode(0),G4code(0), 00041 direction(0.,0.,1.),kinE(0.), 00042 nextParticle(0),daughterParticle(0),trackID(-1), 00043 mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.), 00044 Weight0(1.0),properTime(0.0),userInfo(0) 00045 {;}
G4PrimaryParticle::G4PrimaryParticle | ( | G4int | Pcode | ) |
Definition at line 47 of file G4PrimaryParticle.cc.
References G4ParticleTable::FindParticle(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetPDGCharge(), and G4ParticleDefinition::GetPDGMass().
00048 :PDGcode(Pcode), 00049 direction(0.,0.,1.),kinE(0.), 00050 nextParticle(0),daughterParticle(0),trackID(-1), 00051 mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.), 00052 Weight0(1.0),properTime(0.0),userInfo(0) 00053 { 00054 G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode); 00055 if (G4code !=0) { 00056 mass = G4code->GetPDGMass(); 00057 charge = G4code->GetPDGCharge(); 00058 } 00059 }
Definition at line 61 of file G4PrimaryParticle.cc.
References G4ParticleTable::FindParticle(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGMass(), and SetMomentum().
00063 :PDGcode(Pcode), 00064 direction(0.,0.,1.),kinE(0.), 00065 nextParticle(0),daughterParticle(0),trackID(-1), 00066 mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.), 00067 Weight0(1.0),properTime(0.0),userInfo(0) 00068 { 00069 G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode); 00070 if (G4code !=0) { 00071 mass = G4code->GetPDGMass(); 00072 charge = G4code->GetPDGCharge(); 00073 } 00074 SetMomentum( px, py, pz); 00075 }
G4PrimaryParticle::G4PrimaryParticle | ( | G4int | Pcode, | |
G4double | px, | |||
G4double | py, | |||
G4double | pz, | |||
G4double | E | |||
) |
Definition at line 77 of file G4PrimaryParticle.cc.
References G4ParticleTable::FindParticle(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGMass(), and Set4Momentum().
00079 :PDGcode(Pcode), 00080 direction(0.,0.,1.),kinE(0.), 00081 nextParticle(0),daughterParticle(0),trackID(-1), 00082 charge(0.),polX(0.),polY(0.),polZ(0.), 00083 Weight0(1.0),properTime(0.0),userInfo(0) 00084 { 00085 G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode); 00086 if (G4code !=0) { 00087 mass = G4code->GetPDGMass(); 00088 charge = G4code->GetPDGCharge(); 00089 } 00090 Set4Momentum( px, py, pz, E); 00091 }
G4PrimaryParticle::G4PrimaryParticle | ( | const G4ParticleDefinition * | Gcode | ) |
Definition at line 93 of file G4PrimaryParticle.cc.
References G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGEncoding(), and G4ParticleDefinition::GetPDGMass().
00094 :PDGcode(0),G4code(Gcode), 00095 direction(0.,0.,1.),kinE(0.), 00096 nextParticle(0),daughterParticle(0),trackID(-1), 00097 mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.), 00098 Weight0(1.0),properTime(0.0),userInfo(0) 00099 { 00100 if (G4code !=0) { 00101 PDGcode = Gcode->GetPDGEncoding(); 00102 mass = G4code->GetPDGMass(); 00103 charge = G4code->GetPDGCharge(); 00104 } 00105 }
G4PrimaryParticle::G4PrimaryParticle | ( | const G4ParticleDefinition * | Gcode, | |
G4double | px, | |||
G4double | py, | |||
G4double | pz | |||
) |
Definition at line 107 of file G4PrimaryParticle.cc.
References G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGEncoding(), G4ParticleDefinition::GetPDGMass(), and SetMomentum().
00109 :PDGcode(0),G4code(Gcode), 00110 direction(0.,0.,1.),kinE(0.), 00111 nextParticle(0),daughterParticle(0),trackID(-1), 00112 mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.), 00113 Weight0(1.0),properTime(0.0),userInfo(0) 00114 { 00115 if (G4code !=0) { 00116 PDGcode = Gcode->GetPDGEncoding(); 00117 mass = G4code->GetPDGMass(); 00118 charge = G4code->GetPDGCharge(); 00119 } 00120 SetMomentum( px, py, pz); 00121 }
G4PrimaryParticle::G4PrimaryParticle | ( | const G4ParticleDefinition * | Gcode, | |
G4double | px, | |||
G4double | py, | |||
G4double | pz, | |||
G4double | E | |||
) |
Definition at line 123 of file G4PrimaryParticle.cc.
References G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGEncoding(), G4ParticleDefinition::GetPDGMass(), and Set4Momentum().
00125 :PDGcode(0),G4code(Gcode), 00126 direction(0.,0.,1.),kinE(0.), 00127 nextParticle(0),daughterParticle(0),trackID(-1), 00128 charge(0.),polX(0.),polY(0.),polZ(0.), 00129 Weight0(1.0),properTime(0.0),userInfo(0) 00130 { 00131 if (G4code !=0) { 00132 PDGcode = Gcode->GetPDGEncoding(); 00133 mass = G4code->GetPDGMass(); 00134 charge = G4code->GetPDGCharge(); 00135 } 00136 Set4Momentum( px, py, pz, E); 00137 }
G4PrimaryParticle::~G4PrimaryParticle | ( | ) | [virtual] |
Definition at line 190 of file G4PrimaryParticle.cc.
00191 { 00192 if(nextParticle != 0){ 00193 delete nextParticle; 00194 nextParticle = 0; 00195 } 00196 if(daughterParticle != 0){ 00197 delete daughterParticle; 00198 daughterParticle =0; 00199 } 00200 if(userInfo!=0) { 00201 delete userInfo; 00202 userInfo=0; 00203 } 00204 }
G4PrimaryParticle::G4PrimaryParticle | ( | const G4PrimaryParticle & | right | ) |
Definition at line 139 of file G4PrimaryParticle.cc.
00140 :PDGcode(0),G4code(0), 00141 direction(0.,0.,1.),kinE(0.), 00142 nextParticle(0),daughterParticle(0),trackID(-1), 00143 mass(-1.),charge(0.),polX(0.),polY(0.),polZ(0.), 00144 Weight0(1.0),properTime(0.0),userInfo(0) 00145 { 00146 *this = right; 00147 }
G4double G4PrimaryParticle::GetCharge | ( | ) | const [inline] |
Definition at line 200 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack(), and G4PrimaryTransformer::SetDecayProducts().
G4PrimaryParticle * G4PrimaryParticle::GetDaughter | ( | ) | const [inline] |
Definition at line 257 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack(), and G4PrimaryTransformer::SetDecayProducts().
G4ParticleDefinition * G4PrimaryParticle::GetG4code | ( | ) | const [inline] |
G4double G4PrimaryParticle::GetKineticEnergy | ( | ) | const [inline] |
Definition at line 248 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack().
G4double G4PrimaryParticle::GetMass | ( | ) | const [inline] |
Definition at line 197 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack(), and G4PrimaryTransformer::SetDecayProducts().
G4ThreeVector G4PrimaryParticle::GetMomentum | ( | ) | const [inline] |
Definition at line 218 of file G4PrimaryParticle.hh.
References GetTotalMomentum().
Referenced by G4AdjointPrimaryGeneratorAction::GeneratePrimaries(), G4PrimaryTransformer::GenerateSingleTrack(), and G4PrimaryTransformer::SetDecayProducts().
00219 { return GetTotalMomentum()*direction;}
const G4ThreeVector & G4PrimaryParticle::GetMomentumDirection | ( | ) | const [inline] |
Definition at line 221 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack().
G4PrimaryParticle * G4PrimaryParticle::GetNext | ( | ) | const [inline] |
Definition at line 254 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateTracks(), G4PrimaryVertex::GetPrimary(), G4PrimaryVertex::operator=(), and G4PrimaryTransformer::SetDecayProducts().
const G4ParticleDefinition * G4PrimaryParticle::GetParticleDefinition | ( | ) | const [inline] |
G4int G4PrimaryParticle::GetPDGcode | ( | ) | const [inline] |
Definition at line 203 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack(), and G4PrimaryTransformer::SetDecayProducts().
G4ThreeVector G4PrimaryParticle::GetPolarization | ( | ) | const [inline] |
Definition at line 263 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack().
00264 { return G4ThreeVector(polX,polY,polZ); }
G4double G4PrimaryParticle::GetPolX | ( | ) | const [inline] |
Definition at line 266 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack().
G4double G4PrimaryParticle::GetPolY | ( | ) | const [inline] |
Definition at line 269 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack().
G4double G4PrimaryParticle::GetPolZ | ( | ) | const [inline] |
Definition at line 272 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack().
G4double G4PrimaryParticle::GetProperTime | ( | ) | const [inline] |
Definition at line 284 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack(), and G4PrimaryTransformer::SetDecayProducts().
G4double G4PrimaryParticle::GetPx | ( | ) | const [inline] |
Definition at line 227 of file G4PrimaryParticle.hh.
References GetTotalMomentum().
00228 { return GetTotalMomentum()*direction.x();}
G4double G4PrimaryParticle::GetPy | ( | ) | const [inline] |
Definition at line 230 of file G4PrimaryParticle.hh.
References GetTotalMomentum().
00231 { return GetTotalMomentum()*direction.y();}
G4double G4PrimaryParticle::GetPz | ( | ) | const [inline] |
Definition at line 233 of file G4PrimaryParticle.hh.
References GetTotalMomentum().
00234 { return GetTotalMomentum()*direction.z();}
G4double G4PrimaryParticle::GetTotalEnergy | ( | ) | const [inline] |
G4double G4PrimaryParticle::GetTotalMomentum | ( | ) | const [inline] |
Definition at line 212 of file G4PrimaryParticle.hh.
Referenced by GetMomentum(), GetPx(), GetPy(), GetPz(), and Print().
G4int G4PrimaryParticle::GetTrackID | ( | ) | const [inline] |
G4VUserPrimaryParticleInformation * G4PrimaryParticle::GetUserInformation | ( | ) | const [inline] |
G4double G4PrimaryParticle::GetWeight | ( | ) | const [inline] |
Definition at line 275 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack().
void G4PrimaryParticle::operator delete | ( | void * | aStackedTrack | ) | [inline] |
Definition at line 192 of file G4PrimaryParticle.hh.
References aPrimaryParticleAllocator.
00193 { 00194 aPrimaryParticleAllocator.FreeSingle((G4PrimaryParticle *) aPrimaryParticle); 00195 }
void * G4PrimaryParticle::operator new | ( | size_t | ) | [inline] |
Definition at line 185 of file G4PrimaryParticle.hh.
References aPrimaryParticleAllocator.
00186 { 00187 void * aPrimaryParticle; 00188 aPrimaryParticle = (void *) aPrimaryParticleAllocator.MallocSingle(); 00189 return aPrimaryParticle; 00190 }
G4int G4PrimaryParticle::operator!= | ( | const G4PrimaryParticle & | right | ) | const |
G4PrimaryParticle & G4PrimaryParticle::operator= | ( | const G4PrimaryParticle & | right | ) |
Definition at line 149 of file G4PrimaryParticle.cc.
References charge, daughterParticle, direction, G4code, G4PrimaryParticle(), kinE, mass, nextParticle, PDGcode, polX, polY, polZ, properTime, trackID, and Weight0.
00150 { 00151 if (this != &right) { 00152 PDGcode = right.PDGcode; 00153 G4code = right.G4code; 00154 direction = right.direction; 00155 kinE = right.kinE; 00156 if (nextParticle !=0) delete nextParticle; 00157 if ( right.nextParticle ==0 ){ 00158 nextParticle = 0; 00159 } else { 00160 nextParticle = new G4PrimaryParticle(*right.nextParticle); 00161 } 00162 if (daughterParticle !=0) delete daughterParticle; 00163 if ( right.daughterParticle ==0 ){ 00164 daughterParticle = 0; 00165 } else { 00166 daughterParticle = new G4PrimaryParticle(*right.daughterParticle); 00167 } 00168 trackID = right.trackID; 00169 mass = right.mass; 00170 charge = right.charge; 00171 polX = right.polX; 00172 polY = right.polY; 00173 polZ = right.polZ; 00174 Weight0 = right.Weight0; 00175 properTime = right.properTime; 00176 00177 // userInfo can not be copied 00178 userInfo = 0; 00179 } 00180 00181 return *this; 00182 }
G4int G4PrimaryParticle::operator== | ( | const G4PrimaryParticle & | right | ) | const |
void G4PrimaryParticle::Print | ( | ) | const |
Definition at line 260 of file G4PrimaryParticle.cc.
References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), GetTotalMomentum(), ns, Print(), and G4VUserPrimaryParticleInformation::Print().
Referenced by G4PrimaryVertex::Print(), and Print().
00261 { 00262 G4cout << "==== PDGcode " << PDGcode << " Particle name "; 00263 if(G4code != 0) 00264 { G4cout << G4code->GetParticleName() << G4endl; } 00265 else 00266 { G4cout << " is not defined in G4." << G4endl; } 00267 G4cout << " Assigned charge : " << charge/eplus << G4endl; 00268 G4cout << " Momentum ( " 00269 << GetTotalMomentum()*direction.x()/GeV << "[GeV/c], " 00270 << GetTotalMomentum()*direction.y()/GeV << "[GeV/c], " 00271 << GetTotalMomentum()*direction.z()/GeV << "[GeV/c] )" << G4endl; 00272 G4cout << " kinetic Energy : " << kinE/GeV << " [GeV]" << G4endl; 00273 if(mass>=0.){ 00274 G4cout << " Mass : " << mass/GeV << " [GeV]" << G4endl; 00275 } else { 00276 G4cout << " Mass is not assigned " << G4endl; 00277 } 00278 G4cout << " Polarization ( " 00279 << polX << ", " 00280 << polY << ", " 00281 << polZ << " )" 00282 << G4endl; 00283 G4cout << " Weight : " << Weight0 << G4endl; 00284 if(properTime>0.0) { 00285 G4cout << " PreAssigned proper decay time : " << properTime/ns << " [ns] " << G4endl; 00286 } 00287 if(userInfo != 0) { userInfo->Print(); } 00288 if(daughterParticle != 0) { 00289 G4cout << ">>>> Daughters" << G4endl; 00290 daughterParticle->Print(); 00291 } 00292 if(nextParticle != 0) { 00293 nextParticle->Print(); 00294 } else { 00295 G4cout << "<<<< End of link" << G4endl; 00296 } 00297 }
Definition at line 220 of file G4PrimaryParticle.cc.
References G4ParticleDefinition::GetPDGMass().
Referenced by G4PrimaryParticle().
00221 { 00222 G4double pmom = std::sqrt(px*px+py*py+pz*pz); 00223 if (pmom>0.0) { 00224 direction.setX(px/pmom); 00225 direction.setY(py/pmom); 00226 direction.setZ(pz/pmom); 00227 } 00228 G4double mas2 = E*E - pmom*pmom; 00229 if(mas2>=0.){ 00230 mass = std::sqrt(mas2); 00231 } else { 00232 if (G4code!=0){ 00233 mass = G4code->GetPDGMass(); 00234 } 00235 E = std::sqrt(pmom*pmom+mass*mass); 00236 } 00237 kinE = E - mass; 00238 }
void G4PrimaryParticle::SetCharge | ( | G4double | chg | ) | [inline] |
Definition at line 316 of file G4PrimaryParticle.hh.
Referenced by G4SingleParticleSource::GeneratePrimaryVertex().
void G4PrimaryParticle::SetDaughter | ( | G4PrimaryParticle * | np | ) | [inline] |
Definition at line 304 of file G4PrimaryParticle.hh.
References SetNext().
Referenced by G4HEPEvtInterface::GeneratePrimaryVertex().
00305 { 00306 if(daughterParticle == 0) { daughterParticle = np; } 00307 else { daughterParticle->SetNext(np); } 00308 }
void G4PrimaryParticle::SetG4code | ( | const G4ParticleDefinition * | Gcode | ) | [inline] |
Definition at line 293 of file G4PrimaryParticle.hh.
References SetParticleDefinition().
00294 { 00295 SetParticleDefinition(Gcode); 00296 }
void G4PrimaryParticle::SetKineticEnergy | ( | G4double | eKin | ) | [inline] |
Definition at line 251 of file G4PrimaryParticle.hh.
Referenced by G4SingleParticleSource::GeneratePrimaryVertex(), and G4RayShooter::Shoot().
void G4PrimaryParticle::SetMass | ( | G4double | mas | ) | [inline] |
Definition at line 313 of file G4PrimaryParticle.hh.
Referenced by G4SingleParticleSource::GeneratePrimaryVertex(), G4HEPEvtInterface::GeneratePrimaryVertex(), and G4RayShooter::Shoot().
Definition at line 206 of file G4PrimaryParticle.cc.
References G4ParticleDefinition::GetPDGMass().
Referenced by G4PrimaryParticle(), and G4HEPEvtInterface::GeneratePrimaryVertex().
00207 { 00208 if ((mass<0.)&&(G4code!=0)){ 00209 mass = G4code->GetPDGMass(); 00210 } 00211 G4double pmom = std::sqrt(px*px+py*py+pz*pz); 00212 if (pmom>0.0) { 00213 direction.setX(px/pmom); 00214 direction.setY(py/pmom); 00215 direction.setZ(pz/pmom); 00216 } 00217 kinE = std::sqrt(px*px+py*py+pz*pz+mass*mass)-mass; 00218 }
void G4PrimaryParticle::SetMomentumDirection | ( | const G4ThreeVector & | p | ) | [inline] |
Definition at line 224 of file G4PrimaryParticle.hh.
Referenced by G4SingleParticleSource::GeneratePrimaryVertex(), and G4RayShooter::Shoot().
void G4PrimaryParticle::SetNext | ( | G4PrimaryParticle * | np | ) | [inline] |
Definition at line 298 of file G4PrimaryParticle.hh.
References SetNext().
Referenced by SetDaughter(), SetNext(), and G4PrimaryVertex::SetPrimary().
00299 { 00300 if (nextParticle == 0) { nextParticle = np; } 00301 else { nextParticle->SetNext(np); } 00302 }
void G4PrimaryParticle::SetParticleDefinition | ( | const G4ParticleDefinition * | pdef | ) |
Definition at line 250 of file G4PrimaryParticle.cc.
References G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGEncoding(), and G4ParticleDefinition::GetPDGMass().
Referenced by SetG4code().
00251 { 00252 G4code = Gcode; 00253 if (G4code!=0){ 00254 PDGcode = Gcode->GetPDGEncoding(); 00255 mass = G4code->GetPDGMass(); 00256 charge = G4code->GetPDGCharge(); 00257 } 00258 }
void G4PrimaryParticle::SetPDGcode | ( | G4int | Pcode | ) |
Definition at line 240 of file G4PrimaryParticle.cc.
References G4ParticleTable::FindParticle(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetPDGCharge(), and G4ParticleDefinition::GetPDGMass().
00241 { 00242 PDGcode = Pcode; 00243 G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode); 00244 if (G4code!=0){ 00245 mass = G4code->GetPDGMass(); 00246 charge = G4code->GetPDGCharge(); 00247 } 00248 }
void G4PrimaryParticle::SetPolarization | ( | const G4ThreeVector & | pol | ) | [inline] |
Definition at line 326 of file G4PrimaryParticle.hh.
Referenced by G4SingleParticleSource::GeneratePrimaryVertex(), and G4RayShooter::Shoot().
void G4PrimaryParticle::SetProperTime | ( | G4double | t | ) | [inline] |
void G4PrimaryParticle::SetTotalEnergy | ( | G4double | eTot | ) | [inline] |
void G4PrimaryParticle::SetTrackID | ( | G4int | id | ) | [inline] |
Definition at line 310 of file G4PrimaryParticle.hh.
Referenced by G4PrimaryTransformer::GenerateSingleTrack().
void G4PrimaryParticle::SetUserInformation | ( | G4VUserPrimaryParticleInformation * | anInfo | ) | [inline] |
void G4PrimaryParticle::SetWeight | ( | G4double | w | ) | [inline] |
Definition at line 278 of file G4PrimaryParticle.hh.
Referenced by G4SingleParticleSource::GeneratePrimaryVertex().