ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled > Struct Template Reference

#include <TrackTruthMatchingBaseAlg.h>

Inheritance diagram for ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >:
Collaboration diagram for ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >:

Public Types

using TruthParticleSet
using CounterArrayVec
using StatArrayVec

Public Member Functions

 EventStatBase (const IAthSelectionTool &truth_selection_tool, std::size_t per_eta_size, std::size_t per_pdg_size, std::size_t track_to_truth_size)
void fill (unsigned int eta_category_i, unsigned int pdg_id_category_i, float hit_efficiency, float hit_purity, float match_prob, const xAOD::TruthParticle *best_match)
void reset (const IAthSelectionTool &truth_selection_tool, std::size_t per_eta_size, std::size_t per_pdg_size)
void fill (unsigned int eta_category_i, unsigned int pdg_id_category_i, float hit_efficiency, float hit_purity, float match_prob)
void incrementTotal (unsigned int eta_category_i, unsigned int pdg_id_category_i)
BaseStat< DetailEnabled > & operator+= (const BaseStat< DetailEnabled > &event_stat)
void printStatTables (const TrackTruthMatchingBaseAlg &parent, const std::vector< float > &statPtBins, const std::vector< float > &statEtaBins, std::vector< int > &pdgId, bool printDetails, bool pdgIdCategorisation, bool useAbsEtaForStat)
std::size_t perEtaSize () const
std::size_t perPdgIdSize () const

Public Attributes

TruthParticleSet m_truthParticlesWithAssociatedTrack
unsigned int m_nTruthParticleWithoutAssociatedCounts =0u
unsigned int m_nTracksWithoutAssociatedTruthParticle =0u
unsigned int m_nTracksWithoutSelectedTruthParticle =0u
unsigned int m_nTruthParticleNonoiseMismatches =0u
unsigned int m_nTruthCuts
ActsUtils::StatHist m_truthSelectionCuts
CounterArrayVec m_counterPerEta
CounterArrayVec m_counterPerPdgId
StatArrayVec m_statPerEta
StatArrayVec m_statPerPdgId

Static Public Attributes

static constexpr bool doDetail = DetailEnabled

Detailed Description

template<bool DetailEnabled>
struct ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >

Definition at line 79 of file TrackTruthMatchingBaseAlg.h.

Member Typedef Documentation

◆ CounterArrayVec

template<bool DetailEnabled>
using ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::CounterArrayVec
inherited
Initial value:
std::conditional< DetailEnabled,
std::vector< std::array< std::size_t, kNCategorisedCounter> >,

Definition at line 344 of file TrackTruthMatchingBaseAlg.h.

◆ StatArrayVec

template<bool DetailEnabled>
using ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::StatArrayVec
inherited
Initial value:
std::conditional< DetailEnabled,
std::vector< std::array<ActsUtils::Stat, kNCategorisedStat> >,

Definition at line 347 of file TrackTruthMatchingBaseAlg.h.

◆ TruthParticleSet

template<bool DetailEnabled>
using ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::TruthParticleSet
Initial value:
std::conditional< DetailEnabled,
std::unordered_set<const xAOD::TruthParticle *>,

Definition at line 117 of file TrackTruthMatchingBaseAlg.h.

Constructor & Destructor Documentation

◆ EventStatBase()

template<bool DetailEnabled>
ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::EventStatBase ( const IAthSelectionTool & truth_selection_tool,
std::size_t per_eta_size,
std::size_t per_pdg_size,
std::size_t track_to_truth_size )
inline

Member Function Documentation

◆ fill() [1/2]

template<bool DetailEnabled>
void ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::fill ( unsigned int eta_category_i,
unsigned int pdg_id_category_i,
float hit_efficiency,
float hit_purity,
float match_prob )
inlineinherited

◆ fill() [2/2]

