112 std::vector<float>
etas;
113 for (
const auto&
record : records) {
115 etas.push_back(
record.getBinsRange()[0].min);
116 etas.push_back(
record.getBinsRange()[0].max);
118 etas.push_back(
record.getBinsRange()[0].max);
122 std::vector<float> res;
123 for (std::size_t
i = 0;
i < 40;
i++) {
124 res.push_back(
i * 0.005);
127 m_res_vs_eta =
fs->
make<TH2F>(
"res_vs_eta",
"res_vs_eta", etas.size() - 1, &etas[0], res.size() - 1, &res[0]);
131 for (
const auto&
jet : *jets) {
133 std::cout <<
"New jet; pt=" <<
jet.pt() <<
" eta=" <<
jet.eta() <<
" phi=" <<
jet.phi()
134 <<
" e=" <<
jet.energy() <<
" rho=" << *rho << std::endl;
152 parameters_1.
setRho(*rho);
157 parameters_2.
setJetPt(
jet.pt()).setJetEta(
jet.eta()).setRho(*rho);
178 std::cout <<
"Resolution with parameters_1: " << r << std::endl;
187 std::cout <<
"Resolution using shortcut : " << r2 << std::endl;
202 std::cout <<
"Scale factors (Nominal / Up / Down) : " << sf <<
" / " << sf_up <<
" / " << sf_down << std::endl;
static const std::string kSharedResource
T getUntrackedParameter(std::string const &, T const &) const
std::string m_scale_factors_file
static const JetResolutionScaleFactor get(const edm::EventSetup &, const Token &)
float getResolution(const JetParameters ¶meters) const
JetParameters & setJetEta(float eta)
JetParameters & setRho(float rho)
const std::vector< Binning > & getBins() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
T * make(const Args &...args) const
make new ROOT object
JetParameters & set(const Binning &bin, float value)
void analyze(const edm::Event &, const edm::EventSetup &) override
JME::JetResolution::Token m_resolutions_token
~JetResolutionDemo() override
const std::vector< Record > & getRecords() const
edm::EDGetTokenT< double > m_rho_token
const Definition & getDefinition() const
JME::JetResolutionScaleFactor::Token m_scale_factors_token
std::string m_resolutions_file
float getScaleFactor(const JetParameters ¶meters, Variation variation=Variation::NOMINAL, std::string uncertaintySource="") const
edm::EDGetTokenT< std::vector< pat::Jet > > m_jets_token
const JetResolutionObject * getResolutionObject() const
T getParameter(std::string const &) const
JetParameters & setJetPt(float pt)
edm::Service< TFileService > fs
JetResolutionDemo(const edm::ParameterSet &)
static const JetResolution get(const edm::EventSetup &, const Token &)