Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
lar_pandora::PFParticleValidation Class Reference

PFParticleValidation class. More...

Inheritance diagram for lar_pandora::PFParticleValidation:
Collaboration diagram for lar_pandora::PFParticleValidation:

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.
 
virtual ~PFParticleValidation ()
 Destructor.
 
void beginJob ()
 
void endJob ()
 
void analyze (const art::Event &evt)
 
void reconfigure (fhicl::ParameterSet const &pset)
 

Private Types

typedef std::vector< SimpleMCPrimarySimpleMCPrimaryList
 
typedef std::vector< SimpleMatchedPfoSimpleMatchedPfoList
 
typedef std::map< int, MatchingDetailsMatchingDetailsMap
 
typedef std::map< SimpleMCPrimary, SimpleMatchedPfoListMCPrimaryMatchingMap
 
typedef std::map< art::Ptr< recob::PFParticle >, HitVectorPFParticleToMatchedHits
 
typedef std::map< art::Ptr< simb::MCParticle >, PFParticleToMatchedHitsMCParticleMatchingMap
 
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.
 
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)
 
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.
 
bool IsNeutrinoInduced (const art::Ptr< simb::MCParticle > pMCParticle, const MCParticlesToMCTruth &artMCParticlesToMCTruth) const
 Whether a mc particle is neutrino induced.
 
void GetMCTruth (const art::Event &evt, MCTruthVector &mcTruthVector) const
 Obtain a vector of mc truth.
 
void GetRecoNeutrinos (const art::Event &evt, PFParticleVector &recoNeutrinoVector) const
 Obtain a vector of reco neutrinos.
 
void PrintAllOutput (const MCTruthVector &mcTruthVector, const PFParticleVector &recoNeutrinoVector, const MCPrimaryMatchingMap &mcPrimaryMatchingMap) const
 Print all the raw matching output to screen.
 
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.
 
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.
 
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.
 
void PrintMatchingOutput (const MCPrimaryMatchingMap &mcPrimaryMatchingMap, const MatchingDetailsMap &matchingDetailsMap) const
 Print the results of the matching procedure.
 
bool IsGoodMCPrimary (const SimpleMCPrimary &simpleMCPrimary) const
 Whether a provided mc primary passes selection, based on number of "good" hits.
 
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)
 
bool IsGoodMatch (const SimpleMCPrimary &simpleMCPrimary, const SimpleMatchedPfo &simpleMatchedPfo) const
 Whether a provided mc primary and pfo are deemed to be a good match.
 
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.
 

Static Private Member Functions

static bool SortSimpleMCPrimaries (const SimpleMCPrimary &lhs, const SimpleMCPrimary &rhs)
 Sort simple mc primaries by number of mc hits.
 
static bool SortSimpleMatchedPfos (const SimpleMatchedPfo &lhs, const SimpleMatchedPfo &rhs)
 Sort simple matched pfos by number of matched hits.
 

Private Attributes

std::string m_hitfinderLabel
 The name/label of the hit producer module.
 
std::string m_particleLabel
 The name/label of the particle producer module.
 
std::string m_geantModuleLabel
 The name/label of the geant module.
 
std::string m_backtrackerLabel
 The name/label of the back-tracker module.
 
bool m_printAllToScreen
 Whether to print all/raw matching details to screen.
 
bool m_printMatchingToScreen
 Whether to print matching output to screen.
 
bool m_neutrinoInducedOnly
 Whether to consider only mc particles that were neutrino induced.
 
int m_matchingMinPrimaryHits
 The minimum number of good mc primary hits used in matching scheme.
 
int m_matchingMinHitsForGoodView
 The minimum number of good mc primary hits in given view to declare view to be good.
 
int m_matchingMinPrimaryGoodViews
 The minimum number of good views for a mc primary.
 
bool m_useSmallPrimaries
 Whether to consider matches to mc primaries with fewer than m_matchingMinPrimaryHits.
 
int m_matchingMinSharedHits
 The minimum number of shared hits used in matching scheme.
 
float m_matchingMinCompleteness
 The minimum particle completeness to declare a match.
 
float m_matchingMinPurity
 The minimum particle purity to declare a match.
 

Detailed Description

PFParticleValidation class.

Definition at line 23 of file PFParticleValidation_module.cc.

Member Typedef Documentation

◆ IntSet

typedef std::set<int> lar_pandora::PFParticleValidation::IntSet
private

Definition at line 211 of file PFParticleValidation_module.cc.

◆ MatchingDetailsMap

◆ MCParticleMatchingMap

