ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled > Struct Template Reference
Inheritance diagram for ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >:
Collaboration diagram for ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >:

Classes

struct  Empty

Public Types

using CounterArrayVec
using StatArrayVec

Public Member Functions

 BaseStat ()=default
 BaseStat (const IAthSelectionTool &truth_selection_tool, std::size_t per_eta_size, std::size_t per_pdg_size)
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

ActsUtils::StatHist m_truthSelectionCuts
CounterArrayVec m_counterPerEta
CounterArrayVec m_counterPerPdgId
StatArrayVec m_statPerEta
StatArrayVec m_statPerPdgId

Detailed Description

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

Definition at line 263 of file TrackTruthMatchingBaseAlg.h.

Member Typedef Documentation

◆ CounterArrayVec

template<bool DetailEnabled>
using ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::CounterArrayVec
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
Initial value:
std::conditional< DetailEnabled,
std::vector< std::array<ActsUtils::Stat, kNCategorisedStat> >,

Definition at line 347 of file TrackTruthMatchingBaseAlg.h.

Constructor & Destructor Documentation

◆ BaseStat() [1/2]

template<bool DetailEnabled>
ActsTrk::TrackTruthMatchingBaseAlg::BaseStat< DetailEnabled >::BaseStat ( )
default

◆ BaseStat() [2/2]

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

Member Function Documentation

◆ fill()

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 )
inline

◆ incrementTotal()

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

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)
inline

◆ perEtaSize()

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

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
inline

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 )

Definition at line 452 of file TrackTruthMatchingBaseAlg.cxx.

458 {
459 if constexpr(DetailEnabled) {
460 static constexpr bool rotate=true;// row : eta/PDG ID; column: pt
462 std::string("with asso. track"),
463 std::string("with >1 asso. tracks"),
464 std::string("total tracks")};
466 pt_labels.reserve(statPtBins.size() + 2);
467 unsigned int pt_precision=0;
468 for (float pt : statPtBins) {
469 if (pt<1.) {
470 pt_precision=1;
471 break;
472 }
473 }
474 for (std::size_t bin_i = 0; bin_i < statPtBins.size() + 2; ++bin_i) {
476 }
477 // statistics eta-bins
478 {
480 eta_labels.reserve(statEtaBins.size() + 2);
481 for (std::size_t eta_bin_i = 0; eta_bin_i < statEtaBins.size() + 2; ++eta_bin_i) {
483 }
484
487
488 if (statPtBins.empty() || printDetails) {
490 (!statPtBins.empty()
491 ? hfill("pt ",
492 "eta",
495 : std::string("eta") ),
496 !statPtBins.empty());
497 }
498 if (!statPtBins.empty()) {
499 parent.printData2D(pt_labels, eta_labels,
500 rotate
502 : hfill("pt","\\ eta", TableUtils::maxLabelWidth(pt_labels)),
505 rotate);
506 }
507 }
508
509 // statistics in PDG ID bins.
512 pdg_id_labels.reserve( pdgId.size());
513 pdg_id_labels.push_back("Other");
514 for (unsigned int pdg_i=1; pdg_i < pdgId.size(); ++pdg_i) {
516 a_label << HepPID::particleName(pdgId[pdg_i]) << " [" << pdgId[pdg_i] << "]";
517 pdg_id_labels.push_back( a_label.str() );
518 }
519 unsigned int max_pdg_id_slots=m_statPerPdgId.size()/(statPtBins.size()+2);
520 assert( m_statPerPdgId.size() % (statPtBins.size()+2) == 0 );
521 // also the unused columns are projected, but that does not harm :
524
525 if (statPtBins.empty() || printDetails) {
527 (!statPtBins.empty()
528 ? hfill("pt ",
529 "PDG-id",
532 : std::string("eta")),
533 !statPtBins.empty());
534 }
535 if (!statPtBins.empty()) {
536 parent.printData2D(pt_labels, pdg_id_labels,
537 rotate
538 ? hfill("PDG ID","\\ pt", TableUtils::maxLabelWidth(pdg_id_labels))
539 : hfill("pt","\\ PDG ID", TableUtils::maxLabelWidth(pt_labels)),
542 rotate);
543 }
544 }
545 }
546 }

◆ 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 )
inline

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

◆ m_counterPerEta

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

Definition at line 350 of file TrackTruthMatchingBaseAlg.h.

◆ m_counterPerPdgId

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

Definition at line 351 of file TrackTruthMatchingBaseAlg.h.

◆ m_statPerEta

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

Definition at line 352 of file TrackTruthMatchingBaseAlg.h.

◆ m_statPerPdgId

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

Definition at line 353 of file TrackTruthMatchingBaseAlg.h.

◆ m_truthSelectionCuts

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

Definition at line 341 of file TrackTruthMatchingBaseAlg.h.


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