ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
TauAnalysisAlgorithms
Root
TauExtraVariablesAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
#include <
TauAnalysisAlgorithms/TauExtraVariablesAlg.h
>
8
9
#include <
AsgDataHandles/ReadHandle.h
>
10
#include <
AsgDataHandles/WriteDecorHandle.h
>
11
12
13
namespace
CP
{
14
15
StatusCode
TauExtraVariablesAlg::initialize
() {
16
17
if
(
m_nTracksChargedKey
.contHandleKey().key() ==
m_nTracksChargedKey
.key()) {
18
m_nTracksChargedKey
=
m_tausKey
.key() +
"."
+
m_nTracksChargedKey
.key();
19
}
20
21
ANA_CHECK
(
m_tausKey
.initialize());
22
ANA_CHECK
(
m_nTracksChargedKey
.initialize());
23
24
// register type for output
25
SG::ConstAccessor<int>
(
m_nTracksChargedKey
.key().substr (
m_nTracksChargedKey
.key().find_last_of(
"."
) + 1));
26
27
return
StatusCode::SUCCESS;
28
}
29
30
StatusCode
TauExtraVariablesAlg::execute
(
const
EventContext &ctx)
const
{
31
32
SG::ReadHandle<xAOD::TauJetContainer>
taus
(
m_tausKey
, ctx);
33
34
SG::WriteDecorHandle<xAOD::TauJetContainer, int>
nTracksChargedHandle(
m_nTracksChargedKey
, ctx);
35
for
(
const
xAOD::TauJet
*tau : *
taus
) {
36
nTracksChargedHandle(*tau) = tau->nTracksCharged();
37
}
38
39
return
StatusCode::SUCCESS;
40
}
41
42
}
// namespace
ReadHandle.h
Handle class for reading from StoreGate.
WriteDecorHandle.h
Handle class for adding a decoration to an object.
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
taus
static Double_t taus
Definition
LArPhysWaveHECTool.cxx:37
TauExtraVariablesAlg.h
CP::TauExtraVariablesAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
TauExtraVariablesAlg.cxx:30
CP::TauExtraVariablesAlg::initialize
virtual StatusCode initialize() override
Definition
TauExtraVariablesAlg.cxx:15
CP::TauExtraVariablesAlg::m_nTracksChargedKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_nTracksChargedKey
Definition
TauExtraVariablesAlg.h:26
CP::TauExtraVariablesAlg::m_tausKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_tausKey
Definition
TauExtraVariablesAlg.h:25
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
xAOD::TauJet
TauJet_v3 TauJet
Definition of the current "tau version".
Definition
TauJet.h:17
Generated on
for ATLAS Offline Software by
1.17.0