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 78 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 343 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 346 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 116 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 93 of file TrackTruthMatchingBaseAlg.h.

98 {
103 match_prob);
104 if constexpr(DetailEnabled) {
106 // truth particle already had a best match
109 }
110 else {
113 }
114 }
115 }
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 313 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 332 of file TrackTruthMatchingBaseAlg.h.

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

◆ perPdgIdSize()

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

Definition at line 336 of file TrackTruthMatchingBaseAlg.h.

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

◆ 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 446 of file TrackTruthMatchingBaseAlg.cxx.

452 {
453 if constexpr(DetailEnabled) {
454 static constexpr bool rotate=true;// row : eta/PDG ID; column: pt
456 std::string("with asso. track"),
457 std::string("with >1 asso. tracks"),
458 std::string("total tracks")};
460 pt_labels.reserve(statPtBins.size() + 2);
461 unsigned int pt_precision=0;
462 for (float pt : statPtBins) {
463 if (pt<1.) {
464 pt_precision=1;
465 break;
466 }
467 }
468 const std::string labelStr{"pt"};
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");
510 for (unsigned int pdg_i=1; pdg_i < pdgId.size(); ++pdg_i) {
512 a_label << gendata->particleName(pdgId[pdg_i]).value() << " [" << pdgId[pdg_i] << "]";
513 pdg_id_labels.push_back( a_label.str() );
514 }
515 unsigned int max_pdg_id_slots=m_statPerPdgId.size()/(statPtBins.size()+2);
516 assert( m_statPerPdgId.size() % (statPtBins.size()+2) == 0 );
517 // also the unused columns are projected, but that does not harm :
520
521 if (statPtBins.empty() || printDetails) {
523 (!statPtBins.empty()
524 ? hfill("pt ",
525 "PDG-id",
528 : std::string("eta")),
529 !statPtBins.empty());
530 }
531 if (!statPtBins.empty()) {
532 parent.printData2D(pt_labels, pdg_id_labels,
533 rotate
534 ? hfill("PDG ID","\\ pt", TableUtils::maxLabelWidth(pdg_id_labels))
535 : hfill("pt","\\ PDG ID", TableUtils::maxLabelWidth(pt_labels)),
538 rotate);
539 }
540 }
541 }
542 }

◆ 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 277 of file TrackTruthMatchingBaseAlg.h.

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

Member Data Documentation

◆ doDetail

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

Definition at line 79 of file TrackTruthMatchingBaseAlg.h.

◆ m_counterPerEta

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

Definition at line 349 of file TrackTruthMatchingBaseAlg.h.

◆ m_counterPerPdgId

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

Definition at line 350 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTracksWithoutAssociatedTruthParticle

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

Definition at line 122 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTracksWithoutSelectedTruthParticle

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

Definition at line 123 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTruthCuts

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

Definition at line 126 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTruthParticleNonoiseMismatches

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

Definition at line 124 of file TrackTruthMatchingBaseAlg.h.

◆ m_nTruthParticleWithoutAssociatedCounts

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

Definition at line 121 of file TrackTruthMatchingBaseAlg.h.

◆ m_statPerEta

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

Definition at line 351 of file TrackTruthMatchingBaseAlg.h.

◆ m_statPerPdgId

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

Definition at line 352 of file TrackTruthMatchingBaseAlg.h.

◆ m_truthParticlesWithAssociatedTrack

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

Definition at line 119 of file TrackTruthMatchingBaseAlg.h.

◆ m_truthSelectionCuts

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

Definition at line 340 of file TrackTruthMatchingBaseAlg.h.


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