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

Computation of pfCand_chHad_hcalFraction and pfCand_nHad_hcalFraction input variables in DeepTauId.cc #24

Open
veelken opened this issue Aug 27, 2020 · 3 comments

Comments

@veelken
Copy link

veelken commented Aug 27, 2020

Hi,

just for the record, because it is of interest to everyone who runs a DeepTau training in CMSSW 10_x:
You need to replace lines 1708-1712 and lines 1732-1736 of https://cmssdt.cern.ch/lxr/source/RecoTauTag/RecoTau/plugins/DeepTauId.cc by:
hcal_fraction = pfCands.at(index_nCH).hcalFraction();
and
hcal_fraction = pfCands.at(index_nH).hcalFraction();
respectively, as these definition of the hcalFraction is used when filling the DeepTau training Ntuple ( https://github.com/cms-tau-pog/TauMLTools/blob/master/Production/plugins/TauTupleProducer.cc#L454 ).

The present computation of the input variables pfCand_chHad_hcalFraction and pfCand_nHad_hcalFraction in lines 1708-1712 and lines 1732-1736 of the DeepTauId.cc code are necessary, because Konstantin ran the DeepTau v2 training in CMSSW 9_x, when the hcalFraction was defined differently in the PFCandidate class.

@mbluj
Copy link
Contributor

mbluj commented Aug 27, 2020

Hi,
to complete information on calo fractions:

  1. hcal and calo energy fractions are defined for all charged particles with pT>0.5GeV since 106X, as added by Jan in PR cms-sw#26506
  2. In recent development releases (since 11_2_0_pre5 as far as I remember) the fractions are also available for gammas with pT>0.5GeV, added in PR cms-sw#30571.

The newly added fractions do not break deepTau v2p1 (current production version) evaluation thanks to if conditions limiting usage of the fractions to what was available in 94X/102X, but the new fractions should be considered in new trainings.

I think it makes sense to add a switch in training code reverting to original usage of the fractions - it can be either a flag or a compiler instruction checking version of CMSSW used. It should be less error prone than manual edition of relevant pieces of the code.

@veelken
Copy link
Author

veelken commented Aug 27, 2020

Hi Michal,

good point about adding a python configuration parameter to switch between the old vs new behaviour.
My preference would be to simply use hcalFraction for new DeepTau trainings and add the switch to DeepTauId.cc. If you agree, I will add the switch and prepare a pull request once the Phase-2 HLT tau trigger studies have converged (fingers crossed, within 1-2 weeks).

@mbluj
Copy link
Contributor

mbluj commented Aug 27, 2020

Yes, switch to DeepTau in CMSSW makes sense. I guess it will anyway require some changes to use a new training.

veelken pushed a commit to veelken/cmssw that referenced this issue Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants