ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
TauID
TauDQA
src
RecoEfficiencyPlots.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
RecoEfficiencyPlots.h
"
6
#include "
AthenaKernel/Units.h
"
7
8
namespace
Tau
{
9
10
RecoEfficiencyPlots::RecoEfficiencyPlots
(
PlotBase
* pParent,
const
std::string& sDir, std::string sTauJetContainerName):
11
PlotBase
(pParent, sDir),
12
m_sTauJetContainerName
(
std
::move(sTauJetContainerName))
13
{
14
}
15
16
void
RecoEfficiencyPlots::initializePlots
()
17
{
18
m_eff_truth_pt_all
=
BookTProfile
(
"RecoEff_TruthPt_All"
,
" Matched Truth-Reco taus eff in truth pt; truth pt; eff"
, 26, 0., 260.0);
19
m_eff_truth_eta_all
=
BookTProfile
(
"RecoEff_TruthEta_All"
,
" Matched Truth-Reco taus eff in truth eta; truth eta; eff"
, 10, -2.5,2.5);
20
m_eff_mu_all
=
BookTProfile
(
"RecoEff_Mu_All"
,
"Matched Truth-Reco taus eff in mu; mu; eff"
, 8, 10, 90);
21
22
m_eff_truth_pt_1p
=
BookTProfile
(
"RecoEff_TruthPt_1P"
,
" Matched 1P Truth-Reco taus eff in truth pt; truth pt; eff"
, 26, 0., 260.0);
23
m_eff_truth_eta_1p
=
BookTProfile
(
"RecoEff_TruthEta_1P"
,
" Matched 1P Truth-Reco taus eff in truth eta; truth eta; eff"
, 10, -2.5,2.5);
24
m_eff_mu_1p
=
BookTProfile
(
"RecoEff_Mu_1P"
,
"Matched 1P Truth-Reco taus eff in mu; mu; eff"
, 8, 10, 90);
25
26
m_eff_truth_pt_3p
=
BookTProfile
(
"RecoEff_TruthPt_3P"
,
" Matched 3P Truth-Reco taus eff in truth pt; truth pt; eff"
, 26, 0., 260.0);
27
m_eff_truth_eta_3p
=
BookTProfile
(
"RecoEff_TruthEta_3P"
,
" Matched 3P Truth-Reco taus eff in truth eta; truth eta; eff"
, 10, -2.5,2.5);
28
m_eff_mu_3p
=
BookTProfile
(
"RecoEff_Mu_3P"
,
"Matched 3P Truth-Reco taus eff in mu; mu; eff"
, 8, 10, 90);
29
30
}
31
32
void
RecoEfficiencyPlots::fill
(std::vector<const xAOD::TruthParticle*> & truth_taus, std::vector<const xAOD::TauJet*> & reco_taus,
float
weight,
float
avg_mu)
33
{
34
35
static
const
SG::ConstAccessor<double>
acc_ptvis(
"pt_vis"
);
36
static
const
SG::ConstAccessor<double>
acc_etavis(
"eta_vis"
);
37
static
const
SG::ConstAccessor<char>
accIsHadronicTau (
"IsHadronicTau"
);
38
static
const
SG::ConstAccessor<unsigned long>
acc_ntracks(
"numChargedPion"
);
39
40
for
(
auto
truth_tau : truth_taus) {
41
42
// check that truth tau is not a null pointer
43
if
(truth_tau ==
nullptr
){
continue
; }
44
// place some minimum kinematic requirements on the truth taus
45
if
((acc_ptvis(*truth_tau) < 15 * Athena::Units::GeV) || (std::abs(acc_etavis(*truth_tau)) > 2.5)){
continue
; }
46
// select only truth hadronic taus
47
if
(!(accIsHadronicTau(*truth_tau))) {
continue
; }
48
49
bool
isMatched =
false
;
50
for
(
auto
reco_tau : reco_taus) {
51
if
(truth_tau->p4().DeltaR(reco_tau->p4()) < 0.2) {
52
isMatched =
true
;
53
break
;
54
}
55
}
56
m_eff_truth_pt_all
->Fill(acc_ptvis(*truth_tau)/Athena::Units::GeV,isMatched,weight);
57
m_eff_truth_eta_all
->Fill(acc_etavis(*truth_tau),isMatched,weight);
58
m_eff_mu_all
->Fill(avg_mu,isMatched,weight);
59
60
if
(acc_ntracks(*truth_tau) == 1){
61
m_eff_truth_pt_1p
->Fill(acc_ptvis(*truth_tau)/Athena::Units::GeV,isMatched,weight);
62
m_eff_truth_eta_1p
->Fill(acc_etavis(*truth_tau),isMatched,weight);
63
m_eff_mu_1p
->Fill(avg_mu,isMatched,weight);
64
}
65
66
if
(acc_ntracks(*truth_tau) == 3){
67
m_eff_truth_pt_3p
->Fill(acc_ptvis(*truth_tau)/Athena::Units::GeV,isMatched,weight);
68
m_eff_truth_eta_3p
->Fill(acc_etavis(*truth_tau),isMatched,weight);
69
m_eff_mu_3p
->Fill(avg_mu,isMatched,weight);
70
}
71
}
72
}
73
74
}
RecoEfficiencyPlots.h
Units.h
Wrapper to avoid constant divisions when using units.
PlotBase::BookTProfile
TProfile * BookTProfile(std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, float startY=-1, float endY=-1, bool prependDir=true, bool useRMS=false)
Book a TProfile histogram.
Definition
PlotBase.cxx:186
PlotBase::PlotBase
PlotBase(PlotBase *parent, std::string_view sDir)
Definition
PlotBase.cxx:29
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
Tau::RecoEfficiencyPlots::m_eff_mu_all
TProfile * m_eff_mu_all
Definition
RecoEfficiencyPlots.h:25
Tau::RecoEfficiencyPlots::m_eff_truth_eta_1p
TProfile * m_eff_truth_eta_1p
Definition
RecoEfficiencyPlots.h:28
Tau::RecoEfficiencyPlots::m_eff_truth_eta_all
TProfile * m_eff_truth_eta_all
Definition
RecoEfficiencyPlots.h:24
Tau::RecoEfficiencyPlots::RecoEfficiencyPlots
RecoEfficiencyPlots(PlotBase *pParent, const std::string &sDir, std::string sTauJetContainerName)
Definition
RecoEfficiencyPlots.cxx:10
Tau::RecoEfficiencyPlots::m_eff_truth_eta_3p
TProfile * m_eff_truth_eta_3p
Definition
RecoEfficiencyPlots.h:32
Tau::RecoEfficiencyPlots::m_eff_mu_1p
TProfile * m_eff_mu_1p
Definition
RecoEfficiencyPlots.h:29
Tau::RecoEfficiencyPlots::m_sTauJetContainerName
std::string m_sTauJetContainerName
Definition
RecoEfficiencyPlots.h:37
Tau::RecoEfficiencyPlots::m_eff_truth_pt_1p
TProfile * m_eff_truth_pt_1p
Definition
RecoEfficiencyPlots.h:27
Tau::RecoEfficiencyPlots::m_eff_truth_pt_3p
TProfile * m_eff_truth_pt_3p
Definition
RecoEfficiencyPlots.h:31
Tau::RecoEfficiencyPlots::initializePlots
void initializePlots()
Definition
RecoEfficiencyPlots.cxx:16
Tau::RecoEfficiencyPlots::m_eff_mu_3p
TProfile * m_eff_mu_3p
Definition
RecoEfficiencyPlots.h:33
Tau::RecoEfficiencyPlots::m_eff_truth_pt_all
TProfile * m_eff_truth_pt_all
Definition
RecoEfficiencyPlots.h:23
Tau::RecoEfficiencyPlots::fill
void fill(std::vector< const xAOD::TruthParticle * > &truth_taus, std::vector< const xAOD::TauJet * > &reco_taus, float weight, float avg_mu)
Definition
RecoEfficiencyPlots.cxx:32
Tau
Definition
TauDQA/src/CorePlots.cxx:8
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0