Definition at line 73 of file JetResolutionDemo.cc.
References create_public_pileup_plots::bins, gather_cfg::cout, DOWN, JME::JetResolution::dump(), EnergyCorrector::etas, fs, JME::JetResolution::get(), JME::JetResolutionScaleFactor::get(), JME::JetResolutionObject::Definition::getBins(), edm::Event::getByToken(), JME::JetResolutionObject::getDefinition(), JME::JetResolutionObject::getRecords(), JME::JetResolution::getResolution(), JME::JetResolution::getResolutionObject(), JME::JetResolutionScaleFactor::getScaleFactor(), mps_fire::i, metsig::jet, JME::JetEta, JME::JetPt, fwrapper::jets, m_debug, m_jets_token, m_payload, m_res_vs_eta, m_resolutions_file, m_rho_token, m_scale_factors_file, m_use_conddb, TFileService::make(), alignCSCRings::r, diffTwoXMLs::r2, record, fftjetproducer_cfi::resolution, rho, JME::Rho, JME::JetParameters::set(), JME::JetParameters::setJetEta(), JME::JetParameters::setJetPt(), JME::JetParameters::setRho(), and UP.
116 std::vector<float>
etas;
117 for (
const auto&
record: records) {
119 etas.push_back(
record.getBinsRange()[0].min);
120 etas.push_back(
record.getBinsRange()[0].max);
122 etas.push_back(
record.getBinsRange()[0].max);
126 std::vector<float>
res;
127 for (std::size_t
i = 0;
i < 40;
i++) {
128 res.push_back(
i * 0.005);
131 m_res_vs_eta =
fs->
make<TH2F>(
"res_vs_eta",
"res_vs_eta", etas.size() - 1, &etas[0], res.size() - 1, &res[0]);
135 for (
const auto&
jet: *jets) {
137 std::cout <<
"New jet; pt=" <<
jet.pt() <<
" eta=" <<
jet.eta() <<
" phi=" <<
jet.phi() <<
" e=" <<
jet.energy() <<
" rho=" << *rho << std::endl;
157 parameters_1.
setRho(*rho);
162 parameters_2.
setJetPt(
jet.pt()).setJetEta(
jet.eta()).setRho(*rho);
182 std::cout <<
"Resolution with parameters_1: " << r << std::endl;
190 std::cout <<
"Resolution using shortcut : " << r2 << std::endl;
203 std::cout <<
"Scale factors (Nominal / Up / Down) : " << sf <<
" / " << sf_up <<
" / " << sf_down << std::endl;
std::string m_scale_factors_file
float getResolution(const JetParameters ¶meters) const
JetParameters & setJetEta(float eta)
JetParameters & setRho(float rho)
const std::vector< Binning > & getBins() const
static const JetResolution get(const edm::EventSetup &, const std::string &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
T * make(const Args &...args) const
make new ROOT object
JetParameters & set(const Binning &bin, float value)
const std::vector< Record > & getRecords() const
edm::EDGetTokenT< double > m_rho_token
const Definition & getDefinition() const
std::string m_resolutions_file
edm::EDGetTokenT< std::vector< pat::Jet > > m_jets_token
const JetResolutionObject * getResolutionObject() const
float getScaleFactor(const JetParameters ¶meters, Variation variation=Variation::NOMINAL) const
static const JetResolutionScaleFactor get(const edm::EventSetup &, const std::string &)
JetParameters & setJetPt(float pt)
edm::Service< TFileService > fs