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

StitchingCosmicRayMergingTool class. More...

#include "StitchingCosmicRayMergingTool.h"

Inheritance diagram for lar_content::StitchingCosmicRayMergingTool:
Collaboration diagram for lar_content::StitchingCosmicRayMergingTool:

Classes

class  PfoAssociation
 PfoAssociation class. More...
 

Public Member Functions

 StitchingCosmicRayMergingTool ()
 Default constructor.
 
void Run (const MasterAlgorithm *const pAlgorithm, const pandora::PfoList *const pMultiPfoList, PfoToLArTPCMap &pfoToLArTPCMap, PfoToFloatMap &stitchedPfosToX0Map)
 Run the algorithm tool.
 
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.
 

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 Types

typedef std::unordered_map< const pandora::ParticleFlowObject *, LArPointingClusterThreeDPointingClusterMap
 
typedef std::unordered_map< const pandora::LArTPC *, pandora::PfoListLArTPCToPfoMap
 
typedef std::unordered_map< const pandora::ParticleFlowObject *, PfoAssociationPfoAssociationMap
 
typedef std::unordered_map< const pandora::ParticleFlowObject *, PfoAssociationMapPfoAssociationMatrix
 
typedef std::unordered_map< const pandora::ParticleFlowObject *, pandora::PfoListPfoMergeMap
 
typedef std::unordered_map< const pandora::ParticleFlowObject *, LArPointingCluster::VertexPfoToPointingVertexMap
 
typedef std::unordered_map< const pandora::ParticleFlowObject *, PfoToPointingVertexMapPfoToPointingVertexMatrix
 

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 Read the algorithm settings.
 
void SelectPrimaryPfos (const pandora::PfoList *pInputPfoList, const PfoToLArTPCMap &pfoToLArTPCMap, pandora::PfoList &outputPfoList) const
 Select primary Pfos from the input list of Pfos.
 
void BuildPointingClusterMaps (const pandora::PfoList &inputPfoList, const PfoToLArTPCMap &pfoToLArTPCMap, ThreeDPointingClusterMap &pointingClusterMap) const
 Build a 3D pointing cluster for each Pfo.
 
void BuildTPCMaps (const pandora::PfoList &inputPfoList, const PfoToLArTPCMap &pfoToLArTPCMap, LArTPCToPfoMap &larTPCToPfoMap) const
 Build a list of Pfos for each tpc.
 
void CreatePfoMatches (const LArTPCToPfoMap &larTPCToPfoMap, const ThreeDPointingClusterMap &pointingClusterMap, PfoAssociationMatrix &pfoAssociationMatrix) const
 Create associations between Pfos using 3D pointing clusters.
 
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.
 
void SelectPfoMatches (const PfoAssociationMatrix &pfoAssociationMatrix, PfoMergeMap &pfoSelectedMatches) const
 Select the best associations between Pfos; create a mapping between associated Pfos, handling any ambiguities.
 
void SelectPfoMerges (const PfoMergeMap &pfoMatches, PfoMergeMap &pfoMerges) const
 Create an initial map of Pfo merges to be made.
 
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.
 
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.
 
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.
 
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.
 
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.
 

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.
 
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.
 
float m_boundaryToleranceWidth
 The distance from the APA/CPA boundary inside which the deviation consideration is ignored.
 

Detailed Description

Member Typedef Documentation

◆ LArTPCToPfoMap

◆ PfoAssociationMap

◆ PfoAssociationMatrix

◆ PfoMergeMap

◆ PfoToPointingVertexMap

◆ PfoToPointingVertexMatrix

◆ ThreeDPointingClusterMap

Constructor & Destructor Documentation

◆ StitchingCosmicRayMergingTool()

lar_content::StitchingCosmicRayMergingTool::StitchingCosmicRayMergingTool ( )

Default constructor.

Definition at line 25 of file StitchingCosmicRayMergingTool.cc.

Member Function Documentation

◆ BuildPointingClusterMaps()

