LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
TwoViewCosmicRayRemovalTool class. More...
#include "TwoViewCosmicRayRemovalTool.h"
Public Types | |
typedef std::vector< pandora::HitType > | HitTypeVector |
typedef TwoViewDeltaRayMatchingAlgorithm::MatchingType::MatrixType | MatrixType |
typedef std::vector< MatrixType::ElementList::const_iterator > | IteratorList |
Public Member Functions | |
TwoViewCosmicRayRemovalTool () | |
Default constructor. More... | |
Public Attributes | |
TwoViewDeltaRayMatchingAlgorithm * | m_pParentAlgorithm |
Address of the parent matching algorithm. More... | |
Private Member Functions | |
bool | Run (TwoViewDeltaRayMatchingAlgorithm *const pAlgorithm, MatrixType &overlapMatrix) |
Run the algorithm tool. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
bool | RemoveCosmicRayHits (const MatrixType::ElementList &elementList) const |
Remove hits from delta ray clusters that belong to the parent muon. More... | |
bool | PassElementChecks (const MatrixType::Element &element, const pandora::HitType hitType) const |
Determine whether element satifies simple checks. More... | |
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 ray (and is likely to be a michel) More... | |
bool | IsContaminated (const MatrixType::Element &element, const pandora::HitType hitType) const |
Determine whether the cluster under investigation has muon contamination. More... | |
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. More... | |
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. More... | |
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 defined by the total hit count) More... | |
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 to later grow. More... | |
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 appropriate and a separate list if not. More... | |
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 into a new shower (demandCloserToCollected == false) More... | |
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 remnants in the process. More... | |
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 proximity checks pass) More... | |
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. More... | |
Private Attributes | |
float | m_minSeparation |
The minimum delta ray - parent muon cluster separation required to investigate delta ray cluster. More... | |
unsigned int | m_slidingFitWindow |
The sliding fit window used in cosmic ray parameterisations. More... | |
float | m_distanceToLine |
The maximum perpendicular distance of a position to a line for it to be considered close. More... | |
float | m_minContaminationLength |
The minimum projected length of a delta ray cluster onto the muon track for it to be considered contaminated. More... | |
float | m_maxDistanceToHit |
The maximum distance of a hit from the cosmic ray track for it to be added into the CR. More... | |
unsigned int | m_minRemnantClusterSize |
The minimum hit number of a remnant cluster for it to be considered significant. More... | |
float | m_maxDistanceToTrack |
The minimum distance of an insignificant remnant cluster from the cosmic ray track for it to be merged into the CR. More... | |
TwoViewCosmicRayRemovalTool class.
Definition at line 18 of file TwoViewCosmicRayRemovalTool.h.
typedef std::vector<pandora::HitType> lar_content::TwoViewCosmicRayRemovalTool::HitTypeVector |
Definition at line 21 of file TwoViewCosmicRayRemovalTool.h.
|
inherited |
Definition at line 203 of file TwoViewDeltaRayMatchingAlgorithm.h.
|
inherited |
Definition at line 202 of file TwoViewDeltaRayMatchingAlgorithm.h.
lar_content::TwoViewCosmicRayRemovalTool::TwoViewCosmicRayRemovalTool | ( | ) |
Default constructor.
Definition at line 22 of file TwoViewCosmicRayRemovalTool.cc.
|
private |
Collect hits from the delta ray cluster to either keep (demandCloserToCollected == true) or separate into a new shower (demandCloserToCollected == false)
positionOnMuon | the parameterised muon position |
muonDirection | the parameterised muon direction |
pDeltaRayCluster | the delta ray cluster under investigation |
minDistanceFromMuon | the minimum distance of a hit from the muon track for it to not belong to the muon |
demandCloserToCollected | whether to demand a hit be closer to the collected hits than to the muon hits for it to be collected |
protectedHits | the hits that are protected from being collected |
collectedHits | the output list of collected hits |
Definition at line 374 of file TwoViewCosmicRayRemovalTool.cc.
References lar_content::LArClusterHelper::GetClosestDistance().
Referenced by GrowSeed().
|
private |
Collect hits in the delta ray cluster that lie close to calculated projected positions forming a seed to later grow.
element | the matrix element |
hitType | the hit type of the cluster under investigation |
collectedHits | the output list of identified delta ray hits |
Definition at line 302 of file TwoViewCosmicRayRemovalTool.cc.
References f, lar_content::LArClusterHelper::GetClosestDistance(), lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster(), m_maxDistanceToHit, lar_content::DeltaRayMatrixTool::m_pParentAlgorithm, lar_content::NViewDeltaRayMatchingAlgorithm< T >::ParameteriseMuon(), ProjectDeltaRayPositions(), and lar_content::LArClusterHelper::SortHitsByPosition().
Referenced by RemoveCosmicRayHits().
|
private |
Examine remaining hits in the delta ray cluster adding them to the delta ray seed or parent muon if appropriate and a separate list if not.
element | the matrix element |
hitType | the hit type of the cluster under investigation |
collectedHits | the list of identified delta ray hits |
deltaRayRemantHits | the list of remainder hits |
Definition at line 349 of file TwoViewCosmicRayRemovalTool.cc.
References CollectHitsFromDeltaRay(), f, lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetMuonCluster(), m_maxDistanceToHit, lar_content::DeltaRayMatrixTool::m_pParentAlgorithm, and lar_content::NViewDeltaRayMatchingAlgorithm< T >::ParameteriseMuon().
Referenced by RemoveCosmicRayHits().
|
private |
Determine whether the input element is the best to use to modify the contaminated cluster (best is defined by the total hit count)
element | the matrix element |
hitType | the hit type of the cluster under investigation |
elementList | the matrix element list |
Definition at line 274 of file TwoViewCosmicRayRemovalTool.cc.
References lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster(), lar_content::DeltaRayMatrixTool::m_pParentAlgorithm, and PassElementChecks().
Referenced by RemoveCosmicRayHits().
|
private |
Whether a given position is close to a defined line.
hitPosition | the input position |
lineStart | the start position of the line |
lineEnd | the end position of the line |
distanceToLine | the definition of close |
Definition at line 234 of file TwoViewCosmicRayRemovalTool.cc.
Referenced by IsContaminated().
|
private |
Determine whether the cluster under investigation has muon contamination.
element | the matrix element |
hitType | the hit type of the cluster under investigation |
Definition at line 177 of file TwoViewCosmicRayRemovalTool.cc.
References f, lar_content::LArClusterHelper::GetClosestPositions(), lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster(), lar_content::TwoDSlidingFitResult::GetGlobalDirection(), lar_content::TwoDSlidingFitResult::GetLayerFitResultMap(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetMuonCluster(), lar_content::LArGeometryHelper::GetWirePitch(), IsCloseToLine(), IsInLineSegment(), m_distanceToLine, m_minContaminationLength, lar_content::DeltaRayMatrixTool::m_pParentAlgorithm, and m_slidingFitWindow.
Referenced by RemoveCosmicRayHits().
|
private |
Whether the projection of a given position lies on a defined line.
lowerBoundary | the start position of the line |
upperBoundary | the end position of the line |
point | the input position |
Definition at line 250 of file TwoViewCosmicRayRemovalTool.cc.
Referenced by IsContaminated().
|
private |
Determine whether the matched clusters suggest that the delta ray is at the endpoint of the cosmic ray (and is likely to be a michel)
element | the matrix element |
ignoreHitType | whether to ignore the cluster under investigation |
hitTypeToIgnore | the hit type to ignore |
Definition at line 141 of file TwoViewCosmicRayRemovalTool.cc.
References lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster(), lar_content::TwoViewDeltaRayMatchingAlgorithm::GetHitTypeVector(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetMuonCluster(), and lar_content::DeltaRayMatrixTool::m_pParentAlgorithm.
Referenced by PassElementChecks().
|
private |
Determine whether element satifies simple checks.
element | the matrix element |
hitType | the hit type of the cluster under investigation |
Definition at line 123 of file TwoViewCosmicRayRemovalTool.cc.
References lar_content::LArClusterHelper::GetClosestDistance(), lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetMuonCluster(), IsMuonEndpoint(), m_minSeparation, and lar_content::DeltaRayMatrixTool::m_pParentAlgorithm.
Referenced by IsBestElement(), and RemoveCosmicRayHits().
|
private |
Use two views of a delta ray pfo to calculate projected positions in a given third view.
element | the matrix element |
hitType | the view to be projected into |
projectedPositions | the output list of projected positions |
Definition at line 511 of file TwoViewCosmicRayRemovalTool.cc.
References lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetProjectedPositions(), and lar_content::DeltaRayMatrixTool::m_pParentAlgorithm.
Referenced by CreateSeed().
|
private |
Definition at line 529 of file TwoViewCosmicRayRemovalTool.cc.
References m_distanceToLine, m_maxDistanceToHit, m_maxDistanceToTrack, m_minContaminationLength, m_minRemnantClusterSize, m_minSeparation, and m_slidingFitWindow.
|
private |
Reculster the remnant cluster, merging insignificant created clusters into the parent muon (if proximity checks pass)
hitType | the hit type of the cluster under investigation |
pMuonCluster | the address of the parent muon cluster |
pDeltaRayRemnant | the address of the delta ray remnant |
clusterVector | a vector containing the address of created/modified clusters for bookeeping purposes |
pfoVector | a vector containing the address of the pfo to which a modified muon cluster belongs for bookeeping purposes |
Definition at line 471 of file TwoViewCosmicRayRemovalTool.cc.
References lar_content::LArClusterHelper::GetClosestDistance(), lar_content::TwoViewDeltaRayMatchingAlgorithm::GetClusteringAlgName(), lar_content::NViewMatchingAlgorithm< T >::GetClusterListName(), m_maxDistanceToTrack, m_minRemnantClusterSize, and lar_content::DeltaRayMatrixTool::m_pParentAlgorithm.
Referenced by SplitDeltaRayCluster().
|
private |
Remove hits from delta ray clusters that belong to the parent muon.
elementList | the matrix element list |
Definition at line 69 of file TwoViewCosmicRayRemovalTool.cc.
References CreateSeed(), lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster(), lar_content::TwoViewDeltaRayMatchingAlgorithm::GetHitTypeVector(), GrowSeed(), IsBestElement(), IsContaminated(), lar_content::DeltaRayMatrixTool::m_pParentAlgorithm, PassElementChecks(), and SplitDeltaRayCluster().
Referenced by Run().
|
privatevirtual |
Run the algorithm tool.
pAlgorithm | address of the calling algorithm |
overlapTensor | the overlap tensor |
Implements lar_content::DeltaRayMatrixTool.
Definition at line 35 of file TwoViewCosmicRayRemovalTool.cc.
References lar_content::OverlapMatrix< T >::GetConnectedElements(), lar_content::OverlapMatrix< T >::GetSortedKeyClusters(), lar_content::DeltaRayMatrixTool::m_pParentAlgorithm, and RemoveCosmicRayHits().
|
private |
Fragment the delta ray cluster, refining the matched delta ray cluster perhaps creating significant remnants in the process.
element | the matrix element |
hitType | the hit type of the cluster under investigation |
collectedHits | the list of identified delta ray hits |
deltaRayRemantHits | the list of remainder hits |
Definition at line 411 of file TwoViewCosmicRayRemovalTool.cc.
References lar_content::TwoViewDeltaRayMatchingAlgorithm::GetCluster(), lar_content::NViewMatchingAlgorithm< T >::GetClusterListName(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetMuonCluster(), lar_content::DeltaRayMatrixTool::m_pParentAlgorithm, ReclusterRemnant(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::UpdateForNewClusters(), and lar_content::NViewDeltaRayMatchingAlgorithm< T >::UpdateUponDeletion().
Referenced by RemoveCosmicRayHits().
|
private |
The maximum perpendicular distance of a position to a line for it to be considered close.
Definition at line 181 of file TwoViewCosmicRayRemovalTool.h.
Referenced by IsContaminated(), and ReadSettings().
|
private |
The maximum distance of a hit from the cosmic ray track for it to be added into the CR.
Definition at line 183 of file TwoViewCosmicRayRemovalTool.h.
Referenced by CreateSeed(), GrowSeed(), and ReadSettings().
|
private |
The minimum distance of an insignificant remnant cluster from the cosmic ray track for it to be merged into the CR.
Definition at line 185 of file TwoViewCosmicRayRemovalTool.h.
Referenced by ReadSettings(), and ReclusterRemnant().
|
private |
The minimum projected length of a delta ray cluster onto the muon track for it to be considered contaminated.
Definition at line 182 of file TwoViewCosmicRayRemovalTool.h.
Referenced by IsContaminated(), and ReadSettings().
|
private |
The minimum hit number of a remnant cluster for it to be considered significant.
Definition at line 184 of file TwoViewCosmicRayRemovalTool.h.
Referenced by ReadSettings(), and ReclusterRemnant().
|
private |
The minimum delta ray - parent muon cluster separation required to investigate delta ray cluster.
Definition at line 179 of file TwoViewCosmicRayRemovalTool.h.
Referenced by PassElementChecks(), and ReadSettings().
|
inherited |
Address of the parent matching algorithm.
Definition at line 215 of file TwoViewDeltaRayMatchingAlgorithm.h.
Referenced by CreateSeed(), GrowSeed(), IsBestElement(), IsContaminated(), IsMuonEndpoint(), PassElementChecks(), ProjectDeltaRayPositions(), ReclusterRemnant(), RemoveCosmicRayHits(), Run(), and SplitDeltaRayCluster().
|
private |
The sliding fit window used in cosmic ray parameterisations.
Definition at line 180 of file TwoViewCosmicRayRemovalTool.h.
Referenced by IsContaminated(), and ReadSettings().