ATLAS Offline Software
JetGroomMRatio.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
9 
10 //**********************************************************************
11 
13 : AsgTool(name) { }
14 
15 //**********************************************************************
16 
18  ATH_MSG_INFO("Initializing JetGroomMRatio " << name());
19 
20  if(m_jetContainerName.empty()){
21  ATH_MSG_ERROR("JetGroomMRatio needs to have its input jet container configured!");
22  return StatusCode::FAILURE;
23  }
24 
26 
27  ATH_CHECK(m_groomMRatioKey.initialize());
28 
29  return StatusCode::SUCCESS;
30 }
31 
32 //**********************************************************************
33 
35  ATH_MSG_VERBOSE("Begin decorating jets.");
36  for(const xAOD::Jet* jet : jets) {
37 
38  static const SG::AuxElement::ConstAccessor< ElementLink<xAOD::JetContainer> > parentAcc("Parent");
39  const xAOD::Jet* parent = *parentAcc(*jet);
40 
41  if (parent==nullptr) {
42  ATH_MSG_ERROR("No ungroomed parent jet available");
43  return StatusCode::FAILURE;
44  }
45 
47 
48  // Get jet p4 at constituent scale to compute ratio
49  xAOD::JetFourMom_t uncalP4;
50  jet->getAttribute<xAOD::JetFourMom_t>("JetConstitScaleMomentum",uncalP4);
51 
52  groomMRatioHandle(*jet) = uncalP4.M()/parent->m();
53 
54  }
55 
56  return StatusCode::SUCCESS;
57 }
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
JetGroomMRatio.h
JetGroomMRatio::JetGroomMRatio
JetGroomMRatio(const std::string &t)
Definition: JetGroomMRatio.cxx:12
JetGroomMRatio::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition: JetGroomMRatio.h:31
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
JetAccessorMap.h
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
JetGroomMRatio::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetGroomMRatio.cxx:17
WriteDecorHandle.h
Handle class for adding a decoration to an object.
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition: JetTypes.h:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetGroomMRatio::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
Definition: JetGroomMRatio.cxx:34
JetGroomMRatio::m_groomMRatioKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_groomMRatioKey
Definition: JetGroomMRatio.h:33
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24