34 const EventContext &context,
39 if (!clusters.isValid())
42 return StatusCode::FAILURE;
51 iclus->e(), iclus->eta(), iclus->phi());
72 std::vector<SignedKinematics> masked;
80 pileupSum.
add(tower, sigma);
83 masked.push_back(tower);
91 sum.fillMETComponent(1,
met);
111 return StatusCode::SUCCESS;
#define CHECK(...)
Evaluate an expression and check for errors.
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.
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 fromEnergyEtaPhi(double energy, double eta, double phi)
Factory function to construct from energy, eta, phi (massless)
Gaudi::Property< float > m_nSigma
The sigma threshold.
virtual StatusCode fillMET(xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const override
Calculate and fill the output MET value.
TCPufitFex(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
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.
Gaudi::Property< std::size_t > m_nEtaBins
The number of bins in eta.
Gaudi::Property< float > m_maxEta
The eta range of the grid.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterKey
Input clusters.
Gaudi::Property< float > m_caloStoch
The coefficient of the stochastic term in the calo resolution estimate.
Gaudi::Property< float > m_trimFraction
The trimming fraction.
Gaudi::Property< std::size_t > m_nPhiBins
The number of bins in phi.
virtual StatusCode initialize() override
Initialize the fex.
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.
GridDisplacement selectGrid(const PufitGridSet &grids)
Select the grid with the highest masked sumEt.
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 ...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrigMissingET_v1 TrigMissingET
Define the most recent version of the TrigMissingET class.
Helper struct to contain a full set of grids.
std::array< PufitGrid, 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.