![]() |
sandreco
1.0.8
A modular reconstruction software for SAND
|
Represents a trajectory of a particle through a detector. More...
#include <EDEPTrajectory.h>

Public Member Functions | |
| EDEPTrajectory (const TG4Trajectory &trajectory) | |
| EDEPTrajectory (const EDEPTrajectory &)=default | |
| EDEPTrajectory (EDEPTrajectory &&)=default | |
| ~EDEPTrajectory ()=default | |
| Destructor for EDEPTrajectory. | |
| bool | operator== (const EDEPTrajectory &trj) const |
| Equality operator for EDEPTrajectory. More... | |
| EDEPTrajectory & | operator= (const EDEPTrajectory &)=default |
| Assignment operator for EDEPTrajectory. More... | |
| EDEPTrajectory & | operator= (EDEPTrajectory &&)=default |
| Move assignment operator for EDEPTrajectory. More... | |
| EDEPTrajectory * | Get () |
| Get a pointer to this trajectory. More... | |
| const EDEPTrajectory * | Get () const |
| Get a const pointer to this trajectory. More... | |
| EDEPTrajectory * | GetParent () const |
| Get the parent trajectory of this trajectory. More... | |
| int | GetId () const |
| Get the ID of this trajectory. More... | |
| int | GetDepth () const |
| Get the depth of this trajectory. More... | |
| int | GetInteractionNumber () const |
| Get the number of the interaction that generated this trajectory. More... | |
| std::string | GetReaction () const |
| Get the reaction of the interaction that generated this trajectory. More... | |
| int | GetParentId () const |
| Get the parent ID of this trajectory. More... | |
| int | GetPDGCode () const |
| Get the PDG code of this trajectory. More... | |
| std::vector< EDEPTrajectoryPoint > & | GetFirstPointsInDetector (sand::subdetector_t c) |
| const std::vector< EDEPTrajectoryPoint > & | GetFirstPointsInDetector (sand::subdetector_t c) const |
| std::vector< EDEPTrajectoryPoint > & | GetLastPointsInDetector (sand::subdetector_t c) |
| const std::vector< EDEPTrajectoryPoint > & | GetLastPointsInDetector (sand::subdetector_t c) const |
| sand::vec_4d | GetInitialMomentum () const |
| Get the initial momentum of this trajectory. More... | |
| trajectory_range< EDEPTrajectory > | GetChildrenTrajectories () |
| trajectory_range< const EDEPTrajectory > | GetChildrenTrajectories () const |
| const EDEPHitsMap & | GetHitMap () const |
| Get the hit map associated with this trajectory. More... | |
| const EDEPTrajectoryPoints & | GetTrajectoryPoints () const |
| Get the trajectory points associated with this trajectory. More... | |
| std::vector< EDEPTrajectoryPoint > | GetTrajectoryPointsVect () const |
| Get the trajectory points associated with this trajectory. More... | |
| bool | HasHits () const |
| bool | HasHitWithId (int id) const |
| const EDEPHit & | GetHitWithId (int id) const |
| Returns the hit in the trajectory with the specified ID. More... | |
| bool | HasHitInDetector (sand::subdetector_t c) const |
| double | GetDepositedEnergy (sand::subdetector_t c) const |
Sum of the secondary deposits in c, 0 if there are no hits there. More... | |
| double | GetTotalEnergyDeposit (sand::subdetector_t c) const |
Sum of the total energy deposits (EDEPHit::GetEnergyDeposit) of the hits in c [MeV], 0 if there are none. More... | |
| double | GetTrackLength (sand::subdetector_t c) const |
Sum of the track lengths (EDEPHit::GetTrackLength) of the hits in c [mm], 0 if there are none. More... | |
| bool | HasHitBeforeTime (double t) const |
| Checks if the trajectory has hits before a specified time. More... | |
| bool | HasHitAfterTime (double t) const |
| Checks if the trajectory has hits after a specified time. More... | |
| bool | HasHitWithEnergySmallerThan (double e) const |
| Checks if the trajectory has hits with energy smaller than the specified amount. More... | |
| bool | HasHitWithEnergyLargerThan (double e) const |
| Checks if the trajectory has hits with energy larger than the specified amount. More... | |
| bool | HasHitInEnergy (double min, double max) const |
| Checks if the trajectory has hits within a specified energy range. More... | |
| bool | HasHitInTimeAndEnergy (double start_time, double stop_time, double min_energy, double max_energy) const |
| Checks if the trajectory has hits within a specified energy and time ranges. More... | |
| bool | IsTrajectorySaturated () const |
| True if the trajectory reached the edep-sim limit on the number of stored points. More... | |
| bool | HasHitInTime (double start_time, double stop_time) const |
| Checks if the trajectory has hits within a specified time range. More... | |
| bool | HasHitWithIdInDetector (int id, sand::subdetector_t c) const |
| Checks if the trajectory has a hit with the specified ID in the specified detector sand::subdetector_t. More... | |
| bool | HasHitNearPoint (sand::pos_3d point, double distance) const |
| Checks if any hit is within a given distance from a point. More... | |
| bool | HasHitNear4DPoint (sand::vec_4d point, double distance, double time) const |
| Checks if any hit is within a given 4D distance (space and time) from a point. More... | |
| const EDEPHit * | GetHitNear4DPoint (sand::vec_4d point, double distance, double time) const |
| First hit near the 4D point, nullptr if none. More... | |
| std::string | Print (std::string &full_out, int depth=100, int current_depth=0) const |
| bool | IsEntering (sand::subdetector_t c) const |
| bool | IsExiting (sand::subdetector_t c) const |
| template<typename Funct > | |
| bool | HasHitWhere (Funct &&f) const |
| template<typename Funct > | |
| const EDEPHit * | GetHitWhere (Funct &&f) const |
Static Public Member Functions | |
| static bool | Match (std::string_view volume, std::initializer_list< std::string > names) |
True if volume contains any of names as a substring. More... | |
Protected Member Functions | |
| const EDEPHit * | FindHit (int id) const |
Protected Attributes | |
| sand::vec_4d | p0_ {0, 0, 0, 0} |
| Initial momentum of the trajectory. | |
| EDEPHitsMap | hit_map_ |
| Map of hits associated with the trajectory. | |
| EDEPTrajectoryPoints | trajectory_points_ |
| Trajectory points. | |
| std::vector< EDEPTrajectory * > | children_ |
| Children trajectories. | |
| std::array< bool, sand::kNumComponents > | exiting_ {} |
| Map indicating whether the trajectory is exiting a sand::subdetector_t. | |
| std::array< bool, sand::kNumComponents > | entering_ {} |
| Map indicating whether the trajectory is entering a sand::subdetector_t. | |
| std::array< std::vector< EDEPTrajectoryPoint >, sand::kNumComponents > | last_points_ |
| Map of all the first points in each sand::subdetector_t. | |
| std::array< std::vector< EDEPTrajectoryPoint >, sand::kNumComponents > | first_points_ |
| Map of all the last points in each sand::subdetector_t. | |
| EDEPTrajectory * | parent_trajectory_ = nullptr |
| Pointer to the parent trajectory. | |
| int | id_ = -1 |
| ID of the trajectory. | |
| int | parent_id_ = -99 |
| Parent ID of the trajectory. | |
| int | pdg_code_ = 0 |
| PDG code of the trajectory. | |
| int | depth_ = -1 |
| Depth of the trajectory. | |
| int | interaction_number_ = -1 |
| Number of the interaction that generated this trajectory. | |
| std::string | reaction_ |
| String corresponding to the reaction that generated this trajectory. | |
Static Protected Attributes | |
| static constexpr std::size_t | kMaxPoints = 10000 |
Friends | |
| class | EDEPTree |
Represents a trajectory of a particle through a detector.
This class encapsulates information about a particle trajectory, including its initial momentum, hits along its path, children trajectories, and various utility functions to query trajectory properties. Trajectories are owned by an EDEPTree, which also fills them. Parent and children are non-owning pointers into the tree's storage, so a trajectory copied out of its tree is only a snapshot: its relations still point into the original tree and are valid only as long as the tree is not rebuilt.
|
inline |
Get a pointer to this trajectory.
|
inline |
Get a const pointer to this trajectory.
| double EDEPTrajectory::GetDepositedEnergy | ( | sand::subdetector_t | c | ) | const |
Sum of the secondary deposits in c, 0 if there are no hits there.
Calculates the total deposited energy in the specified detector sand::subdetector_t.
| component_name | The name of the detector sand::subdetector_t. |
|
inline |
Get the depth of this trajectory.
|
inline |
Get the hit map associated with this trajectory.
| const EDEPHit * EDEPTrajectory::GetHitNear4DPoint | ( | sand::vec_4d | point, |
| double | distance, | ||
| double | time | ||
| ) | const |
First hit near the 4D point, nullptr if none.
Returns an iterator to the hit near a given 4D point (space and time).
This function searches for a hit whose midpoint is within the specified spatial distance and time difference from the given 4D point. It returns an iterator to the first hit that matches the criteria.
| point | The reference 4D point as a sand::vec_4d (includes space and time components). |
| distance | The maximum allowed spatial distance. |
| time | The maximum allowed time difference. |
| const EDEPHit & EDEPTrajectory::GetHitWithId | ( | int | id | ) | const |
Returns the hit in the trajectory with the specified ID.
This function searches through all hits in the trajectory and returns the one that has a matching ID.
| id | The ID to search for. |
|
inline |
Get the ID of this trajectory.
|
inline |
Get the initial momentum of this trajectory.
|
inline |
Get the number of the interaction that generated this trajectory.
|
inline |
Get the parent trajectory of this trajectory.
|
inline |
Get the parent ID of this trajectory.
|
inline |
Get the PDG code of this trajectory.
|
inline |
Get the reaction of the interaction that generated this trajectory.
| double EDEPTrajectory::GetTotalEnergyDeposit | ( | sand::subdetector_t | c | ) | const |
Sum of the total energy deposits (EDEPHit::GetEnergyDeposit) of the hits in c [MeV], 0 if there are none.
Calculates the total energy deposited by the trajectory in the specified detector sand::subdetector_t, as the sum of EDEPHit::GetEnergyDeposit over its hits there.
| c | The detector sand::subdetector_t. |
| double EDEPTrajectory::GetTrackLength | ( | sand::subdetector_t | c | ) | const |
Sum of the track lengths (EDEPHit::GetTrackLength) of the hits in c [mm], 0 if there are none.
Calculates the length of the trajectory in the specified detector sand::subdetector_t, as the sum of EDEPHit::GetTrackLength over its hits there.
| c | The detector sand::subdetector_t. |
|
inline |
Get the trajectory points associated with this trajectory.
| std::vector< EDEPTrajectoryPoint > EDEPTrajectory::GetTrajectoryPointsVect | ( | ) | const |
Get the trajectory points associated with this trajectory.
| bool EDEPTrajectory::HasHitAfterTime | ( | double | t | ) | const |
Checks if the trajectory has hits after a specified time.
| time | The time threshold. |
| bool EDEPTrajectory::HasHitBeforeTime | ( | double | t | ) | const |
Checks if the trajectory has hits before a specified time.
| time | The time threshold. |
| bool EDEPTrajectory::HasHitInEnergy | ( | double | min, |
| double | max | ||
| ) | const |
Checks if the trajectory has hits within a specified energy range.
| min | The min of the energy range. |
| max | The max of the energy range. |
| bool EDEPTrajectory::HasHitInTime | ( | double | t0, |
| double | t1 | ||
| ) | const |
Checks if the trajectory has hits within a specified time range.
| start_time | The start of the time range. |
| stop_time | The end of the time range. |
| bool EDEPTrajectory::HasHitInTimeAndEnergy | ( | double | t0, |
| double | t1, | ||
| double | emin, | ||
| double | emax | ||
| ) | const |
Checks if the trajectory has hits within a specified energy and time ranges.
| start_time | The start of the time range. |
| stop_time | The stop of the time range. |
| min_energy | The min of the energy range. |
| max_energy | The max of the energy range. |
| bool EDEPTrajectory::HasHitNear4DPoint | ( | sand::vec_4d | point, |
| double | distance, | ||
| double | time | ||
| ) | const |
Checks if any hit is within a given 4D distance (space and time) from a point.
This function checks if the midpoint of any hit is within the specified spatial distance and time difference from a given 4D point.
| point | The reference 4D point as a sand::vec_4d (includes both space and time). |
| distance | The maximum spatial distance to consider. |
| time | The maximum time difference to consider. |
| bool EDEPTrajectory::HasHitNearPoint | ( | sand::pos_3d | point, |
| double | distance | ||
| ) | const |
Checks if any hit is within a given distance from a point.
This function determines if the midpoint of any hit is closer than the specified distance to the given point.
| point | The reference point as a sand::pos_3d. |
| distance | The maximum distance to consider. |
| bool EDEPTrajectory::HasHitWithEnergyLargerThan | ( | double | e | ) | const |
Checks if the trajectory has hits with energy larger than the specified amount.
| time | The energy threshold. |
| bool EDEPTrajectory::HasHitWithEnergySmallerThan | ( | double | e | ) | const |
Checks if the trajectory has hits with energy smaller than the specified amount.
| time | The energy threshold. |
| bool EDEPTrajectory::HasHitWithIdInDetector | ( | int | id, |
| sand::subdetector_t | c | ||
| ) | const |
Checks if the trajectory has a hit with the specified ID in the specified detector sand::subdetector_t.
| id | The ID of the hit. |
| component_name | The name of the detector sand::subdetector_t. |
| bool EDEPTrajectory::IsTrajectorySaturated | ( | ) | const |
True if the trajectory reached the edep-sim limit on the number of stored points.
Checks if the trajectory is saturated (i.e., has reached the maximum number of points).
|
static |
True if volume contains any of names as a substring.
Matches a given volume name against a list of names.
| volume | The volume name to match. |
| names | An initializer list of names to match against. |
|
default |
Assignment operator for EDEPTrajectory.
| trj | The EDEPTrajectory object to assign. |
|
default |
Move assignment operator for EDEPTrajectory.
| trj | The EDEPTrajectory object to move. |
| bool EDEPTrajectory::operator== | ( | const EDEPTrajectory & | trj | ) | const |
Equality operator for EDEPTrajectory.
| trj | The EDEPTrajectory object to compare. |