void lar_content::StitchingCosmicRayMergingTool::BuildPointingClusterMaps ( const pandora::PfoList inputPfoList,
const PfoToLArTPCMap pfoToLArTPCMap,
ThreeDPointingClusterMap pointingClusterMap 
) const
private

Build a 3D pointing cluster for each Pfo.

Parameters
inputPfoListthe input list of Pfos
pfoToLArTPCMapthe input mapping between Pfos and tpc
pointingClusterMapthe mapping between Pfos and their corresponding 3D pointing clusters

Definition at line 98 of file StitchingCosmicRayMergingTool.cc.

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

◆ BuildTPCMaps()

void lar_content::StitchingCosmicRayMergingTool::BuildTPCMaps ( const pandora::PfoList inputPfoList,
const PfoToLArTPCMap pfoToLArTPCMap,
LArTPCToPfoMap larTPCToPfoMap 
) const
private

Build a list of Pfos for each tpc.

Parameters
inputPfoListthe input list of Pfos
pfoToLArTPCMapthe input mapping between Pfos and tpc
larTPCToPfoMapthe output mapping between tpc and Pfos

Definition at line 129 of file StitchingCosmicRayMergingTool.cc.

Here is the caller graph for this function:

◆ CalculateX0()

bool lar_content::StitchingCosmicRayMergingTool::CalculateX0 ( const PfoToLArTPCMap pfoToLArTPCMap,
const ThreeDPointingClusterMap pointingClusterMap,
const pandora::PfoVector pfoVector,
float &  x0,
PfoToPointingVertexMatrix pfoToPointingVertexMatrix 
) const
private

Calculate x0 shift for a group of associated Pfos.

Parameters
pfoToLArTPCMapthe mapping between pfos and tpc
pointingClusterMapthe mapping between Pfos and their corresponding 3D pointing clusters
pfoVectorthe vector of parent Pfos to stitch together
x0the output x0 value
pfoToPointingVertexMatrixmap of pfo to a map of matched pfo and the corresponding pointing vertex used in stitching
Returns
bool true if all x0 contributions were consistent, false otherwise

Definition at line 662 of file StitchingCosmicRayMergingTool.cc.

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

◆ CollectAssociatedPfos()

void lar_content::StitchingCosmicRayMergingTool::CollectAssociatedPfos ( const pandora::ParticleFlowObject *const  pSeedPfo,
const pandora::ParticleFlowObject *const  pCurrentPfo,
const PfoMergeMap pfoMerges,
const pandora::PfoSet vetoSet,
pandora::PfoList associatedList 
) const
private

Collect up associations between Pfos.

Parameters
pSeedPfothe seed Pfo (will be enlarged after merging)
pCurrentPfothe target Pfo (will be deleted after merging)
pfoMergesthe list of associations between Pfos
vetoSetthe set of associated Pfos that have already been considered
associatedListthe output list of associated Pfos

Definition at line 432 of file StitchingCosmicRayMergingTool.cc.

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

◆ CreatePfoMatches() [1/2]

void lar_content::StitchingCosmicRayMergingTool::CreatePfoMatches ( const LArTPCToPfoMap larTPCToPfoMap,
const ThreeDPointingClusterMap pointingClusterMap,
PfoAssociationMatrix pfoAssociationMatrix 
) const
private

Create associations between Pfos using 3D pointing clusters.

Parameters
larTPCToPfoMapthe input mapping between tpc and Pfos
pointingClusterMapthe input mapping between Pfos and their corresponding 3D pointing clusters
pfoAssociationMatrixthe output matrix of associations between Pfos

Definition at line 142 of file StitchingCosmicRayMergingTool.cc.

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

◆ CreatePfoMatches() [2/2]

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

Create associations between Pfos using 3D pointing clusters.

Parameters
larTPC1the tpc description for the first Pfo
larTPC2the tpc description for the second Pfo
pPfo1the first Pfo
pPfo2the second Pfo
pointingClusterMapthe input mapping between Pfos and their corresponding 3D pointing clusters
pfoAssociationMatrixthe output matrix of associations between Pfos

Definition at line 174 of file StitchingCosmicRayMergingTool.cc.

Here is the call 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.

◆ 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:

◆ OrderPfoMerges()

void lar_content::StitchingCosmicRayMergingTool::OrderPfoMerges ( const PfoToLArTPCMap pfoToLArTPCMap,
const ThreeDPointingClusterMap pointingClusterMap,
const PfoMergeMap inputPfoMerges,
PfoMergeMap outputPfoMerges 
) const
private

Identify the vertex Pfo and then re-order the map of merges so that the vertex Pfo will be enlarged.

Parameters
pfoToLArTPCMapthe mapping between pfos and tpc
pointingClusterMapthe mapping between Pfos and their corresponding 3D pointing clusters
inputPfoMergesthe input map of Pfo merges
outputPfoMergesthe re-ordered map of Pfo merges

Definition at line 461 of file StitchingCosmicRayMergingTool.cc.

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

◆ ReadSettings()

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

Read the algorithm settings.

Parameters
xmlHandlethe relevant xml handle

Implements pandora::Process.

Definition at line 818 of file StitchingCosmicRayMergingTool.cc.

Here is the call 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:

◆ 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()

void lar_content::StitchingCosmicRayMergingTool::Run ( const MasterAlgorithm *const  pAlgorithm,
const pandora::PfoList *const  pMultiPfoList,
PfoToLArTPCMap pfoToLArTPCMap,
PfoToFloatMap stitchedPfosToX0Map 
)
virtual

Run the algorithm tool.

Parameters
pAlgorithmaddress of the calling algorithm
pMultiPfoListthe list of pfos in multiple lar tpcs
pfoToLArTPCMapthe pfo to lar tpc map
stitchedPfosToX0Mapa 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.

Here is the call graph for this function:

◆ SelectPfoMatches()

void lar_content::StitchingCosmicRayMergingTool::SelectPfoMatches ( const PfoAssociationMatrix pfoAssociationMatrix,
PfoMergeMap pfoSelectedMatches 
) const
private

Select the best associations between Pfos; create a mapping between associated Pfos, handling any ambiguities.

Parameters
pfoAssociationMatrixthe input list of all associations between Pfos
pfoSelectedMatchesthe output list of good associations between pfos (candidates for merging)

Definition at line 291 of file StitchingCosmicRayMergingTool.cc.

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

◆ SelectPfoMerges()

void lar_content::StitchingCosmicRayMergingTool::SelectPfoMerges ( const PfoMergeMap pfoMatches,
PfoMergeMap pfoMerges 
) const
private

Create an initial map of Pfo merges to be made.

Parameters
pfoMatchesthe input list of associated Pfos
pfoMergesthe output mapping between Pfos to enlarge and Pfos to delete

Definition at line 392 of file StitchingCosmicRayMergingTool.cc.

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

◆ SelectPrimaryPfos()

void lar_content::StitchingCosmicRayMergingTool::SelectPrimaryPfos ( const pandora::PfoList pInputPfoList,
const PfoToLArTPCMap pfoToLArTPCMap,
pandora::PfoList outputPfoList 
) const
private

Select primary Pfos from the input list of Pfos.

Parameters
pInputPfoListthe input list of Pfos
pfoToLArTPCMapthe input mapping between Pfos and tpc
outputPfoListthe output list of Pfos

Definition at line 80 of file StitchingCosmicRayMergingTool.cc.

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

◆ ShiftPfo()

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

Shift a pfo given its pfo stitching pair.

Parameters
pPfoToShiftthe pfo of the stitching pair to shift
pMatchedPfothe pfo of the stitching pair to remain stationary
x0the distance by which pPfoToShift is to be shifted (direction of shift is determined in method)
pfoToLArTPCMapthe pfo to lar tpc map
pfoToPointingVertexMatrixthe map [pfo -> map [matched pfo -> pfo stitching vertex]]

Definition at line 618 of file StitchingCosmicRayMergingTool.cc.

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

◆ StitchPfos()

