20 ATH_MSG_INFO(
"Initializing JetConstituentFrac " << name());
23 ATH_MSG_ERROR(
"JetConstituentFrac needs to have its input jet container configured!");
24 return StatusCode::FAILURE;
35 return StatusCode::SUCCESS;
47 return StatusCode::SUCCESS;
54 TLorentzVector chargM = {0., 0., 0., 0.};
56 size_t numConstit =
jet.numConstituents();
57 for (
size_t i=0; i<numConstit; i++ ) {
59 ATH_MSG_WARNING(
"Tried to call fillConstituentFrac with a jet constituent that is not a FlowElement!");
66 chargPt += constit->
pt();
67 chargM += constit->
p4();
79 neutralEFracHandle(
jet) = neutE/uncalP4.e();
80 chargePTFracHandle(
jet) = chargPt/uncalP4.pt();
81 chargeMFracHandle(
jet) = uncalP4.M() != 0. ? chargM.M()/uncalP4.M() : 0.;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_chargeMFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_neutralEFracKey
Gaudi::Property< std::string > m_jetContainerName
JetConstituentFrac(const std::string &t)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_chargePTFracKey
void fillConstituentFrac(const xAOD::Jet &jet) const
Handle class for adding a decoration to an object.
virtual double pt() const override
signal_t signalType() const
virtual double e() const override
The total energy of the particle.
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
@ FlowElement
The object is a track-calo-cluster.
Jet_v1 Jet
Definition of the current "jet version".
FlowElement_v1 FlowElement
Definition of the current "pfo version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.