LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 
13 namespace lar_content
14 {
19 {
20 public:
21  typedef std::vector<pandora::HitType> HitTypeVector;
26 
27 private:
28  bool Run(TwoViewDeltaRayMatchingAlgorithm *const pAlgorithm, MatrixType &overlapMatrix);
29  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
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 
176  pandora::StatusCode ProjectDeltaRayPositions(
177  const MatrixType::Element &element, const pandora::HitType hitType, pandora::CartesianPointVector &projectedPositions) const;
178 
180  unsigned int m_slidingFitWindow;
184  unsigned int m_minRemnantClusterSize;
186 };
187 
188 } // namespace lar_content
189 
190 #endif // #ifndef TWO_VIEW_COSMIC_RAY_REMOVAL_TOOL_H
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...
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_slidingFitWindow
The sliding fit window used in cosmic ray parameterisations.
bool RemoveCosmicRayHits(const MatrixType::ElementList &elementList) const
Remove hits from delta ray clusters that belong to the parent muon.
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...
unsigned int m_minRemnantClusterSize
The minimum hit number of a remnant cluster for it to be considered significant.
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 PassElementChecks(const MatrixType::Element &element, const pandora::HitType hitType) const
Determine whether element satifies simple checks.
float m_distanceToLine
The maximum perpendicular distance of a position to a line for it to be considered close...
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.
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 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 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_maxDistanceToTrack
The minimum distance of an insignificant remnant cluster from the cosmic ray track for it to be merge...
float m_minContaminationLength
The minimum projected length of a delta ray cluster onto the muon track for it to be considered conta...
bool Run(TwoViewDeltaRayMatchingAlgorithm *const pAlgorithm, MatrixType &overlapMatrix)
Run the algorithm tool.
bool IsContaminated(const MatrixType::Element &element, const pandora::HitType hitType) const
Determine whether the cluster under investigation has muon contamination.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
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.
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...
float m_minSeparation
The minimum delta ray - parent muon cluster separation required to investigate delta ray cluster...
HitType
Definition: HitType.h:12
float m_maxDistanceToHit
The maximum distance of a hit from the cosmic ray track for it to be added into the CR...
std::vector< art::Ptr< recob::Cluster > > ClusterVector