void lar_content::StitchingCosmicRayMergingTool::StitchPfos ( const MasterAlgorithm *const  pAlgorithm,
const ThreeDPointingClusterMap pointingClusterMap,
const PfoMergeMap pfoMerges,
PfoToLArTPCMap pfoToLArTPCMap,
PfoToFloatMap stitchedPfosToX0Map 
) const
private

Apply X0 corrections, and then stitch together Pfos.

Parameters
pAlgorithmthe address of the parent stitching algorithm
pointingClusterMapthe mapping between Pfos and their corresponding 3D pointing clusters
pfoMergesthe input map of Pfo merges
pfoToLArTPCMapthe pfo to lar tpc map
stitchedPfosToX0Mapa map of cosmic-ray pfos that have been stitched between lar tpcs to the X0 shift

Definition at line 541 of file StitchingCosmicRayMergingTool.cc.

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

Member Data Documentation

◆ m_alwaysApplyT0Calculation

bool lar_content::StitchingCosmicRayMergingTool::m_alwaysApplyT0Calculation
private

Definition at line 232 of file StitchingCosmicRayMergingTool.h.

◆ m_boundaryToleranceWidth

float lar_content::StitchingCosmicRayMergingTool::m_boundaryToleranceWidth
private

The distance from the APA/CPA boundary inside which the deviation consideration is ignored.

Definition at line 243 of file StitchingCosmicRayMergingTool.h.

◆ m_halfWindowLayers

int lar_content::StitchingCosmicRayMergingTool::m_halfWindowLayers
private

Definition at line 233 of file StitchingCosmicRayMergingTool.h.

◆ m_instanceName

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

The process instance name.

Definition at line 89 of file Process.h.

◆ m_maxLongitudinalDisplacementX

float lar_content::StitchingCosmicRayMergingTool::m_maxLongitudinalDisplacementX
private

Definition at line 237 of file StitchingCosmicRayMergingTool.h.

◆ m_maxTransverseDisplacement

float lar_content::StitchingCosmicRayMergingTool::m_maxTransverseDisplacement
private

Definition at line 238 of file StitchingCosmicRayMergingTool.h.

◆ m_maxX0FractionalDeviation

float lar_content::StitchingCosmicRayMergingTool::m_maxX0FractionalDeviation
private

The maximum allowed fractional difference of an X0 contribution for matches to be stitched.

Definition at line 242 of file StitchingCosmicRayMergingTool.h.

◆ m_minCosRelativeAngle

float lar_content::StitchingCosmicRayMergingTool::m_minCosRelativeAngle
private

Definition at line 235 of file StitchingCosmicRayMergingTool.h.

◆ m_minLengthSquared

float lar_content::StitchingCosmicRayMergingTool::m_minLengthSquared
private

Definition at line 234 of file StitchingCosmicRayMergingTool.h.

◆ m_minNCaloHits3D

unsigned int lar_content::StitchingCosmicRayMergingTool::m_minNCaloHits3D
private

Definition at line 241 of file StitchingCosmicRayMergingTool.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_relaxCosRelativeAngle

float lar_content::StitchingCosmicRayMergingTool::m_relaxCosRelativeAngle
private

Definition at line 239 of file StitchingCosmicRayMergingTool.h.

◆ m_relaxMinLongitudinalDisplacement

float lar_content::StitchingCosmicRayMergingTool::m_relaxMinLongitudinalDisplacement
private

The minimum value of the longitudinal impact parameter for association if both verticies fall in the detector gap.

Definition at line 236 of file StitchingCosmicRayMergingTool.h.

◆ m_relaxTransverseDisplacement

float lar_content::StitchingCosmicRayMergingTool::m_relaxTransverseDisplacement
private

Definition at line 240 of file StitchingCosmicRayMergingTool.h.

◆ m_type

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

The process type.

Definition at line 88 of file Process.h.

◆ m_useXcoordinate

bool lar_content::StitchingCosmicRayMergingTool::m_useXcoordinate
private

Definition at line 231 of file StitchingCosmicRayMergingTool.h.


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