Root 6.22 cmsenv python

Hi,
I use ROOT in a simple manner with cmsenv.
When I used ROOT 6.18 with cmsenv on CMSSW_11_1_0_pre4 release, I made simples histos (see left picture).
With CMSSW_11_2_X or CMSW_11_3_Y release, and for an identical use, I have a pbm with axis and font size (right picture).
ROOT_pbms2

I have this pbm with slc7_amd64_gcc820 or slc7_amd64_gcc900 and only with ROOT 6.22.
Is there something changed in ROOT initialization ? Or something I forgot ?

If someone can help me.
thanks in advance.

Arnaud


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.18/6.22
Platform: lxplus
Compiler: Not Provided


In 6.22 there was a new style implemented but that should not affect the other styles.
It looks like the top axis fonts are bigger and the TPaveText top left disappeared.
Can we have the macro to check ?

sorry for the delay. What do you call Macro ?
We use a python script with or without cmsenv to generate some histos pictures.

I mean the script you are using, or a subset of it reproducing the problem.

DQM_V0001_R000000001__RelValTTbar_14TeV__CMSSW_11_3_0_pre5-v1__RECO-PHASE2wo__RECO3.root (33.7 KB) DQM_V0001_R000000001__RelValTTbar_14TeV__CMSSW_11_3_0_pre5-v1__RECO-PHASE2__RECO3.root (35.5 KB) testROOT.py (11.2 KB)

I use these 3 files.
for the 2 version of root : python testROOT.py
with ROOT 6.18 (with cmsenv command) I got the correct picture.
the pictures are located in 11_3_0_pre5_P2_miniAOD_woRecomp.3_DQM_dev folder.

thanks.

P.S. it’s a script made from an original package more complicated but with the same results about the pictures.

Your script does not run if the data files and the script are in the same folder. I start to look at it but it seems a bit tricky (several place to modify) can you modify your script so it runs under that conditions? ie all file in same folder ?

OK. Do I keep the picture folder or do you want the pictures to be created into the same folder as the script ?

if the folder is created I do not care

testROOT.py (10.9 KB)
and there is a new folder name : 11_3_0_pre5_Test_ROOT.3_DQM_dev

You do not set the size of labels of the top plot. At line 122 I would do …

    histo1.GetXaxis().SetLabelFont(43)
    histo1.GetXaxis().SetLabelSize(15)
    histo1.GetYaxis().SetLabelFont(43)
    histo1.GetYaxis().SetLabelSize(15)
    histo1.Draw(newDrawOptions)

… if you want to have the same labels’ sizes as the bottom plot

Clear !
I seems to solve the font pbm.

And a visual of the upgrade
ROOT_pbms3
I used the following cmds:

  • connect to lxplus.
  • go to my folder on [1]
  • root -v gives : 6.22/08
  • python testROOT.py gives picture on the right and the corrected font sizes.
  • going to a previous version of release [2].
  • cmsenv
  • retrun to first folder [1]
  • root -v gives 6.18/04
  • python testROOT.py gives picture on the left.

[1] : /afs/cern.ch/work/a/archiron/public/CMSSW_11_3_0_pre4/src/Validation/RecoEgamma/test/quickValidationsNG
[2] : /afs/cern.ch/work/a/archiron/private/CMSSW_11_1_0_pre4_ValELE/src

So the missing title is the only issue now ?

yes, and perhaps the width of the histo. If you look carefully, you see 2 things :

  • the size of the histo seems greater with ROOT 6.22 while the statboxes stay in place,
  • between the 2 histo it seems a small shift as we can see betwwen correct histo (ROOT 6.18)
    ROOT_pbms4a
    and the histo generated with ROOT 6.22
    ROOT_pbms4b

For an obscur reason your macro generates a:

    gStyle.SetOptTitle(0)

I could not managed to reproduce it using C++. To bypass that you can do:

...
   ROOT.gROOT.ForceStyle()
   gStyle.SetOptTitle(1)    <==== Add this line
...

For the other issue I guess you can enlarge the left margin.

I found it !
folowing your precedent comment, I looked for values used with my initRootStyle() subroutine.
I saw that for the left/right pad margin I want :
eleStyle.SetPadLeftMargin(0.15)
eleStyle.SetPadRightMargin(0.2)

and I had :
PadLeftMargin : 0.160000
PadRightMargin : 0.050000

By adding : gStyle.SetPadRightMargin(0.2)
after this line :

ROOT.gROOT.ForceStyle()
gStyle.SetOptTitle(1) <==== Add this line
gStyle.SetPadRightMargin(0.2) <=== My add

it looks like well :

I will make some other tests to confirm, but it seems OK.
Many thanks.

OK. All tests passed. I think I can close.
Many thanks to you.

Heee, if I find how to …