8 #ifndef LAR_EVENT_CLUSTER_VALIDATION_ALGORITHM_H 9 #define LAR_EVENT_CLUSTER_VALIDATION_ALGORITHM_H 1 11 #include "Pandora/Algorithm.h" 61 typedef std::map<const pandora::Cluster *const, std::map<const pandora::MCParticle *const, int>>
ContingencyTable;
63 pandora::StatusCode
Run();
64 pandora::StatusCode
ReadSettings(
const pandora::TiXmlHandle xmlHandle);
72 void GetMetrics(
const std::map<const pandora::CaloHit *const, CaloHitParents> &hitParents,
ClusterMetrics &metrics)
const;
80 float CalcRandIndex(std::map<const pandora::CaloHit *const, CaloHitParents> &hitParents)
const;
89 void GetHitParents(
const pandora::CaloHitList &caloHits,
const pandora::ClusterList &clusters,
90 std::map<const pandora::CaloHit *const, CaloHitParents> &hitParents)
const;
105 std::map<const pandora::CaloHit *const, CaloHitParents>
ApplyPDGCut(
106 std::map<const pandora::CaloHit *const, CaloHitParents> &hitParents,
const ValidationType &valType)
const;
127 #endif // LAR_EVENT_CLUSTER_VALIDATION_ALGORITHM_H pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
int m_eventNumber
To track the current event number.
std::map< const pandora::Cluster *const, std::map< const pandora::MCParticle *const, int > > ContingencyTable
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)
std::vector< float > m_purities
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.
EventClusterValidationAlgorithm()
Default constructor.
std::vector< float > m_completenesses
pandora::StatusCode Run()
std::string m_caloHitListName
The name of the hit list containing all 2D hits.
const pandora::Cluster * m_pCluster
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...
EventClusterValidationAlgorithm class.
std::string m_fileName
The filename of the ROOT output file.
void GetMetrics(const std::map< const pandora::CaloHit *const, CaloHitParents > &hitParents, ClusterMetrics &metrics) const
Retrieve the metrics of every cluster in a view.
void SetBranches(ClusterMetrics &metrics, float randIdx, std::string branchPrefix) const
Update the branches of the TTree for this entry.
~EventClusterValidationAlgorithm()
Destructor saves the validation TTree along with making and saving a metadata TTree.
std::vector< std::string > m_clusterListNames
The names of the lists of 2D clusters to process.
int m_minMCHitsPerView
Threshold on total main MCParticle hits in each view for consideration in metric calculations.
std::string m_treeName
The name of the ROOT tree.
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.
const pandora::MCParticle * m_pMainMC
std::vector< int > m_nRecoHits