![]() |
LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
EventValidationAlgorithm class. More...
#include "EventValidationAlgorithm.h"
Classes | |
| class | ValidationInfo |
| ValidationInfo class. More... | |
Public Member Functions | |
| EventValidationAlgorithm () | |
| Default constructor. More... | |
| ~EventValidationAlgorithm () | |
| Destructor. More... | |
Private Types | |
| typedef std::unordered_map< const pandora::ParticleFlowObject *, unsigned int > | PfoToIdMap |
| typedef std::vector< pandora::HitType > | HitTypeVector |
Private Member Functions | |
| pandora::StatusCode | Run () |
| 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 | PrintAllMatches (const ValidationInfo &validationInfo) const |
| Print all/raw matching information to screen. More... | |
| void | PrintInterpretedMatches (const ValidationInfo &validationInfo) const |
| Print interpreted matching information to screen. More... | |
| void | WriteInterpretedMatches (const ValidationInfo &validationInfo) const |
| Write interpreted matching information to tree. 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 | 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... | |
| pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Private Attributes | |
| std::string | m_caloHitListName |
| Name of input calo hit list. More... | |
| std::string | m_mcParticleListName |
| Name of input MC particle list. More... | |
| std::string | m_pfoListName |
| Name of input Pfo list. More... | |
| bool | m_useTrueNeutrinosOnly |
| Whether to consider only mc particles that were neutrino induced. More... | |
| bool | m_testBeamMode |
| Whether pandora is reconstructing test beam particles. More... | |
| bool | m_selectInputHits |
| Whether to use only hits passing mc-based quality (is "reconstructable") checks. More... | |
| float | m_minHitSharingFraction |
| Minimum fraction of energy deposited by selected primary in a single "good" hit. More... | |
| float | m_maxPhotonPropagation |
| Maximum distance travelled by photon, downstream of a track, in mc particle hierarchy. More... | |
| bool | m_printAllToScreen |
| Whether to print all/raw matching details to screen. More... | |
| bool | m_printMatchingToScreen |
| Whether to print matching output to screen. More... | |
| bool | m_writeToTree |
| Whether to write all/raw matching details to tree. More... | |
| bool | m_useSmallPrimaries |
| Whether to consider matches to mc primaries with fewer than m_matchingMinPrimaryHits. More... | |
| unsigned int | m_matchingMinSharedHits |
| The minimum number of shared hits used in matching scheme. More... | |
| float | m_matchingMinCompleteness |
| The minimum particle completeness to declare a match. More... | |
| float | m_matchingMinPurity |
| The minimum particle purity to declare a match. More... | |
| std::string | m_treeName |
| Name of output tree. More... | |
| std::string | m_fileName |
| Name of output file. More... | |
| int | m_fileIdentifier |
| The input file identifier. More... | |
| int | m_eventNumber |
| The event number. More... | |
EventValidationAlgorithm class.
Definition at line 27 of file EventValidationAlgorithm.h.
|
private |
Definition at line 216 of file EventValidationAlgorithm.h.
|
private |
Definition at line 138 of file EventValidationAlgorithm.h.
| lar_content::EventValidationAlgorithm::EventValidationAlgorithm | ( | ) |
Default constructor.
Definition at line 24 of file EventValidationAlgorithm.cc.
| lar_content::EventValidationAlgorithm::~EventValidationAlgorithm | ( | ) |
Destructor.
Definition at line 44 of file EventValidationAlgorithm.cc.
References m_fileName, m_treeName, and m_writeToTree.
|
private |
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 |
Definition at line 91 of file EventValidationAlgorithm.cc.
References lar_content::LArPfoHelper::GetAllConnectedPfos(), lar_content::EventValidationAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::LArMCParticleHelper::GetPfoMCParticleHitSharingMaps(), lar_content::EventValidationAlgorithm::ValidationInfo::GetPfoToHitsMap(), lar_content::LArMCParticleHelper::GetPfoToReconstructable2DHitsMap(), InterpretMatching(), lar_content::LArMCParticleHelper::IsBeamNeutrinoFinalState(), lar_content::LArMCParticleHelper::IsBeamParticle(), lar_content::LArMCParticleHelper::IsCosmicRay(), lar_content::LArPfoHelper::IsFinalState(), lar_content::LArMCParticleHelper::PrimaryParameters::m_maxPhotonPropagation, m_maxPhotonPropagation, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitsForGoodView, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitSharingFraction, m_minHitSharingFraction, lar_content::LArMCParticleHelper::PrimaryParameters::m_minPrimaryGoodHits, lar_content::LArMCParticleHelper::PrimaryParameters::m_selectInputHits, m_selectInputHits, m_testBeamMode, m_useTrueNeutrinosOnly, lar_content::LArMCParticleHelper::SelectReconstructableMCParticles(), lar_content::EventValidationAlgorithm::ValidationInfo::SetAllMCParticleToHitsMap(), lar_content::EventValidationAlgorithm::ValidationInfo::SetInterpretedMCToPfoHitSharingMap(), lar_content::EventValidationAlgorithm::ValidationInfo::SetMCToPfoHitSharingMap(), lar_content::EventValidationAlgorithm::ValidationInfo::SetPfoToHitsMap(), and lar_content::EventValidationAlgorithm::ValidationInfo::SetTargetMCParticleToHitsMap().
Referenced by Run().
|
private |
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 565 of file EventValidationAlgorithm.cc.
References lar_content::EventValidationAlgorithm::ValidationInfo::GetMCToPfoHitSharingMap(), lar_content::EventValidationAlgorithm::ValidationInfo::GetTargetMCParticleToHitsMap(), and m_useSmallPrimaries.
Referenced by InterpretMatching().
|
private |
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 522 of file EventValidationAlgorithm.cc.
References lar_content::EventValidationAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::EventValidationAlgorithm::ValidationInfo::GetMCToPfoHitSharingMap(), lar_content::EventValidationAlgorithm::ValidationInfo::GetPfoToHitsMap(), lar_content::EventValidationAlgorithm::ValidationInfo::GetTargetMCParticleToHitsMap(), IsGoodMatch(), and m_useSmallPrimaries.
Referenced by InterpretMatching().
|
private |
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 502 of file EventValidationAlgorithm.cc.
References lar_content::EventValidationAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::LArMonitoringHelper::GetOrderedMCParticleVector(), GetRemainingPfoMatches(), GetStrongestPfoMatch(), and lar_content::LArPfoHelper::SortByNHits().
Referenced by FillValidationInfo().
|
private |
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 612 of file EventValidationAlgorithm.cc.
References f, m_matchingMinCompleteness, m_matchingMinPurity, and m_matchingMinSharedHits.
Referenced by GetStrongestPfoMatch(), and ProcessOutput().
|
inlineprivate |
Print all/raw matching information to screen.
| validationInfo | the validation info |
Definition at line 320 of file EventValidationAlgorithm.h.
References ProcessOutput().
Referenced by Run().
|
inlineprivate |
Print interpreted matching information to screen.
| validationInfo | the validation info |
Definition at line 327 of file EventValidationAlgorithm.h.
References ProcessOutput().
Referenced by Run().
|
private |
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 |
Definition at line 147 of file EventValidationAlgorithm.cc.
References lar_content::LArMonitoringHelper::CountHitsByType(), lar_content::EventValidationAlgorithm::ValidationInfo::GetAllMCParticleToHitsMap(), lar_content::LArInteractionTypeHelper::GetInteractionType(), lar_content::EventValidationAlgorithm::ValidationInfo::GetInterpretedMCToPfoHitSharingMap(), lar_content::EventValidationAlgorithm::ValidationInfo::GetMCToPfoHitSharingMap(), lar_content::LArMCParticleHelper::GetNuanceCode(), lar_content::LArMonitoringHelper::GetOrderedMCParticleVector(), lar_content::LArMonitoringHelper::GetOrderedPfoVector(), lar_content::LArMCParticleHelper::GetParentMCParticle(), lar_content::LArPfoHelper::GetParentNeutrino(), lar_content::EventValidationAlgorithm::ValidationInfo::GetPfoToHitsMap(), lar_content::EventValidationAlgorithm::ValidationInfo::GetTargetMCParticleToHitsMap(), lar_content::LArPfoHelper::GetVertex(), lar_content::LArMCParticleHelper::IsBeamNeutrinoFinalState(), lar_content::LArMCParticleHelper::IsBeamParticle(), lar_content::LArMCParticleHelper::IsCosmicRay(), IsGoodMatch(), lar_content::LArPfoHelper::IsNeutrinoFinalState(), lar_content::LArPfoHelper::IsTestBeam(), m_eventNumber, m_fileIdentifier, m_testBeamMode, m_treeName, max, and lar_content::LArInteractionTypeHelper::ToString().
Referenced by PrintAllMatches(), PrintInterpretedMatches(), and WriteInterpretedMatches().
|
private |
Definition at line 622 of file EventValidationAlgorithm.cc.
References m_caloHitListName, m_fileIdentifier, m_fileName, m_matchingMinCompleteness, m_matchingMinPurity, m_matchingMinSharedHits, m_maxPhotonPropagation, m_mcParticleListName, m_minHitSharingFraction, m_pfoListName, m_printAllToScreen, m_printMatchingToScreen, m_selectInputHits, m_testBeamMode, m_treeName, m_useSmallPrimaries, m_useTrueNeutrinosOnly, and m_writeToTree.
|
private |
Definition at line 61 of file EventValidationAlgorithm.cc.
References FillValidationInfo(), m_caloHitListName, m_eventNumber, m_mcParticleListName, m_pfoListName, m_printAllToScreen, m_printMatchingToScreen, m_writeToTree, PrintAllMatches(), PrintInterpretedMatches(), and WriteInterpretedMatches().
|
inlineprivate |
Write interpreted matching information to tree.
| validationInfo | the validation info |
Definition at line 334 of file EventValidationAlgorithm.h.
References ProcessOutput().
Referenced by Run().
|
private |
Name of input calo hit list.
Definition at line 218 of file EventValidationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
The event number.
Definition at line 243 of file EventValidationAlgorithm.h.
Referenced by ProcessOutput(), and Run().
|
private |
The input file identifier.
Definition at line 242 of file EventValidationAlgorithm.h.
Referenced by ProcessOutput(), and ReadSettings().
|
private |
Name of output file.
Definition at line 240 of file EventValidationAlgorithm.h.
Referenced by ReadSettings(), and ~EventValidationAlgorithm().
|
private |
The minimum particle completeness to declare a match.
Definition at line 236 of file EventValidationAlgorithm.h.
Referenced by IsGoodMatch(), and ReadSettings().
|
private |
The minimum particle purity to declare a match.
Definition at line 237 of file EventValidationAlgorithm.h.
Referenced by IsGoodMatch(), and ReadSettings().
|
private |
The minimum number of shared hits used in matching scheme.
Definition at line 235 of file EventValidationAlgorithm.h.
Referenced by IsGoodMatch(), and ReadSettings().
|
private |
Maximum distance travelled by photon, downstream of a track, in mc particle hierarchy.
Definition at line 227 of file EventValidationAlgorithm.h.
Referenced by FillValidationInfo(), and ReadSettings().
|
private |
Name of input MC particle list.
Definition at line 219 of file EventValidationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Minimum fraction of energy deposited by selected primary in a single "good" hit.
Definition at line 226 of file EventValidationAlgorithm.h.
Referenced by FillValidationInfo(), and ReadSettings().
|
private |
Name of input Pfo list.
Definition at line 220 of file EventValidationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to print all/raw matching details to screen.
Definition at line 229 of file EventValidationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to print matching output to screen.
Definition at line 230 of file EventValidationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to use only hits passing mc-based quality (is "reconstructable") checks.
Definition at line 225 of file EventValidationAlgorithm.h.
Referenced by FillValidationInfo(), and ReadSettings().
|
private |
Whether pandora is reconstructing test beam particles.
Definition at line 223 of file EventValidationAlgorithm.h.
Referenced by FillValidationInfo(), ProcessOutput(), and ReadSettings().
|
private |
Name of output tree.
Definition at line 239 of file EventValidationAlgorithm.h.
Referenced by ProcessOutput(), ReadSettings(), and ~EventValidationAlgorithm().
|
private |
Whether to consider matches to mc primaries with fewer than m_matchingMinPrimaryHits.
Definition at line 234 of file EventValidationAlgorithm.h.
Referenced by GetRemainingPfoMatches(), GetStrongestPfoMatch(), and ReadSettings().
|
private |
Whether to consider only mc particles that were neutrino induced.
Definition at line 222 of file EventValidationAlgorithm.h.
Referenced by FillValidationInfo(), and ReadSettings().
|
private |
Whether to write all/raw matching details to tree.
Definition at line 232 of file EventValidationAlgorithm.h.
Referenced by ReadSettings(), Run(), and ~EventValidationAlgorithm().