cms-tau-pog / TauFW

Analysis framework for tau analysis at CMS using NanoAOD
9 stars 41 forks source link

python3 compatibility & coffea #6

Open IzaakWN opened 3 years ago

IzaakWN commented 3 years ago

Since coffea is very similar to nanoAOD-tools, it would be nice to have this option in the future to speed up processing of nanoAOD files.

I have looked at it, but the main difficulty at the moment is that in CMSSW I have not found a neat way to use python3 with ROOT. Maybe it's first necessary to divorce TauFW from CMSSW (see issue https://github.com/cms-tau-pog/TauFW/issues/5), and/or some tricks are needed to set the ROOT version with for example

source /cvmfs/sft.cern.ch/lcg/views/LCG_96python3/x86_64-centos7-gcc8-opt/setup.sh

In any case, the code like pico.py and common help functions should be made python3 compatible in preparation by using

from __future__ import print_function

and fixing all print statements without parentheses, as well as replacing iteritems() with items(), etc.

IzaakWN commented 3 years ago

Having python3 would also allow for easy use of correctionlib, which will become CMS standard soon: https://github.com/cms-nanoAOD/correctionlib

IzaakWN commented 5 months ago