template<bool DetailEnabled>
void ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::fill ( unsigned int eta_category_i,
unsigned int pdg_id_category_i,
float hit_efficiency,
float hit_purity,
float match_prob,
const xAOD::TruthParticle * best_match )
inline

Definition at line 94 of file TrackTruthMatchingBaseAlg.h.

99 {
104 match_prob);
105 if constexpr(DetailEnabled) {
107 // truth particle already had a best match
110 }
111 else {
114 }
115 }
116 }
void fill(unsigned int eta_category_i, unsigned int pdg_id_category_i, float hit_efficiency, float hit_purity, float match_prob)

◆ incrementTotal()

template<bool DetailEnabled>
void ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::incrementTotal ( unsigned int eta_category_i,
unsigned int pdg_id_category_i )
inlineinherited

Definition at line 314 of file TrackTruthMatchingBaseAlg.h.

◆ operator+=()

template<bool DetailEnabled>
TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled > & ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::operator+= ( const BaseStat< DetailEnabled > & event_stat)
inlineinherited

◆ perEtaSize()

template<bool DetailEnabled>
std::size_t ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::perEtaSize ( ) const
inlineinherited

Definition at line 333 of file TrackTruthMatchingBaseAlg.h.

333 {
334 if constexpr(DetailEnabled) { return m_counterPerEta.size(); }
335 else { return 0u; }
336 }

◆ perPdgIdSize()

template<bool DetailEnabled>
std::size_t ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::perPdgIdSize ( ) const
inlineinherited

Definition at line 337 of file TrackTruthMatchingBaseAlg.h.

337 {
338 if constexpr(DetailEnabled) { return m_counterPerPdgId.size(); }
339 else { return 0u; }
340 }

◆ printStatTables()

template<bool DetailEnabled>
void ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::printStatTables ( const TrackTruthMatchingBaseAlg & parent,
const std::vector< float > & statPtBins,
const std::vector< float > & statEtaBins,
std::vector< int > & pdgId,
bool printDetails,
bool pdgIdCategorisation,
bool useAbsEtaForStat )
inherited

Definition at line 447 of file TrackTruthMatchingBaseAlg.cxx.

453 {
454 if constexpr(DetailEnabled) {
455 static constexpr bool rotate=true;// row : eta/PDG ID; column: pt
457 std::string("with asso. track"),
458 std::string("with >1 asso. tracks"),
459 std::string("total tracks")};
461 pt_labels.reserve(statPtBins.size() + 2);
462 unsigned int pt_precision=0;
463 for (float pt : statPtBins) {
464 if (pt<1.) {
465 pt_precision=1;
466 break;
467 }
468 }
469 for (std::size_t bin_i = 0; bin_i < statPtBins.size() + 2; ++bin_i) {
471 }
472 // statistics eta-bins
473 {
475 eta_labels.reserve(statEtaBins.size() + 2);
476 for (std::size_t eta_bin_i = 0; eta_bin_i < statEtaBins.size() + 2; ++eta_bin_i) {
478 }
479
482
483 if (statPtBins.empty() || printDetails) {
485 (!statPtBins.empty()
486 ? hfill("pt ",
487 "eta",
490 : std::string("eta") ),
491 !statPtBins.empty());
492 }
493 if (!statPtBins.empty()) {
494 parent.printData2D(pt_labels, eta_labels,
495 rotate
497 : hfill("pt","\\ eta", TableUtils::maxLabelWidth(pt_labels)),
500 rotate);
501 }
502 }
503
504 // statistics in PDG ID bins.
507 pdg_id_labels.reserve( pdgId.size());
508 pdg_id_labels.push_back("Other");
509 for (unsigned int pdg_i=1; pdg_i < pdgId.size(); ++pdg_i) {
511 a_label << HepPID::particleName(pdgId[pdg_i]) << " [" << pdgId[pdg_i] << "]";
512 pdg_id_labels.push_back( a_label.str() );
513 }
514 unsigned int max_pdg_id_slots=m_statPerPdgId.size()/(statPtBins.size()+2);
515 assert( m_statPerPdgId.size() % (statPtBins.size()+2) == 0 );
516 // also the unused columns are projected, but that does not harm :
519
520 if (statPtBins.empty() || printDetails) {
522 (!statPtBins.empty()
523 ? hfill("pt ",
524 "PDG-id",
527 : std::string("eta")),
528 !statPtBins.empty());
529 }
530 if (!statPtBins.empty()) {
531 parent.printData2D(pt_labels, pdg_id_labels,
532 rotate
533 ? hfill("PDG ID","\\ pt", TableUtils::maxLabelWidth(pdg_id_labels))
534 : hfill("pt","\\ PDG ID", TableUtils::maxLabelWidth(pt_labels)),
537 rotate);
538 }
539 }
540 }
541 }