typedef std::map<art::Ptr<simb::MCParticle>, PFParticleToMatchedHits> lar_pandora::PFParticleValidation::MCParticleMatchingMap
private

Definition at line 121 of file PFParticleValidation_module.cc.

◆ MCPrimaryMatchingMap

◆ PFParticleToMatchedHits

typedef std::map<art::Ptr<recob::PFParticle>, HitVector> lar_pandora::PFParticleValidation::PFParticleToMatchedHits
private

Definition at line 120 of file PFParticleValidation_module.cc.

◆ SimpleMatchedPfoList

◆ SimpleMCPrimaryList

Constructor & Destructor Documentation

◆ PFParticleValidation()

lar_pandora::PFParticleValidation::PFParticleValidation ( fhicl::ParameterSet const &  pset)

Constructor.

Parameters
pset

Definition at line 354 of file PFParticleValidation_module.cc.

Here is the call graph for this function:

◆ ~PFParticleValidation()

lar_pandora::PFParticleValidation::~PFParticleValidation ( )
virtual

Destructor.

Definition at line 362 of file PFParticleValidation_module.cc.

Member Function Documentation

◆ analyze()

void lar_pandora::PFParticleValidation::analyze ( const art::Event &  evt)

Definition at line 394 of file PFParticleValidation_module.cc.

Here is the call graph for this function:

◆ beginJob()

void lar_pandora::PFParticleValidation::beginJob ( )

Definition at line 386 of file PFParticleValidation_module.cc.

◆ CountHitsByType()

unsigned int lar_pandora::PFParticleValidation::CountHitsByType ( const geo::View_t  view,
const HitVector hitVector 
) const
private

Count the number of hits, in a provided vector, of a specified view.

Parameters
viewthe view
hitVectorthe hit vector
Returns
the number of hits of the specified view

Definition at line 923 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

◆ endJob()

void lar_pandora::PFParticleValidation::endJob ( )

Definition at line 390 of file PFParticleValidation_module.cc.

◆ GetMCParticleMatchingMap()

void lar_pandora::PFParticleValidation::GetMCParticleMatchingMap ( const PFParticlesToHits recoParticlesToHits,
const MCParticlesToHits trueParticlesToHits,
const HitsToMCParticles hitsToTrueParticles,
MCParticleMatchingMap mcParticleMatchingMap 
) const
private

Performing matching between true and reconstructed particles.

Parameters
recoParticlesToHitsthe mapping from reconstructed particles to hits
trueParticlesToHitsthe mapping from true particles to hits
hitsToTrueParticlesthe mapping from hits to true particles
mcParticleMatchingMapthe output matches between all reconstructed and true particles

Definition at line 459 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

◆ GetMCPrimaryMatchingMap()

void lar_pandora::PFParticleValidation::GetMCPrimaryMatchingMap ( const SimpleMCPrimaryList simpleMCPrimaryList,
const MCParticleMatchingMap mcParticleMatchingMap,
const PFParticlesToHits pfParticlesToHits,
MCPrimaryMatchingMap mcPrimaryMatchingMap 
) const
private

Obtain a sorted list of matched pfos for each mc primary.

Parameters
simpleMCPrimaryListthe simple mc primary list
mcToFullPfoMatchingMapthe mc to full pfo matching map
pfoToHitListMapthe pfo to hit list map
mcPrimaryMatchingMapto receive the populated mc primary matching map

Definition at line 557 of file PFParticleValidation_module.cc.

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

◆ GetMCTruth()

void lar_pandora::PFParticleValidation::GetMCTruth ( const art::Event &  evt,
MCTruthVector mcTruthVector 
) const
private

Obtain a vector of mc truth.

Parameters
evtthe event
mcNeutrinoVectorto receive the populated vector of mc truth

Definition at line 643 of file PFParticleValidation_module.cc.

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

◆ GetRecoNeutrinos()

void lar_pandora::PFParticleValidation::GetRecoNeutrinos ( const art::Event &  evt,
PFParticleVector recoNeutrinoVector 
) const
private

Obtain a vector of reco neutrinos.

Parameters
evtthe event
recoNeutrinoVectorto receive the populated vector of reco neutrinos

Definition at line 662 of file PFParticleValidation_module.cc.

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

◆ GetRemainingPfoMatches()

void lar_pandora::PFParticleValidation::GetRemainingPfoMatches ( const MCPrimaryMatchingMap mcPrimaryMatchingMap,
const IntSet usedPfoIds,
MatchingDetailsMap matchingDetailsMap 
) const
private

Get the best matches for any pfos left-over after the strong matching procedure.

