63 scaleFactor_(
cfg.getParameter<double>(
"scaleFactor")),
64 jetPTThresholdForMET_(
cfg.getParameter<double>(
"jetPTThresholdForMET")),
65 jetEMLimitForMET_(
cfg.getParameter<double>(
"jetEMLimitForMET")) {
81 auto pJets = std::make_unique<std::vector<pat::Jet>>();
82 auto pMETs = std::make_unique<std::vector<pat::MET>>();
88 for (std::vector<pat::Jet>::const_iterator
jet =
jets->begin();
jet !=
jets->end(); ++
jet) {
91 pJets->push_back(scaledJet);
95 dPx += scaledJet.
px() -
jet->px();
96 dPy += scaledJet.
py() -
jet->py();
97 dSumEt += scaledJet.
et() -
jet->et();
103 double scaledMETPx =
met.px() - dPx;
104 double scaledMETPy =
met.py() - dPy;
108 scaledMETPx, scaledMETPy, 0,
sqrt(scaledMETPx * scaledMETPx + scaledMETPy * scaledMETPy)),
110 pMETs->push_back(scaledMET);
Analysis-level MET class.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
rescale jet energy and recalculated MET
void scaleEnergy(double fScale) override
Scale energy and correspondingly adjust raw jec factors.
double jetEMLimitForMET_
limit on the emf of the jet for Type1 MET corrections
std::string outputJets_
jet output collection
double px() const final
x coordinate of momentum vector
#define DEFINE_FWK_MODULE(type)
double py() const final
y coordinate of momentum vector
edm::EDGetTokenT< std::vector< pat::MET > > inputMETsToken_
met input collection
JetEnergyShift(const edm::ParameterSet &)
default constructor
Analysis-level calorimeter jet class.
double et() const final
transverse energy
double scaleFactor_
scale factor for the rescaling
Plugin to shift the jet energy scale and recalculate the MET accordingly.
double jetPTThresholdForMET_
threshold on (raw!) jet pt for Type1 MET corrections
edm::EDGetTokenT< std::vector< pat::Jet > > inputJetsToken_
jet input collection
std::string outputMETs_
MET output collection.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
math::XYZPoint Point
point in the space