15 ATH_MSG_ERROR(
"JetClusterMomentsTool needs to have its input jet container name configured!");
16 return StatusCode::FAILURE;
29 return StatusCode::SUCCESS;
35 std::unique_ptr<SG::WriteDecorHandle<xAOD::JetContainer, float> > handlePt;
36 std::unique_ptr<SG::WriteDecorHandle<xAOD::JetContainer, float> > handleSecondLambda;
37 std::unique_ptr<SG::WriteDecorHandle<xAOD::JetContainer, float> > handleCenterLambda;
38 std::unique_ptr<SG::WriteDecorHandle<xAOD::JetContainer, float> > handleSecondR;
40 if(!
m_clsPtKey.empty()) handlePt = std::make_unique<SG::WriteDecorHandle<xAOD::JetContainer, float> >(
m_clsPtKey);
50 ATH_MSG_WARNING(
"Jet has no CaloCluster constituents, leading cluster not found");
51 return StatusCode::FAILURE;
54 if(handlePt.get() !=
nullptr) (*handlePt)(*jet) = leadingCluster->
pt();
59 return StatusCode::SUCCESS;
66 if (
jet.numConstituents() == 0 )
return nullptr;
70 switch(
jet.rawConstituent(0)->type() ) {
72 for (
size_t i_cl = 0; i_cl <
jet.numConstituents(); i_cl++){
74 if (!cl_current)
continue;
75 if (!cl_leading || cl_leading->
pt() < cl_current->
pt() ) cl_leading = cl_current;
81 for (
size_t i_cl = 0; i_cl <
jet.numConstituents(); i_cl++){
83 if (!jet_constit)
continue;
85 if(cl_current)
if (!cl_leading || cl_leading->
pt() < cl_current->
pt() ) cl_leading = cl_current;
99 if (isRetrieved)
return (
float) moment;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
MomentType
Enums to identify different moments.
@ SECOND_LAMBDA
Second Moment in .
@ SECOND_R
Second Moment in .
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ Jet
The object is a jet.
@ CaloCluster
The object is a calorimeter cluster.
Jet_v1 Jet
Definition of the current "jet version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
JetContainer_v1 JetContainer
Definition of the current "jet container version".