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

Implementation of beam halo tagger algorithm for the endcap photons #36901

Merged

Conversation

jainshilpi
Copy link
Contributor

@jainshilpi jainshilpi commented Feb 7, 2022

This PR concerns the newly developed BDT based algorithm to deal with a huge beam halo background in the ECAL endcap which is identified as good photons. Already presented in ECAL DPG, JetMET POG and E/gamma groups:

  1. ECAL DPG: https://indico.cern.ch/event/991261/contributions/4283096/attachments/2219229/3757719/beamHalo_31march_v1.pdf
  2. JetMET POG: https://indico.cern.ch/event/1027614/contributions/4314949/attachments/2224472/3767396/beamHalo_12April.pdf
  3. E/gamma: https://indico.cern.ch/event/1095380/#13-beam-halo-tagging-in-ee
    The last presentation has the checks done as well comparing the implementation using private framework
    and the CMSSW implementation.
    This implementation touches the DataFromats/EgammaCandidates/Photon.h
    The PR for training file will be done as well in RecoEgamma/PhotonIdentification/data

This training is relevant for photons with PT > 100 GeV - the regime important for single photon (+MET) analyses.
The runMatrix tests have been done and they all ran successfully.

Currently the changes are done only at the miniAOD level. After the discussion with the xpog, the relevant variable will be put in the nanoAOD as well.

Thanks to @thomreis for the help.

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 7, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36901/28185

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 7, 2022

A new Pull Request was created by @jainshilpi for master.

It involves the following packages:

  • DataFormats/EgammaCandidates (reconstruction)
  • DataFormats/PatCandidates (reconstruction)
  • RecoEgamma/EgammaPhotonProducers (reconstruction)
  • RecoEgamma/PhotonIdentification (reconstruction)

@jpata, @cmsbuild, @clacaputo, @slava77 can you please review it and eventually sign? Thanks.
@Sam-Harper, @sobhatta, @afiqaize, @valsdav, @rovere, @lgray, @gouskos, @lecriste, @hatakeyamak, @gpetruc, @wrtabb, @varuns23, @ram1123 this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@jpata
Copy link
Contributor

jpata commented Feb 7, 2022

test parameters:

@jpata
Copy link
Contributor

jpata commented Feb 7, 2022

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 7, 2022

-1

Failed Tests: Build ClangBuild
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b5b203/22257/summary.html
COMMIT: fdcfde2
CMSSW: CMSSW_12_3_X_2022-02-06-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/36901/22257/install.sh to create a dev area with all the needed externals and cmssw changes.

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:

You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b5b203/22257/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b5b203/22257/git-merge-result

Build

I found compilation warning when building: See details on the summary page.

Clang Build

I found compilation warning while trying to compile with clang. Command used:

USER_CUDA_FLAGS='--expt-relaxed-constexpr' USER_CXXFLAGS='-Wno-register -fsyntax-only' scram build -k -j 64 COMPILER='llvm compile'

See details on the summary page.

@jpata
Copy link
Contributor

jpata commented Feb 7, 2022

The following clang errors seem relevant:

RecoEgamma/PhotonIdentification/src/PhotonMVABasedHaloTagger.cc
/pool/condor/dir_122481/jenkins/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-06-2300/src/RecoEgamma/PhotonIdentification/src/PhotonMVABasedHaloTagger.cc:157:21: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
/pool/condor/dir_122481/jenkins/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-06-2300/src/RecoEgamma/PhotonIdentification/src/PhotonMVABasedHaloTagger.cc:382:12: warning: unused variable 'rhPhi' [-Wunused-variable]

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 7, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36901/28199

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 2, 2022

Pull request #36901 was updated. @jpata, @cmsbuild, @clacaputo, @slava77 can you please check and sign again.

@perrotta
Copy link
Contributor

perrotta commented Mar 2, 2022

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 3, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b5b203/22784/summary.html
COMMIT: 73220c5
CMSSW: CMSSW_12_3_X_2022-03-02-1100/slc7_amd64_gcc10
Additional Tests: PROFILING
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/36901/22784/install.sh to create a dev area with all the needed externals and cmssw changes.

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:

You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b5b203/22784/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b5b203/22784/git-merge-result

Comparison Summary

