10#include "fastjet/PseudoJet.hh"
11#include "fastjet/AreaDefinition.hh"
12#include "fastjet/ClusterSequence.hh"
24using fastjet::PseudoJet;
41 for (
const std::string & att :
m_atts) {
42 if ( att ==
"ActiveArea" )
m_doArea =
true;
49 return StatusCode::SUCCESS;
66 if(!
vec.isValid() ) {
67 ATH_MSG_ERROR(
"Jet constituent vector is invalid. Can't set EM scale momentum");
75 for (
auto it=
vec.begin(uncal); it !=
vec.end(uncal); ++it) {
81 ATH_MSG_DEBUG(
" EM scale momentum set with uncalibrated constituents.");
98 if ( pjet ==
nullptr )
return pjet;
134 return addjet(pj, pjContainer, jets, pparent);
151 double eta = pj.eta();
152 double phi = pj.phi_std();
153 double p2 = px*px + py*py + pz*pz;
155 double dpovere = p/e - 1.0;
157 if ( dpovere > 1.e-6 ) {
160 << e <<
", " << p <<
", " << m <<
", " << p/e-1.0);
161 ATH_MSG_WARNING(setw(12) <<
"px" << setw(12) <<
"py" << setw(12) <<
"pz"
162 << setw(12) <<
"E" << setw(12) <<
"p");
163 ATH_MSG_WARNING(setw(12) <<
"---" << setw(12) <<
"---" << setw(12) <<
"---"
164 << setw(12) <<
"---" << setw(12) <<
"---");
166 for ( PseudoJetVector::const_iterator icon=cons.begin(); icon!=cons.end(); ++icon ) {
167 double cpx = icon->px();
168 double cpy = icon->py();
169 double cpz = icon->pz();
170 double ce = icon->e();
171 double cp2 = cpx*cpx + cpy*cpy + cpz*cpz;
172 double cp = sqrt(cp2);
173 ATH_MSG_WARNING(setw(12) <<
int(cpx) << setw(12) <<
int(cpy) << setw(12) <<
int(cpz)
174 << setw(12) <<
int(ce) << setw(12) <<
int(cp));
181 ATH_MSG_VERBOSE(
" Jet has pT = " << pt <<
" MeV, m = " << m <<
" MeV, eta = " <<
eta );
184 jets.push_back(pjet);
187 if ( pj.associated_cluster_sequence() ==
nullptr ) {
188 ATH_MSG_VERBOSE(
"Pseudojet does not have a cluster sequence and so cannot be copied to Jet.");
196 if ( pj.has_area() ) {
202 fastjet::PseudoJet pja = pj.area_4vector();
208 ATH_MSG_WARNING(
"Save of active area attribute requested for jet without area.");
211 if ( pj.has_area() ) {
217 ATH_MSG_VERBOSE(
" Adding constituents: multiplicity is " << pjcons.size());
218 if ( pparent !=
nullptr ) {
221 if ( pcon ==
nullptr ) {
254 for ( std::vector<std::string>::const_iterator inam=
m_atts.begin();
255 inam!=
m_atts.end(); ++inam ) {
256 const std::string& name = *inam;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::vector< size_t > vec
std::vector< fastjet::PseudoJet > PseudoJetVector
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ElementLink implementation for ROOT usage.
virtual void print() const override
Print the state of the tool.
std::vector< std::string > m_atts
virtual xAOD::Jet * add(const fastjet::PseudoJet &, const PseudoJetContainer &, xAOD::JetContainer &, xAOD::JetInput::Type inputtype) const override
Method to construct an ATLAS jet from a pseudojet, input type and vector of ghost labels.
JetFromPseudojet(const std::string &name)
xAOD::Jet * addjet(const fastjet::PseudoJet &pj, const PseudoJetContainer &, xAOD::JetContainer &jets, const xAOD::Jet *pparent) const
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
void buildAndSetEMScaleMom(xAOD::Jet *jet, xAOD::JetInput::Type inputtype) const
bool extractConstituents(xAOD::Jet &, const std::vector< PseudoJet > &) const
const SG::AuxVectorData * container() const
Return the container holding this element.
size_t index() const
Return the index of this element within its container.
A vector of jet constituents at the scale used during jet finding.
void setAlgorithmType(JetAlgorithmType::ID a)
void setAttribute(const std::string &name, const T &v)
JetAlgorithmType::ID getAlgorithmType() const
void setJetP4(const JetFourMom_t &p4)
JetConstitScale getConstituentsSignalState() const
The state at which constituents were when this jet was found.
void setConstituentsSignalState(JetConstitScale t)
Set the state at which constituents were when this jet was found. This function is called by jet buil...
float getSizeParameter() const
void setPseudoJet(const PSEUDOJET *fj)
Set the fast jet pointer.
void setSizeParameter(float p)
bool getAttribute(AttributeID type, T &value) const
Retrieve attribute moment by enum.
void setInputType(JetInput::Type t)
JetInput::Type getInputType() const
JetFourMom_t jetP4() const
The full 4-momentum of the particle : internal jet type.
Jet_v1 Jet
Definition of the current "jet version".
@ JetConstitScaleMomentum
JetContainer_v1 JetContainer
Definition of the current "jet container version".
@ UncalibratedJetConstituent
@ CalibratedJetConstituent
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.