63 : inputJetsToken_(consumes<std::
vector<pat::
Jet>>(cfg.getParameter<edm::
InputTag>(
"inputJets"))),
64 inputMETsToken_(consumes<std::
vector<pat::
MET>>(cfg.getParameter<edm::
InputTag>(
"inputMETs"))),
65 scaleFactor_(cfg.getParameter<double>(
"scaleFactor")),
66 jetPTThresholdForMET_(cfg.getParameter<double>(
"jetPTThresholdForMET")),
67 jetEMLimitForMET_(cfg.getParameter<double>(
"jetEMLimitForMET")) {
83 auto pJets = std::make_unique<std::vector<pat::Jet>>();
84 auto pMETs = std::make_unique<std::vector<pat::MET>>();
90 for (std::vector<pat::Jet>::const_iterator
jet = jets->begin();
jet != jets->end(); ++
jet) {
93 pJets->push_back(scaledJet);
97 dPx += scaledJet.
px() -
jet->px();
98 dPy += scaledJet.
py() -
jet->py();
99 dSumEt += scaledJet.
et() -
jet->et();
105 double scaledMETPx = met.
px() - dPx;
106 double scaledMETPy = met.
py() - dPy;
110 scaledMETPx, scaledMETPy, 0,
sqrt(scaledMETPx * scaledMETPx + scaledMETPy * scaledMETPy)),
112 pMETs->push_back(scaledMET);
Analysis-level MET class.
#define DEFINE_FWK_MODULE(type)
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
~JetEnergyShift() override
default destructor
void produce(edm::Event &, const edm::EventSetup &) override
rescale jet energy and recalculated MET
double py() const final
y coordinate of momentum vector
edm::EDGetTokenT< std::vector< pat::MET > > inputMETsToken_
met input collection
T getParameter(std::string const &) const
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