Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
lar_content::TwoViewCosmicRayRemovalTool Class Reference

TwoViewCosmicRayRemovalTool class. More...

#include "TwoViewCosmicRayRemovalTool.h"

Inheritance diagram for lar_content::TwoViewCosmicRayRemovalTool:
Collaboration diagram for lar_content::TwoViewCosmicRayRemovalTool:

Public Types

typedef std::vector< pandora::HitTypeHitTypeVector
 
typedef TwoViewDeltaRayMatchingAlgorithm::MatchingType::MatrixType MatrixType
 
typedef std::vector< MatrixType::ElementList::const_iterator > IteratorList
 

Public Member Functions

 TwoViewCosmicRayRemovalTool ()
 Default constructor.
 
const std::string & GetType () const
 Get the type.
 
const std::string & GetInstanceName () const
 Get the instance name.
 
const PandoraGetPandora () const
 Get the associated pandora instance.
 

Public Attributes

TwoViewDeltaRayMatchingAlgorithmm_pParentAlgorithm
 Address of the parent matching algorithm.
 

Protected Member Functions

virtual StatusCode Initialize ()
 Perform any operations that must occur after reading settings, but before running the process.
 
virtual StatusCode Reset ()
 Perform any operations when pandora is reset, typically at the end of each event.
 
StatusCode RegisterDetails (const Pandora *const pPandora, const std::string &type, const std::string &instanceName)
 Register i) the pandora instance that will run the process and ii) the process type.
 

Protected Attributes

const Pandoram_pPandora
 The pandora object that will run the process.
 
std::string m_type
 The process type.
 
std::string m_instanceName
 The process instance name.
 

Private Member Functions

bool Run (TwoViewDeltaRayMatchingAlgorithm *const pAlgorithm, MatrixType &overlapMatrix)
 Run the algorithm tool.
 
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 PassElementChecks (const MatrixType::Element &element, const pandora::HitType hitType) const
 Determine whether element satifies simple checks.
 
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)
 
bool IsContaminated (const MatrixType::Element &element, const pandora::HitType hitType) const
 Determine whether the cluster under investigation has muon contamination.
 
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 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 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)
 
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.
 
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.
 
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)
 
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.
 
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)
 
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.
 

Private Attributes

float m_minSeparation
 The minimum delta ray - parent muon cluster separation required to investigate delta ray cluster.
 
unsigned int m_slidingFitWindow
 The sliding fit window used in cosmic ray parameterisations.
 
float m_distanceToLine
 The maximum perpendicular distance of a position to a line for it to be considered close.
 
float m_minContaminationLength
 The minimum projected length of a delta ray cluster onto the muon track for it to be considered contaminated.
 
float m_maxDistanceToHit
 The maximum distance of a hit from the cosmic ray track for it to be added into the CR.
 
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 merged into the CR.
 

Detailed Description

Member Typedef Documentation

◆ HitTypeVector

◆ IteratorList

typedef std::vector<MatrixType::ElementList::const_iterator> lar_content::DeltaRayMatrixTool::IteratorList
inherited

Definition at line 203 of file TwoViewDeltaRayMatchingAlgorithm.h.

◆ MatrixType

typedef TwoViewDeltaRayMatchingAlgorithm::MatchingType::MatrixType lar_content::DeltaRayMatrixTool::MatrixType
inherited

Definition at line 202 of file TwoViewDeltaRayMatchingAlgorithm.h.

Constructor & Destructor Documentation

◆ TwoViewCosmicRayRemovalTool()

lar_content::TwoViewCosmicRayRemovalTool::TwoViewCosmicRayRemovalTool ( )

Default constructor.

Definition at line 22 of file TwoViewCosmicRayRemovalTool.cc.

Member Function Documentation

◆ CollectHitsFromDeltaRay()

void lar_content::TwoViewCosmicRayRemovalTool::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
private

Collect hits from the delta ray cluster to either keep (demandCloserToCollected == true) or separate into a new shower (demandCloserToCollected == false)

Parameters
positionOnMuonthe parameterised muon position
muonDirectionthe parameterised muon direction
pDeltaRayClusterthe delta ray cluster under investigation
minDistanceFromMuonthe minimum distance of a hit from the muon track for it to not belong to the muon
demandCloserToCollectedwhether to demand a hit be closer to the collected hits than to the muon hits for it to be collected
protectedHitsthe hits that are protected from being collected
collectedHitsthe output list of collected hits

Definition at line 374 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateSeed()

void lar_content::TwoViewCosmicRayRemovalTool::CreateSeed ( const MatrixType::Element &  element,
const pandora::HitType  hitType,
pandora::CaloHitList collectedHits 
) const
private

Collect hits in the delta ray cluster that lie close to calculated projected positions forming a seed to later grow.

Parameters
elementthe matrix element
hitTypethe hit type of the cluster under investigation
collectedHitsthe output list of identified delta ray hits

Definition at line 302 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInstanceName()

const std::string & pandora::Process::GetInstanceName ( ) const
inlineinherited

Get the instance name.

Returns
The instance name

Definition at line 109 of file Process.h.