Parameters
mcPrimaryMatchingMapthe input/raw mc primary matching map
usedPfoIdsthe list of pfo ids with an existing match
matchingDetailsMapthe matching details map, to be populated

Definition at line 778 of file PFParticleValidation_module.cc.

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

◆ GetSimpleMCPrimaryList()

void lar_pandora::PFParticleValidation::GetSimpleMCPrimaryList ( const art::Event &  evt,
const MCParticlesToHits mcParticlesToHits,
const HitsToMCParticles hitsToMCParticles,
const MCParticleMatchingMap mcParticleMatchingMap,
SimpleMCPrimaryList simpleMCPrimaryList 
) const
private

Extract details of each mc primary (ordered by number of true hits)

Parameters
evtthe event
mcParticlesToHitsthe mc primary to hits map
hitsToMCParticlesthe hits to mc particles map
mcParticleMatchingMapthe mc to particle to pf particle matching map (to record number of matched pf particles)
simpleMCPrimaryListto receive the populated simple mc primary list

Definition at line 490 of file PFParticleValidation_module.cc.

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

◆ GetStrongestPfoMatch()

bool lar_pandora::PFParticleValidation::GetStrongestPfoMatch ( const MCPrimaryMatchingMap mcPrimaryMatchingMap,
IntSet usedMCIds,
IntSet usedPfoIds,
MatchingDetailsMap matchingDetailsMap 
) const
private

Get the strongest pfo match (most matched hits) between an available mc primary and an available pfo.

Parameters
mcPrimaryMatchingMapthe input/raw mc primary matching map
usedMCIdsthe list of mc primary ids with an existing match
usedPfoIdsthe list of pfo ids with an existing match
matchingDetailsMapthe matching details map, to be populated

Definition at line 735 of file PFParticleValidation_module.cc.

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

◆ HasMatch()

bool lar_pandora::PFParticleValidation::HasMatch ( const SimpleMCPrimary simpleMCPrimary,
const SimpleMatchedPfoList simpleMatchedPfoList,
const MatchingDetailsMap matchingDetailsMap 
) const
private

Whether a provided mc primary has a match, of any quality (use simple matched pfo list and information in matching details map)

Parameters
simpleMCPrimarythe simple mc primary
simpleMatchedPfoListthe list of simple matched pfos
matchingDetailsMapthe matching details map
Returns
boolean

Definition at line 890 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

◆ IsGoodMatch()

bool lar_pandora::PFParticleValidation::IsGoodMatch ( const SimpleMCPrimary simpleMCPrimary,
const SimpleMatchedPfo simpleMatchedPfo 
) const
private

Whether a provided mc primary and pfo are deemed to be a good match.

Parameters
simpleMCPrimarythe simple mc primary
simpleMatchedPfothe simple matched pfo
Returns
boolean

Definition at line 905 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

◆ IsGoodMCPrimary()

bool lar_pandora::PFParticleValidation::IsGoodMCPrimary ( const SimpleMCPrimary simpleMCPrimary) const
private

Whether a provided mc primary passes selection, based on number of "good" hits.

Parameters
simpleMCPrimarythe simple mc primary
Returns
boolean

Definition at line 874 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

◆ IsNeutrinoInduced()

bool lar_pandora::PFParticleValidation::IsNeutrinoInduced ( const art::Ptr< simb::MCParticle >  pMCParticle,
const MCParticlesToMCTruth artMCParticlesToMCTruth 
) const
private

Whether a mc particle is neutrino induced.

Parameters
pMCParticleaddress of the mc particle
artMCParticlesToMCTruththe mapping from mc particles to mc truth
Returns
boolean

Definition at line 543 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

◆ PerformMatching()

void lar_pandora::PFParticleValidation::PerformMatching ( const MCPrimaryMatchingMap mcPrimaryMatchingMap,
MatchingDetailsMap matchingDetailsMap 
) const
private

Apply a well-defined matching procedure to the comprehensive matches in the provided mc primary matching map.

Parameters
mcPrimaryMatchingMapthe input/raw mc primary matching map
matchingDetailsMapthe matching details map, to be populated

Definition at line 722 of file PFParticleValidation_module.cc.

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

◆ PrintAllOutput()

void lar_pandora::PFParticleValidation::PrintAllOutput ( const MCTruthVector mcTruthVector,
const PFParticleVector recoNeutrinoVector,
const MCPrimaryMatchingMap mcPrimaryMatchingMap 
) const
private

Print all the raw matching output to screen.

Parameters
mcTruthVectorthe mc truth vector
recoNeutrinoVectorthe reco neutrino vector
mcPrimaryMatchingMapthe input/raw mc primary matching map

Definition at line 672 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

◆ PrintMatchingOutput()

void lar_pandora::PFParticleValidation::PrintMatchingOutput ( const MCPrimaryMatchingMap mcPrimaryMatchingMap,
const MatchingDetailsMap matchingDetailsMap 
) const
private

Print the results of the matching procedure.

Parameters
mcPrimaryMatchingMapthe input/raw mc primary matching map
matchingDetailsMapthe matching details map

Definition at line 806 of file PFParticleValidation_module.cc.

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

◆ reconfigure()

void lar_pandora::PFParticleValidation::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 366 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

◆ SortSimpleMatchedPfos()

bool lar_pandora::PFParticleValidation::SortSimpleMatchedPfos ( const SimpleMatchedPfo lhs,
const SimpleMatchedPfo rhs 
)
staticprivate

Sort simple matched pfos by number of matched hits.

Parameters
lhsthe left-hand side
rhsthe right-hand side
Returns
boolean

Definition at line 947 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

◆ SortSimpleMCPrimaries()

bool lar_pandora::PFParticleValidation::SortSimpleMCPrimaries ( const SimpleMCPrimary lhs,
const SimpleMCPrimary rhs 
)
staticprivate

Sort simple mc primaries by number of mc hits.

Parameters
lhsthe left-hand side
rhsthe right-hand side
Returns
boolean

Definition at line 937 of file PFParticleValidation_module.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ m_backtrackerLabel

std::string lar_pandora::PFParticleValidation::m_backtrackerLabel
private

The name/label of the back-tracker module.

Definition at line 312 of file PFParticleValidation_module.cc.

◆ m_geantModuleLabel

std::string lar_pandora::PFParticleValidation::m_geantModuleLabel
private

The name/label of the geant module.

Definition at line 311 of file PFParticleValidation_module.cc.

◆ m_hitfinderLabel

std::string lar_pandora::PFParticleValidation::m_hitfinderLabel
private

The name/label of the hit producer module.

Definition at line 309 of file PFParticleValidation_module.cc.

◆ m_matchingMinCompleteness

float lar_pandora::PFParticleValidation::m_matchingMinCompleteness
private

The minimum particle completeness to declare a match.

Definition at line 329 of file PFParticleValidation_module.cc.

◆ m_matchingMinHitsForGoodView

int lar_pandora::PFParticleValidation::m_matchingMinHitsForGoodView
private

The minimum number of good mc primary hits in given view to declare view to be good.

Definition at line 323 of file PFParticleValidation_module.cc.

◆ m_matchingMinPrimaryGoodViews

int lar_pandora::PFParticleValidation::m_matchingMinPrimaryGoodViews
private

The minimum number of good views for a mc primary.

Definition at line 324 of file PFParticleValidation_module.cc.

◆ m_matchingMinPrimaryHits

int lar_pandora::PFParticleValidation::m_matchingMinPrimaryHits
private

The minimum number of good mc primary hits used in matching scheme.

Definition at line 321 of file PFParticleValidation_module.cc.

◆ m_matchingMinPurity

float lar_pandora::PFParticleValidation::m_matchingMinPurity
private

The minimum particle purity to declare a match.

Definition at line 330 of file PFParticleValidation_module.cc.

◆ m_matchingMinSharedHits

int lar_pandora::PFParticleValidation::m_matchingMinSharedHits
private

The minimum number of shared hits used in matching scheme.

Definition at line 328 of file PFParticleValidation_module.cc.

◆ m_neutrinoInducedOnly

bool lar_pandora::PFParticleValidation::m_neutrinoInducedOnly
private

Whether to consider only mc particles that were neutrino induced.

Definition at line 318 of file PFParticleValidation_module.cc.

◆ m_particleLabel

std::string lar_pandora::PFParticleValidation::m_particleLabel
private

The name/label of the particle producer module.

Definition at line 310 of file PFParticleValidation_module.cc.

◆ m_printAllToScreen

bool lar_pandora::PFParticleValidation::m_printAllToScreen
private

Whether to print all/raw matching details to screen.

Definition at line 314 of file PFParticleValidation_module.cc.

◆ m_printMatchingToScreen

bool lar_pandora::PFParticleValidation::m_printMatchingToScreen
private

Whether to print matching output to screen.

Definition at line 315 of file PFParticleValidation_module.cc.

◆ m_useSmallPrimaries

bool lar_pandora::PFParticleValidation::m_useSmallPrimaries
private

Whether to consider matches to mc primaries with fewer than m_matchingMinPrimaryHits.

Definition at line 327 of file PFParticleValidation_module.cc.


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