ATLAS Offline Software
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
#include <
AsgTools/CurrentContext.h
>
12
13
14
namespace
CP
{
15
16
StatusCode
TauExtraVariablesAlg::initialize
() {
17
18
if
(
m_nTracksKey
.contHandleKey().key() ==
m_nTracksKey
.key()) {
19
m_nTracksKey
=
m_tausKey
.key() +
"."
+
m_nTracksKey
.key();
20
}
21
22
ANA_CHECK
(
m_tausKey
.initialize());
23
ANA_CHECK
(
m_nTracksKey
.initialize());
24
25
return
StatusCode::SUCCESS;
26
}
27
28
StatusCode
TauExtraVariablesAlg::execute
() {
29
30
const
EventContext& ctx = Gaudi::Hive::currentContext();
31
SG::ReadHandle<xAOD::TauJetContainer>
taus(
m_tausKey
, ctx);
32
33
SG::WriteDecorHandle<xAOD::TauJetContainer, int>
nTracksHandle(
m_nTracksKey
, ctx);
34
for
(
const
xAOD::TauJet
*tau : *taus) {
35
nTracksHandle(*tau) = tau->nTracks();
36
}
37
38
return
StatusCode::SUCCESS;
39
}
40
41
}
// namespace
CurrentContext.h
SG::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:70
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition:
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP
Select isolated Photons, Electrons and Muons.
Definition:
Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
CP::TauExtraVariablesAlg::m_tausKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_tausKey
Definition:
TauExtraVariablesAlg.h:25
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition:
StoreGate/StoreGate/WriteDecorHandle.h:100
xAOD::TauJet_v3
Class describing a tau jet.
Definition:
TauJet_v3.h:41
WriteDecorHandle.h
Handle class for adding a decoration to an object.
CP::TauExtraVariablesAlg::execute
virtual StatusCode execute() override
Definition:
TauExtraVariablesAlg.cxx:28
CP::TauExtraVariablesAlg::m_nTracksKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_nTracksKey
Definition:
TauExtraVariablesAlg.h:26
ReadHandle.h
Handle class for reading from StoreGate.
CP::TauExtraVariablesAlg::initialize
virtual StatusCode initialize() override
Definition:
TauExtraVariablesAlg.cxx:16
TauExtraVariablesAlg.h
Generated on Wed Jan 8 2025 21:17:51 for ATLAS Offline Software by
1.8.18