ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
13
14//**********************************************************************
15
17: AsgTool(name) {
18 //declareProperty("Attributes", m_atts);
19}
20
21//**********************************************************************
22
24 return StatusCode::SUCCESS;
25}
26
27
28//**********************************************************************
29
30const fastjet::PseudoJet* JetPseudojetRetriever::
31pseudojet(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
53std::string JetPseudojetRetriever::label() const {
54 return "JetPseudojetMap";
55}
56
57//**********************************************************************
58
60 ATH_MSG_INFO("JetPseudojetRetriever");
61}
62
63//**********************************************************************
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
ServiceHandle< StoreGateSvc > & evtStore()
StatusCode initialize()
Dummy implementation of the initialisation function.
std::string label() const
Return the label.
const fastjet::PseudoJet * pseudojet(const xAOD::Jet &jet) const
Retrieve the pseudojet associate with a jet.
JetPseudojetRetriever(const std::string &name)
void print() const
Print the state of the tool.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114
std::map< const xAOD::Jet *, const fastjet::PseudoJet * > PseudoJetMap
Jet_v1 Jet
Definition of the current "jet version".