LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
CosmicRayRemovalTool class. More...
#include "CosmicRayRemovalTool.h"
Public Types | |
typedef std::vector< pandora::HitType > | HitTypeVector |
typedef ThreeViewDeltaRayMatchingAlgorithm::MatchingType::TensorType | TensorType |
typedef std::vector< TensorType::ElementList::const_iterator > | IteratorList |
Public Member Functions | |
CosmicRayRemovalTool () | |
Default constructor. More... | |
Public Attributes | |
ThreeViewDeltaRayMatchingAlgorithm * | m_pParentAlgorithm |
Address of the parent matching algorithm. More... | |
Protected Member Functions | |
bool | IsMuonEndpoint (const TensorType::Element &element, const bool ignoreHitType, const pandora::HitType hitTypeToIgnore=pandora::TPC_VIEW_U) 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 | IsBestElement (const TensorType::Element &element, const pandora::HitType hitType, const TensorType::ElementList &elementList, const pandora::ClusterSet &modifiedClusters) 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... | |
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... | |
void | FindExtrapolatedHits (const pandora::Cluster *const pCluster, const pandora::CartesianVector &lowerBoundary, const pandora::CartesianVector &upperBoundary, pandora::CaloHitList &collectedHits) const |
Collect the hits that are closest to and can be projected onto a defined line. More... | |
pandora::StatusCode | ProjectDeltaRayPositions (const TensorType::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... | |
Protected Attributes | |
float | m_minSeparation |
The minimum delta ray - parent muon cluster separation required to investigate a delta/cosmic ray cluster. More... | |
float | m_distanceToLine |
The maximum perpendicular distance of a position to a line for it to be considered close. More... | |
Private Member Functions | |
bool | Run (ThreeViewDeltaRayMatchingAlgorithm *const pAlgorithm, TensorType &overlapTensor) |
Run the algorithm tool. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
bool | RemoveCosmicRayHits (const TensorType::ElementList &elementList) const |
Remove hits from delta ray clusters that belong to the parent muon. More... | |
virtual bool | PassElementChecks (const TensorType::Element &element, const pandora::HitType hitType) const |
Determine whether element satifies simple checks. More... | |
bool | IsContaminated (const TensorType::Element &element, const pandora::HitType hitType) const |
Determine whether the cluster under investigation has muon contamination. More... | |
void | CreateSeed (const TensorType::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 TensorType::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 TensorType::Element &element, const pandora::HitType hitType, pandora::CaloHitList &collectedHits, pandora::CaloHitList &deltaRayRemnantHits) const |
Fragment the delta ray cluster adding hits to the muon track and 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 a given remnant cluster, merging insignificant created clusters into the parent muon (if proximity checks pass) More... | |
Private Attributes | |
unsigned int | m_slidingFitWindow |
The sliding fit window used in cosmic ray parameterisations. 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... | |
CosmicRayRemovalTool class.
Definition at line 20 of file CosmicRayRemovalTool.h.
|
inherited |
Definition at line 21 of file RemovalBaseTool.h.
|
inherited |
Definition at line 102 of file ThreeViewDeltaRayMatchingAlgorithm.h.
|
inherited |
Definition at line 101 of file ThreeViewDeltaRayMatchingAlgorithm.h.
lar_content::CosmicRayRemovalTool::CosmicRayRemovalTool | ( | ) |
Default constructor.
Definition at line 23 of file CosmicRayRemovalTool.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 262 of file CosmicRayRemovalTool.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 tensor element |
hitType | the hit type of the cluster under investigation |
collectedHits | the output list of identified delta ray hits |
Definition at line 191 of file CosmicRayRemovalTool.cc.
References f, lar_content::LArClusterHelper::GetClosestDistance(), m_maxDistanceToHit, lar_content::DeltaRayTensorTool::m_pParentAlgorithm, lar_content::NViewDeltaRayMatchingAlgorithm< T >::ParameteriseMuon(), lar_content::RemovalBaseTool::ProjectDeltaRayPositions(), and lar_content::LArClusterHelper::SortHitsByPosition().
Referenced by RemoveCosmicRayHits().
|
protectedinherited |
Collect the hits that are closest to and can be projected onto a defined line.
pCluster | the address of the input cluster containing the hits to be investigated |
lowerBoundary | the start position of the line |
upperBoundary | the end position of the line |
collectedHits | the collected hits |
Definition at line 152 of file RemovalBaseTool.cc.
References lar_content::RemovalBaseTool::IsCloseToLine(), lar_content::RemovalBaseTool::IsInLineSegment(), and lar_content::RemovalBaseTool::m_distanceToLine.
Referenced by lar_content::DeltaRayRemovalTool::IsContaminated().
|
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 tensor 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 238 of file CosmicRayRemovalTool.cc.
References CollectHitsFromDeltaRay(), f, lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetMuonCluster(), m_maxDistanceToHit, lar_content::DeltaRayTensorTool::m_pParentAlgorithm, and lar_content::NViewDeltaRayMatchingAlgorithm< T >::ParameteriseMuon().
Referenced by RemoveCosmicRayHits().
|
protectedinherited |
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 tensor element |
hitType | the hit type of the cluster under investigation |
elementList | the tensor element list |
modifiedClusters | the set of modified clusters |
Definition at line 78 of file RemovalBaseTool.cc.
References lar_content::RemovalBaseTool::PassElementChecks().
Referenced by RemoveCosmicRayHits(), and lar_content::DeltaRayRemovalTool::RemoveDeltaRayHits().
|
protectedinherited |
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 113 of file RemovalBaseTool.cc.
Referenced by lar_content::RemovalBaseTool::FindExtrapolatedHits(), and IsContaminated().
|
private |
Determine whether the cluster under investigation has muon contamination.
element | the tensor element |
hitType | the hit type of the cluster under investigation |
Definition at line 134 of file CosmicRayRemovalTool.cc.
References f, lar_content::LArClusterHelper::GetClosestPositions(), lar_content::TwoDSlidingFitResult::GetGlobalDirection(), lar_content::TwoDSlidingFitResult::GetLayerFitResultMap(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetMuonCluster(), lar_content::LArGeometryHelper::GetWirePitch(), lar_content::RemovalBaseTool::IsCloseToLine(), lar_content::RemovalBaseTool::IsInLineSegment(), lar_content::RemovalBaseTool::m_distanceToLine, m_minContaminationLength, lar_content::DeltaRayTensorTool::m_pParentAlgorithm, and m_slidingFitWindow.
Referenced by RemoveCosmicRayHits().
|
protectedinherited |
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 129 of file RemovalBaseTool.cc.
Referenced by lar_content::RemovalBaseTool::FindExtrapolatedHits(), and IsContaminated().
|
protectedinherited |
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 tensor element |
ignoreHitType | whether to ignore the cluster under investigation |
hitTypeToIgnore | the hit type to ignore |
Definition at line 42 of file RemovalBaseTool.cc.
References lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetMuonCluster(), and lar_content::DeltaRayTensorTool::m_pParentAlgorithm.
Referenced by lar_content::DeltaRayRemovalTool::PassElementChecks(), and PassElementChecks().
|
privatevirtual |
Determine whether element satifies simple checks.
element | the tensor element |
hitType | the hit type of the cluster under investigation |
Implements lar_content::RemovalBaseTool.
Definition at line 123 of file CosmicRayRemovalTool.cc.
References lar_content::RemovalBaseTool::IsMuonEndpoint(), and lar_content::RemovalBaseTool::PassElementChecks().
Referenced by RemoveCosmicRayHits().
|
protectedinherited |
Use two views of a delta ray pfo to calculate projected positions in a given third view.
element | the tensor element |
hitType | the view to be projected into |
projectedPositions | the output list of projected positions |
Definition at line 172 of file RemovalBaseTool.cc.
References lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetProjectedPositions(), and lar_content::DeltaRayTensorTool::m_pParentAlgorithm.
Referenced by CreateSeed().
|
privatevirtual |
Implements lar_content::RemovalBaseTool.
Definition at line 399 of file CosmicRayRemovalTool.cc.
References m_maxDistanceToHit, m_maxDistanceToTrack, m_minContaminationLength, m_minRemnantClusterSize, m_slidingFitWindow, and lar_content::RemovalBaseTool::ReadSettings().
|
private |
Reculster a given 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 359 of file CosmicRayRemovalTool.cc.
References lar_content::LArClusterHelper::GetClosestDistance(), lar_content::ThreeViewDeltaRayMatchingAlgorithm::GetClusteringAlgName(), lar_content::NViewMatchingAlgorithm< T >::GetClusterListName(), m_maxDistanceToTrack, m_minRemnantClusterSize, and lar_content::DeltaRayTensorTool::m_pParentAlgorithm.
Referenced by SplitDeltaRayCluster().
|
private |
Remove hits from delta ray clusters that belong to the parent muon.
elementList | the tensor element list |
Definition at line 68 of file CosmicRayRemovalTool.cc.
References CreateSeed(), GrowSeed(), lar_content::RemovalBaseTool::IsBestElement(), IsContaminated(), PassElementChecks(), and SplitDeltaRayCluster().
Referenced by Run().
|
privatevirtual |
Run the algorithm tool.
pAlgorithm | address of the calling algorithm |
overlapTensor | the overlap tensor |
Implements lar_content::RemovalBaseTool.
Definition at line 34 of file CosmicRayRemovalTool.cc.
References lar_content::OverlapTensor< T >::GetConnectedElements(), lar_content::OverlapTensor< T >::GetSortedKeyClusters(), lar_content::DeltaRayTensorTool::m_pParentAlgorithm, and RemoveCosmicRayHits().
|
private |
Fragment the delta ray cluster adding hits to the muon track and perhaps creating significant remnants in the process.
element | the tensor 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 299 of file CosmicRayRemovalTool.cc.
References lar_content::NViewMatchingAlgorithm< T >::GetClusterListName(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetMuonCluster(), lar_content::DeltaRayTensorTool::m_pParentAlgorithm, ReclusterRemnant(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::UpdateForNewClusters(), and lar_content::NViewDeltaRayMatchingAlgorithm< T >::UpdateUponDeletion().
Referenced by RemoveCosmicRayHits().
|
protectedinherited |
The maximum perpendicular distance of a position to a line for it to be considered close.
Definition at line 115 of file RemovalBaseTool.h.
Referenced by lar_content::RemovalBaseTool::FindExtrapolatedHits(), IsContaminated(), and lar_content::RemovalBaseTool::ReadSettings().
|
private |
The maximum distance of a hit from the cosmic ray track for it to be added into the CR.
Definition at line 123 of file CosmicRayRemovalTool.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 125 of file CosmicRayRemovalTool.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 122 of file CosmicRayRemovalTool.h.
Referenced by IsContaminated(), and ReadSettings().
|
private |
The minimum hit number of a remnant cluster for it to be considered significant.
Definition at line 124 of file CosmicRayRemovalTool.h.
Referenced by ReadSettings(), and ReclusterRemnant().
|
protectedinherited |
The minimum delta ray - parent muon cluster separation required to investigate a delta/cosmic ray cluster.
Definition at line 114 of file RemovalBaseTool.h.
Referenced by lar_content::RemovalBaseTool::PassElementChecks(), and lar_content::RemovalBaseTool::ReadSettings().
|
inherited |
Address of the parent matching algorithm.
Definition at line 114 of file ThreeViewDeltaRayMatchingAlgorithm.h.
Referenced by CreateSeed(), lar_content::AmbiguousDeltaRayTool::ExamineConnectedElements(), lar_content::UnambiguousDeltaRayTool::ExamineUnambiguousElements(), GrowSeed(), lar_content::DeltaRayRemovalTool::IsContaminated(), IsContaminated(), lar_content::RemovalBaseTool::IsMuonEndpoint(), lar_content::DeltaRayMergeTool::MakeOneCommonViewMerges(), lar_content::DeltaRayMergeTool::MakeTwoCommonViewMerges(), lar_content::RemovalBaseTool::PassElementChecks(), lar_content::RemovalBaseTool::ProjectDeltaRayPositions(), ReclusterRemnant(), lar_content::DeltaRayRemovalTool::RemoveDeltaRayHits(), lar_content::DeltaRayMergeTool::Run(), lar_content::UnambiguousDeltaRayTool::Run(), lar_content::AmbiguousDeltaRayTool::Run(), lar_content::DeltaRayRemovalTool::Run(), Run(), SplitDeltaRayCluster(), and lar_content::DeltaRayRemovalTool::SplitMuonCluster().
|
private |
The sliding fit window used in cosmic ray parameterisations.
Definition at line 121 of file CosmicRayRemovalTool.h.
Referenced by IsContaminated(), and ReadSettings().