![]() |
LArSoft
v10_06_00
Liquid Argon Software toolkit - https://larsoft.org/
|
EventClusterValidationAlgorithm class. More...
#include "EventClusterValidationAlgorithm.h"
Classes | |
struct | CaloHitParents |
struct | ClusterMetrics |
Public Member Functions | |
EventClusterValidationAlgorithm () | |
Default constructor. More... | |
~EventClusterValidationAlgorithm () | |
Destructor saves the validation TTree along with making and saving a metadata TTree. More... | |
Private Types | |
enum | ValidationType { ALL, SHOWER, TRACK } |
typedef std::map< const pandora::Cluster *const, std::map< const pandora::MCParticle *const, int > > | ContingencyTable |
Private Member Functions | |
pandora::StatusCode | Run () |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
void | GetMetrics (const std::map< const pandora::CaloHit *const, CaloHitParents > &hitParents, ClusterMetrics &metrics) const |
Retrieve the metrics of every cluster in a view. More... | |
float | CalcRandIndex (std::map< const pandora::CaloHit *const, CaloHitParents > &hitParents) const |
Calculate Rand Index for the clusters with the clusters of true MCParticles. (Ref. for Adjusted Rand Index: https://link.springer.com/article/10.1007/BF01908075) More... | |
void | GetHitParents (const pandora::CaloHitList &caloHits, const pandora::ClusterList &clusters, std::map< const pandora::CaloHit *const, CaloHitParents > &hitParents) const |
Find the cluster and MCParticle each hit belongs to. More... | |
void | ApplyMCParticleMinSumHits (std::map< const pandora::CaloHit *const, CaloHitParents > &hitParents) const |
Erase hits associated to an MCParticle that does meet a minimum number of hits in the view. More... | |
std::map< const pandora::CaloHit *const, CaloHitParents > | ApplyPDGCut (std::map< const pandora::CaloHit *const, CaloHitParents > &hitParents, const ValidationType &valType) const |
Erase hits not associated with an MCParticle PDG incompatible with track/shower/all. More... | |
void | SetBranches (ClusterMetrics &metrics, float randIdx, std::string branchPrefix) const |
Update the branches of the TTree for this entry. More... | |
Private Attributes | |
int | m_eventNumber |
To track the current event number. More... | |
std::string | m_fileName |
The filename of the ROOT output file. More... | |
std::string | m_treeName |
The name of the ROOT tree. More... | |
std::string | m_caloHitListName |
The name of the hit list containing all 2D hits. More... | |
std::vector< std::string > | m_clusterListNames |
The names of the lists of 2D clusters to process. More... | |
int | m_minMCHitsPerView |
Threshold on total main MCParticle hits in each view for consideration in metric calculations. More... | |
EventClusterValidationAlgorithm class.
Definition at line 19 of file EventClusterValidationAlgorithm.h.
|
private |
Definition at line 61 of file EventClusterValidationAlgorithm.h.
Enumerator | |
---|---|
ALL | |
SHOWER | |
TRACK |
Definition at line 34 of file EventClusterValidationAlgorithm.h.
lar_content::EventClusterValidationAlgorithm::EventClusterValidationAlgorithm | ( | ) |
Default constructor.
Definition at line 43 of file EventClusterValidationAlgorithm.cc.
References m_caloHitListName, and m_minMCHitsPerView.
lar_content::EventClusterValidationAlgorithm::~EventClusterValidationAlgorithm | ( | ) |
Destructor saves the validation TTree along with making and saving a metadata TTree.
Definition at line 52 of file EventClusterValidationAlgorithm.cc.
References m_fileName, m_minMCHitsPerView, and m_treeName.
|
private |
Erase hits associated to an MCParticle that does meet a minimum number of hits in the view.
[in,out] | hitParents | Map of hits to the Cluster/MCParticle they belong to |
Definition at line 172 of file EventClusterValidationAlgorithm.cc.
References m_minMCHitsPerView.
Referenced by Run().
|
private |
Erase hits not associated with an MCParticle PDG incompatible with track/shower/all.
[in] | hitParents | Map of hits to the Cluster/MCParticle they belong to |
[in] | valType | Enum for track/shower/all |
Definition at line 194 of file EventClusterValidationAlgorithm.cc.
References util::abs().
Referenced by Run().
|
private |
Calculate Rand Index for the clusters with the clusters of true MCParticles. (Ref. for Adjusted Rand Index: https://link.springer.com/article/10.1007/BF01908075)
[in] | hitParents | Map of hits being considered to the Cluster/MCParticle they belong to |
Definition at line 291 of file EventClusterValidationAlgorithm.cc.
References lar_content::LArMonitoringHelper::CalcRandIndex().
Referenced by Run().
|
private |
Find the cluster and MCParticle each hit belongs to.
[in] | caloHits | List of hits |
[in] | clusters | List of clusters |
[out] | hitParents | Map of hits to the Cluster/MCParticle they belong to |
Definition at line 131 of file EventClusterValidationAlgorithm.cc.
References weight.
Referenced by Run().
|
private |
Retrieve the metrics of every cluster in a view.
[in] | hitParents | Map of hits being considered to the Cluster/MCParticle they belong to |
[out] | metrics | Metrics for the clusters in this view |
Definition at line 216 of file EventClusterValidationAlgorithm.cc.
References lar_content::EventClusterValidationAlgorithm::ClusterMetrics::m_completenesses, lar_content::EventClusterValidationAlgorithm::ClusterMetrics::m_nClusters, lar_content::EventClusterValidationAlgorithm::ClusterMetrics::m_nHits, lar_content::EventClusterValidationAlgorithm::ClusterMetrics::m_nMainMCs, lar_content::EventClusterValidationAlgorithm::ClusterMetrics::m_nRecoHits, and lar_content::EventClusterValidationAlgorithm::ClusterMetrics::m_purities.
Referenced by Run().
|
private |
Definition at line 333 of file EventClusterValidationAlgorithm.cc.
References m_caloHitListName, m_clusterListNames, m_fileName, m_minMCHitsPerView, and m_treeName.
|
private |
Definition at line 63 of file EventClusterValidationAlgorithm.cc.
References ApplyMCParticleMinSumHits(), ApplyPDGCut(), CalcRandIndex(), lar_content::LArClusterHelper::GetClusterHitType(), GetHitParents(), GetMetrics(), m_caloHitListName, m_clusterListNames, m_eventNumber, m_minMCHitsPerView, m_treeName, and SetBranches().
|
private |
Update the branches of the TTree for this entry.
[in] | metrics | Metrics for clusters in a view |
[in] | randIfx | Adjusted Rand index |
[in] | branchPrefix | Prefix for the branch name |
Definition at line 310 of file EventClusterValidationAlgorithm.cc.
References m_treeName.
Referenced by Run().
|
private |
The name of the hit list containing all 2D hits.
Definition at line 120 of file EventClusterValidationAlgorithm.h.
Referenced by EventClusterValidationAlgorithm(), ReadSettings(), and Run().
|
private |
The names of the lists of 2D clusters to process.
Definition at line 121 of file EventClusterValidationAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
To track the current event number.
Definition at line 117 of file EventClusterValidationAlgorithm.h.
Referenced by Run().
|
private |
The filename of the ROOT output file.
Definition at line 118 of file EventClusterValidationAlgorithm.h.
Referenced by ReadSettings(), and ~EventClusterValidationAlgorithm().
|
private |
Threshold on total main MCParticle hits in each view for consideration in metric calculations.
Definition at line 122 of file EventClusterValidationAlgorithm.h.
Referenced by ApplyMCParticleMinSumHits(), EventClusterValidationAlgorithm(), ReadSettings(), Run(), and ~EventClusterValidationAlgorithm().
|
private |
The name of the ROOT tree.
Definition at line 119 of file EventClusterValidationAlgorithm.h.
Referenced by ReadSettings(), Run(), SetBranches(), and ~EventClusterValidationAlgorithm().