Loading src/modules/DepositionGeant4/TrackInfoG4.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ TrackInfoG4::TrackInfoG4(int custom_track_id, int parent_track_id, const G4Track origin_g4_process_type_ = (G4Process != nullptr) ? G4Process->GetProcessType() : -1; particle_id_ = aTrack->GetDynamicParticle()->GetPDGcode(); start_point_ = static_cast<ROOT::Math::XYZPoint>(aTrack->GetPosition()); start_time_ = aTrack->GetGlobalTime(); origin_g4_vol_name_ = aTrack->GetVolume()->GetName(); origin_g4_process_name_ = (G4Process != nullptr) ? static_cast<std::string>(G4Process->GetProcessName()) : "none"; initial_kin_E_ = aTrack->GetKineticEnergy(); Loading @@ -30,6 +31,7 @@ void TrackInfoG4::finalizeInfo(const G4Track* const aTrack) { final_kin_E_ = aTrack->GetKineticEnergy(); final_tot_E_ = aTrack->GetTotalEnergy(); end_point_ = static_cast<ROOT::Math::XYZPoint>(aTrack->GetPosition()); end_time_ = aTrack->GetGlobalTime(); } int TrackInfoG4::getID() const { Loading @@ -48,6 +50,14 @@ ROOT::Math::XYZPoint TrackInfoG4::getEndPoint() const { return end_point_; } double TrackInfoG4::getStartTime() const { return start_time_; } double TrackInfoG4::getEndTime() const { return end_time_; } int TrackInfoG4::getParticleID() const { return particle_id_; } Loading src/modules/DepositionGeant4/TrackInfoG4.hpp +16 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,18 @@ namespace allpix { */ int getParticleID() const; /** * @brief Get the starting time of the particle * @return The time at the beginning of the track */ double getStartTime() const; /** * @brief Get the end time of the particle * @return The time at the end of the track */ double getEndTime() const; /** * @brief Get the Geant4 internal ID of the process which created the particle * @return The Geant4 process type, or "-1" if no such process exists Loading Loading @@ -127,6 +139,10 @@ namespace allpix { ROOT::Math::XYZPoint start_point_{}; // End point of track (in mm) ROOT::Math::XYZPoint end_point_{}; // Starting time (in ns) double start_time_{}; // Ending time (in ns) double end_time_{}; // Geant4 volume in which the track was created std::string origin_g4_vol_name_{}; // Name of Geant4 process which created this track Loading Loading
src/modules/DepositionGeant4/TrackInfoG4.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ TrackInfoG4::TrackInfoG4(int custom_track_id, int parent_track_id, const G4Track origin_g4_process_type_ = (G4Process != nullptr) ? G4Process->GetProcessType() : -1; particle_id_ = aTrack->GetDynamicParticle()->GetPDGcode(); start_point_ = static_cast<ROOT::Math::XYZPoint>(aTrack->GetPosition()); start_time_ = aTrack->GetGlobalTime(); origin_g4_vol_name_ = aTrack->GetVolume()->GetName(); origin_g4_process_name_ = (G4Process != nullptr) ? static_cast<std::string>(G4Process->GetProcessName()) : "none"; initial_kin_E_ = aTrack->GetKineticEnergy(); Loading @@ -30,6 +31,7 @@ void TrackInfoG4::finalizeInfo(const G4Track* const aTrack) { final_kin_E_ = aTrack->GetKineticEnergy(); final_tot_E_ = aTrack->GetTotalEnergy(); end_point_ = static_cast<ROOT::Math::XYZPoint>(aTrack->GetPosition()); end_time_ = aTrack->GetGlobalTime(); } int TrackInfoG4::getID() const { Loading @@ -48,6 +50,14 @@ ROOT::Math::XYZPoint TrackInfoG4::getEndPoint() const { return end_point_; } double TrackInfoG4::getStartTime() const { return start_time_; } double TrackInfoG4::getEndTime() const { return end_time_; } int TrackInfoG4::getParticleID() const { return particle_id_; } Loading
src/modules/DepositionGeant4/TrackInfoG4.hpp +16 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,18 @@ namespace allpix { */ int getParticleID() const; /** * @brief Get the starting time of the particle * @return The time at the beginning of the track */ double getStartTime() const; /** * @brief Get the end time of the particle * @return The time at the end of the track */ double getEndTime() const; /** * @brief Get the Geant4 internal ID of the process which created the particle * @return The Geant4 process type, or "-1" if no such process exists Loading Loading @@ -127,6 +139,10 @@ namespace allpix { ROOT::Math::XYZPoint start_point_{}; // End point of track (in mm) ROOT::Math::XYZPoint end_point_{}; // Starting time (in ns) double start_time_{}; // Ending time (in ns) double end_time_{}; // Geant4 volume in which the track was created std::string origin_g4_vol_name_{}; // Name of Geant4 process which created this track Loading