LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
StitchingCosmicRayMergingTool class. More...
#include "StitchingCosmicRayMergingTool.h"
Classes | |
class | PfoAssociation |
PfoAssociation class. More... | |
Public Member Functions | |
StitchingCosmicRayMergingTool () | |
Default constructor. More... | |
void | Run (const MasterAlgorithm *const pAlgorithm, const pandora::PfoList *const pMultiPfoList, PfoToLArTPCMap &pfoToLArTPCMap, PfoToFloatMap &stitchedPfosToX0Map) |
Run the algorithm tool. More... | |
Private Types | |
typedef std::unordered_map< const pandora::ParticleFlowObject *, LArPointingCluster > | ThreeDPointingClusterMap |
typedef std::unordered_map< const pandora::LArTPC *, pandora::PfoList > | LArTPCToPfoMap |
typedef std::unordered_map< const pandora::ParticleFlowObject *, PfoAssociation > | PfoAssociationMap |
typedef std::unordered_map< const pandora::ParticleFlowObject *, PfoAssociationMap > | PfoAssociationMatrix |
typedef std::unordered_map< const pandora::ParticleFlowObject *, pandora::PfoList > | PfoMergeMap |
Private Member Functions | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
void | SelectPrimaryPfos (const pandora::PfoList *pInputPfoList, const PfoToLArTPCMap &pfoToLArTPCMap, pandora::PfoList &outputPfoList) const |
Select primary Pfos from the input list of Pfos. More... | |
void | BuildPointingClusterMaps (const pandora::PfoList &inputPfoList, const PfoToLArTPCMap &pfoToLArTPCMap, ThreeDPointingClusterMap &pointingClusterMap) const |
Build a 3D pointing cluster for each Pfo. More... | |
void | BuildTPCMaps (const pandora::PfoList &inputPfoList, const PfoToLArTPCMap &pfoToLArTPCMap, LArTPCToPfoMap &larTPCToPfoMap) const |
Build a list of Pfos for each tpc. More... | |
void | CreatePfoMatches (const LArTPCToPfoMap &larTPCToPfoMap, const ThreeDPointingClusterMap &pointingClusterMap, PfoAssociationMatrix &pfoAssociationMatrix) const |
Create associations between Pfos using 3D pointing clusters. More... | |
void | CreatePfoMatches (const pandora::LArTPC &larTPC1, const pandora::LArTPC &larTPC2, const pandora::ParticleFlowObject *const pPfo1, const pandora::ParticleFlowObject *const pPfo2, const ThreeDPointingClusterMap &pointingClusterMap, PfoAssociationMatrix &pfoAssociationMatrix) const |
Create associations between Pfos using 3D pointing clusters. More... | |
void | SelectPfoMatches (const PfoAssociationMatrix &pfoAssociationMatrix, PfoMergeMap &pfoSelectedMatches) const |
Select the best associations between Pfos; create a mapping between associated Pfos, handling any ambiguities. More... | |
void | SelectPfoMerges (const PfoMergeMap &pfoMatches, PfoMergeMap &pfoMerges) const |
Create an initial map of Pfo merges to be made. More... | |
void | CollectAssociatedPfos (const pandora::ParticleFlowObject *const pSeedPfo, const pandora::ParticleFlowObject *const pCurrentPfo, const PfoMergeMap &pfoMerges, const pandora::PfoSet &vetoSet, pandora::PfoList &associatedList) const |
Collect up associations between Pfos. More... | |
void | OrderPfoMerges (const PfoToLArTPCMap &pfoToLArTPCMap, const ThreeDPointingClusterMap &pointingClusterMap, const PfoMergeMap &inputPfoMerges, PfoMergeMap &outputPfoMerges) const |
Identify the vertex Pfo and then re-order the map of merges so that the vertex Pfo will be enlarged. More... | |
void | StitchPfos (const MasterAlgorithm *const pAlgorithm, const ThreeDPointingClusterMap &pointingClusterMap, const PfoMergeMap &pfoMerges, PfoToLArTPCMap &pfoToLArTPCMap, PfoToFloatMap &stitchedPfosToX0Map) const |
Apply X0 corrections, and then stitch together Pfos. More... | |
void | CalculateX0 (const PfoToLArTPCMap &pfoToLArTPCMap, const ThreeDPointingClusterMap &pointingClusterMap, const pandora::PfoVector &pfoVector, float &x0) const |
Calculate x0 shift for a group of associated Pfos. More... | |
Private Attributes | |
bool | m_useXcoordinate |
int | m_halfWindowLayers |
float | m_minLengthSquared |
float | m_minCosRelativeAngle |
float | m_maxLongitudinalDisplacementX |
float | m_maxTransverseDisplacement |
float | m_relaxCosRelativeAngle |
float | m_relaxTransverseDisplacement |
StitchingCosmicRayMergingTool class.
Definition at line 24 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 109 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 120 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 121 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 146 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 98 of file StitchingCosmicRayMergingTool.h.
lar_content::StitchingCosmicRayMergingTool::StitchingCosmicRayMergingTool | ( | ) |
Default constructor.
Definition at line 24 of file StitchingCosmicRayMergingTool.cc.
|
private |
Build a 3D pointing cluster for each Pfo.
inputPfoList | the input list of Pfos |
pfoToLArTPCMap | the input mapping between Pfos and tpc |
pointingClusterMap | the mapping between Pfos and their corresponding 3D pointing clusters |
Definition at line 93 of file StitchingCosmicRayMergingTool.cc.
References lar_content::LArPfoHelper::GetThreeDClusterList(), and m_halfWindowLayers.
Referenced by Run().
|
private |
Build a list of Pfos for each tpc.
inputPfoList | the input list of Pfos |
pfoToLArTPCMap | the input mapping between Pfos and tpc |
larTPCToPfoMap | the output mapping between tpc and Pfos |
Definition at line 121 of file StitchingCosmicRayMergingTool.cc.
Referenced by Run().
|
private |
Calculate x0 shift for a group of associated Pfos.
pfoToLArTPCMap | the mapping between pfos and tpc |
pointingClusterMap | the mapping between Pfos and their corresponding 3D pointing clusters |
pfoVector | the vector of parent Pfos to stitch together |
x0 | the output x0 value |
Definition at line 557 of file StitchingCosmicRayMergingTool.cc.
References lar_content::LArStitchingHelper::CalculateX0(), lar_content::LArStitchingHelper::CanTPCsBeStitched(), f, and lar_content::LArStitchingHelper::GetClosestVertices().
Referenced by StitchPfos().
|
private |
Collect up associations between Pfos.
pSeedPfo | the seed Pfo (will be enlarged after merging) |
pCurrentPfo | the target Pfo (will be deleted after merging) |
pfoMerges | the list of associations between Pfos |
vetoSet | the set of associated Pfos that have already been considered |
associatedList | the output list of associated Pfos |
Definition at line 408 of file StitchingCosmicRayMergingTool.cc.
Referenced by SelectPfoMerges().
|
private |
Create associations between Pfos using 3D pointing clusters.
larTPCToPfoMap | the input mapping between tpc and Pfos |
pointingClusterMap | the mapping between Pfos and their corresponding 3D pointing clusters |
pfoAssociationMatrix | the output matrix of associations between Pfos |
Definition at line 134 of file StitchingCosmicRayMergingTool.cc.
References lar_content::LArStitchingHelper::CanTPCsBeStitched(), f, lar_content::LArStitchingHelper::GetClosestVertices(), lar_content::LArPointingCluster::Vertex::GetDirection(), lar_content::LArPointingClusterHelper::GetImpactParameters(), lar_content::LArPointingClusterHelper::GetImpactParametersInYZ(), lar_content::LArPointingCluster::GetLengthSquared(), lar_content::LArPointingCluster::Vertex::GetPosition(), lar_content::LArStitchingHelper::GetTPCBoundaryCenterX(), lar_content::LArStitchingHelper::GetTPCBoundaryWidthX(), lar_content::StitchingCosmicRayMergingTool::PfoAssociation::INNER, lar_content::LArPointingCluster::Vertex::IsInnerVertex(), m_maxLongitudinalDisplacementX, m_maxTransverseDisplacement, m_minCosRelativeAngle, m_minLengthSquared, m_relaxCosRelativeAngle, m_relaxTransverseDisplacement, m_useXcoordinate, max, min, lar_content::StitchingCosmicRayMergingTool::PfoAssociation::OUTER, and lar_content::LArStitchingHelper::SortTPCs().
Referenced by Run().
|
private |
Create associations between Pfos using 3D pointing clusters.
larTPC1 | the tpc description for the first Pfo |
larTPC2 | the tpc description for the second Pfo |
pPfo1 | the first Pfo |
pPfo2 | the second Pfo |
pointingClusterMap | the mapping between Pfos and their corresponding 3D pointing clusters |
pfoAssociationMatrix | the output matrix of associations between Pfos |
|
private |
Identify the vertex Pfo and then re-order the map of merges so that the vertex Pfo will be enlarged.
pfoToLArTPCMap | the mapping between pfos and tpc |
pointingClusterMap | the mapping between Pfos and their corresponding 3D pointing clusters |
inputPfoMerges | the input map of Pfo merges |
outputPfoMerges | the re-ordered map of Pfo merges |
Definition at line 437 of file StitchingCosmicRayMergingTool.cc.
References evd::details::begin(), f, lar_content::LArStitchingHelper::GetClosestVertices(), lar_content::LArPointingCluster::GetInnerVertex(), lar_content::LArPointingCluster::GetOuterVertex(), lar_content::LArStitchingHelper::GetTPCDisplacement(), lar_content::LArPointingCluster::Vertex::IsInnerVertex(), and lar_content::LArPfoHelper::SortByNHits().
Referenced by Run().
|
private |
Definition at line 644 of file StitchingCosmicRayMergingTool.cc.
References m_halfWindowLayers, m_maxLongitudinalDisplacementX, m_maxTransverseDisplacement, m_minCosRelativeAngle, m_minLengthSquared, m_relaxCosRelativeAngle, m_relaxTransverseDisplacement, and m_useXcoordinate.
|
virtual |
Run the algorithm tool.
pAlgorithm | address of the calling algorithm |
pMultiPfoList | the list of pfos in multiple lar tpcs |
pfoToLArTPCMap | the pfo to lar tpc map |
stitchedPfosToX0Map | a map of cosmic-ray pfos that have been stitched between lar tpcs to the X0 shift |
Implements lar_content::StitchingBaseTool.
Definition at line 38 of file StitchingCosmicRayMergingTool.cc.
References BuildPointingClusterMaps(), BuildTPCMaps(), CreatePfoMatches(), OrderPfoMerges(), SelectPfoMatches(), SelectPfoMerges(), SelectPrimaryPfos(), and StitchPfos().
|
private |
Select the best associations between Pfos; create a mapping between associated Pfos, handling any ambiguities.
pfoAssociationMatrix | the input list of all associations between Pfos |
pfoSelectedMatches | the output list of good associations between pfos (candidates for merging) |
Definition at line 272 of file StitchingCosmicRayMergingTool.cc.
References f, lar_content::StitchingCosmicRayMergingTool::PfoAssociation::GetDaughter(), lar_content::StitchingCosmicRayMergingTool::PfoAssociation::GetFigureOfMerit(), lar_content::StitchingCosmicRayMergingTool::PfoAssociation::GetParent(), lar_content::StitchingCosmicRayMergingTool::PfoAssociation::INNER, lar_content::StitchingCosmicRayMergingTool::PfoAssociation::OUTER, lar_content::LArPfoHelper::SortByNHits(), and lar_content::StitchingCosmicRayMergingTool::PfoAssociation::UNDEFINED.
Referenced by Run().
|
private |
Create an initial map of Pfo merges to be made.
pfoMatches | the input list of associated Pfos |
pfoMerges | the output mapping between Pfos to enlarge and Pfos to delete |
Definition at line 369 of file StitchingCosmicRayMergingTool.cc.
References CollectAssociatedPfos(), and lar_content::LArPfoHelper::SortByNHits().
Referenced by Run().
|
private |
Select primary Pfos from the input list of Pfos.
pInputPfoList | the input list of Pfos |
pfoToLArTPCMap | the input mapping between Pfos and tpc |
outputPfoList | the output list of Pfos |
Definition at line 75 of file StitchingCosmicRayMergingTool.cc.
References lar_content::LArPfoHelper::IsFinalState(), lar_content::LArPfoHelper::IsTrack(), and lar_content::LArPfoHelper::SortByNHits().
Referenced by Run().
|
private |
Apply X0 corrections, and then stitch together Pfos.
pAlgorithm | the address of the parent stitching algorithm |
pointingClusterMap | the mapping between Pfos and their corresponding 3D pointing clusters |
pfoMerges | the input map of Pfo merges |
pfoToLArTPCMap | the pfo to lar tpc map |
stitchedPfosToX0Map | a map of cosmic-ray pfos that have been stitched between lar tpcs to the X0 shift |
Definition at line 512 of file StitchingCosmicRayMergingTool.cc.
References CalculateX0(), f, m_useXcoordinate, lar_content::MasterAlgorithm::ShiftPfoHierarchy(), lar_content::LArPfoHelper::SortByNHits(), and lar_content::MasterAlgorithm::StitchPfos().
Referenced by Run().
|
private |
Definition at line 211 of file StitchingCosmicRayMergingTool.h.
Referenced by BuildPointingClusterMaps(), and ReadSettings().
|
private |
Definition at line 214 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 215 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 213 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 212 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 216 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 217 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 210 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), ReadSettings(), and StitchPfos().