35 return StatusCode::SUCCESS;
40 return StatusCode::SUCCESS;
49 CHECK(h_caloClusters.isValid());
50 ATH_MSG_DEBUG(
"Read in " << h_caloClusters->size() <<
" clusters");
51 const auto& caloClusters = *h_caloClusters;
58 return StatusCode::SUCCESS;
63 const EventContext& context)
const {
72 for (
const auto* cluster : caloClusters ) {
89 std::vector<SignedKinematics> masked;
93 masked.push_back(tower);
99 pileupSum.
add(tower, sigma);
124 auto METObj = std::make_unique<xAOD::EnergySumRoI>();
127 METObj->setEnergyX(sum.mpx);
128 METObj->setEnergyY(sum.mpy);
129 METObj->setEnergyT(sum.met());
131 h_outputMET = std::move(METObj);
135 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Provide a base class for the grids used in some pufit algorithms.
virtual void setFilterPassed(bool state, const EventContext &ctx) const
An algorithm that can be simultaneously executed in multiple threads.
StatusCode PufitMET(const xAOD::CaloClusterContainer &, float inputSigma, const EventContext &) const
virtual StatusCode initialize() override
SG::WriteHandleKey< xAOD::EnergySumRoI > m_outputMETPufitKey
virtual StatusCode execute(const EventContext &) const override
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClustersKey
GepMETPufitAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode finalize() override
virtual ~GepMETPufitAlg()
Helper struct to build up MET values before moving them into the EDM.
Describes a single element of the grid.
Bins energy deposits into a grid.
METComponent sum(SumStrategy strategy=SumStrategy::All) const
Class to describe the kinematics of an object that can have negative energies.
static SignedKinematics fromEtEtaPhi(double et, double eta, double phi)
Factory function to construct from et, eta, phi (massless)
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="")
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.
constexpr float caloResFloor
constexpr float constraintWeight
constexpr std::size_t nPhiBins
constexpr float trimFactor
constexpr float caloResSqrtTerm
constexpr std::size_t nEtaBins
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
EnergySumRoIAuxInfo_v2 EnergySumRoIAuxInfo
Declare the most recent version of the energy-sum auxiliary info.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Parameters describing a grid.
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.