8#include "fastjet/PseudoJet.hh"
43 return StatusCode::SUCCESS;
57 const fastjet::PseudoJet* ppj =
m_hpjr->pseudojet(
jet);
58 if ( ppj ==
nullptr ) {
61 if ( ! ppj->has_constituents() ) {
65 constits.insert(constits.end(), pjcons.begin(), pjcons.end());
73 const string liname =
"PseudoJetLabelMap";
77 if ( pli ==
nullptr ) {
84 if (
evtStore()->record(pli, liname).isFailure() ) {
96 <<
" real constituents.");
97 for (
const auto *
const pjetcon :
jet.getConstituents() ) {
98 if ( pjetcon ==
nullptr ) {
102 fastjet::PseudoJet psj(pjetcon->px(), pjetcon->py(), pjetcon->pz(), pjetcon->e());
106 psj.set_user_info(pcui);
107 constits.push_back(psj);
109 <<
", index=" << pcui->
index()
110 <<
", label=" << pcui->
label()
111 <<
", isGhost=" << pcui->
isGhost());
118 for (
const std::string& glab :
m_glabs ) {
119 string gname =
"Ghost" + glab;
121 if ( glab ==
"MuonSegment" ) {
123 if (
jet.getAssociatedObjects(gname, psegs) ) {
125 << psegs.size() <<
" entries.");
127 glabs.push_back(glab);
128 unsigned int iseg = 0;
130 if ( pseg ==
nullptr ) {
131 ATH_MSG_DEBUG(
"Muon segment not found: " << gname <<
"[" << iseg <<
"]");
135 double x = pseg->x();
136 double y = pseg->y();
137 double z = pseg->z();
138 double xy = sqrt(
x*
x +
y*
y);
139 double r = xy*xy +
z*
z;
145 fastjet::PseudoJet psj(px, py, pz, e);
148 psj.set_user_info(pcui);
149 constits.push_back(psj);
151 <<
", index=" << pcui->
index()
152 <<
", label=" << pcui->
label()
153 <<
", isGhost=" << pcui->
isGhost());
159 ATH_MSG_VERBOSE(
" Muon segment vector " << gname <<
" is not found on jet.");
164 if (
jet.getAssociatedObjects(gname, ppars) ) {
166 << ppars.size() <<
" entries.");
168 glabs.push_back(glab);
169 unsigned int ipar = 0;
171 if ( ppar ==
nullptr ) {
172 ATH_MSG_DEBUG(
"IParticle not found: " << gname <<
"[" << ipar <<
"]");
174 auto p4 = ppar->p4();
175 fastjet::PseudoJet psj(fac*p4.Px(), fac*p4.Py(), fac*p4.Pz(), fac*p4.E());
178 psj.set_user_info(pcui);
179 constits.push_back(psj);
181 <<
", index=" << pcui->
index()
182 <<
", label=" << pcui->
label()
183 <<
", isGhost=" << pcui->
isGhost());
189 ATH_MSG_VERBOSE(
" IParticle vector " << gname <<
" is not found on jet.");
193 if ( pghostlabs !=
nullptr ) {
194 pghostlabs->insert(pghostlabs->end(), glabs.begin(), glabs.end());
214 for (
const std::string& glab :
m_glabs ) {
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::vector< const MuonSegment * > MuonSegmentVector
std::vector< fastjet::PseudoJet > PseudoJetVector
std::vector< const IParticle * > IParticleVector
IJetConstituentsRetriever::NameList NameList
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
std::vector< std::string > NameList
std::vector< fastjet::PseudoJet > PseudoJetVector
ToolHandle< IJetPseudojetRetriever > m_hpjr
int constituents(const xAOD::Jet &jet, PseudoJetVector &cons, NameList *pghostlabs=nullptr) const
Append constituents to the supplied vector.
JetConstituentsRetriever(const std::string &name)
StatusCode initialize()
Dummy implementation of the initialisation function.
void print() const
Print the state of the tool.
virtual Label label() const =0
virtual bool isGhost() const
Returns true if this constituent is a ghost.
virtual const xAOD::IParticle * particle() const =0
virtual Index index() const
Index addLabel(const Label &lab)
Add a label and get its index.
Class providing the definition of the 4-vector interface.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
Jet_v1 Jet
Definition of the current "jet version".
MuonSegment_v1 MuonSegment
Reference the current persistent version: