|
EDEpReader
|
Represents a trajectory of a particle through a detector. More...
#include <EDEPTrajectory.h>
Public Member Functions | |
| EDEPTrajectory (const TG4Trajectory &trajectory) | |
| EDEPTrajectory (const TG4Trajectory &trajectory, const std::map< int, std::map< component, std::vector< EDEPHit > > > &hit_map, const TG4PrimaryVertexContainer &primaries, TGeoManager *geo) | |
| Constructs an EDEPTrajectory object from a TG4Trajectory and hit information. | |
| EDEPTrajectory (const EDEPTrajectory &trj) | |
| Copy constructor for the EDEPTrajectory class. | |
| EDEPTrajectory (EDEPTrajectory &&trj) | |
| Copy assignment operator for the EDEPTrajectory class. | |
| ~EDEPTrajectory () | |
| Destructor for EDEPTrajectory. | |
| bool | operator== (const EDEPTrajectory &trj) |
| Equality operator for EDEPTrajectory. | |
| EDEPTrajectory & | operator= (const EDEPTrajectory &trj) |
| Assignment operator for EDEPTrajectory. | |
| EDEPTrajectory & | operator= (EDEPTrajectory &&trj) |
| Move assignment operator for EDEPTrajectory. | |
| EDEPTrajectory * | Get () |
| Get a pointer to this trajectory. | |
| const EDEPTrajectory * | Get () const |
| Get a const pointer to this trajectory. | |
| EDEPTrajectory * | GetParent () const |
| Get the parent trajectory of this trajectory. | |
| int | GetId () const |
| Get the ID of this trajectory. | |
| int | GetDepth () const |
| Get the depth of this trajectory. | |
| int | GetInteractionNumber () const |
| Get the number of the interaction that generated this trajectory. | |
| std::string | GetReaction () const |
| Get the reaction of the interaction that generated this trajectory. | |
| int | GetParentId () const |
| Get the parent ID of this trajectory. | |
| int | GetPDGCode () const |
| Get the PDG code of this trajectory. | |
| std::vector< EDEPTrajectoryPoint > & | GetFirstPointsInDetector (component component_name) |
| std::vector< EDEPTrajectoryPoint > & | GetLastPointsInDetector (component component_name) |
| TLorentzVector | GetInitialMomentum () const |
| Get the initial momentum of this trajectory. | |
| std::vector< EDEPTrajectory > & | GetChildrenTrajectories () |
| Get the children trajectories of this trajectory. | |
| const std::vector< EDEPTrajectory > & | GetChildrenTrajectories () const |
| Get the const children trajectories of this trajectory. | |
| const EDEPHitsMap & | GetHitMap () const |
| Get the hit map associated with this trajectory. | |
| const EDEPTrajectoryPoints & | GetTrajectoryPoints () const |
| Get the trajectory points associated with this trajectory. | |
| std::vector< EDEPTrajectoryPoint > | GetTrajectoryPointsVect () const |
| Get the trajectory points associated with this trajectory. | |
| std::vector< EDEPTrajectoryPoint > | GetTrajectoryPointsInComponentVect (component component_name) const |
| Get a time-ordered vector of the trajectory points associated with this trajectory, in the specified component. | |
| void | SetId (int id) |
| Set the ID of this trajectory. | |
| void | SetDepth (int depth) |
| Set the depth of this trajectory. | |
| void | SetParentId (int parent_id) |
| Set the parent ID of this trajectory. | |
| void | SetParent (EDEPTrajectory *parent_trajectory) |
| Set the parent trajectory of this trajectory. | |
| void | AddChild (const EDEPTrajectory &trajectory) |
| Add a child trajectory to this trajectory. | |
| bool | RemoveChildWithId (int child_id) |
| Removes a child trajectory with the given ID. | |
| void | ComputeDepth () |
| Computes the depth of the trajectory in the tree. | |
| bool | HasHits () const |
| bool | HasHitWithId (int id) const |
| Checks if any hit in the trajectory has the specified ID. | |
| bool | HasHitInDetector (component component_name) const |
| Checks if the trajectory has hits in the specified detector component. | |
| std::vector< EDEPHit > | GetHitsInDetector (component component_name) const |
| double | GetPrimaryDepositedEnergy (component component_name) |
| double | GetDepositedEnergy (component component_name) |
| Calculates the total deposited energy in the specified detector component. | |
| double | GetTotalDepositedEnergy () |
| Calculates the total deposited energy ove all components. | |
| double | GetRecursivePrimaryDepositedEnergy (component component_name) |
| Calculates the total (scintillation + other) deposited energy in the specified detector component by a trajectory and all its children. | |
| double | GetRecursiveDepositedEnergy (component component_name) |
| Calculates the deposited energy from scintillation in the specified detector component by a trajectory and all its children. | |
| double | GetTotalRecursiveDepositedEnergy () |
| Calculates the deposited energy from scintillation over all components. | |
| bool | HasHitBeforeTime (double start_time) const |
| Checks if the trajectory has hits before a specified time. | |
| bool | HasHitAfterTime (double stop_time) const |
| Checks if the trajectory has hits after a specified time. | |
| bool | IsTrajectorySaturated () const |
| Checks if the trajectory is saturated (i.e., has reached the maximum number of points). | |
| bool | HasHitInTime (double start_time, double stop_time) const |
| Checks if the trajectory has hits within a specified time range. | |
| bool | HasHitWithIdInDetector (int id, component component_name) const |
| Checks if the trajectory has a hit with the specified ID in the specified detector component. | |
| bool | HasHitNearPoint (TVector3 point, double distance) const |
| Checks if any hit is within a given distance from a point. | |
| bool | HasHitNear4DPoint (TLorentzVector point, double distance, double time) const |
| Checks if any hit is within a given 4D distance (space and time) from a point. | |
| std::vector< EDEPHit >::iterator | GetHitNear4DPoint (TLorentzVector point, double distance, double time) |
| Returns an iterator to the hit near a given 4D point (space and time). | |
| std::string | Print (std::string &full_out, int depth=100, int current_depth=0) const |
| Prints the trajectory information to stdout and stores it in a string. | |
| bool | IsEntering (component component_name) const |
| Checks if the trajectory is entering the specified detector component. | |
| bool | IsExiting (component component_name) const |
| Checks if the trajectory is exiting the specified detector component. | |
| component | GetStartDetector () const |
| Retrieves the component containing the first point of the trajectory. | |
| bool | StartsInDetector (component component_name) const |
| Checks if the trajectory has its first TrajectoryPoint in the specified component. | |
| template<typename Funct> | |
| bool | HasHitWhere (Funct &&f) const |
| template<typename Funct> | |
| std::vector< EDEPHit >::iterator | GetHitWhere (Funct &&f) |
| bool | Match (std::string volume, std::initializer_list< std::string > names) const |
| Matches a given volume name against a list of names. | |
| void | CheckInNext (bool *in, bool *next, TG4TrajectoryPoint it, TG4TrajectoryPoint next_it) |
| Checks for transitions between detector components in a particle trajectory. | |
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.
| EDEPTrajectory::EDEPTrajectory | ( | const TG4Trajectory & | trajectory, |
| const std::map< int, std::map< component, std::vector< EDEPHit > > > & | hit_map, | ||
| const TG4PrimaryVertexContainer & | primaries, | ||
| TGeoManager * | geo ) |
Constructs an EDEPTrajectory object from a TG4Trajectory and hit information.
This constructor converts a TG4Trajectory object into an EDEPTrajectory, categorizing the trajectory points into different components based on geometry and associating hits with the trajectory. It also handles entering and exiting of different volume regions and maps hits to their respective components.
| trajectory | The TG4Trajectory object to be converted. |
| hits | A map of hit segment detectors, containing hits associated with different components. |
| primaries | A container for primary vertex information to track interaction number and reaction type. |
| geo | The TGeoManager object representing the detector geometry for identifying volume regions. |
| EDEPTrajectory::EDEPTrajectory | ( | const EDEPTrajectory & | trj | ) |
Copy constructor for the EDEPTrajectory class.
| trj | The EDEPTrajectory object to copy. |
| EDEPTrajectory::EDEPTrajectory | ( | EDEPTrajectory && | trj | ) |
Copy assignment operator for the EDEPTrajectory class.
| trj | The EDEPTrajectory object to copy. |
|
inline |
Add a child trajectory to this trajectory.
| trajectory | The child trajectory to add. |
| void EDEPTrajectory::CheckInNext | ( | bool * | in, |
| bool * | next, | ||
| TG4TrajectoryPoint | it, | ||
| TG4TrajectoryPoint | next_it ) |
Checks for transitions between detector components in a particle trajectory.
This function examines the current and next trajectory points to determine if a transition occurs from one detector component to another. If a transition is detected, it updates the entering and exiting state of the respective components and stores the associated trajectory points.
The in and next arrays should reflect the following order of components:
| in | Pointer to a boolean array indicating the components the current trajectory point is inside. |
| next | Pointer to a boolean array indicating the components the next trajectory point is inside. |
| it | The current trajectory point being checked. |
| next_it | The next trajectory point being checked. |
|
inline |
Get a pointer to this trajectory.
|
inline |
Get a const pointer to this trajectory.
|
inline |
Get the children trajectories of this trajectory.
|
inline |
Get the const children trajectories of this trajectory.
| double EDEPTrajectory::GetDepositedEnergy | ( | component | component_name | ) |
Calculates the total deposited energy in the specified detector component.
| component_name | The name of the detector component. |
|
inline |
Get the depth of this trajectory.
|
inline |
Get the hit map associated with this trajectory.
| std::vector< EDEPHit >::iterator EDEPTrajectory::GetHitNear4DPoint | ( | TLorentzVector | point, |
| double | distance, | ||
| double | time ) |
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 TLorentzVector (includes space and time components). |
| distance | The maximum allowed spatial distance. |
| time | The maximum allowed time difference. |
|
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::GetRecursiveDepositedEnergy | ( | component | component_name | ) |
Calculates the deposited energy from scintillation in the specified detector component by a trajectory and all its children.
| component_name | The name of the detector component. |
| double EDEPTrajectory::GetRecursivePrimaryDepositedEnergy | ( | component | component_name | ) |
Calculates the total (scintillation + other) deposited energy in the specified detector component by a trajectory and all its children.
| component_name | The name of the detector component. |
| component EDEPTrajectory::GetStartDetector | ( | ) | const |
Retrieves the component containing the first point of the trajectory.
| double EDEPTrajectory::GetTotalDepositedEnergy | ( | ) |
Calculates the total deposited energy ove all components.
return The total deposited energy in the specified component.
| double EDEPTrajectory::GetTotalRecursiveDepositedEnergy | ( | ) |
Calculates the deposited energy from scintillation over all components.
| component_name | The name of the detector component. |
|
inline |
Get the trajectory points associated with this trajectory.
| std::vector< EDEPTrajectoryPoint > EDEPTrajectory::GetTrajectoryPointsInComponentVect | ( | component | component_name | ) | const |
Get a time-ordered vector of the trajectory points associated with this trajectory, in the specified component.
| std::vector< EDEPTrajectoryPoint > EDEPTrajectory::GetTrajectoryPointsVect | ( | ) | const |
Get the trajectory points associated with this trajectory.
| bool EDEPTrajectory::HasHitAfterTime | ( | double | time | ) | const |
Checks if the trajectory has hits after a specified time.
| time | The time threshold. |
| bool EDEPTrajectory::HasHitBeforeTime | ( | double | time | ) | const |
Checks if the trajectory has hits before a specified time.
| time | The time threshold. |
| bool EDEPTrajectory::HasHitInDetector | ( | component | component_name | ) | const |
Checks if the trajectory has hits in the specified detector component.
| component_name | The name of the detector component. |
| bool EDEPTrajectory::HasHitInTime | ( | double | start_time, |
| double | stop_time ) 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::HasHitNear4DPoint | ( | TLorentzVector | 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 TLorentzVector (includes both space and time). |
| distance | The maximum spatial distance to consider. |
| time | The maximum time difference to consider. |
| bool EDEPTrajectory::HasHitNearPoint | ( | TVector3 | 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 TVector3. |
| distance | The maximum distance to consider. |
| bool EDEPTrajectory::HasHitWithId | ( | int | id | ) | const |
Checks if any hit in the trajectory has the specified ID.
This function searches through all hits in the trajectory and returns true if any hit has a matching ID.
| id | The ID to search for. |
| bool EDEPTrajectory::HasHitWithIdInDetector | ( | int | id, |
| component | component_name ) const |
Checks if the trajectory has a hit with the specified ID in the specified detector component.
| id | The ID of the hit. |
| component_name | The name of the detector component. |
| bool EDEPTrajectory::IsEntering | ( | component | component_name | ) | const |
Checks if the trajectory is entering the specified detector component.
| component_name | The name of the detector component. |
| bool EDEPTrajectory::IsExiting | ( | component | component_name | ) | const |
Checks if the trajectory is exiting the specified detector component.
| component_name | The name of the detector component. |
| bool EDEPTrajectory::IsTrajectorySaturated | ( | ) | const |
Checks if the trajectory is saturated (i.e., has reached the maximum number of points).
| bool EDEPTrajectory::Match | ( | std::string | volume, |
| std::initializer_list< std::string > | names ) const |
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. |
| EDEPTrajectory & EDEPTrajectory::operator= | ( | const EDEPTrajectory & | trj | ) |
Assignment operator for EDEPTrajectory.
Copy assignment operator for the EDEPTrajectory class.
| trj | The EDEPTrajectory object to assign. |
| trj | The EDEPTrajectory object to copy. |
| EDEPTrajectory & EDEPTrajectory::operator= | ( | EDEPTrajectory && | trj | ) |
Move assignment operator for EDEPTrajectory.
Move assignment operator for the EDEPTrajectory class.
| trj | The EDEPTrajectory object to move. |
| bool EDEPTrajectory::operator== | ( | const EDEPTrajectory & | trj | ) |
Equality operator for EDEPTrajectory.
| trj | The EDEPTrajectory object to compare. |
| std::string EDEPTrajectory::Print | ( | std::string & | full_out, |
| int | depth = 100, | ||
| int | current_depth = 0 ) const |
Prints the trajectory information to stdout and stores it in a string.
| full_out | Reference to a string to store the trajectory information. |
| depth | Maximum depth to print. |
| current_depth | Current depth in the tree. |
| bool EDEPTrajectory::RemoveChildWithId | ( | int | child_id | ) |
Removes a child trajectory with the given ID.
| child_id | ID of the child trajectory to remove. |
|
inline |
Set the depth of this trajectory.
| depth | The depth to set. |
|
inline |
Set the ID of this trajectory.
| id | The ID to set. |
|
inline |
Set the parent trajectory of this trajectory.
| parent_trajectory | The parent trajectory to set. |
|
inline |
Set the parent ID of this trajectory.
| parent_id | The parent ID to set. |
| bool EDEPTrajectory::StartsInDetector | ( | component | component_name | ) | const |
Checks if the trajectory has its first TrajectoryPoint in the specified component.
| component_name | The name of the detector component. |