ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkLLP
src
AugmentationToolLeadingJets.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
// Author: Louie Corpe (lcorpe@cern.ch)
6
7
#include "
DerivationFrameworkLLP/AugmentationToolLeadingJets.h
"
8
#include "
xAODJet/JetContainer.h
"
9
#include "
StoreGate/ReadHandle.h
"
10
#include "
StoreGate/WriteDecorHandle.h
"
11
#include <vector>
12
#include <string>
13
14
namespace
DerivationFramework
{
15
16
StatusCode
AugmentationToolLeadingJets::initialize
()
17
{
18
ATH_CHECK
( AthAlgTool::initialize() );
19
ATH_CHECK
(
m_jetKey
.initialize() );
20
ATH_CHECK
(
m_decorationKey
.initialize() );
21
return
StatusCode::SUCCESS;
22
}
23
24
StatusCode
AugmentationToolLeadingJets::addBranches
(
const
EventContext& ctx)
const
25
{
26
// Set up the decorators
27
SG::WriteDecorHandle<xAOD::JetContainer, bool>
decorator (
m_decorationKey
, ctx);
28
29
// CALCULATION OF THE NEW VARIABLE
30
// Get Primary vertex
31
SG::ReadHandle<xAOD::JetContainer>
jets (
m_jetKey
, ctx);
32
int
counter=0;
33
for
(
unsigned
int
i =0 ; i < jets->size() ; i++){
34
auto
jet
= (*jets)[i] ;
35
if
(fabs(
jet
->eta()) < 2.5){
36
decorator(*
jet
) = (counter <2);
// pick the two leading jets only
37
counter+=1;
38
}
else
{
39
decorator(*
jet
) = 0;
// pick the two leading jets only
40
}
41
}
42
return
StatusCode::SUCCESS;
43
}
44
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AugmentationToolLeadingJets.h
JetContainer.h
ReadHandle.h
Handle class for reading from StoreGate.
WriteDecorHandle.h
Handle class for adding a decoration to an object.
DerivationFramework::AugmentationToolLeadingJets::m_decorationKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decorationKey
Definition
AugmentationToolLeadingJets.h:30
DerivationFramework::AugmentationToolLeadingJets::m_jetKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetKey
Definition
AugmentationToolLeadingJets.h:28
DerivationFramework::AugmentationToolLeadingJets::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition
AugmentationToolLeadingJets.cxx:24
DerivationFramework::AugmentationToolLeadingJets::initialize
virtual StatusCode initialize() override final
Definition
AugmentationToolLeadingJets.cxx:16
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
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
Generated on
for ATLAS Offline Software by
1.17.0