LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
MuonLeadingEventValidationAlgorithm class. More...
#include "MuonLeadingEventValidationAlgorithm.h"
Public Member Functions | |
MuonLeadingEventValidationAlgorithm () | |
Default constructor. More... | |
virtual | ~MuonLeadingEventValidationAlgorithm () |
Destructor. More... | |
Protected Member Functions | |
void | InterpretMatching (const ValidationInfo &validationInfo, LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap) const |
Apply an interpretative matching procedure to the comprehensive matches in the provided validation info object. More... | |
bool | GetStrongestPfoMatch (const ValidationInfo &validationInfo, const pandora::MCParticleVector &mcPrimaryVector, pandora::PfoSet &usedPfos, LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap) const |
Get the strongest pfo match (most matched hits) between an available mc primary and an available pfo. More... | |
void | GetRemainingPfoMatches (const ValidationInfo &validationInfo, const pandora::MCParticleVector &mcPrimaryVector, const pandora::PfoSet &usedPfos, LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap) const |
Get the best matches for any pfos left-over after the strong matching procedure. More... | |
bool | IsGoodMatch (const pandora::CaloHitList &trueHits, const pandora::CaloHitList &recoHits, const pandora::CaloHitList &sharedHits) const |
Whether a provided mc primary and pfo are deemed to be a good match. More... | |
Protected Attributes | |
LArMCParticleHelper::PrimaryParameters | m_primaryParameters |
The mc particle primary selection parameters. More... | |
int | m_fileIdentifier |
The input file identifier. More... | |
int | m_eventNumber |
The event number. More... | |
std::string | m_treeName |
Name of output tree. More... | |
Private Member Functions | |
void | FillValidationInfo (const pandora::MCParticleList *const pMCParticleList, const pandora::CaloHitList *const pCaloHitList, const pandora::PfoList *const pPfoList, ValidationInfo &validationInfo) const |
Fill the validation info containers. More... | |
void | GetRecoCosmicRayHits (const pandora::MCParticleList *const pMCParticleList, const pandora::CaloHitList *const pCaloHitList, const pandora::PfoList *const pPfoList, pandora::CaloHitList &recoCosmicRayHitList) const |
Determine all reconstructable hits in cosmic ray pfos. More... | |
void | PerformUnfoldedMatching (const pandora::MCParticleList *const pMCParticleList, const pandora::CaloHitList *const pCaloHitList, const pandora::PfoList *const pPfoList, const pandora::CaloHitList &recoCosmicRayHitList, const float minHitSharingFraction, ValidationInfo &validationInfo) const |
Perform the main matching procedure. More... | |
void | RemoveIncorrectlyReconstructedCosmicRays (const pandora::MCParticleList *const pMCParticleList, const pandora::CaloHitList *const pCaloHitList, const pandora::PfoList *const pPfoList, ValidationInfo &validationInfo) const |
Remove incorrectly reconstructed cosmic rays from main matching maps. More... | |
void | DetermineIncorrectlyReconstructedCosmicRays (const pandora::MCParticleList *const pMCParticleList, const pandora::CaloHitList *const pCaloHitList, const pandora::PfoList *const pPfoList, pandora::MCParticleList &incorrectlyReconstructedCosmicRays) const |
Perform the cosmic ray matching procedure and identify incorrectly reconstructed cosmic rays. More... | |
void | ProcessOutput (const ValidationInfo &validationInfo, const bool useInterpretedMatching, const bool printToScreen, const bool fillTree) const |
Print matching information in a provided validation info object, and write information to tree if configured to do so. More... | |
void | PrintHits (const pandora::CaloHitList totalCaloHitList, const pandora::CaloHitList leadingCaloHitList, const std::string &stringTag) const |
Print leading MCParticle hits. More... | |
void | FillContaminationHitsDistance (const pandora::CaloHitList &contaminationHits, const pandora::CaloHitList &leadingMCHits, pandora::FloatVector &bestMatchContaminationHitsDistance) const |
Fill an input contamination hit distance vector with the closest distance of each contaminant hit to the true leading particle hits. More... | |
void | GetHitsOfType (const pandora::CaloHitList &inputList, const pandora::HitType hitType, pandora::CaloHitList &outputList) const |
To filter out the hits of a given type from an input list. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Private Attributes | |
LArMuonLeadingHelper::ValidationParameters | m_validationParameters |
The definition of a reconstructable MCParticle. More... | |
bool | m_removeRecoCosmicRayHits |
Whether to remove the reconstructed cosmic ray hits from leading particle metrics. More... | |
bool | m_deltaRayMode |
Whether to run in delta ray mode. More... | |
bool | m_michelMode |
Whether to run in michel mode. More... | |
int | m_cosmicRaysToSkip |
The number of reconstructable cosmic rays to skip. More... | |
bool | m_visualize |
Whether to visualize the MC and reco leading particles. More... | |
bool | m_ignoreIncorrectCosmicRays |
Whether to remove the leading particles with incorrrectly reconstructed parents from metrics. More... | |
bool | m_writeRawMatchesToTree |
Whether to write all matches to output tree. More... | |
std::vector< int > | m_deltaRayIDs |
If filled, to contain the list leading particles to run metrics over. More... | |
MuonLeadingEventValidationAlgorithm class.
Definition at line 28 of file MuonLeadingEventValidationAlgorithm.h.
lar_content::MuonLeadingEventValidationAlgorithm::MuonLeadingEventValidationAlgorithm | ( | ) |
Default constructor.
Definition at line 25 of file MuonLeadingEventValidationAlgorithm.cc.
|
virtual |
|
private |
Perform the cosmic ray matching procedure and identify incorrectly reconstructed cosmic rays.
pMCParticleList | the address of the mc particle list |
pCaloHitList | the address of the calo hit list |
pPfoList | the address of the pfo list |
incorrectlyReconstructedCosmicRays | the output list of incorrectly reconstructed cosmic rays |
Definition at line 191 of file MuonLeadingEventValidationAlgorithm.cc.
References f, lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetInterpretedMCToPfoHitSharingMap(), lar_content::LArMonitoringHelper::GetOrderedMCParticleVector(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetPfoToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetTargetMCParticleToHitsMap(), lar_content::LArMCParticleHelper::IsCosmicRay(), lar_content::EventValidationBaseAlgorithm::IsGoodMatch(), and PerformUnfoldedMatching().
Referenced by RemoveIncorrectlyReconstructedCosmicRays().
|
private |
Fill an input contamination hit distance vector with the closest distance of each contaminant hit to the true leading particle hits.
contaminationHits | the list of contaminant hits |
leadingMCHitList | the list of true MCParticles hits |
bestMatchContaminationHitsDistance | the output contaminant hit distance vector |
Definition at line 874 of file MuonLeadingEventValidationAlgorithm.cc.
References lar_content::LArClusterHelper::GetClosestDistance(), and GetHitsOfType().
Referenced by ProcessOutput().
|
privatevirtual |
Fill the validation info containers.
pMCParticleList | the address of the mc particle list |
pCaloHitList | the address of the calo hit list |
pPfoList | the address of the pfo list |
validationInfo | to receive the validation info |
Implements lar_content::EventValidationBaseAlgorithm.
Definition at line 44 of file MuonLeadingEventValidationAlgorithm.cc.
References f, GetRecoCosmicRayHits(), m_deltaRayMode, m_ignoreIncorrectCosmicRays, m_michelMode, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitSharingFraction, m_removeRecoCosmicRayHits, m_validationParameters, m_visualize, PerformUnfoldedMatching(), and RemoveIncorrectlyReconstructedCosmicRays().
|
private |
To filter out the hits of a given type from an input list.
inputList | the input list of hits |
hitType | the specified TPC view |
outputList | the output list of hits of the specified list |
Definition at line 899 of file MuonLeadingEventValidationAlgorithm.cc.
Referenced by FillContaminationHitsDistance().
|
private |
Determine all reconstructable hits in cosmic ray pfos.
pMCParticleList | the address of the mc particle list |
pCaloHitList | the address of the calo hit list |
pPfoList | the address of the pfo list |
recoCosmicRayHitList | the output list of cosmic ray pfo reconstructable hits |
Definition at line 70 of file MuonLeadingEventValidationAlgorithm.cc.
References f, lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetInterpretedMCToPfoHitSharingMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetPfoToHitsMap(), lar_content::LArMCParticleHelper::IsCosmicRay(), and PerformUnfoldedMatching().
Referenced by FillValidationInfo().
|
protectedinherited |
Get the best matches for any pfos left-over after the strong matching procedure.
validationInfo | the validation info |
mcPrimaryVector | the mc primary vector |
usedPfos | the set of previously used pfos |
interpretedMCToPfoHitSharingMap | the output, interpreted mc particle to pfo hit sharing map |
Definition at line 155 of file EventValidationBaseAlgorithm.cc.
References lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetMCToPfoHitSharingMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetTargetMCParticleToHitsMap(), and lar_content::EventValidationBaseAlgorithm::m_useSmallPrimaries.
Referenced by lar_content::EventValidationBaseAlgorithm::InterpretMatching().
|
protectedinherited |
Get the strongest pfo match (most matched hits) between an available mc primary and an available pfo.
validationInfo | the validation info |
mcPrimaryVector | the mc primary vector |
usedPfos | the set of previously used pfos |
interpretedMCToPfoHitSharingMap | the output, interpreted mc particle to pfo hit sharing map |
Definition at line 111 of file EventValidationBaseAlgorithm.cc.
References lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetMCToPfoHitSharingMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetPfoToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetTargetMCParticleToHitsMap(), lar_content::EventValidationBaseAlgorithm::IsGoodMatch(), and lar_content::EventValidationBaseAlgorithm::m_useSmallPrimaries.
Referenced by lar_content::EventValidationBaseAlgorithm::InterpretMatching().
|
protectedinherited |
Apply an interpretative matching procedure to the comprehensive matches in the provided validation info object.
validationInfo | the validation info |
interpretedMCToPfoHitSharingMap | the output, interpreted mc particle to pfo hit sharing map |
Definition at line 86 of file EventValidationBaseAlgorithm.cc.
References lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::LArMonitoringHelper::GetOrderedMCParticleVector(), lar_content::EventValidationBaseAlgorithm::GetRemainingPfoMatches(), lar_content::EventValidationBaseAlgorithm::GetStrongestPfoMatch(), and lar_content::LArPfoHelper::SortByNHits().
Referenced by lar_content::NeutrinoEventValidationAlgorithm::FillValidationInfo(), and PerformUnfoldedMatching().
|
protectedinherited |
Whether a provided mc primary and pfo are deemed to be a good match.
trueHits | the list of true hits |
recoHits | the list of reco hits |
sharedHits | the list of shared hits |
Definition at line 203 of file EventValidationBaseAlgorithm.cc.
References f, lar_content::EventValidationBaseAlgorithm::m_matchingMinCompleteness, lar_content::EventValidationBaseAlgorithm::m_matchingMinPurity, and lar_content::EventValidationBaseAlgorithm::m_matchingMinSharedHits.
Referenced by DetermineIncorrectlyReconstructedCosmicRays(), lar_content::EventValidationBaseAlgorithm::GetStrongestPfoMatch(), lar_content::NeutrinoEventValidationAlgorithm::ProcessOutput(), and ProcessOutput().
|
private |
Perform the main matching procedure.
pMCParticleList | the address of the mc particle list |
pCaloHitList | the address of the calo hit list |
pPfoList | the address of the pfo list |
recoCosmicRayHitList | the list of cosmic ray pfo reconstructable hits to remove from leading particle maps |
minHitSharingFraction | the minimum hit share fraction of a reconstructable hit |
validationInfo | to receive the validation info |
Definition at line 100 of file MuonLeadingEventValidationAlgorithm.cc.
References lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::LArMCParticleHelper::GetPfoMCParticleHitSharingMaps(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetPfoToHitsMap(), lar_content::LArMCParticleHelper::GetPfoToReconstructable2DHitsMap(), lar_content::EventValidationBaseAlgorithm::InterpretMatching(), lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitsForGoodView, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitSharingFraction, lar_content::LArMCParticleHelper::PrimaryParameters::m_minPrimaryGoodHits, m_validationParameters, lar_content::LArMuonLeadingHelper::SelectReconstructableLeadingParticles(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::SetAllMCParticleToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::SetInterpretedMCToPfoHitSharingMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::SetMCToPfoHitSharingMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::SetPfoToHitsMap(), and lar_content::EventValidationBaseAlgorithm::ValidationInfo::SetTargetMCParticleToHitsMap().
Referenced by DetermineIncorrectlyReconstructedCosmicRays(), FillValidationInfo(), and GetRecoCosmicRayHits().
|
private |
Print leading MCParticle hits.
caloHitList | the list of hits to print |
isCR | whether the hits belong to a MC cosmic ray or delta ray/michel electron Print leading pfo hits |
totalCaloHitList | the list of hits to print |
otherShowerCaloHitList | the list of hits that in truth belong to a different shower |
otherTrackCaloHitList | the list of hits that in truth belong to a cosmic ray that is not the parent |
parentTrackCaloHitList | the list of hits that in truth belong to the parent cosmic ray |
stringTag | the event display marker string Print hits of the parent cosmic ray |
totalCaloHitList | the list of hits to print |
leadingCaloHitList | the list of hits that in truth belong to the child hierarchy |
stringTag | the event display marker string |
Referenced by ProcessOutput().
|
privatevirtual |
Print matching information in a provided validation info object, and write information to tree if configured to do so.
validationInfo | the validation info |
useInterpretedMatching | whether to use the interpreted (rather than raw) matching information |
printToScreen | whether to print the information to screen |
fillTree | whether to write the information to tree |
Implements lar_content::EventValidationBaseAlgorithm.
Definition at line 240 of file MuonLeadingEventValidationAlgorithm.cc.
References lar_content::LArMonitoringHelper::CountHitsByType(), f, FillContaminationHitsDistance(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetInterpretedMCToPfoHitSharingMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetMCToPfoHitSharingMap(), lar_content::LArMuonLeadingHelper::GetMuonPfoContaminationContribution(), lar_content::LArPfoHelper::GetParentPfo(), lar_content::LArMuonLeadingHelper::GetPfoMatchContamination(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetPfoToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetTargetMCParticleToHitsMap(), lar_content::LArMCParticleHelper::IsCosmicRay(), lar_content::LArMuonLeadingHelper::IsDeltaRay(), lar_content::EventValidationBaseAlgorithm::IsGoodMatch(), lar_content::LArMuonLeadingHelper::IsMichel(), m_cosmicRaysToSkip, m_deltaRayIDs, m_deltaRayMode, lar_content::EventValidationBaseAlgorithm::m_eventNumber, m_michelMode, lar_content::EventValidationBaseAlgorithm::m_treeName, m_visualize, m_writeRawMatchesToTree, PrintHits(), and lar_content::LArMCParticleHelper::SortByMomentum().
|
private |
Definition at line 910 of file MuonLeadingEventValidationAlgorithm.cc.
References m_cosmicRaysToSkip, m_deltaRayIDs, m_deltaRayMode, lar_content::LArMCParticleHelper::PrimaryParameters::m_foldBackHierarchy, m_ignoreIncorrectCosmicRays, lar_content::LArMCParticleHelper::PrimaryParameters::m_maxPhotonPropagation, m_michelMode, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitsForGoodView, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitSharingFraction, lar_content::LArMCParticleHelper::PrimaryParameters::m_minPrimaryGoodHits, lar_content::LArMCParticleHelper::PrimaryParameters::m_minPrimaryGoodViews, m_removeRecoCosmicRayHits, lar_content::LArMCParticleHelper::PrimaryParameters::m_selectInputHits, m_validationParameters, m_visualize, m_writeRawMatchesToTree, and lar_content::EventValidationBaseAlgorithm::ReadSettings().
|
private |
Remove incorrectly reconstructed cosmic rays from main matching maps.
pMCParticleList | the address of the mc particle list |
pCaloHitList | the address of the calo hit list |
pPfoList | the address of the pfo list |
validationInfo | to receive the updated validation info |
Definition at line 149 of file MuonLeadingEventValidationAlgorithm.cc.
References DetermineIncorrectlyReconstructedCosmicRays(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetInterpretedMCToPfoHitSharingMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetMCToPfoHitSharingMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::GetTargetMCParticleToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::SetAllMCParticleToHitsMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::SetInterpretedMCToPfoHitSharingMap(), lar_content::EventValidationBaseAlgorithm::ValidationInfo::SetMCToPfoHitSharingMap(), and lar_content::EventValidationBaseAlgorithm::ValidationInfo::SetTargetMCParticleToHitsMap().
Referenced by FillValidationInfo().
|
private |
The number of reconstructable cosmic rays to skip.
Definition at line 168 of file MuonLeadingEventValidationAlgorithm.h.
Referenced by ProcessOutput(), and ReadSettings().
|
private |
If filled, to contain the list leading particles to run metrics over.
Definition at line 172 of file MuonLeadingEventValidationAlgorithm.h.
Referenced by ProcessOutput(), and ReadSettings().
|
private |
Whether to run in delta ray mode.
Definition at line 166 of file MuonLeadingEventValidationAlgorithm.h.
Referenced by FillValidationInfo(), ProcessOutput(), and ReadSettings().
|
protectedinherited |
The event number.
Definition at line 194 of file EventValidationBaseAlgorithm.h.
Referenced by lar_content::NeutrinoEventValidationAlgorithm::ProcessOutput(), ProcessOutput(), and lar_content::EventValidationBaseAlgorithm::Run().
|
protectedinherited |
The input file identifier.
Definition at line 193 of file EventValidationBaseAlgorithm.h.
Referenced by lar_content::NeutrinoEventValidationAlgorithm::ProcessOutput(), and lar_content::EventValidationBaseAlgorithm::ReadSettings().
|
private |
Whether to remove the leading particles with incorrrectly reconstructed parents from metrics.
Definition at line 170 of file MuonLeadingEventValidationAlgorithm.h.
Referenced by FillValidationInfo(), and ReadSettings().
|
private |
Whether to run in michel mode.
Definition at line 167 of file MuonLeadingEventValidationAlgorithm.h.
Referenced by FillValidationInfo(), ProcessOutput(), and ReadSettings().
|
protectedinherited |
The mc particle primary selection parameters.
Definition at line 192 of file EventValidationBaseAlgorithm.h.
Referenced by lar_content::NeutrinoEventValidationAlgorithm::FillValidationInfo(), and lar_content::EventValidationBaseAlgorithm::ReadSettings().
|
private |
Whether to remove the reconstructed cosmic ray hits from leading particle metrics.
Definition at line 165 of file MuonLeadingEventValidationAlgorithm.h.
Referenced by FillValidationInfo(), and ReadSettings().
|
protectedinherited |
Name of output tree.
Definition at line 196 of file EventValidationBaseAlgorithm.h.
Referenced by lar_content::NeutrinoEventValidationAlgorithm::ProcessOutput(), ProcessOutput(), lar_content::EventValidationBaseAlgorithm::ReadSettings(), and lar_content::EventValidationBaseAlgorithm::~EventValidationBaseAlgorithm().
|
private |
The definition of a reconstructable MCParticle.
Definition at line 164 of file MuonLeadingEventValidationAlgorithm.h.
Referenced by FillValidationInfo(), PerformUnfoldedMatching(), and ReadSettings().
|
private |
Whether to visualize the MC and reco leading particles.
Definition at line 169 of file MuonLeadingEventValidationAlgorithm.h.
Referenced by FillValidationInfo(), ProcessOutput(), and ReadSettings().
|
private |
Whether to write all matches to output tree.
Definition at line 171 of file MuonLeadingEventValidationAlgorithm.h.
Referenced by ProcessOutput(), and ReadSettings().