48 ATH_MSG_ERROR(
"Input JVT key does not match the input jet key!");
49 return StatusCode::FAILURE;
62 const EventContext &context,
68 if (!inputJets.isValid())
71 return StatusCode::FAILURE;
75 if (!inputs.isValid())
78 return StatusCode::FAILURE;
88 return StatusCode::FAILURE;
94 CovarianceSum pileupSum;
99 std::set<const xAOD::IParticle *> hardScatterInputs;
100 std::vector<SignedKinematics> hardScatterJets;
101 std::vector<float> jetAreas;
118 hardScatterJets.push_back(*ijet);
119 jetAreas.push_back(accArea(*ijet));
120 for (
const auto &link : ijet->constituentLinks())
126 hardScatterInputs.insert(original);
128 hardScatterInputs.insert(constituent);
135 if (hardScatterJets.size() > 0)
142 bool isHS = hardScatterInputs.count(original);
144 ipart->e(), ipart->eta(), ipart->phi());
149 bool outOfRange =
false;
150 std::size_t idx = grid.
getIndex(ipart->eta(), ipart->phi(), outOfRange);
162 double towerMean = 0;
163 double towerVariance = 0;
164 unmaskedMeanAndVariance(grid, towerMean, towerVariance);
166 std::vector<double> means;
167 std::vector<double> variances;
168 means.reserve(jetAreas.size());
169 variances.reserve(jetAreas.size());
170 for (
float area : jetAreas)
172 means.push_back(towerMean *
area / towerArea);
173 variances.push_back(towerVariance *
area / towerArea);
176 std::vector<SignedKinematics> corrections = pufit(
178 pileupSum.covariance,
184 for (std::size_t ii = 0; ii < hardScatterJets.size(); ++ii)
192 jetAreas.at(ii) * rho, kin.
eta(), kin.
phi());
194 sum += corrections.at(ii);
201 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
#define ATH_MSG_WARNING(x)
#define CHECK(...)
Evaluate an expression and check for errors.
Some common helper functions used by decoration handles.
Handle class for reading a decoration on an object.
Handle class for reading from StoreGate.
FexBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
StatusCode initializeBase(const std::vector< std::string > &componentNames)
Initialize the base class.
Helper struct to build up MET values before moving them into the EDM.
void fillMETComponent(std::size_t idx, xAOD::TrigMissingET &met) const
Fill a component of the MET with this.
Gaudi::Property< float > m_minPt
virtual StatusCode initialize() override
Initialize the fex.
Gaudi::Property< bool > m_useDetectorEta
virtual StatusCode fillMET(xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const override
Calculate and fill the output MET value.
Gaudi::Property< bool > m_jetCalibIncludesAreaSub
Gaudi::Property< float > m_caloStoch
The coefficient of the stochastic term in the calo resolution estimate.
Gaudi::Property< float > m_forwardPt
Gaudi::Property< float > m_centralEta
Gaudi::Property< float > m_caloNoise
The coefficient of the noise term in the calo resolution estimate.
Gaudi::Property< float > m_constraintImportance
The relative constraint importance.
SG::ReadDecorHandleKey< xAOD::JetContainer > m_inputJvtKey
The input JVT decoration.
SG::ReadHandleKey< xAOD::EventShape > m_rhoKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_inputKey
The input clusters or PFOs.
Gaudi::Property< float > m_maxEta
The eta range of the grid.
Gaudi::Property< std::size_t > m_nPhiBins
Gaudi::Property< std::size_t > m_nEtaBins
The number of bins in eta.
Gaudi::Property< float > m_jvtCut
double getSigma(const SignedKinematics &kin) const
Calculate the estimate on the variance of a tower.
MHTPufitFex(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadHandleKey< xAOD::JetContainer > m_inputJetsKey
Input objects.
Gaudi::Property< float > m_maxPt
std::size_t getIndex(double eta, double phi, bool &outOfRange) const
Get the index for the given eta, phi values.
double phiWidth() const
The bin width in phi.
double etaWidth() const
The bin width in eta.
Describes a single element of the grid.
void mask(bool value=true)
Set the mask on this tower.
Bins energy deposits into a grid.
Class to describe the kinematics of an object that can have negative energies.
double eta() const
Direction.
double absPt() const
unsigned pt
static SignedKinematics fromEnergyEtaPhi(double energy, double eta, double phi)
Factory function to construct from energy, eta, phi (massless)
SG::ConstAccessor< T, ALLOC > ConstAccessor
Class providing the definition of the 4-vector interface.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
std::string contKeyFromKey(const std::string &key)
Extract the container part of key.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Jet_v1 Jet
Definition of the current "jet version".
const IParticle * getOriginalObject(const IParticle ©)
This function can be used to conveniently get a pointer back to the original object from which a copy...
TrigMissingET_v1 TrigMissingET
Define the most recent version of the TrigMissingET class.