42 ATH_MSG_ERROR(
"Input category key does not match the input key!");
43 return StatusCode::FAILURE;
46 return initializeBase({
"NeutralForward",
"ChargedHS",
"ChargedPU",
"UncorrSelNF"});
51 const EventContext &context,
59 return StatusCode::FAILURE;
71 ipart->e(), ipart->eta(), ipart->phi());
85 return StatusCode::FAILURE;
98 std::size_t
count = 0;
125 std::vector<SignedKinematics> masked;
126 masked.reserve(
count);
127 std::vector<double> means;
128 means.reserve(
count);
129 std::vector<double> variances(
count, variance);
146 means.push_back(
mean - cPUKin.
pt());
148 means.push_back(
mean);
194 ATH_MSG_DEBUG(
"Correction: (px, py, pz, et) = (" << kin.px() <<
", " << kin.py() <<
", " << kin.pz() <<
", " << kin.et() <<
")");
199 ATH_MSG_DEBUG(
"Tower variance is 0 => there were no towers in the trimmed mean calculation with energy > 0. Skip the corrections");
203 return StatusCode::SUCCESS;
#define ATH_MSG_VERBOSE(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.
bool msgLvl(const MSG::Level lvl) const
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.
virtual StatusCode initialize() override
Initialize the fex.
Gaudi::Property< std::size_t > m_nEtaBins
The number of bins in eta.
double getSigma(const SignedKinematics &kin) const
Calculate the estimate on the variance of a tower.
Gaudi::Property< float > m_maxEta
The eta range of the grid.
Gaudi::Property< float > m_caloStoch
The coefficient of the stochastic term in the calo resolution estimate.
SG::ReadDecorHandleKey< xAOD::IParticleContainer > m_inputCategoryKey
Gaudi::Property< std::size_t > m_neutralThresholdMode
The neutral threshold mode.
PUSplitPufitFex(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Property< bool > m_subtractCPUFromMean
Whether to remove the cPU component from the tower expectations.
Gaudi::Property< float > m_trimFraction
The trimming fraction.
Gaudi::Property< float > m_nSigma
The sigma threshold.
Gaudi::Property< std::size_t > m_nPhiBins
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.
virtual StatusCode fillMET(xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const override
Calculate and fill the output MET value.
SG::ReadHandleKey< xAOD::IParticleContainer > m_inputKey
Input objects.
Base class for towers belonging to the grids.
PufitGrid & get()
Get one of the underlying grids.
Class to describe the kinematics of an object that can have negative energies.
double absPt() const
unsigned pt
static SignedKinematics fromEnergyEtaPhi(double energy, double eta, double phi)
Factory function to construct from energy, eta, phi (massless)
double pt() const
(signed) pt
Class providing the definition of the 4-vector interface.
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
constexpr PUClassification NFcHS
void trimmedMeanAndVariance(const std::vector< double > &sorted, double trimFraction, double &mean, double &variance)
Calculate the trimmed mean and variance for a vector of tower sumEts.
Eigen::VectorXd pufit(const Eigen::Vector2d &pileupSum, const Eigen::Matrix2d &pileupCovariance, const Eigen::VectorXd &towerExpectations, const Eigen::VectorXd &towerVariances, const Eigen::VectorXd &correctionDirections, double constraintImportance)
Perform the pile-up fit.
GridDisplacement selectGrid(const PufitGridSet &grids)
Select the grid with the highest masked sumEt.
PufitMultiGridSet< PUSplitGrid > PUSplitGridSet
GridDisplacement
Enum to describe the positioning of the grid.
@ NoDisplacement
The grid is not shifted.
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())
TrigMissingET_v1 TrigMissingET
Define the most recent version of the TrigMissingET class.
std::array< Grid, 4 > grids
Helper struct to hold the sum over pileup objects and its covariance.
Eigen::Matrix2d covariance
The covariance matrix.
CovarianceSum & add(const SignedKinematics &kin, double sigma)
Add a new contribution to the sum.
Eigen::Vector2d sum
The sum.