◆ GetPandora()

const Pandora & pandora::Process::GetPandora ( ) const
inlineinherited

Get the associated pandora instance.

Returns
the associated pandora instance

Definition at line 116 of file Process.h.

◆ GetType()

const std::string & pandora::Process::GetType ( ) const
inlineinherited

Get the type.

Returns
The type

Definition at line 102 of file Process.h.

◆ GrowSeed()

StatusCode lar_content::TwoViewCosmicRayRemovalTool::GrowSeed ( const MatrixType::Element &  element,
const pandora::HitType  hitType,
pandora::CaloHitList collectedHits,
pandora::CaloHitList deltaRayRemantHits 
) const
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.

Parameters
elementthe matrix element
hitTypethe hit type of the cluster under investigation
collectedHitsthe list of identified delta ray hits
deltaRayRemantHitsthe list of remainder hits
Returns
whether the muon projection mechanics were successful - abort process if not

Definition at line 349 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialize()

StatusCode pandora::Process::Initialize ( )
inlineprotectedvirtualinherited

Perform any operations that must occur after reading settings, but before running the process.

Reimplemented in lar_content::BdtBeamParticleIdTool, lar_content::BeamParticleIdTool, lar_content::CosmicRayTaggingTool, lar_content::EventReadingAlgorithm, lar_content::EventWritingAlgorithm, lar_content::LArPseudoLayerPlugin, lar_content::LArRotationalTransformationPlugin, EventReadingAlgorithm, and EventWritingAlgorithm.

Definition at line 126 of file Process.h.

Here is the caller graph for this function:

◆ IsBestElement()

bool lar_content::TwoViewCosmicRayRemovalTool::IsBestElement ( const MatrixType::Element &  element,
const pandora::HitType  hitType,
const MatrixType::ElementList &  elementList 
) const
private

Determine whether the input element is the best to use to modify the contaminated cluster (best is defined by the total hit count)

Parameters
elementthe matrix element
hitTypethe hit type of the cluster under investigation
elementListthe matrix element list
Returns
whether the input element is the best element

Definition at line 274 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsCloseToLine()

bool lar_content::TwoViewCosmicRayRemovalTool::IsCloseToLine ( const pandora::CartesianVector hitPosition,
const pandora::CartesianVector lineStart,
const pandora::CartesianVector lineEnd,
const float  distanceToLine 
) const
private

Whether a given position is close to a defined line.

Parameters
hitPositionthe input position
lineStartthe start position of the line
lineEndthe end position of the line
distanceToLinethe definition of close
Returns
whether the position is close to the definied line

Definition at line 234 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsContaminated()

bool lar_content::TwoViewCosmicRayRemovalTool::IsContaminated ( const MatrixType::Element &  element,
const pandora::HitType  hitType 
) const
private

Determine whether the cluster under investigation has muon contamination.

Parameters
elementthe matrix element
hitTypethe hit type of the cluster under investigation
Returns
whether the cluster contains muon hits to remove

Definition at line 177 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsInLineSegment()

bool lar_content::TwoViewCosmicRayRemovalTool::IsInLineSegment ( const pandora::CartesianVector lowerBoundary,
const pandora::CartesianVector upperBoundary,
const pandora::CartesianVector point 
) const
private

Whether the projection of a given position lies on a defined line.

Parameters
lowerBoundarythe start position of the line
upperBoundarythe end position of the line
pointthe input position
Returns
whether the position lies between the two points

Definition at line 250 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsMuonEndpoint()

bool lar_content::TwoViewCosmicRayRemovalTool::IsMuonEndpoint ( const MatrixType::Element &  element,
const pandora::HitType  hitType 
) const
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)

Parameters
elementthe matrix element
ignoreHitTypewhether to ignore the cluster under investigation
hitTypeToIgnorethe hit type to ignore
Returns
whether the delta ray is at the endpoint of the cosmic ray

Definition at line 141 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PassElementChecks()

bool lar_content::TwoViewCosmicRayRemovalTool::PassElementChecks ( const MatrixType::Element &  element,
const pandora::HitType  hitType 
) const
private

Determine whether element satifies simple checks.

Parameters
elementthe matrix element
hitTypethe hit type of the cluster under investigation
Returns
whether the checks pass

Definition at line 123 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProjectDeltaRayPositions()

StatusCode lar_content::TwoViewCosmicRayRemovalTool::ProjectDeltaRayPositions ( const MatrixType::Element &  element,
const pandora::HitType  hitType,
pandora::CartesianPointVector projectedPositions 
) const
private

Use two views of a delta ray pfo to calculate projected positions in a given third view.

Parameters
elementthe matrix element
hitTypethe view to be projected into
projectedPositionsthe output list of projected positions
Returns
a status code reflecting whether the procedure ran smoothly and if the outcome is good

Definition at line 511 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadSettings()

StatusCode lar_content::TwoViewCosmicRayRemovalTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Read the algorithm settings.

Parameters
xmlHandlethe relevant xml handle

Implements pandora::Process.

Definition at line 529 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:

◆ ReclusterRemnant()

