-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Issues with (Char_t) seediEtaOriX in Nanov11 onwards #43699
Comments
cms-bot internal usage |
A new Issue was created by @a-kapoor Anshul Kapoor. @Dr15Jones, @makortel, @smuzaffar, @antoniovilela, @rappoccio, @sextonkennedy can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
type egamma, root |
assign egamma-pog, xpog |
New categories assigned: egamma-pog,xpog @vlimant,@hqucms,@a-kapoor,@RSalvatico you have been requested to review this Pull request/Issue and eventually sign? Thanks |
The definitions (as added by #40327) cmssw/PhysicsTools/NanoAOD/python/electrons_cff.py Lines 353 to 354 in f5cbbf1
have
that seems explain why the first one is stored as |
indeed, the new types were introduced with #40478 and this end up with leaves of questionable type in ROOT so int8 (and uint8) are messed up when transferred to plain ROOT, as was already noticed by @swertz (not CMS anymore). |
Otherwise the behavior looks like expected. |
type -root I don't think this is an issue to be addressed by ROOT. |
@makortel : where do I find the real meaning of "int8_t" and can we change this to what it means ? |
The // in /usr/include/bits/types.h
typedef signed char __int8_t;
// in /usr/include/bits/stdint-intn.h
typedef __int8_t int8_t; We can not change its meaning. (What would you change it to? |
@vlimant Shall I change the "int8" to int as done for seediPhiOriY if there are no central nano issues with this? It will solve the problem for these variables at least. What do you think? |
Hi there, if you want to avoid that pesky ROOT formatting issue with
|
because of the fundamental type and how it ends up stored in root, I think we need to centrally roll back and ban usage of int8, unit8, and maybe others from the nano table code to avoid dubious interpretation in root. |
See the discussion here: https://root-forum.cern.ch/t/draw-short-integers-as-numbers-not-characters/52530/24
|
Hi @swertz as you can see in my description, in this specific case, it is "int8" that's making the mess cmssw/PhysicsTools/NanoAOD/python/electrons_cff.py Lines 353 to 354 in f5cbbf1
|
Sorry that was a typo, I meant to say that |
uint8 (used for PV_npvs for example) give issues with pyroot https://cms-talk.web.cern.ch/t/issues-with-uint8-t-variables-in-nanoaodv12/31598 |
parallel to rolling back int8 in nano (and then uint8), how do we go about having this "fixed" at the ROOT level ? |
root-project/root#14361 for reference |
+1 |
please close |
The PR #40327 added iEta,iPhi (for barrel) and iX,iY(for endcaps) to NanoAOD for photons and electrons. These are useful to veto the EE+ leak region at analysis level.
These variables were added as int8, it is not clear why _seediEtaOriX ends of as Char_t in the NanoAOD.
See docs
Same issue for electrons too.
The consequence is that when one reads these values, the _seediEtaOriX dumps some junk values:
Happens for both photons and electrons. The reason might be that ROOT interprets int8 as char. Although it is not clear why it only happens for _seediEtaOriX and not _seediPhiOriY
A workaround for analyzers might be to force ROOT to tree it as an integer, like this:
Note how I forced the type conversion by adding a zero.
Yet a permanent solution for future versions could be to change the type of this variable from int8 to int16.
This is not an isolated issue, and my student has seen other issues in new NanoAODs with these kind of datatypes:
https://cms-talk.web.cern.ch/t/uchar-short-and-char-variables-in-nanoaod-v12-inconsistent-results-using-root/33208
Will target a fix for EGM variable in Nano v14.
@RSalvatico @swagata87 @Prasant1993
The text was updated successfully, but these errors were encountered: