61 if (track->GetDynamicParticle()->GetPrimaryParticle() !=
nullptr) {
62 G4VUserPrimaryParticleInformation* primaryInfo =
63 track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation();
64 if (primaryInfo !=
nullptr) {
65 particle.setGenStatus(
70 auto particle_def{track->GetDefinition()};
72 particle.setPdgID(particle_def->GetPDGEncoding());
73 particle.setCharge(particle_def->GetPDGCharge());
74 particle.setMass(track->GetDynamicParticle()->GetMass());
75 particle.setEnergy(track->GetVertexKineticEnergy() +
76 track->GetDynamicParticle()->GetMass());
79 particle.setVertexVolume(track_info->getVertexVolume());
81 auto vert{track->GetVertexPosition()};
82 particle.setVertex(vert.x(), vert.y(), vert.z());
83 particle.setTime(track_info->getVertexTime());
86 particle.setMomentum(init_momentum.x(), init_momentum.y(), init_momentum.z());
88 const G4VProcess* process{track->GetCreatorProcess()};
90 const G4String& name{process->GetProcessName()};
93 if (track->GetParentID() == 0) {
94 particle.setProcessType(ldmx::SimParticle::ProcessType::Primary);
96 particle.setProcessType(ldmx::SimParticle::ProcessType::unknown);
103 auto momentum{track->GetMomentum()};
104 particle.setEndPointMomentum(momentum.x(), momentum.y(), momentum.z());
106 auto end_pt{track->GetPosition()};
107 particle.setEndPoint(end_pt.x(), end_pt.y(), end_pt.z());
Class representing a simulated particle.
void setGenStatus(const int &genStatus)
Set the generator status of this particle.
static ProcessType findProcessType(std::string processName)
Get the process type enum from a G4VProcess name.
bool isDescendant(int trackID, int ancestorID, int maximum_depth) const
Check if the track with the given ID is a descendant of the track with the given ancestor ID up to a ...