LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
CosmicRayTaggingMonitoringTool class. More...
#include "CosmicRayTaggingMonitoringTool.h"
Public Member Functions | |
CosmicRayTaggingMonitoringTool () | |
Default constructor. More... | |
void | FindAmbiguousPfos (const pandora::PfoList &parentCosmicRayPfos, pandora::PfoList &ambiguousPfos, const MasterAlgorithm *const pAlgorithm) |
Find the list of ambiguous pfos (could represent cosmic-ray muons or neutrinos) More... | |
Private Types | |
enum | Classification { CR_MUON, CR_OTHER, TARGET, FRAGMENTED, ABSORBED, MIXED, SPARSE, UNCLASSIFIED } |
typedef std::map< const pandora::ParticleFlowObject *, float > | PfoToFloatMap |
typedef std::map< const pandora::ParticleFlowObject *, Classification > | PfoClassificationMap |
Private Member Functions | |
void | CalculatePfoMetrics (const LArMCParticleHelper::PfoToMCParticleHitSharingMap &hitSharingMap, const LArMCParticleHelper::PfoContributionMap &pfoToCaloHitListMap, const LArMCParticleHelper::MCContributionMapVector &targetsToGoodHitsMaps, PfoToFloatMap &pfoSignificanceMap, PfoToFloatMap &pfoPurityMap, PfoClassificationMap &pfoClassificationMap) const |
Calculate metrics to classify Pfos based on the target reconstructable MCParticles with which they share hits. More... | |
bool | IsMainMCParticleMuon (const pandora::ParticleFlowObject *const pPfo) const |
Returns true if the main MCParticle of the supplied Pfo is a muon. More... | |
Classification | ClassifyPfo (const unsigned int &nHits, const float &significance, const float &purity, const bool isMuon) const |
Classify a pfo given some metrics. More... | |
LArFormattingHelper::Color | GetClassificationColor (const Classification &classification) const |
Returns a unique color for each possible Pfo classification. More... | |
std::string | GetClassificationName (const Classification &classification) const |
Returns a string for each classification. More... | |
void | PrintPfoTable (const pandora::PfoVector &orderedPfoVector, const LArMCParticleHelper::PfoContributionMap &pfoToReconstructable2DHitsMap, const PfoToFloatMap &pfoPurityMap, const PfoToFloatMap &pfoSignificanceMap, const PfoClassificationMap &pfoClassificationMap, const pandora::PfoList &ambiguousPfos) const |
Prints a table detailing all input Pfos and their classifications. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Read settings. More... | |
Private Attributes | |
LArMCParticleHelper::PrimaryParameters | m_parameters |
Parameters used to decide when an MCParticle is reconstructable. More... | |
unsigned int | m_minHitsToConsiderTagging |
The minimum number of hits to consider a Pfo for tagging. More... | |
float | m_minPurity |
The minimum purity to consider a Pfo as "pure". More... | |
float | m_minImpurity |
The minimum impurity to consider a Pfo as "impure". More... | |
float | m_minSignificance |
The minimum significance to consider a Pfo as "significant". More... | |
std::string | m_caloHitList2D |
The 2D calo hit list. More... | |
CosmicRayTaggingMonitoringTool class.
Definition at line 24 of file CosmicRayTaggingMonitoringTool.h.
|
private |
Definition at line 51 of file CosmicRayTaggingMonitoringTool.h.
|
private |
Definition at line 50 of file CosmicRayTaggingMonitoringTool.h.
Enumerator | |
---|---|
CR_MUON | |
CR_OTHER | |
TARGET | |
FRAGMENTED | |
ABSORBED | |
MIXED | |
SPARSE | |
UNCLASSIFIED |
Definition at line 38 of file CosmicRayTaggingMonitoringTool.h.
lar_content::CosmicRayTaggingMonitoringTool::CosmicRayTaggingMonitoringTool | ( | ) |
Default constructor.
Definition at line 24 of file CosmicRayTaggingMonitoringTool.cc.
|
private |
Calculate metrics to classify Pfos based on the target reconstructable MCParticles with which they share hits.
hitSharingMap | input mapping from Pfos to MCParticles + number of shared hits pairs |
pfoToCaloHitListMap | input mapping from Pfos to their reconstructable 2D hits |
targetsToGoodHitsMaps | input mapping from target reconstructable MCParticles (those which shouldn't be tagged) to their good hits |
pfoSignificanceMap | output mapping from Pfos to their target significance |
pfoPurityMap | output mapping from Pfos to their target purities |
pfoClassificationMap | output mapping from Pfos to their classification |
Definition at line 103 of file CosmicRayTaggingMonitoringTool.cc.
References ClassifyPfo(), IsMainMCParticleMuon(), and lar_content::LArPfoHelper::SortByNHits().
Referenced by FindAmbiguousPfos().
|
private |
Classify a pfo given some metrics.
nHits | the number of reconstructable hits in the Pfo |
significance | the number of target MCParticles represented by the Pfo |
purity | the fraction of reconstructable hits in the Pfo that come from a target MCParticle |
isMuon | is the main MCParticle that the Pfo represents a muon? |
Definition at line 178 of file CosmicRayTaggingMonitoringTool.cc.
References ABSORBED, CR_MUON, CR_OTHER, FRAGMENTED, m_minHitsToConsiderTagging, m_minImpurity, m_minPurity, m_minSignificance, MIXED, SPARSE, and TARGET.
Referenced by CalculatePfoMetrics().
|
virtual |
Find the list of ambiguous pfos (could represent cosmic-ray muons or neutrinos)
parentCosmicRayPfos | the list of parent cosmic-ray pfos |
ambiguousPfos | to receive the list of ambiguous pfos |
pAlgorithm | the address of this master algorithm |
Implements lar_content::CosmicRayTaggingBaseTool.
Definition at line 34 of file CosmicRayTaggingMonitoringTool.cc.
References CalculatePfoMetrics(), lar_content::LArMonitoringHelper::GetOrderedMCParticleVector(), lar_content::LArMonitoringHelper::GetOrderedPfoVector(), lar_content::LArMCParticleHelper::GetPfoMCParticleHitSharingMaps(), lar_content::LArMCParticleHelper::GetPfoToReconstructable2DHitsMap(), lar_content::LArMCParticleHelper::IsBeamNeutrinoFinalState(), lar_content::LArMCParticleHelper::IsBeamParticle(), lar_content::LArMCParticleHelper::IsCosmicRay(), m_caloHitList2D, lar_content::LArMCParticleHelper::PrimaryParameters::m_foldBackHierarchy, m_parameters, lar_content::LArFormattingHelper::PrintHeader(), lar_content::LArMonitoringHelper::PrintMCParticleTable(), PrintPfoTable(), and lar_content::LArMCParticleHelper::SelectReconstructableMCParticles().
|
private |
Returns a unique color for each possible Pfo classification.
Definition at line 276 of file CosmicRayTaggingMonitoringTool.cc.
References ABSORBED, CR_MUON, CR_OTHER, FRAGMENTED, lar_content::LArFormattingHelper::LIGHT_BLUE, lar_content::LArFormattingHelper::LIGHT_CYAN, lar_content::LArFormattingHelper::LIGHT_GRAY, lar_content::LArFormattingHelper::LIGHT_GREEN, lar_content::LArFormattingHelper::LIGHT_MAGENTA, lar_content::LArFormattingHelper::LIGHT_RED, lar_content::LArFormattingHelper::LIGHT_YELLOW, MIXED, and TARGET.
Referenced by PrintPfoTable().
|
private |
Returns a string for each classification.
Definition at line 299 of file CosmicRayTaggingMonitoringTool.cc.
References ABSORBED, CR_MUON, CR_OTHER, FRAGMENTED, MIXED, SPARSE, and TARGET.
Referenced by PrintPfoTable().
|
private |
Returns true if the main MCParticle of the supplied Pfo is a muon.
Definition at line 162 of file CosmicRayTaggingMonitoringTool.cc.
Referenced by CalculatePfoMetrics().
|
private |
Prints a table detailing all input Pfos and their classifications.
orderedPfoVector | input vector of Pfos in print order |
pfoToReconstructable2DHitsMap | input mapping from Pfos to their reconstructable 2D hits |
pfoPurityMap | input mapping from Pfos to their purity |
pfoSignificanceMap | input mapping from Pfos to their significance |
pfoClassificationMap | input mapping from Pfos to their classification |
ambiguousPfos | input list of ambiguous Pfos as (not) tagged by a previous CR tagging module |
Definition at line 209 of file CosmicRayTaggingMonitoringTool.cc.
References lar_content::LArMonitoringHelper::CountHitsByType(), CR_MUON, CR_OTHER, lar_content::LArPfoHelper::GetCaloHits(), GetClassificationColor(), GetClassificationName(), lar_content::LArFormattingHelper::INVERTED, lar_content::LArFormattingHelper::LIGHT_GREEN, lar_content::LArFormattingHelper::LIGHT_RED, lar_content::LArFormattingHelper::LIGHT_YELLOW, and TARGET.
Referenced by FindAmbiguousPfos().
|
private |
Read settings.
Definition at line 324 of file CosmicRayTaggingMonitoringTool.cc.
References m_caloHitList2D, lar_content::LArMCParticleHelper::PrimaryParameters::m_maxPhotonPropagation, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitsForGoodView, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitSharingFraction, m_minHitsToConsiderTagging, m_minImpurity, lar_content::LArMCParticleHelper::PrimaryParameters::m_minPrimaryGoodHits, lar_content::LArMCParticleHelper::PrimaryParameters::m_minPrimaryGoodViews, m_minPurity, m_minSignificance, m_parameters, and lar_content::LArMCParticleHelper::PrimaryParameters::m_selectInputHits.
|
private |
The 2D calo hit list.
Definition at line 116 of file CosmicRayTaggingMonitoringTool.h.
Referenced by FindAmbiguousPfos(), and ReadSettings().
|
private |
The minimum number of hits to consider a Pfo for tagging.
Definition at line 112 of file CosmicRayTaggingMonitoringTool.h.
Referenced by ClassifyPfo(), and ReadSettings().
|
private |
The minimum impurity to consider a Pfo as "impure".
Definition at line 114 of file CosmicRayTaggingMonitoringTool.h.
Referenced by ClassifyPfo(), and ReadSettings().
|
private |
The minimum purity to consider a Pfo as "pure".
Definition at line 113 of file CosmicRayTaggingMonitoringTool.h.
Referenced by ClassifyPfo(), and ReadSettings().
|
private |
The minimum significance to consider a Pfo as "significant".
Definition at line 115 of file CosmicRayTaggingMonitoringTool.h.
Referenced by ClassifyPfo(), and ReadSettings().
|
private |
Parameters used to decide when an MCParticle is reconstructable.
Definition at line 111 of file CosmicRayTaggingMonitoringTool.h.
Referenced by FindAmbiguousPfos(), and ReadSettings().