EventSlicingTool class. More...
#include <EventSlicingTool.h>
Public Member Functions | |
EventSlicingTool () | |
Default constructor. More... | |
void | RunSlicing (const pandora::Algorithm *const pAlgorithm, const SlicingAlgorithm::HitTypeToNameMap &caloHitListNames, const SlicingAlgorithm::HitTypeToNameMap &clusterListNames, SlicingAlgorithm::SliceList &sliceList) |
Run the slicing tool. More... | |
Private Types | |
typedef std::unordered_map < const pandora::Cluster *, const pandora::ParticleFlowObject * > | ClusterToPfoMap |
typedef std::vector < pandora::ClusterVector > | ClusterSliceList |
typedef std::unordered_map < const pandora::Cluster *, unsigned int > | ClusterToSliceIndexMap |
typedef KDTreeLinkerAlgo < const pandora::CartesianVector *, 2 > | PointKDTree2D |
typedef KDTreeNodeInfoT< const pandora::CartesianVector *, 2 > | PointKDNode2D |
typedef std::vector < PointKDNode2D > | PointKDNode2DList |
typedef std::list< const pandora::CartesianVector * > | PointList |
typedef std::unordered_map < const pandora::CartesianVector *, unsigned int > | PointToSliceIndexMap |
Private Member Functions | |
void | CopyAllHitsToSingleSlice (const pandora::Algorithm *const pAlgorithm, const SlicingAlgorithm::HitTypeToNameMap &caloHitListNames, SlicingAlgorithm::SliceList &sliceList) const |
Copy all the input hits in an event into a single slice. More... | |
void | GetThreeDClusters (const pandora::Algorithm *const pAlgorithm, const std::string &pfoListName, pandora::ClusterList &clusters3D, ClusterToPfoMap &clusterToPfoMap) const |
Get the 3D clusters from a specified list of pfos, storing the 3D clusters in the provided list and populating a map from 3D cluster to parent pfo. More... | |
void | GetClusterSliceList (const pandora::ClusterList &trackClusters3D, const pandora::ClusterList &showerClusters3D, ClusterSliceList &clusterSliceList) const |
Divide the provided lists of 3D track and shower clusters into slices. More... | |
void | CollectAssociatedClusters (const pandora::Cluster *const pClusterInSlice, const pandora::ClusterVector &candidateClusters, const ThreeDSlidingFitResultMap &trackFitResults, const ThreeDSlidingConeFitResultMap &showerConeFitResults, pandora::ClusterVector &clusterSlice, pandora::ClusterSet &usedClusters) const |
Collect all clusters associated with a provided cluster. More... | |
bool | PassPointing (const pandora::Cluster *const pClusterInSlice, const pandora::Cluster *const pCandidateCluster, const ThreeDSlidingFitResultMap &trackFitResults) const |
Compare the provided clusters to assess whether they are associated via pointing (checks association "both ways") More... | |
bool | PassProximity (const pandora::Cluster *const pClusterInSlice, const pandora::Cluster *const pCandidateCluster) const |
Compare the provided clusters to assess whether they are associated via pointing. More... | |
bool | PassShowerCone (const pandora::Cluster *const pConeCluster, const pandora::Cluster *const pNearbyCluster, const ThreeDSlidingConeFitResultMap &showerConeFitResults) const |
Compare the provided clusters to assess whether they are associated via cone fits to the shower cluster (single "direction" check) More... | |
bool | CheckClosestApproach (const LArPointingCluster &cluster1, const LArPointingCluster &cluster2) const |
Check closest approach metrics for a pair of pointing clusters. More... | |
bool | CheckClosestApproach (const LArPointingCluster::Vertex &vertex1, const LArPointingCluster::Vertex &vertex2) const |
Check closest approach metrics for a pair of pointing cluster vertices. More... | |
bool | IsNode (const LArPointingCluster &cluster1, const LArPointingCluster &cluster2) const |
Check whether a pair of pointing clusters are nodally associated. More... | |
bool | IsEmission (const LArPointingCluster &cluster1, const LArPointingCluster &cluster2) const |
Check whether a pair of pointing clusters are consistent with an emission. More... | |
void | CreateSlices (const ClusterSliceList &clusterSliceList, SlicingAlgorithm::SliceList &sliceList, ClusterToSliceIndexMap &clusterToSliceIndexMap) const |
Create new slices for each of the groupings of 3D clusters in the provided cluster slice list. More... | |
void | CopyPfoHitsToSlices (const ClusterToSliceIndexMap &clusterToSliceIndexMap, const ClusterToPfoMap &clusterToPfoMap, SlicingAlgorithm::SliceList &sliceList, pandora::ClusterSet &assignedClusters) const |
Use 3D clusters in the cluster slice list, find their parent pfos and assign all hits in all 2D clusters in the pfos to the relevant slice in the output slice list. More... | |
void | GetRemainingClusters (const pandora::Algorithm *const pAlgorithm, const SlicingAlgorithm::HitTypeToNameMap &clusterListNames, const pandora::ClusterSet &assignedClusters, pandora::ClusterList &remainingClusters) const |
Get the list of 2D clusters with hits yets to be assigned to slices. More... | |
void | GetRemainingClusters (const pandora::Algorithm *const pAlgorithm, const std::string &clusterListName, const pandora::ClusterSet &assignedClusters, pandora::ClusterList &remainingClusters) const |
Get the list of 2D clusters (from a named 2D cluster list) with hits yets to be assigned to slices. More... | |
void | AssignRemainingHitsToSlices (const pandora::ClusterList &remainingClusters, const ClusterToSliceIndexMap &clusterToSliceIndexMap, SlicingAlgorithm::SliceList &sliceList) const |
Use the list of remaining 2D clusters to assign all remaining 2D hits to existing slices in the slice list. More... | |
void | GetKDTreeEntries2D (const SlicingAlgorithm::SliceList &sliceList, PointList &pointsU, PointList &pointsV, PointList &pointsW, PointToSliceIndexMap &pointToSliceIndexMap) const |
Use projections of 3D hits already assigned to slices to populate kd trees to aid assignment of remaining clusters. More... | |
void | GetKDTreeEntries3D (const ClusterToSliceIndexMap &clusterToSliceIndexMap, PointList &pointsU, PointList &pointsV, PointList &pointsW, PointToSliceIndexMap &pointToSliceIndexMap) const |
Use 2D hits already assigned to slices to populate kd trees to aid assignment of remaining clusters. More... | |
const PointKDNode2D * | MatchClusterToSlice (const pandora::Cluster *const pCluster2D, PointKDTree2D &kdTree) const |
Use the provided kd tree to efficiently identify the most appropriate slice for the provided 2D cluster. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Static Private Member Functions | |
static bool | SortPoints (const pandora::CartesianVector *const pLhs, const pandora::CartesianVector *const pRhs) |
Sort points (use Z, followed by X, followed by Y) More... | |
Private Attributes | |
std::string | m_trackPfoListName |
The name of the input track pfo list. More... | |
std::string | m_showerPfoListName |
The name of the input shower pfo list. More... | |
unsigned int | m_minHitsPer3DCluster |
The minimum number of hits in a 3D cluster to warrant consideration in slicing. More... | |
unsigned int | m_min3DHitsToSeedNewSlice |
The minimum number of hits in a 3D cluster to seed a new slice. More... | |
unsigned int | m_halfWindowLayers |
The number of layers to use for half-window of sliding fit. More... | |
bool | m_usePointingAssociation |
Whether to use pointing association. More... | |
float | m_minVertexLongitudinalDistance |
Pointing association check: min longitudinal distance cut. More... | |
float | m_maxVertexLongitudinalDistance |
Pointing association check: max longitudinal distance cut. More... | |
float | m_maxVertexTransverseDistance |
Pointing association check: max transverse distance cut. More... | |
float | m_vertexAngularAllowance |
Pointing association check: pointing angular allowance in degrees. More... | |
float | m_maxClosestApproach |
Pointing association: max distance of closest approach between straight line fits. More... | |
float | m_maxInterceptDistance |
Pointing association: max distance from cluster vertex to point of closest approach. More... | |
bool | m_useProximityAssociation |
Whether to use proximity association. More... | |
float | m_maxHitSeparationSquared |
Proximity association: max distance allowed between the closest pair of hits. More... | |
bool | m_useShowerConeAssociation |
Whether to use shower cone association. More... | |
unsigned int | m_nConeFitLayers |
The number of layers over which to sum fitted direction to obtain cone fit. More... | |
unsigned int | m_nConeFits |
The number of cone fits to perform, spread roughly uniformly along the shower length. More... | |
float | m_coneLengthMultiplier |
The cone length multiplier to use when calculating bounded cluster fractions. More... | |
float | m_maxConeLength |
The maximum allowed cone length to use when calculating bounded cluster fractions. More... | |
float | m_coneTanHalfAngle1 |
The cone tan half angle to use when calculating bounded cluster fractions 1. More... | |
float | m_coneBoundedFraction1 |
The minimum cluster bounded fraction for association 1. More... | |
float | m_coneTanHalfAngle2 |
The cone tan half angle to use when calculating bounded cluster fractions 2. More... | |
float | m_coneBoundedFraction2 |
The minimum cluster bounded fraction for association 2. More... | |
bool | m_use3DProjectionsInHitPickUp |
Whether to include 3D cluster projections when assigning remaining clusters to slices. More... | |
EventSlicingTool class.
Definition at line 32 of file EventSlicingTool.h.
|
private |
Definition at line 68 of file EventSlicingTool.h.
|
private |
Definition at line 54 of file EventSlicingTool.h.
|
private |
Definition at line 168 of file EventSlicingTool.h.
|
private |
Definition at line 224 of file EventSlicingTool.h.
|
private |
Definition at line 225 of file EventSlicingTool.h.
|
private |
Definition at line 223 of file EventSlicingTool.h.
|
private |
Definition at line 227 of file EventSlicingTool.h.
|
private |
Definition at line 228 of file EventSlicingTool.h.
lar_content::EventSlicingTool::EventSlicingTool | ( | ) |
Default constructor.
Definition at line 34 of file EventSlicingTool.cc.
|
private |
Use the list of remaining 2D clusters to assign all remaining 2D hits to existing slices in the slice list.
remainingClusters | the list of 2D clusters with hits yet to be assigned to slices |
clusterToSliceIndexMap | the mapping from 3D clusters to index in the slice list |
sliceList | the list containing slices to be populated with 2D hits |
Definition at line 527 of file EventSlicingTool.cc.
|
private |
Check closest approach metrics for a pair of pointing clusters.
cluster1 | the first pointing cluster |
cluster2 | the second pointing cluster |
Definition at line 345 of file EventSlicingTool.cc.
|
private |
Check closest approach metrics for a pair of pointing cluster vertices.
vertex1 | the first pointing cluster vertex |
vertex2 | the second pointing cluster vertex |
Definition at line 355 of file EventSlicingTool.cc.
|
private |
Collect all clusters associated with a provided cluster.
pClusterInSlice | the address of the cluster already in a slice |
candidateClusters | the list of candidate clusters |
trackFitResults | the map of sliding fit results for track candidate clusters |
showerConeFitResults | the map of sliding const fit results for shower candidate clusters |
clusterSlice | the cluster slice |
usedClusters | the list of clusters already added to slices |
Definition at line 228 of file EventSlicingTool.cc.
|
private |
Copy all the input hits in an event into a single slice.
pAlgorithm | the address of the calling algorithm |
caloHitListNames | the hit type to calo hit list name map |
sliceList | the slice list to receive the single new slice |
Definition at line 100 of file EventSlicingTool.cc.
|
private |
Use 3D clusters in the cluster slice list, find their parent pfos and assign all hits in all 2D clusters in the pfos to the relevant slice in the output slice list.
clusterToSliceIndexMap | the mapping from 3D clusters to index in the slice list |
clusterToPfoMap | the mapping from 3D clusters to parent pfos |
sliceList | the list containing slices to be populated with 2D hits |
assignedClusters | to receive the list of 2D clusters with hits assigned to slices |
Definition at line 445 of file EventSlicingTool.cc.
|
private |
Create new slices for each of the groupings of 3D clusters in the provided cluster slice list.
clusterSliceList | the list of 3D clusters, divided into slices (one 3D cluster list per slice) |
sliceList | the slice list to receive the new slices |
clusterToSliceIndexMap | to receive the mapping from 3D clusters to index in the slice list |
Definition at line 423 of file EventSlicingTool.cc.
|
private |
Divide the provided lists of 3D track and shower clusters into slices.
trackClusters3D | the list of 3D track clusters |
showerClusters3D | the list of 3D shower clusters |
clusterSliceList | to receive the list of 3D clusters, divided into slices (one 3D cluster list per slice) |
Definition at line 170 of file EventSlicingTool.cc.
|
private |
Use projections of 3D hits already assigned to slices to populate kd trees to aid assignment of remaining clusters.
sliceList | the slice list |
pointsU | to receive the points in the u view |
pointsV | to receive the points in the v view |
pointsW | to receive the points in the w view |
pointToSliceIndexMap | to receive the mapping from points to slice index |
Definition at line 591 of file EventSlicingTool.cc.
|
private |
Use 2D hits already assigned to slices to populate kd trees to aid assignment of remaining clusters.
clusterToSliceIndexMap | the 3D cluster to slice index map |
pointsU | to receive the points in the u view |
pointsV | to receive the points in the v view |
pointsW | to receive the points in the w view |
pointToSliceIndexMap | to receive the mapping from points to slice index |
Definition at line 625 of file EventSlicingTool.cc.
|
private |
Get the list of 2D clusters with hits yets to be assigned to slices.
pAlgorithm | the address of the calling algorithm |
clusterListNames | the hit type to cluster list name map |
assignedClusters | the list of 2D clusters with hits assigned to slices |
remainingClusters | to receive the list of 2D clusters with hits yet to be assigned to slices |
|
private |
Get the list of 2D clusters (from a named 2D cluster list) with hits yets to be assigned to slices.
pAlgorithm | the address of the calling algorithm |
clusterListName | the cluster list name |
assignedClusters | the list of 2D clusters with hits assigned to slices |
remainingClusters | to receive the list of 2D clusters with hits yet to be assigned to slices |
|
private |
Get the 3D clusters from a specified list of pfos, storing the 3D clusters in the provided list and populating a map from 3D cluster to parent pfo.
pAlgorithm | the address of the calling algorithm |
pfoListName | the pfo list name |
clusters3D | to receive the list of 3D clusters |
clusterToPfoMap | to receive the mapping from 3D clusters to parent pfos |
Definition at line 133 of file EventSlicingTool.cc.
|
private |
Check whether a pair of pointing clusters are consistent with an emission.
cluster1 | the first pointing cluster |
cluster2 | the second pointing cluster |
Definition at line 401 of file EventSlicingTool.cc.
|
private |
Check whether a pair of pointing clusters are nodally associated.
cluster1 | the first pointing cluster |
cluster2 | the second pointing cluster |
Definition at line 379 of file EventSlicingTool.cc.
|
private |
Use the provided kd tree to efficiently identify the most appropriate slice for the provided 2D cluster.
pCluster2D | the address of the 2D cluster |
kdTree | the kd tree |
Definition at line 667 of file EventSlicingTool.cc.
|
private |
Compare the provided clusters to assess whether they are associated via pointing (checks association "both ways")
pClusterInSlice | address of a cluster already in the slice |
pCandidateCluster | address of the candidate cluster |
trackFitResults | the map of sliding fit results for track candidate clusters |
Definition at line 257 of file EventSlicingTool.cc.
|
private |
Compare the provided clusters to assess whether they are associated via pointing.
pClusterInSlice | address of a cluster already in the slice |
pCandidateCluster | address of the candidate cluster |
Definition at line 280 of file EventSlicingTool.cc.
|
private |
Compare the provided clusters to assess whether they are associated via cone fits to the shower cluster (single "direction" check)
pClusterInSlice | address of a cluster already in the slice |
pCandidateCluster | address of the candidate cluster |
showerConeFitResults | the map of sliding cone fit results for shower candidate clusters |
Definition at line 304 of file EventSlicingTool.cc.
|
private |
Definition at line 726 of file EventSlicingTool.cc.
|
virtual |
Run the slicing tool.
pAlgorithm | address of the calling algorithm |
caloHitListNames | the hit type to calo hit list name map |
clusterListNames | the hit type to cluster list name map |
sliceList | to receive the populated slice list |
Implements lar_content::EventSlicingBaseTool.
Definition at line 62 of file EventSlicingTool.cc.
|
staticprivate |
Sort points (use Z, followed by X, followed by Y)
pLhs | address of first point |
pRhs | address of second point |
Definition at line 711 of file EventSlicingTool.cc.
|
private |
The minimum cluster bounded fraction for association 1.
Definition at line 298 of file EventSlicingTool.h.
|
private |
The minimum cluster bounded fraction for association 2.
Definition at line 300 of file EventSlicingTool.h.
|
private |
The cone length multiplier to use when calculating bounded cluster fractions.
Definition at line 295 of file EventSlicingTool.h.
|
private |
The cone tan half angle to use when calculating bounded cluster fractions 1.
Definition at line 297 of file EventSlicingTool.h.
|
private |
The cone tan half angle to use when calculating bounded cluster fractions 2.
Definition at line 299 of file EventSlicingTool.h.
|
private |
The number of layers to use for half-window of sliding fit.
Definition at line 279 of file EventSlicingTool.h.
|
private |
Pointing association: max distance of closest approach between straight line fits.
Definition at line 286 of file EventSlicingTool.h.
|
private |
The maximum allowed cone length to use when calculating bounded cluster fractions.
Definition at line 296 of file EventSlicingTool.h.
|
private |
Proximity association: max distance allowed between the closest pair of hits.
Definition at line 290 of file EventSlicingTool.h.
|
private |
Pointing association: max distance from cluster vertex to point of closest approach.
Definition at line 287 of file EventSlicingTool.h.
|
private |
Pointing association check: max longitudinal distance cut.
Definition at line 283 of file EventSlicingTool.h.
|
private |
Pointing association check: max transverse distance cut.
Definition at line 284 of file EventSlicingTool.h.
|
private |
The minimum number of hits in a 3D cluster to seed a new slice.
Definition at line 278 of file EventSlicingTool.h.
|
private |
The minimum number of hits in a 3D cluster to warrant consideration in slicing.
Definition at line 277 of file EventSlicingTool.h.
|
private |
Pointing association check: min longitudinal distance cut.
Definition at line 282 of file EventSlicingTool.h.
|
private |
The number of layers over which to sum fitted direction to obtain cone fit.
Definition at line 293 of file EventSlicingTool.h.
|
private |
The number of cone fits to perform, spread roughly uniformly along the shower length.
Definition at line 294 of file EventSlicingTool.h.
|
private |
The name of the input shower pfo list.
Definition at line 275 of file EventSlicingTool.h.
|
private |
The name of the input track pfo list.
Definition at line 274 of file EventSlicingTool.h.
|
private |
Whether to include 3D cluster projections when assigning remaining clusters to slices.
Definition at line 302 of file EventSlicingTool.h.
|
private |
Whether to use pointing association.
Definition at line 281 of file EventSlicingTool.h.
|
private |
Whether to use proximity association.
Definition at line 289 of file EventSlicingTool.h.
|
private |
Whether to use shower cone association.
Definition at line 292 of file EventSlicingTool.h.
|
private |
Pointing association check: pointing angular allowance in degrees.
Definition at line 285 of file EventSlicingTool.h.