CMSBParking / BParkingNANO

Code to make parking NanoAOD
Apache License 2.0
5 stars 44 forks source link

Low precision --> 4 MeV mass resolution #93

Open rmanzoni opened 3 years ago

rmanzoni commented 3 years ago

Hi,

@friti and I have adapted your BParking nanoAOD code for our R(Jpsi) analysis and have noticed a strange, but perhaps known/intended, behaviour: some branches are saved with low numerical precision (which I guess it's intended) but for some of them, most notably masses, this is critical. Masses end up having 4 MeV resolution, which is problematic when it comes to fitting.

We attach one example from our ntuples

Schermata 2020-11-14 alle 14 45 01

and one from your ntuples /eos/cms/store/cmst3/group/bpark/BParkingNANO_2020Jan29/BuToKee_Mufilter_SoftQCDnonD_TuneCP5_13TeV-pythia8-evtgen/crab_BuToKee/200129_160213/0000/BParkNANO_mc_2020Jan29_130.root

Schermata 2020-11-16 alle 10 26 14

Questions:

  1. is this an effect of a configuration that belongs to BParkingNANO?
  2. If yes, how can we tune it?
  3. if not, is this an effect of the standard nanoAOD setup?

Thanks

amartelli commented 3 years ago

zoom-in_1MeVbin Hi @rmanzoni, this is indeed likely an effect of the precision used to save variables in the miniAOD. We saw the same thing in the past with the gen pT (see attached spectrum with fine binning of 1MeV and zoom-in), where the steps on the crest are not uniform but become sparse at higher pTs: you see that from 8 (= 2^3) the precision changes, on larger scale, same effect is visible at 32. This is due to the precision with which the gen-particles are saved in nanoAOD, that is 8 bits. It was also noted that in a similar plot from George, this effect was not visible, but he used miniAOD.

The parameter in this case, was the precision used to fill in the table in the nano steps. Unless things changed, you can change the parameter and rerun the nanoAOD... check the table where the variables are filled

rmanzoni commented 3 years ago

thanks Arabella!

Following your suggestion, this is the place where CandVars (to which the observable I plotted belongs) are defined https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/python/common_cff.py#L43-L56 and there, the precision of the mass is set to 10 bits.

It's worth noting that for variables that are defined within BParkingNANO, the precision is set to max https://github.com/friti/BParkingNANO/blob/master/BParkingNano/python/common_cff.py#L4

in fact, if I plot BToKEE_fit_mass (red) and the corresponding BToKEE_mass (blue) from the same file, I obtain this

Schermata 2020-11-16 alle 11 42 16

I guess this is understood now, thank you!