LArSoft
v09_90_00
Liquid Argon Software toolkit - https://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 |
typedef std::unordered_map< const pandora::ParticleFlowObject *, LArPointingCluster::Vertex > | PfoToPointingVertexMap |
typedef std::unordered_map< const pandora::ParticleFlowObject *, PfoToPointingVertexMap > | PfoToPointingVertexMatrix |
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 | ShiftPfo (const MasterAlgorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pPfoToShift, const pandora::ParticleFlowObject *const pMatchedPfo, const float x0, const PfoToLArTPCMap &pfoToLArTPCMap, const PfoToPointingVertexMatrix &pfoToPointingVertexMatrix) const |
Shift a pfo given its pfo stitching pair. More... | |
bool | CalculateX0 (const PfoToLArTPCMap &pfoToLArTPCMap, const ThreeDPointingClusterMap &pointingClusterMap, const pandora::PfoVector &pfoVector, float &x0, PfoToPointingVertexMatrix &pfoToPointingVertexMatrix) const |
Calculate x0 shift for a group of associated Pfos. More... | |
Private Attributes | |
bool | m_useXcoordinate |
bool | m_alwaysApplyT0Calculation |
int | m_halfWindowLayers |
float | m_minLengthSquared |
float | m_minCosRelativeAngle |
float | m_relaxMinLongitudinalDisplacement |
The minimum value of the longitudinal impact parameter for association if both verticies fall in the detector gap. More... | |
float | m_maxLongitudinalDisplacementX |
float | m_maxTransverseDisplacement |
float | m_relaxCosRelativeAngle |
float | m_relaxTransverseDisplacement |
unsigned int | m_minNCaloHits3D |
float | m_maxX0FractionalDeviation |
The maximum allowed fractional difference of an X0 contribution for matches to be stitched. More... | |
float | m_boundaryToleranceWidth |
The distance from the APA/CPA boundary inside which the deviation consideration is ignored. More... | |
StitchingCosmicRayMergingTool class.
Definition at line 24 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 111 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 122 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 123 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 149 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 202 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 203 of file StitchingCosmicRayMergingTool.h.
|
private |
Definition at line 99 of file StitchingCosmicRayMergingTool.h.
lar_content::StitchingCosmicRayMergingTool::StitchingCosmicRayMergingTool | ( | ) |
Default constructor.
Definition at line 25 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 98 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 129 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 |
pfoToPointingVertexMatrix | map of pfo to a map of matched pfo and the corresponding pointing vertex used in stitching |
Definition at line 666 of file StitchingCosmicRayMergingTool.cc.
References lar_content::LArStitchingHelper::CalculateX0(), lar_content::LArStitchingHelper::CanTPCsBeStitched(), f, lar_content::LArStitchingHelper::GetClosestVertices(), lar_content::LArPointingCluster::Vertex::GetPosition(), lar_content::LArStitchingHelper::GetTPCBoundaryCenterX(), m_boundaryToleranceWidth, and m_maxX0FractionalDeviation.
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 436 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 input mapping between Pfos and their corresponding 3D pointing clusters |
pfoAssociationMatrix | the output matrix of associations between Pfos |
Definition at line 142 of file StitchingCosmicRayMergingTool.cc.
References lar_content::LArStitchingHelper::CanTPCsBeStitched(), f, lar_content::LArPfoHelper::GetCaloHits(), 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::LArGeometryHelper::IsInGap(), lar_content::LArPointingCluster::Vertex::IsInnerVertex(), m_maxLongitudinalDisplacementX, m_maxTransverseDisplacement, m_minCosRelativeAngle, m_minLengthSquared, m_minNCaloHits3D, m_relaxCosRelativeAngle, m_relaxMinLongitudinalDisplacement, m_relaxTransverseDisplacement, m_useXcoordinate, 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 input 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 465 of file StitchingCosmicRayMergingTool.cc.
References util::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 822 of file StitchingCosmicRayMergingTool.cc.
References m_alwaysApplyT0Calculation, m_boundaryToleranceWidth, m_halfWindowLayers, m_maxLongitudinalDisplacementX, m_maxTransverseDisplacement, m_maxX0FractionalDeviation, m_minCosRelativeAngle, m_minLengthSquared, m_minNCaloHits3D, m_relaxCosRelativeAngle, m_relaxMinLongitudinalDisplacement, 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 42 of file StitchingCosmicRayMergingTool.cc.
References BuildPointingClusterMaps(), BuildTPCMaps(), CreatePfoMatches(), OrderPfoMerges(), SelectPfoMatches(), SelectPfoMerges(), SelectPrimaryPfos(), util::size(), 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 295 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 396 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 80 of file StitchingCosmicRayMergingTool.cc.
References lar_content::LArPfoHelper::IsFinalState(), lar_content::LArPfoHelper::IsTrack(), and lar_content::LArPfoHelper::SortByNHits().
Referenced by Run().
|
private |
Shift a pfo given its pfo stitching pair.
pPfoToShift | the pfo of the stitching pair to shift |
pMatchedPfo | the pfo of the stitching pair to remain stationary |
x0 | the distance by which pPfoToShift is to be shifted (direction of shift is determined in method) |
pfoToLArTPCMap | the pfo to lar tpc map |
pfoToPointingVertexMatrix | the map [pfo -> map [matched pfo -> pfo stitching vertex]] |
Definition at line 622 of file StitchingCosmicRayMergingTool.cc.
References f, lar_content::LArPfoHelper::GetAllDownstreamPfos(), lar_content::LArStitchingHelper::GetTPCBoundaryCenterX(), and lar_content::MasterAlgorithm::ShiftPfoHierarchy().
Referenced by StitchPfos().
|
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 545 of file StitchingCosmicRayMergingTool.cc.
References CalculateX0(), lar_content::LArStitchingHelper::CanTPCsBeStitched(), f, m_alwaysApplyT0Calculation, m_useXcoordinate, ShiftPfo(), lar_content::LArPfoHelper::SortByNHits(), and lar_content::MasterAlgorithm::StitchPfos().
Referenced by Run().
|
private |
Definition at line 233 of file StitchingCosmicRayMergingTool.h.
Referenced by ReadSettings(), and StitchPfos().
|
private |
The distance from the APA/CPA boundary inside which the deviation consideration is ignored.
Definition at line 244 of file StitchingCosmicRayMergingTool.h.
Referenced by CalculateX0(), and ReadSettings().
|
private |
Definition at line 234 of file StitchingCosmicRayMergingTool.h.
Referenced by BuildPointingClusterMaps(), and ReadSettings().
|
private |
Definition at line 238 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 239 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
The maximum allowed fractional difference of an X0 contribution for matches to be stitched.
Definition at line 243 of file StitchingCosmicRayMergingTool.h.
Referenced by CalculateX0(), and ReadSettings().
|
private |
Definition at line 236 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 235 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 242 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 240 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
The minimum value of the longitudinal impact parameter for association if both verticies fall in the detector gap.
Definition at line 237 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 241 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), and ReadSettings().
|
private |
Definition at line 232 of file StitchingCosmicRayMergingTool.h.
Referenced by CreatePfoMatches(), ReadSettings(), and StitchPfos().