◆ reset()

template<bool DetailEnabled>
void ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::reset ( const IAthSelectionTool & truth_selection_tool,
std::size_t per_eta_size,
std::size_t per_pdg_size )
inlineinherited

Definition at line 278 of file TrackTruthMatchingBaseAlg.h.

281 {
282 m_truthSelectionCuts.setBinning(truth_selection_tool.nCuts()+1, -0.5,truth_selection_tool.nCuts()+.5);
283 if constexpr(DetailEnabled) {
284 m_counterPerEta.clear();
285 m_counterPerPdgId.clear();
286 m_statPerEta.clear();
287 m_statPerPdgId.clear();
290 m_statPerEta.resize( per_eta_size );
292 }
293 }

Member Data Documentation

◆ doDetail

template<bool DetailEnabled>
bool ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::doDetail = DetailEnabled
staticconstexpr

Definition at line 80 of file TrackTruthMatchingBaseAlg.h.

◆ m_counterPerEta

template<bool DetailEnabled>
CounterArrayVec ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::m_counterPerEta
inherited

Definition at line 350 of file TrackTruthMatchingBaseAlg.h.

◆ m_counterPerPdgId

template<bool DetailEnabled>
CounterArrayVec ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::m_counterPerPdgId
inherited

Definition at line 351 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTracksWithoutAssociatedTruthParticle

template<bool DetailEnabled>
unsigned int ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::m_nTracksWithoutAssociatedTruthParticle =0u

Definition at line 123 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTracksWithoutSelectedTruthParticle

template<bool DetailEnabled>
unsigned int ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::m_nTracksWithoutSelectedTruthParticle =0u

Definition at line 124 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTruthCuts

template<bool DetailEnabled>
unsigned int ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::m_nTruthCuts

Definition at line 127 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTruthParticleNonoiseMismatches

template<bool DetailEnabled>
unsigned int ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::m_nTruthParticleNonoiseMismatches =0u

Definition at line 125 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTruthParticleWithoutAssociatedCounts

template<bool DetailEnabled>
unsigned int ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::m_nTruthParticleWithoutAssociatedCounts =0u

Definition at line 122 of file TrackTruthMatchingBaseAlg.h.

◆ m_statPerEta

template<bool DetailEnabled>
StatArrayVec ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::m_statPerEta
inherited

Definition at line 352 of file TrackTruthMatchingBaseAlg.h.

◆ m_statPerPdgId

template<bool DetailEnabled>
StatArrayVec ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::m_statPerPdgId
inherited

Definition at line 353 of file TrackTruthMatchingBaseAlg.h.

◆ m_truthParticlesWithAssociatedTrack

template<bool DetailEnabled>
TruthParticleSet ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase< DetailEnabled >::m_truthParticlesWithAssociatedTrack

Definition at line 120 of file TrackTruthMatchingBaseAlg.h.

◆ m_truthSelectionCuts

template<bool DetailEnabled>
ActsUtils::StatHist ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::m_truthSelectionCuts
inherited

Definition at line 341 of file TrackTruthMatchingBaseAlg.h.


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