ATLAS Offline Software
Loading...
Searching...
No Matches
JetNumConstitsTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8//**********************************************************************
9
10JetNumConstitTool::JetNumConstitTool(const std::string& myname)
11 : asg::AsgTool(myname)
12{}
13
14//**********************************************************************
15
17
18 if(m_jetContainerName.empty()){
19 ATH_MSG_ERROR("JetNumConstitTool needs to have its input jet container name configured!");
20 return StatusCode::FAILURE;
21 }
22
23 // Prepend jet container name
25 ATH_CHECK(m_numConstitKey.initialize());
26
27 return StatusCode::SUCCESS;
28}
29
30//**********************************************************************
31
32StatusCode JetNumConstitTool::decorate(const xAOD::JetContainer& jets) const {
33
35
36 for(const xAOD::Jet* jet : jets){
37 numConstitHandle(*jet) = jet->numConstituents();
38 }
39
40 return StatusCode::SUCCESS;
41}
42
43//**********************************************************************
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
Handle class for adding a decoration to an object.
JetNumConstitTool(const std::string &myname)
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
Gaudi::Property< std::string > m_jetContainerName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_numConstitKey
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".