Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
TwoViewCosmicRayRemovalTool.h
Go to the documentation of this file.
1
8#ifndef TWO_VIEW_COSMIC_RAY_REMOVAL_TOOL_H
9#define TWO_VIEW_COSMIC_RAY_REMOVAL_TOOL_H 1
10
12
13namespace lar_content
14{
19{
20public:
21 typedef std::vector<pandora::HitType> HitTypeVector;
26
27private:
28 bool Run(TwoViewDeltaRayMatchingAlgorithm *const pAlgorithm, MatrixType &overlapMatrix);
30
38 bool RemoveCosmicRayHits(const MatrixType::ElementList &elementList) const;
39
48 bool PassElementChecks(const MatrixType::Element &element, const pandora::HitType hitType) const;
49
59 bool IsMuonEndpoint(const MatrixType::Element &element, const pandora::HitType hitType) const;
60
69 bool IsContaminated(const MatrixType::Element &element, const pandora::HitType hitType) const;
70
81 bool IsCloseToLine(const pandora::CartesianVector &hitPosition, const pandora::CartesianVector &lineStart,
82 const pandora::CartesianVector &lineEnd, const float distanceToLine) const;
83
93 bool IsInLineSegment(const pandora::CartesianVector &lowerBoundary, const pandora::CartesianVector &upperBoundary,
94 const pandora::CartesianVector &point) const;
95
105 bool IsBestElement(const MatrixType::Element &element, const pandora::HitType hitType, const MatrixType::ElementList &elementList) const;
106
114 void CreateSeed(const MatrixType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits) const;
115
126 pandora::StatusCode GrowSeed(const MatrixType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits,
127 pandora::CaloHitList &deltaRayRemantHits) const;
128
140 void CollectHitsFromDeltaRay(const pandora::CartesianVector &positionOnMuon, const pandora::CartesianVector &muonDirection,
141 const pandora::Cluster *const pDeltaRayCluster, const float &minDistanceFromMuon, const bool demandCloserToCollected,
142 const pandora::CaloHitList &protectedHits, pandora::CaloHitList &collectedHits) const;
143
152 void SplitDeltaRayCluster(const MatrixType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits,
153 pandora::CaloHitList &deltaRayRemnantHits) const;
154
164 void ReclusterRemnant(const pandora::HitType hitType, const pandora::Cluster *const pMuonCluster,
165 const pandora::Cluster *const pDeltaRayRemnant, pandora::ClusterVector &clusterVector, pandora::PfoVector &pfoVector) const;
166
177 const MatrixType::Element &element, const pandora::HitType hitType, pandora::CartesianPointVector &projectedPositions) const;
178
180 unsigned int m_slidingFitWindow;
186};
187
188} // namespace lar_content
189
190#endif // #ifndef TWO_VIEW_COSMIC_RAY_REMOVAL_TOOL_H
TwoViewDeltaRayMatchingAlgorithm::MatchingType::MatrixType MatrixType
float m_minSeparation
The minimum delta ray - parent muon cluster separation required to investigate delta ray cluster.
float m_distanceToLine
The maximum perpendicular distance of a position to a line for it to be considered close.
bool IsContaminated(const MatrixType::Element &element, const pandora::HitType hitType) const
Determine whether the cluster under investigation has muon contamination.
void SplitDeltaRayCluster(const MatrixType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits, pandora::CaloHitList &deltaRayRemnantHits) const
Fragment the delta ray cluster, refining the matched delta ray cluster perhaps creating significant r...
bool Run(TwoViewDeltaRayMatchingAlgorithm *const pAlgorithm, MatrixType &overlapMatrix)
Run the algorithm tool.
pandora::StatusCode GrowSeed(const MatrixType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits, pandora::CaloHitList &deltaRayRemantHits) const
Examine remaining hits in the delta ray cluster adding them to the delta ray seed or parent muon if a...
void CollectHitsFromDeltaRay(const pandora::CartesianVector &positionOnMuon, const pandora::CartesianVector &muonDirection, const pandora::Cluster *const pDeltaRayCluster, const float &minDistanceFromMuon, const bool demandCloserToCollected, const pandora::CaloHitList &protectedHits, pandora::CaloHitList &collectedHits) const
Collect hits from the delta ray cluster to either keep (demandCloserToCollected == true) or separate ...
unsigned int m_minRemnantClusterSize
The minimum hit number of a remnant cluster for it to be considered significant.
float m_maxDistanceToTrack
The minimum distance of an insignificant remnant cluster from the cosmic ray track for it to be merge...
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
bool RemoveCosmicRayHits(const MatrixType::ElementList &elementList) const
Remove hits from delta ray clusters that belong to the parent muon.
bool IsMuonEndpoint(const MatrixType::Element &element, const pandora::HitType hitType) const
Determine whether the matched clusters suggest that the delta ray is at the endpoint of the cosmic ra...
void CreateSeed(const MatrixType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits) const
Collect hits in the delta ray cluster that lie close to calculated projected positions forming a seed...
pandora::StatusCode ProjectDeltaRayPositions(const MatrixType::Element &element, const pandora::HitType hitType, pandora::CartesianPointVector &projectedPositions) const
Use two views of a delta ray pfo to calculate projected positions in a given third view.
bool IsInLineSegment(const pandora::CartesianVector &lowerBoundary, const pandora::CartesianVector &upperBoundary, const pandora::CartesianVector &point) const
Whether the projection of a given position lies on a defined line.
bool IsCloseToLine(const pandora::CartesianVector &hitPosition, const pandora::CartesianVector &lineStart, const pandora::CartesianVector &lineEnd, const float distanceToLine) const
Whether a given position is close to a defined line.
float m_maxDistanceToHit
The maximum distance of a hit from the cosmic ray track for it to be added into the CR.
bool IsBestElement(const MatrixType::Element &element, const pandora::HitType hitType, const MatrixType::ElementList &elementList) const
Determine whether the input element is the best to use to modify the contaminated cluster (best is de...
float m_minContaminationLength
The minimum projected length of a delta ray cluster onto the muon track for it to be considered conta...
unsigned int m_slidingFitWindow
The sliding fit window used in cosmic ray parameterisations.
void ReclusterRemnant(const pandora::HitType hitType, const pandora::Cluster *const pMuonCluster, const pandora::Cluster *const pDeltaRayRemnant, pandora::ClusterVector &clusterVector, pandora::PfoVector &pfoVector) const
Reculster the remnant cluster, merging insignificant created clusters into the parent muon (if proxim...
bool PassElementChecks(const MatrixType::Element &element, const pandora::HitType hitType) const
Determine whether element satifies simple checks.
CartesianVector class.
Cluster class.
Definition Cluster.h:31
HitType
Calorimeter hit type enum.
std::vector< const Cluster * > ClusterVector
std::vector< const ParticleFlowObject * > PfoVector
std::vector< CartesianVector > CartesianPointVector
MANAGED_CONTAINER< const CaloHit * > CaloHitList
StatusCode
The StatusCode enum.