Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pt dependent SF and add legends on summary plots #41240

Merged
merged 1 commit into from
Apr 7, 2023

Conversation

yuanchao
Copy link
Contributor

PR description:

As requested in AlCa meeting, adding support for JetResolutionObject SF records with Eta and Pt (2-bin). Corresponding histograms are added. Adding legends for PlotImage outputs.

PR validation:

Tested locally with getPayloadData.py script. Running scram code-checks and code-format.

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

This is not a backport.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41240/34966

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @yuanchao (Yuan CHAO) for master.

It involves the following packages:

  • CondCore/JetMETPlugins (db)

@cmsbuild, @tvami, @saumyaphor4252, @francescobrivio can you please review it and eventually sign? Thanks.
@mmusich this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41240/34975

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

Pull request #41240 was updated. @cmsbuild, @tvami, @saumyaphor4252, @francescobrivio can you please check and sign again.

Comment on lines 158 to 159
// leg->SetFillColor(0);
// leg->SetLineColor(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove commented out code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Comment on lines 396 to 397
// leg->SetFillColor(0);
// leg->SetLineColor(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove commented out code

Comment on lines 443 to 447

// payload->getDefinition().getBinName(1) == "JetPt" &&
// !record.getBinsRange()[1].is_inside(500.) )
// continue; // for 2-bin payload, take jetpt=500

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove commented out code

Copy link
Contributor

@tvami tvami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The legend entry question is something I only pointed out once, but it's there several times

if (record.getBinsRange()[0].is_inside(x_axis)) {
if (((is_2bin == false) || (is_2bin == true && record.getBinsRange()[1].is_inside(500.))) &&
record.getBinsRange()[0].is_inside(x_axis)) {
//edm::LogWarning("JRObj_PI") << "JetEta " << x_axis << ", SF "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove commented out code

for (size_t it = 0; it <= NBIN_PT; it++) {
double x_axis = (it + 0.5) * (MAX_PT - MIN_PT) / NBIN_PT + MIN_PT;
if (record.getBinsRange()[1].is_inside(x_axis)) {
//edm::LogWarning("JRObj_PI") << "JetPt " << x_axis << ", SF " << record.getParametersValues()[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove commented out code, here actually you could make it LogDebug right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@@ -52,7 +52,7 @@ int main(int argc, char** argv) {
histo4.process(connectionString, PI::mk_input(tag_eta, start, end));
std::cout << histo4.data() << std::endl;

std::cout << "## Jet SF Histograms" << std::endl;
std::cout << "## Jet SF vs. Eta Histograms" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we void using the couts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply a copy from the example unit test code provided. Surely I can replace them with LogINFO.


JME::JetScaleFactorVsPtUP histo10;
histo10.process(connectionString, PI::mk_input(tag_sf, start, end));
std::cout << histo10.data() << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we void using the couts? In all the other occurrences too

sf_pt_norm->Draw("axis same");

leg_pt->AddEntry(sf_pt_norm, (tag_ver + '_' + tag_jet).c_str(), "l");
leg_pt->AddEntry((TObject*)nullptr, "JetEta=2.55", "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this hardcoded to 2.55? Also isnt this less than 2.55 instead of the equal sign?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the Jet resolution part, I follow the plots in the presentation of Andrea that rho and eta or pt are fixed. As to SF, for this two-bin case, I pick up the eta region that has most records. (here 2.5-2.6, 2.55 is the central value)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm but then the PI has the option to pass arguments, wouldnt it be better to be able to specify the eta instead of having these hardcoded numbers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the old JEC/JER web viewer shown in Andreas' slides uses fixed values and in the latest version users can choose from a drop-down menu, PI can only take float inputs. I need to check if some default values can be set, otherwise it's rather not-ideal. I'll deal with this after finish the JEC PI.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 6, 2023

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41240/35091

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 6, 2023

Pull request #41240 was updated. @cmsbuild, @tvami, @saumyaphor4252, @francescobrivio can you please check and sign again.

add tests for SF vs. Pt

removing commented code and use edm::MessageLogger
@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 6, 2023

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41240/35100

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 6, 2023

Pull request #41240 was updated. @cmsbuild, @tvami, @saumyaphor4252, @francescobrivio can you please check and sign again.

@tvami
Copy link
Contributor

tvami commented Apr 6, 2023

+db

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 6, 2023

This pull request is fully signed and it will be integrated in one of the next master IBs after it passes the integration tests. This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 6, 2023

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b2a4c6/31878/summary.html
COMMIT: 2fc509a
CMSSW: CMSSW_13_1_X_2023-04-06-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/41240/31878/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 3 lines from the logs
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3459609
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3459584
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 207 log files, 159 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@@ -32,39 +32,55 @@ int main(int argc, char** argv) {
cond::Time_t start = static_cast<unsigned long long>(1);
cond::Time_t end = static_cast<unsigned long long>(1);

std::cout << "## Jet Pt Resolution Histograms" << std::endl;
edm::LogWarning("JER_PI") << "## Jet Pt Resolution Histograms" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For test code, not used in productions, there is normally no strict requirement to move out of std::cout.
In any case, since you are migrating to LogWarning, please add the corresponding header include

#include "FWCore/MessageLogger/interface/MessageLogger.h"

which is now missing

@perrotta
Copy link
Contributor

perrotta commented Apr 7, 2023

@tvami your comment https://github.com/cms-sw/cmssw/pull/41240/files#r1154408873 was not implemented yet. Could you please confirm that this is still fine with you?

@tvami
Copy link
Contributor

tvami commented Apr 7, 2023

Could you please confirm that this is still fine with you?

Yes, Yuan agreed to follow-up on that in a next PR. Thanks for double-checking!

@rappoccio
Copy link
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants