ATLAS Offline Software
JetPseudojetRetriever.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // JetPseudojetRetriever.cxx
6 
8 #include "JetEDM/FastJetLink.h"
9 #include "JetEDM/PseudoJetMap.h"
11 
12 using jet::PseudoJetMap;
13 
14 //**********************************************************************
15 
17 : AsgTool(name) {
18  //declareProperty("Attributes", m_atts);
19 }
20 
21 //**********************************************************************
22 
24  return StatusCode::SUCCESS;
25 }
26 
27 
28 //**********************************************************************
29 
30 const fastjet::PseudoJet* JetPseudojetRetriever::
31 pseudojet(const xAOD::Jet& jet) const {
32  const fastjet::PseudoJet* ppj = nullptr;
33  ppj = jet.getPseudoJet();
34  if ( ppj != nullptr ) return ppj;
35  PseudoJetMap* ppjmap;
36  std::string pjmapname = label();
37  if ( evtStore()->contains<PseudoJetMap>(pjmapname) ) {
38  if ( evtStore()->retrieve(ppjmap, pjmapname).isSuccess() ) {
39  PseudoJetMap::const_iterator ipj = ppjmap->find(&jet);
40  if ( ipj != ppjmap->end() ) ppj = ipj->second;
41  } else {
42  ATH_MSG_WARNING("Unable to retrieve pseudojet map.");
43  }
44  }
45  ATH_MSG_VERBOSE("Retrieved pseudojet @" << long(ppj)
46  << " for jet @" << long(&jet)
47  << " from " << pjmapname);
48  return ppj;
49 }
50 
51 //**********************************************************************
52 
53 std::string JetPseudojetRetriever::label() const {
54  return "JetPseudojetMap";
55 }
56 
57 //**********************************************************************
58 
60  ATH_MSG_INFO("JetPseudojetRetriever");
61 }
62 
63 //**********************************************************************
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
JetPseudojetRetriever::print
void print() const
Print the state of the tool.
Definition: JetPseudojetRetriever.cxx:59
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
JetPseudojetRetriever::JetPseudojetRetriever
JetPseudojetRetriever(const std::string &name)
Definition: JetPseudojetRetriever.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
JetPseudojetRetriever.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
jet::PseudoJetMap
std::map< const xAOD::Jet *, const fastjet::PseudoJet * > PseudoJetMap
Definition: PseudoJetMap.h:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
JetPseudojetRetriever::label
std::string label() const
Return the label.
Definition: JetPseudojetRetriever.cxx:53
PseudoJetMap.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
JetPseudojetRetriever::initialize
StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: JetPseudojetRetriever.cxx:23
Jet_PseudoJet.icc
JetPseudojetRetriever::pseudojet
const fastjet::PseudoJet * pseudojet(const xAOD::Jet &jet) const
Retrieve the pseudojet associate with a jet.
Definition: JetPseudojetRetriever.cxx:31