#ifndef _TrackTruthInfo_hxx_seen #define _TrackTruthInfo_hxx_seen #include #include #include #include #include /// Functions for associating reconstructed tracks and true trajectories namespace TrackTruthInfo { /// Calculate the contribution of all truth trajectories to the /// given set of hits std::map GetG4Trajectories(const COMET::IHitSelection &hits); /// Calculate the contribution of all truth trajectories to the /// given hit std::map GetG4Trajectories(COMET::IHandle hit); /// Calculate the fraction of hits associated with each truth trajectory /// in the given reconstructed track std::map GetG4TrajectoryFractions(const COMET::IHandle track); /// Find the ID of the most common contributing G4 trajectory in the /// given set of hits. int GetG4TrajIDHits(const COMET::IHitSelection &hits); /// Find the ID of the truth trajectory that contributes the most to the /// given reconstructed track int GetG4TrajectoryID(const COMET::IHandle track); /// Find the ID of the most common contributing G4 trajectory in the /// given set of hits. COMET::IHandle GetG4TrajHits(const COMET::IHitSelection &hits); /// Find the ID of the truth trajectory that contributes the most to the /// given reconstructed track COMET::IHandle GetG4Trajectory(const COMET::IHandle track); /// Find the ID of the truth trajectory that contributes the most to the /// given reconstructed track and calculate completeness and cleanliness at the same time COMET::IHandle GetG4Trajectory(const COMET::IHandle track, double &complete, double &clean); /// Check whether the given hit has a contribtution from the given /// G4 trajectory. bool HitMatchesTrajectory(COMET::IHandle hit, int g4id); /// Return the hits which the given G4 trajectory ID contributes to. /// These hits are selected from the given hit selection only. COMET::IHandle GetTrueTrackHits(int g4id, COMET::IHandle universe); /// Find the ID of the truth trajectory that contributes the most to the /// given reconstructed track int GetG4TrajectoryID(const COMET::IHandle track, double &complete, double &clean); /// Get the detector ID for the hit as defined in IReconBase /// given set of hits. int GetG4TrajIDHits(const COMET::IHitSelection &hits, double &complete, double &clean, std::string views="33"); /// Convert a hit to the IReconBase::Status of the module it is in. int HitToDetectorId(COMET::IHandle hit); /// Convert a IGeometryId to the IReconBase::Status of the module it is in. int GeomIdToDetectorId(COMET::IGeometryId geomId); /// Returns the detectors crossed by the true trajectory in terms of a sum of /// IReconBase detector bins (i.e. COMET::IReconBase::kTPC1 ...) int GetDetectorCrossedByG4Traj(COMET::IHandle g4traj); int GetDetectorCrossedByG4Traj(int g4id); /// Find the true hit closest to the state COMET::IG4TrajectoryPoint GetCloserG4Point(COMET::IHandle traj, TVector3 *Position, double &dist); }; #endif