PFParticleValidation class. More...
Classes | |
class | MatchingDetails |
MatchingDetails class. More... | |
class | SimpleMatchedPfo |
SimpleMatchedPfo class. More... | |
class | SimpleMCPrimary |
SimpleMCPrimary class. More... | |
Public Member Functions | |
PFParticleValidation (fhicl::ParameterSet const &pset) | |
Constructor. More... | |
virtual | ~PFParticleValidation () |
Destructor. More... | |
void | beginJob () |
void | endJob () |
void | analyze (const art::Event &evt) |
void | reconfigure (fhicl::ParameterSet const &pset) |
Private Types | |
typedef std::vector < SimpleMCPrimary > | SimpleMCPrimaryList |
typedef std::vector < SimpleMatchedPfo > | SimpleMatchedPfoList |
typedef std::map< int, MatchingDetails > | MatchingDetailsMap |
typedef std::map < SimpleMCPrimary, SimpleMatchedPfoList > | MCPrimaryMatchingMap |
typedef std::map< art::Ptr < recob::PFParticle > , HitVector > | PFParticleToMatchedHits |
typedef std::map< art::Ptr < simb::MCParticle > , PFParticleToMatchedHits > | MCParticleMatchingMap |
typedef std::set< int > | IntSet |
Private Member Functions | |
void | GetMCParticleMatchingMap (const PFParticlesToHits &recoParticlesToHits, const MCParticlesToHits &trueParticlesToHits, const HitsToMCParticles &hitsToTrueParticles, MCParticleMatchingMap &mcParticleMatchingMap) const |
Performing matching between true and reconstructed particles. More... | |
void | GetSimpleMCPrimaryList (const art::Event &evt, const MCParticlesToHits &mcParticlesToHits, const HitsToMCParticles &hitsToMCParticles, const MCParticleMatchingMap &mcParticleMatchingMap, SimpleMCPrimaryList &simpleMCPrimaryList) const |
Extract details of each mc primary (ordered by number of true hits) More... | |
void | GetMCPrimaryMatchingMap (const SimpleMCPrimaryList &simpleMCPrimaryList, const MCParticleMatchingMap &mcParticleMatchingMap, const PFParticlesToHits &pfParticlesToHits, MCPrimaryMatchingMap &mcPrimaryMatchingMap) const |
Obtain a sorted list of matched pfos for each mc primary. More... | |
bool | IsNeutrinoInduced (const art::Ptr< simb::MCParticle > pMCParticle, const MCParticlesToMCTruth &artMCParticlesToMCTruth) const |
Whether a mc particle is neutrino induced. More... | |
void | GetMCTruth (const art::Event &evt, MCTruthVector &mcTruthVector) const |
Obtain a vector of mc truth. More... | |
void | GetRecoNeutrinos (const art::Event &evt, PFParticleVector &recoNeutrinoVector) const |
Obtain a vector of reco neutrinos. More... | |
void | PrintAllOutput (const MCTruthVector &mcTruthVector, const PFParticleVector &recoNeutrinoVector, const MCPrimaryMatchingMap &mcPrimaryMatchingMap) const |
Print all the raw matching output to screen. More... | |
void | PerformMatching (const MCPrimaryMatchingMap &mcPrimaryMatchingMap, MatchingDetailsMap &matchingDetailsMap) const |
Apply a well-defined matching procedure to the comprehensive matches in the provided mc primary matching map. More... | |
bool | GetStrongestPfoMatch (const MCPrimaryMatchingMap &mcPrimaryMatchingMap, IntSet &usedMCIds, IntSet &usedPfoIds, MatchingDetailsMap &matchingDetailsMap) const |
Get the strongest pfo match (most matched hits) between an available mc primary and an available pfo. More... | |
void | GetRemainingPfoMatches (const MCPrimaryMatchingMap &mcPrimaryMatchingMap, const IntSet &usedPfoIds, MatchingDetailsMap &matchingDetailsMap) const |
Get the best matches for any pfos left-over after the strong matching procedure. More... | |
void | PrintMatchingOutput (const MCPrimaryMatchingMap &mcPrimaryMatchingMap, const MatchingDetailsMap &matchingDetailsMap) const |
Print the results of the matching procedure. More... | |
bool | IsGoodMCPrimary (const SimpleMCPrimary &simpleMCPrimary) const |
Whether a provided mc primary passes selection, based on number of "good" hits. More... | |
bool | HasMatch (const SimpleMCPrimary &simpleMCPrimary, const SimpleMatchedPfoList &simpleMatchedPfoList, const MatchingDetailsMap &matchingDetailsMap) const |
Whether a provided mc primary has a match, of any quality (use simple matched pfo list and information in matching details map) More... | |
bool | IsGoodMatch (const SimpleMCPrimary &simpleMCPrimary, const SimpleMatchedPfo &simpleMatchedPfo) const |
Whether a provided mc primary and pfo are deemed to be a good match. More... | |
unsigned int | CountHitsByType (const geo::View_t view, const HitVector &hitVector) const |
Count the number of hits, in a provided vector, of a specified view. More... | |
Static Private Member Functions | |
static bool | SortSimpleMCPrimaries (const SimpleMCPrimary &lhs, const SimpleMCPrimary &rhs) |
Sort simple mc primaries by number of mc hits. More... | |
static bool | SortSimpleMatchedPfos (const SimpleMatchedPfo &lhs, const SimpleMatchedPfo &rhs) |
Sort simple matched pfos by number of matched hits. More... | |
Private Attributes | |
std::string | m_hitfinderLabel |
The name/label of the hit producer module. More... | |
std::string | m_particleLabel |
The name/label of the particle producer module. More... | |
std::string | m_geantModuleLabel |
The name/label of the geant module. More... | |
std::string | m_backtrackerLabel |
The name/label of the back-tracker module. 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_neutrinoInducedOnly |
Whether to consider only mc particles that were neutrino induced. More... | |
int | m_matchingMinPrimaryHits |
The minimum number of good mc primary hits used in matching scheme. More... | |
int | m_matchingMinHitsForGoodView |
The minimum number of good mc primary hits in given view to declare view to be good. More... | |
int | m_matchingMinPrimaryGoodViews |
The minimum number of good views for a mc primary. More... | |
bool | m_useSmallPrimaries |
Whether to consider matches to mc primaries with fewer than m_matchingMinPrimaryHits. More... | |
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... | |
PFParticleValidation class.
Definition at line 24 of file PFParticleValidation_module.cc.
|
private |
Definition at line 204 of file PFParticleValidation_module.cc.
|
private |
Definition at line 121 of file PFParticleValidation_module.cc.
|
private |
Definition at line 125 of file PFParticleValidation_module.cc.
|
private |
Definition at line 122 of file PFParticleValidation_module.cc.
|
private |
Definition at line 124 of file PFParticleValidation_module.cc.
|
private |
Definition at line 103 of file PFParticleValidation_module.cc.
|
private |
Definition at line 76 of file PFParticleValidation_module.cc.
lar_pandora::PFParticleValidation::PFParticleValidation | ( | fhicl::ParameterSet const & | pset | ) |
Constructor.
pset |
Definition at line 336 of file PFParticleValidation_module.cc.
|
virtual |
void lar_pandora::PFParticleValidation::analyze | ( | const art::Event & | evt | ) |
Definition at line 382 of file PFParticleValidation_module.cc.
void lar_pandora::PFParticleValidation::beginJob | ( | ) |
Definition at line 370 of file PFParticleValidation_module.cc.
|
private |
Count the number of hits, in a provided vector, of a specified view.
view | the view |
hitVector | the hit vector |
Definition at line 857 of file PFParticleValidation_module.cc.
void lar_pandora::PFParticleValidation::endJob | ( | ) |
Definition at line 376 of file PFParticleValidation_module.cc.
|
private |
Performing matching between true and reconstructed particles.
recoParticlesToHits | the mapping from reconstructed particles to hits |
trueParticlesToHits | the mapping from true particles to hits |
hitsToTrueParticles | the mapping from hits to true particles |
mcParticleMatchingMap | the output matches between all reconstructed and true particles |
Definition at line 434 of file PFParticleValidation_module.cc.
|
private |
Obtain a sorted list of matched pfos for each mc primary.
simpleMCPrimaryList | the simple mc primary list |
mcToFullPfoMatchingMap | the mc to full pfo matching map |
pfoToHitListMap | the pfo to hit list map |
mcPrimaryMatchingMap | to receive the populated mc primary matching map |
Definition at line 526 of file PFParticleValidation_module.cc.
|
private |
Obtain a vector of mc truth.
evt | the event |
mcNeutrinoVector | to receive the populated vector of mc truth |
Definition at line 603 of file PFParticleValidation_module.cc.
|
private |
Obtain a vector of reco neutrinos.
evt | the event |
recoNeutrinoVector | to receive the populated vector of reco neutrinos |
Definition at line 623 of file PFParticleValidation_module.cc.
|
private |
Get the best matches for any pfos left-over after the strong matching procedure.
mcPrimaryMatchingMap | the input/raw mc primary matching map |
usedPfoIds | the list of pfo ids with an existing match |
matchingDetailsMap | the matching details map, to be populated |
Definition at line 732 of file PFParticleValidation_module.cc.
|
private |
Extract details of each mc primary (ordered by number of true hits)
evt | the event |
mcParticlesToHits | the mc primary to hits map |
hitsToMCParticles | the hits to mc particles map |
mcParticleMatchingMap | the mc to particle to pf particle matching map (to record number of matched pf particles) |
simpleMCPrimaryList | to receive the populated simple mc primary list |
Definition at line 465 of file PFParticleValidation_module.cc.
|
private |
Get the strongest pfo match (most matched hits) between an available mc primary and an available pfo.
mcPrimaryMatchingMap | the input/raw mc primary matching map |
usedMCIds | the list of mc primary ids with an existing match |
usedPfoIds | the list of pfo ids with an existing match |
matchingDetailsMap | the matching details map, to be populated |
Definition at line 685 of file PFParticleValidation_module.cc.
|
private |
Whether a provided mc primary has a match, of any quality (use simple matched pfo list and information in matching details map)
simpleMCPrimary | the simple mc primary |
simpleMatchedPfoList | the list of simple matched pfos |
matchingDetailsMap | the matching details map |
Definition at line 833 of file PFParticleValidation_module.cc.
|
private |
Whether a provided mc primary and pfo are deemed to be a good match.
simpleMCPrimary | the simple mc primary |
simpleMatchedPfo | the simple matched pfo |
Definition at line 847 of file PFParticleValidation_module.cc.
|
private |
Whether a provided mc primary passes selection, based on number of "good" hits.
simpleMCPrimary | the simple mc primary |
Definition at line 815 of file PFParticleValidation_module.cc.
|
private |
Whether a mc particle is neutrino induced.
pMCParticle | address of the mc particle |
artMCParticlesToMCTruth | the mapping from mc particles to mc truth |
Definition at line 513 of file PFParticleValidation_module.cc.
|
private |
Apply a well-defined matching procedure to the comprehensive matches in the provided mc primary matching map.
mcPrimaryMatchingMap | the input/raw mc primary matching map |
matchingDetailsMap | the matching details map, to be populated |
Definition at line 673 of file PFParticleValidation_module.cc.
|
private |
Print all the raw matching output to screen.
mcTruthVector | the mc truth vector |
recoNeutrinoVector | the reco neutrino vector |
mcPrimaryMatchingMap | the input/raw mc primary matching map |
Definition at line 632 of file PFParticleValidation_module.cc.
|
private |
Print the results of the matching procedure.
mcPrimaryMatchingMap | the input/raw mc primary matching map |
matchingDetailsMap | the matching details map |
Definition at line 761 of file PFParticleValidation_module.cc.
void lar_pandora::PFParticleValidation::reconfigure | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 350 of file PFParticleValidation_module.cc.
|
staticprivate |
Sort simple matched pfos by number of matched hits.
lhs | the left-hand side |
rhs | the right-hand side |
Definition at line 882 of file PFParticleValidation_module.cc.
|
staticprivate |
Sort simple mc primaries by number of mc hits.
lhs | the left-hand side |
rhs | the right-hand side |
Definition at line 872 of file PFParticleValidation_module.cc.
|
private |
The name/label of the back-tracker module.
Definition at line 296 of file PFParticleValidation_module.cc.
|
private |
The name/label of the geant module.
Definition at line 295 of file PFParticleValidation_module.cc.
|
private |
The name/label of the hit producer module.
Definition at line 293 of file PFParticleValidation_module.cc.
|
private |
The minimum particle completeness to declare a match.
Definition at line 309 of file PFParticleValidation_module.cc.
|
private |
The minimum number of good mc primary hits in given view to declare view to be good.
Definition at line 304 of file PFParticleValidation_module.cc.
|
private |
The minimum number of good views for a mc primary.
Definition at line 305 of file PFParticleValidation_module.cc.
|
private |
The minimum number of good mc primary hits used in matching scheme.
Definition at line 303 of file PFParticleValidation_module.cc.
|
private |
The minimum particle purity to declare a match.
Definition at line 310 of file PFParticleValidation_module.cc.
|
private |
The minimum number of shared hits used in matching scheme.
Definition at line 308 of file PFParticleValidation_module.cc.
|
private |
Whether to consider only mc particles that were neutrino induced.
Definition at line 301 of file PFParticleValidation_module.cc.
|
private |
The name/label of the particle producer module.
Definition at line 294 of file PFParticleValidation_module.cc.
|
private |
Whether to print all/raw matching details to screen.
Definition at line 298 of file PFParticleValidation_module.cc.
|
private |
Whether to print matching output to screen.
Definition at line 299 of file PFParticleValidation_module.cc.
|
private |
Whether to consider matches to mc primaries with fewer than m_matchingMinPrimaryHits.
Definition at line 307 of file PFParticleValidation_module.cc.