ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
TauID
TauAnalysisTools
src
TauAnalysisToolsExampleAthena.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// EDM include(s):
6
#include "
xAODTau/TauJetContainer.h
"
7
#include "
AthContainers/ConstAccessor.h
"
8
9
// Local include(s):
10
#include "
TauAnalysisToolsExampleAthena.h
"
11
12
using namespace
TauAnalysisTools
;
13
14
TauAnalysisToolsExampleAthena::TauAnalysisToolsExampleAthena
(
const
std::string& name, ISvcLocator* svcLoc )
15
:
AthAlgorithm
( name, svcLoc )
16
{
17
}
18
19
StatusCode
TauAnalysisToolsExampleAthena::initialize
()
20
{
21
// Greet the user:
22
ATH_MSG_INFO
(
"Initialising"
);
23
ATH_MSG_DEBUG
(
"TauJets SGKey = "
<<
m_sgKey_TauJets
);
24
if
(
m_useMuonRemovalTaus
){
25
ATH_MSG_DEBUG
(
"TauJets_MuonRM SGKey = "
<<
m_sgKey_TauJets_MuonRM
);
26
}
27
ATH_MSG_DEBUG
(
"TauSelectionTool = "
<<
m_selTool
);
28
ATH_MSG_DEBUG
(
"TauSmearingTool = "
<<
m_smearTool
);
29
ATH_MSG_DEBUG
(
"TauEfficiencyTool = "
<<
m_effTool
);
30
31
// Retrieve the tools:
32
ATH_CHECK
(
m_selTool
.retrieve() );
33
ATH_CHECK
(
m_smearTool
.retrieve() );
34
ATH_CHECK
(
m_effTool
.retrieve() );
35
36
// Return gracefully:
37
return
StatusCode::SUCCESS;
38
}
39
40
StatusCode
TauAnalysisToolsExampleAthena::execute
(
const
EventContext&
/*ctx*/
)
41
{
42
// Retrieve the taus:
43
std::vector<const xAOD::TauJet*> taus_to_calibrate;
44
const
xAOD::TauJetContainer
* taus_std = 0;
45
ATH_CHECK
(
evtStore
()->retrieve( taus_std,
m_sgKey_TauJets
) );
46
ATH_MSG_INFO
(
"Number of taus: "
<< taus_std->
size
() );
47
const
xAOD::TauJetContainer
* taus_muonRM = 0;
48
if
(
m_useMuonRemovalTaus
){
49
ATH_CHECK
(
evtStore
()->retrieve( taus_muonRM,
m_sgKey_TauJets_MuonRM
) );
50
ATH_MSG_INFO
(
"Number of muon removal taus: "
<< taus_muonRM->
size
() );
51
taus_to_calibrate =
TauAnalysisTools::combineTauJetsWithMuonRM
(taus_std, taus_muonRM);
52
}
53
else
{
54
for
(
const
xAOD::TauJet
* tau : *taus_std){
55
taus_to_calibrate.push_back(tau);
56
}
57
}
58
// Loop over them:
59
for
(
const
xAOD::TauJet
* tau_uncali : taus_to_calibrate)
60
{
61
ATH_MSG_DEBUG
(
" current tau: eta = "
<< tau_uncali->eta()
62
<<
", phi = "
<< tau_uncali->phi()
63
<<
", pt = "
<< tau_uncali->pt() );
64
65
// Select "good" taus:
66
if
( !
m_selTool
->accept( *tau_uncali ) )
continue
;
67
68
// Print some info about the selected tau:
69
ATH_MSG_INFO
(
" Selected tau: eta = "
<< tau_uncali->eta()
70
<<
", phi = "
<< tau_uncali->phi()
71
<<
", pt = "
<< tau_uncali->pt() );
72
73
// copy constant objects to non-constant
74
xAOD::TauJet
* tau = 0;
75
tau =
new
xAOD::TauJet
();
76
tau->makePrivateStore( *tau_uncali );
77
78
ATH_CHECK
(
m_effTool
->applyEfficiencyScaleFactor(*tau));
79
80
static
const
SG::ConstAccessor<double>
accTauScaleFactorJetID (
"TauScaleFactorJetIDHadTau"
);
81
ATH_MSG_INFO
(
" sf = "
<< accTauScaleFactorJetID (*tau) );
82
83
ATH_CHECK
(
m_smearTool
->applyCorrection(*tau));
84
ATH_MSG_INFO
(
"Unsmeared tau pt "
<< tau->
pt
() <<
" Smeared tau pt: "
<< tau->
p4
().Pt());
85
}
86
87
// Return gracefully:
88
return
StatusCode::SUCCESS;
89
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
TauAnalysisToolsExampleAthena.h
TauJetContainer.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
TauAnalysisTools::TauAnalysisToolsExampleAthena::m_sgKey_TauJets
Gaudi::Property< std::string > m_sgKey_TauJets
StoreGate key for the tau container to investigate.
Definition
TauAnalysisToolsExampleAthena.h:38
TauAnalysisTools::TauAnalysisToolsExampleAthena::m_smearTool
ToolHandle< ITauSmearingTool > m_smearTool
Connection to the smearing tool.
Definition
TauAnalysisToolsExampleAthena.h:48
TauAnalysisTools::TauAnalysisToolsExampleAthena::m_useMuonRemovalTaus
Gaudi::Property< bool > m_useMuonRemovalTaus
Definition
TauAnalysisToolsExampleAthena.h:43
TauAnalysisTools::TauAnalysisToolsExampleAthena::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition
TauAnalysisToolsExampleAthena.cxx:19
TauAnalysisTools::TauAnalysisToolsExampleAthena::m_selTool
ToolHandle< ITauSelectionTool > m_selTool
Connection to the selection tool.
Definition
TauAnalysisToolsExampleAthena.h:46
TauAnalysisTools::TauAnalysisToolsExampleAthena::execute
virtual StatusCode execute(const EventContext &ctx)
Function executing the algorithm.
Definition
TauAnalysisToolsExampleAthena.cxx:40
TauAnalysisTools::TauAnalysisToolsExampleAthena::TauAnalysisToolsExampleAthena
TauAnalysisToolsExampleAthena(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition
TauAnalysisToolsExampleAthena.cxx:14
TauAnalysisTools::TauAnalysisToolsExampleAthena::m_effTool
ToolHandle< ITauEfficiencyCorrectionsTool > m_effTool
Connection to the efficiency correction tool.
Definition
TauAnalysisToolsExampleAthena.h:50
TauAnalysisTools::TauAnalysisToolsExampleAthena::m_sgKey_TauJets_MuonRM
Gaudi::Property< std::string > m_sgKey_TauJets_MuonRM
Special StoreGate key for the muon-removed taus.
Definition
TauAnalysisToolsExampleAthena.h:42
xAOD::TauJet_v3::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition
TauJet_v3.cxx:96
xAOD::TauJet_v3::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
TauAnalysisTools
Definition
PhysValMET.h:37
TauAnalysisTools::combineTauJetsWithMuonRM
std::vector< const xAOD::TauJet * > combineTauJetsWithMuonRM(const xAOD::TauJetContainer *taus_std, const xAOD::TauJetContainer *taus_muonRM)
combine the standard taujets container with the muon removal container
Definition
PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:473
xAOD::TauJet
TauJet_v3 TauJet
Definition of the current "tau version".
Definition
TauJet.h:17
xAOD::TauJetContainer
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
Definition
TauJetContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0