ATLAS Offline Software
Loading...
Searching...
No Matches
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
12JetGroomMRatio::JetGroomMRatio(const std::string& name)
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
34StatusCode JetGroomMRatio::decorate(const xAOD::JetContainer& jets) const {
35 ATH_MSG_VERBOSE("Begin decorating jets.");
36 for(const xAOD::Jet* jet : jets) {
37
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
Handle class for adding a decoration to an object.
Gaudi::Property< std::string > m_jetContainerName
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_groomMRatioKey
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
JetGroomMRatio(const std::string &t)
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
Handle class for adding a decoration to an object.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition JetTypes.h:17