38 "It was requested to apply only the mu-based AND the NPV-based calibrations.");
44 return StatusCode::SUCCESS;
56 "Could not retrieve xAOD::EventShape::Density from xAOD::EventShape "<<
m_rhoKey.key() );
65 double mu = eventInfoDecor(0);
84 const double E_det = jetStartP4.e();
85 const double pT_det = jetStartP4.pt();
86 const double mass_det = jetStartP4.mass();
88 if ( E_det < mass_det ) {
89 ATH_MSG_ERROR(
"PileupCalibStep: jet mass (" << mass_det <<
" MeV) is greater than E (" << E_det <<
" MeV!) Aborting.");
90 return StatusCode::FAILURE;
93 double pT_offset = pT_det;
103 pT_offset = pT_det - rho*jetareaP4.pt();
104 rhoAreaP4 = jetStartP4*pT_offset/pT_det;
109 double alpha = 0.0, beta = 0.0;
119 pT_offset = pT_offset - offsetET;
123 pileup_SF = pT_offset >= 0 ? pT_offset / pT_det : 10./pT_det;
125 calibP4 = jetStartP4*pileup_SF;
129 jet->setJetP4( calibP4 );
132 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
This header defines wrapper classes around SG::AuxElement::Accessor used internally in the Jet EDM.
#define CHECK_THEN_ERROR(checkcode, message)
Class JetContext Designed to read AOD information related to the event, N vertices,...
Gaudi::Property< float > m_muSF
static constexpr float m_GeV
Gaudi::Property< float > m_mu_ref
virtual StatusCode calibrate(xAOD::JetContainer &jetCont) const override
Apply calibration to a jet container.
PileupCalibStep(const std::string &name="PileupCalibStep")
Gaudi::Property< std::string > m_jetOutScale
Gaudi::Property< bool > m_doMuOnly
Gaudi::Property< bool > m_doJetArea
Gaudi::Property< bool > m_doNPVOnly
ToolHandle< JetHelper::IVarTool > m_histTool_mu
Histograms with PU residual correction factors.
Gaudi::Property< std::string > m_jetInScale
In and out scales.
Gaudi::Property< std::string > m_jetAreaOutScale
Gaudi::Property< float > m_NPV_ref
Properties.
Gaudi::Property< bool > m_isData
Gaudi::Property< bool > m_doResidual
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
SG::ReadHandleKey< xAOD::EventShape > m_rhoKey
Event properties.
SG::ReadHandleKey< xAOD::VertexContainer > m_pvKey
ToolHandle< JetHelper::IVarTool > m_histTool_NPV
SG::ReadDecorHandleKey< xAOD::EventInfo > m_muKey
Handle class for reading a decoration on an object.
bool isPresent() const
Is the referenced container present in SG?
virtual bool isValid() override final
Can the handle be successfully dereferenced?
void getAttribute(const SG::AuxElement &p, TYPE &v) const
void setAttribute(SG::AuxElement &p, const TYPE &v) const
int countNPV(const VXCONT &vxCont)
Jet_v1 Jet
Definition of the current "jet 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.