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

Simplify inheritance hirachy of EcalClusterFunctions #28332

Merged
merged 3 commits into from
Nov 9, 2019
Merged

Simplify inheritance hirachy of EcalClusterFunctions #28332

merged 3 commits into from
Nov 9, 2019

Conversation

guitargeek
Copy link
Contributor

PR description:

On my egamma refactors, I frequently encounter these plugins inheriting from EcalClusterFunctionBaseClass and it's always a bit complicated to understand what is going on.

For every plugin (let's say the EcalClusterCrackCorrection, there is another intermediate class defined (EcalClusterCrackCorrectionBaseClass) which is private to the plugins directory and is only used such that the EcalClusterCrackCorrection can inherit from it. This pattern is repeated for all the plugins. I would suggest to simplify this by having the plugins all inherit from EcalClusterFunctionBaseClass directly. Like this, the RecoEcal/EgammaCoreTools/plugins directory looks radically simpler and it would really help for understanding the code and future refactors. For example, one can now just do git grep EcalClusterFunctionBaseClass to find all the plugins that inherit from it. This PR doesn't make any actual changes to the code, it just reshuffles some lines.

PR validation:

CMSSW complies and local matrix tests pass.

if this PR is a backport please specify the original PR:

No backport intended.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 1, 2019

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 1, 2019

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28332/12593

  • This PR adds an extra 48KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 1, 2019

A new Pull Request was created by @guitargeek (Jonas Rembser) for master.

It involves the following packages:

RecoEcal/EgammaCoreTools
RecoEgamma/EgammaPhotonProducers

@perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@Sam-Harper, @jainshilpi, @rovere, @argiro, @sobhatta, @afiqaize, @lgray, @varuns23 this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented Nov 1, 2019

@ferriff it looks like you are the original developer/designer of these tools in RecoEcal/EgammaCoreTools
please check that this update is still OK wrt the original design ideas or if those are not needed anymore.
@argiro please confirm that this is fine for the ECAL DPG.
Thank you.

@guitargeek
Copy link
Contributor Author

I assumed the idea was to maybe have at some point separate factories for alternative functions that serve the same purpose, like crack correction or energy correction, is that correct? But since these don't exist, this inheritances were just complicated boilerplate at this point.

@slava77
Copy link
Contributor

slava77 commented Nov 1, 2019

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 1, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/3307/console Started: 2019/11/01 18:21

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 1, 2019

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 1, 2019

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 1, 2019

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ada09/3307/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2939026
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2938683
  • DQMHistoTests: Total skipped: 341
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@VinInn
Copy link
Contributor

VinInn commented Nov 3, 2019

is this inheritance needed at all?

@@ -13,25 +21,75 @@
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
#include "Geometry/CaloGeometry/interface/TruncatedPyramid.h"

//////From DummyHepMCAnalyzer.cc:
#include "FWCore/Framework/interface/EDAnalyzer.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this include needed?

#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionBaseClass.h"
#include "FWCore/Framework/interface/ESHandle.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate

#include "FWCore/Framework/interface/ESHandle.h"
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionBaseClass.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate

@@ -13,32 +19,92 @@
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
#include "Geometry/CaloGeometry/interface/TruncatedPyramid.h"

//////From DummyHepMCAnalyzer.cc:
#include "FWCore/Framework/interface/EDAnalyzer.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed?

#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionBaseClass.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate

#include "CondFormats/EcalObjects/interface/EcalClusterEnergyUncertaintyParameters.h"
#include "DataFormats/EgammaReco/interface/BasicCluster.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate

@@ -13,19 +19,70 @@
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
#include "Geometry/CaloGeometry/interface/TruncatedPyramid.h"

//////From DummyHepMCAnalyzer.cc:
#include "FWCore/Framework/interface/EDAnalyzer.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this include needed?

#include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "DataFormats/EgammaReco/interface/BasicCluster.h"
#include "FWCore/Framework/interface/EventSetup.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate

#include "FWCore/Framework/interface/EventSetup.h"
#include "DataFormats/EgammaReco/interface/BasicCluster.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate

#include "FWCore/Framework/interface/ESHandle.h"
#include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "DataFormats/EgammaReco/interface/BasicCluster.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2019

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2019

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28332/12639

  • This PR adds an extra 28KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2019

Pull request #28332 was updated. @perrotta, @cmsbuild, @slava77 can you please check and sign again.

@guitargeek
Copy link
Contributor Author

is this inheritance needed at all?

@VinInn Right now it is technically used because many plugins in Egamma use the EcalClusterFunctionFactory to create these helper functions. Whether this is the good way to use these helper functions is another question. In this PR I only wanted to address the "internal" inheritance hierarchy in the plugins directory for now.

@perrotta
Copy link
Contributor

perrotta commented Nov 6, 2019

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/3367/console Started: 2019/11/06 14:07

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2019

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2019

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2019

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ada09/3367/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2939026
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2938683
  • DQMHistoTests: Total skipped: 341
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@perrotta
Copy link
Contributor

perrotta commented Nov 8, 2019

+1

  • The simplification achieved by eliminating the intermediate layer of base classes is welcome, and blessed (in private communications) by the ECAL contacts
  • Additional simplification and cleanings also applied during the review
  • Plugins functionalities are not affected
  • Jenkins tests pass and show no differences

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 8, 2019

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@fabiocos
Copy link
Contributor

fabiocos commented Nov 9, 2019

+1

@cmsbuild cmsbuild merged commit 1c116f6 into cms-sw:master Nov 9, 2019
@guitargeek guitargeek deleted the EcalClusterFunctions_1 branch November 10, 2019 11:05
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.

6 participants