Summary:

  • No significant changes to the logs found
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 144 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3987333
  • DQMHistoTests: Total failures: 152
  • DQMHistoTests: Total nulls: 6
  • DQMHistoTests: Total successes: 3987153
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -6538.53 KiB( 48 files compared)
  • DQMHistoSizes: changed ( 11634.0,... ): -1091.170 KiB HLT/BPH
  • DQMHistoSizes: changed ( 11634.0,... ): 1.415 KiB HLT/Filters
  • Checked 204 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: found differences in 7 / 48 workflows

@jpata
Copy link
Contributor

jpata commented Mar 3, 2022

+reconstruction

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 3, 2022

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. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

perrotta commented Mar 3, 2022

+1

import FWCore.ParameterSet.Config as cms
from RecoEgamma.EgammaIsolationAlgos.egammaHBHERecHitThreshold_cff import egammaHBHERecHit

pathToHaloMVATrainingFile = "RecoEgamma/PhotonIdentification/data/beamHaloTaggerID/xgboostToTMVA_BHtagger.root"
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the beamHaloTaggerID/xgboostToTMVA_BHtagger.root file wasn't included, so this PR broke the IB judging from #37130 (comment).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! Should be fixed now by cms-sw/cmsdist#7665

@perrotta
Copy link
Contributor

perrotta commented Mar 6, 2022

@jainshilpi as suggested by @mmusich in #37143 (comment) there is quite likely some uninitialized variable in the PhotonMVABasedHaloTagger that causes some unphysical (and non reproducible) haloTaggerMVA value, see the results of the comparisons and the plots atteched to the #37143 github thread.
Could you please have a look and provide a fix, if needed?

@jainshilpi
Copy link
Contributor Author

@perrotta - thanks for pointing to this problem and sorry that I missed to have the appropriate treatment to Run 1+2 files. It seems that the WF 136.7611 essentially picks the 2016 AOD files and tries to find the value of haloTaggerMVAVal_. Since this variable does not exist in those AOD files (which is added by this PR in the releases beyond 12_3_X), this just takes some junk value and puts in haloTaggerMVAVal(). I have fixed this issue in this update:
https://github.com/cms-sw/cmssw/compare/master...jainshilpi:BHtaggerImplementation_12_3_0pre4_codechecks?expand=1

Re-running over the same WF seems now to give -99 value for this variable. I also checked by running over the AOD files generated in 12_3_X and correct values can be seen.

Can you please confirm that the treatment to old files seem fine to you? If this is fine, I suppose I should do a new PR?

@perrotta
Copy link
Contributor

perrotta commented Mar 7, 2022

@perrotta - thanks for pointing to this problem and sorry that I missed to have the appropriate treatment to Run 1+2 files. It seems that the WF 136.7611 essentially picks the 2016 AOD files and tries to find the value of haloTaggerMVAVal_. Since this variable does not exist in those AOD files (which is added by this PR in the releases beyond 12_3_X), this just takes some junk value and puts in haloTaggerMVAVal(). I have fixed this issue in this update: https://github.com/cms-sw/cmssw/compare/master...jainshilpi:BHtaggerImplementation_12_3_0pre4_codechecks?expand=1

Re-running over the same WF seems now to give -99 value for this variable. I also checked by running over the AOD files generated in 12_3_X and correct values can be seen.

Can you please confirm that the treatment to old files seem fine to you? If this is fine, I suppose I should do a new PR?

Thank you @jainshilpi for the prompt feedback!
Could you please make a PR out of it?

@jainshilpi
Copy link
Contributor Author

@perrotta - thanks for pointing to this problem and sorry that I missed to have the appropriate treatment to Run 1+2 files. It seems that the WF 136.7611 essentially picks the 2016 AOD files and tries to find the value of haloTaggerMVAVal_. Since this variable does not exist in those AOD files (which is added by this PR in the releases beyond 12_3_X), this just takes some junk value and puts in haloTaggerMVAVal(). I have fixed this issue in this update: https://github.com/cms-sw/cmssw/compare/master...jainshilpi:BHtaggerImplementation_12_3_0pre4_codechecks?expand=1
Re-running over the same WF seems now to give -99 value for this variable. I also checked by running over the AOD files generated in 12_3_X and correct values can be seen.
Can you please confirm that the treatment to old files seem fine to you? If this is fine, I suppose I should do a new PR?

Thank you @jainshilpi for the prompt feedback! Could you please make a PR out of it?

Hi @perrotta I just created PR #37156

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.

8 participants