void lar_content::TwoViewCosmicRayRemovalTool::ReclusterRemnant ( const pandora::HitType  hitType,
const pandora::Cluster *const  pMuonCluster,
const pandora::Cluster *const  pDeltaRayRemnant,
pandora::ClusterVector clusterVector,
pandora::PfoVector pfoVector 
) const
private

Reculster the remnant cluster, merging insignificant created clusters into the parent muon (if proximity checks pass)

Parameters
hitTypethe hit type of the cluster under investigation
pMuonClusterthe address of the parent muon cluster
pDeltaRayRemnantthe address of the delta ray remnant
clusterVectora vector containing the address of created/modified clusters for bookeeping purposes
pfoVectora 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegisterDetails()

StatusCode pandora::Process::RegisterDetails ( const Pandora *const  pPandora,
const std::string &  type,
const std::string &  instanceName 
)
inlineprotectedinherited

Register i) the pandora instance that will run the process and ii) the process type.

Parameters
pPandoraaddress of the pandora object that will run the process
typethe process type
instanceNamethe process instance name

Definition at line 146 of file Process.h.

Here is the caller graph for this function:

◆ RemoveCosmicRayHits()

bool lar_content::TwoViewCosmicRayRemovalTool::RemoveCosmicRayHits ( const MatrixType::ElementList &  elementList) const
private

Remove hits from delta ray clusters that belong to the parent muon.

Parameters
elementListthe matrix element list
Returns
whether any clusters have been modified

Definition at line 69 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reset()

StatusCode pandora::Process::Reset ( )
inlineprotectedvirtualinherited

Perform any operations when pandora is reset, typically at the end of each event.

Reimplemented in lar_content::MasterAlgorithm, lar_content::PostProcessingAlgorithm, and lar_content::PreProcessingAlgorithm.

Definition at line 133 of file Process.h.

Here is the caller graph for this function:

◆ Run()

bool lar_content::TwoViewCosmicRayRemovalTool::Run ( TwoViewDeltaRayMatchingAlgorithm *const  pAlgorithm,
MatrixType matrixTensor 
)
privatevirtual

Run the algorithm tool.

Parameters
pAlgorithmaddress of the calling algorithm
overlapTensorthe overlap tensor
Returns
whether changes have been made by the tool

Implements lar_content::DeltaRayMatrixTool.

Definition at line 35 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:

◆ SplitDeltaRayCluster()

void lar_content::TwoViewCosmicRayRemovalTool::SplitDeltaRayCluster ( const MatrixType::Element &  element,
const pandora::HitType  hitType,
pandora::CaloHitList collectedHits,
pandora::CaloHitList deltaRayRemnantHits 
) const
private

Fragment the delta ray cluster, refining the matched delta ray cluster perhaps creating significant remnants in the process.

Parameters
elementthe matrix element
hitTypethe hit type of the cluster under investigation
collectedHitsthe list of identified delta ray hits
deltaRayRemantHitsthe list of remainder hits

Definition at line 411 of file TwoViewCosmicRayRemovalTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_distanceToLine

float lar_content::TwoViewCosmicRayRemovalTool::m_distanceToLine
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.

◆ m_instanceName

std::string pandora::Process::m_instanceName
protectedinherited

The process instance name.

Definition at line 89 of file Process.h.

◆ m_maxDistanceToHit

float lar_content::TwoViewCosmicRayRemovalTool::m_maxDistanceToHit
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.

◆ m_maxDistanceToTrack

float lar_content::TwoViewCosmicRayRemovalTool::m_maxDistanceToTrack
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.

◆ m_minContaminationLength

float lar_content::TwoViewCosmicRayRemovalTool::m_minContaminationLength
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.

◆ m_minRemnantClusterSize

unsigned int lar_content::TwoViewCosmicRayRemovalTool::m_minRemnantClusterSize
private

The minimum hit number of a remnant cluster for it to be considered significant.

Definition at line 184 of file TwoViewCosmicRayRemovalTool.h.

◆ m_minSeparation

float lar_content::TwoViewCosmicRayRemovalTool::m_minSeparation
private

The minimum delta ray - parent muon cluster separation required to investigate delta ray cluster.

Definition at line 179 of file TwoViewCosmicRayRemovalTool.h.

◆ m_pPandora

const Pandora* pandora::Process::m_pPandora
protectedinherited

The pandora object that will run the process.

Definition at line 87 of file Process.h.

◆ m_pParentAlgorithm

TwoViewDeltaRayMatchingAlgorithm* lar_content::DeltaRayMatrixTool::m_pParentAlgorithm
inherited

Address of the parent matching algorithm.

Definition at line 215 of file TwoViewDeltaRayMatchingAlgorithm.h.

◆ m_slidingFitWindow

unsigned int lar_content::TwoViewCosmicRayRemovalTool::m_slidingFitWindow
private

The sliding fit window used in cosmic ray parameterisations.

Definition at line 180 of file TwoViewCosmicRayRemovalTool.h.

◆ m_type

std::string pandora::Process::m_type
protectedinherited

The process type.

Definition at line 88 of file Process.h.


The documentation for this class was generated from the following files: