|
|
Go to the documentation of this file. 1 #ifndef PhysicsTools_PatUtils_ShiftedJetProducerT_h
2 #define PhysicsTools_PatUtils_ShiftedJetProducerT_h
36 template <
typename T,
typename Textractor>
49 if (
cfg.exists(
"jecUncertaintyValue")) {
53 if (
cfg.exists(
"jetCorrInputFileName")) {
66 if (
cfg.exists(
"jetCorrLabelUpToL3")) {
74 jetCorrEtaMax_ = (
cfg.exists(
"jetCorrEtaMax")) ?
cfg.getParameter<
double>(
"jetCorrEtaMax") : 9.9;
78 verbosity_ = (
cfg.exists(
"verbosity")) ?
cfg.getParameter<
int>(
"verbosity") : 0;
80 produces<JetCollection>();
90 std::cout <<
"<ShiftedJetProducerT::produce>:" << std::endl;
103 auto shiftedJets = std::make_unique<JetCollection>();
113 for (
typename JetCollection::const_iterator originalJet = originalJets->begin(); originalJet != originalJets->end();
117 std::cout <<
"originalJet: Pt = " << originalJetP4.pt() <<
", eta = " << originalJetP4.eta()
118 <<
", phi = " << originalJetP4.phi() << std::endl;
137 if (rawJetP4.E() > 1.e-1) {
146 if (corrJetP4upToL3.E() > 1.e-1 && corrJetP4upToL3Res.E() > 1.e-1) {
147 double residualJES = (corrJetP4upToL3Res.E() / corrJetP4upToL3.E()) - 1.;
158 T shiftedJet(*originalJet);
159 shiftedJet.setP4((1. +
shift) * originalJetP4);
161 std::cout <<
"shiftedJet: Pt = " << shiftedJet.pt() <<
", eta = " << shiftedJet.eta()
162 <<
", phi = " << shiftedJet.phi() << std::endl;
165 shiftedJets->push_back(shiftedJet);
double jecUncertaintyValue_
edm::InputTag jetCorrLabelUpToL3_
T const * product() const
void produce(edm::Event &evt, const edm::EventSetup &es) override
Textractor jetCorrExtractor_
~ShiftedJetProducerT() override
edm::InputTag jetCorrLabelUpToL3Res_
void setJetEta(float fEta)
std::vector< T > JetCollection
edm::FileInPath jetCorrInputFileName_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
LocationCode location() const
Where was the file found?
std::string jetCorrUncertaintyTag_
JetCorrectionUncertainty * jecUncertainty_
JetCorrectorParameters * jetCorrParameters_
ShiftedJetProducerT(const edm::ParameterSet &cfg)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
float getUncertainty(bool fDirection)
static unsigned const int shift
edm::EDGetTokenT< reco::JetCorrector > jetCorrTokenUpToL3Res_
std::string jetCorrPayloadName_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
edm::EDGetTokenT< JetCollection > srcToken_
std::string fullPath() const
edm::EDGetTokenT< reco::JetCorrector > jetCorrTokenUpToL3_