Hi, thanks for your answer.
when I logged into lxplus, and launch ROOT, I get the 6.32.02 version.
using my script (python3 mainSimple.py), I got :
PYTHON version : 3.9.18 (main, Jul 3 2024, 00:00:00)
[GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]
ROOT version : 6.32.02
How can I force the 6.32.04 version ?
I reply to myself :
source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.32.04/x86_64-almalinux9.4-gcc114-opt/bin/thisroot.sh
and with this version, I still have the notification (ASImage2gif():1137:GIFS/h_ele_vertexEta.gif> (null)) but not for all the pictures (i.e. some have and some have not).
_, short_histo_names, histo_positions = shortHistoName('ElectronMcSignalValidator/h_ele_vertexEta 1 1 1 0')
gif_name = "GIFS/" + short_histo_names[0] + ".gif"
print('positions %s' % histo_positions)
histo_1 = h1.Get(short_histo_names[0]) #
histo_2 = h2.Get(short_histo_names[0]) #
gr.PictureChoice(histo_1, histo_2, histo_positions[1], histo_positions[2], gif_name, 0) # 2
_, short_histo_names, histo_positions = shortHistoName('ElectronMcSignalValidator/h_ele_mva_isolated_barrel 1 1 0 0')
gif_name = "GIFS/" + short_histo_names[0] + ".gif"
print('positions %s' % histo_positions)
histo_1 = h1.Get(short_histo_names[0]) #
histo_2 = h2.Get(short_histo_names[0]) #
gr.PictureChoice(histo_1, histo_2, histo_positions[1], histo_positions[2], gif_name, 0) # 2
I got :
positions [‘h_ele_vertexEta’, ‘1’, ‘1’, ‘1’, ‘0’]
PictureChoice : TH1F
positions [‘h_ele_mva_isolated_barrel’, ‘1’, ‘1’, ‘0’, ‘0’]
PictureChoice : TH1F
ASImage2gif():1137:<GIFS/h_ele_mva_isolated_barrel.gif> (null)
I think this can come from the function I use for gif picture (createPicture2).
def createPicture2(self, histo1, histo2, scaled, err, filename, id):
new_entries = histo1.GetEntries() # ttl # of bins (9000 in general)
ref_entries = histo2.GetEntries()
self.cnv = TCanvas(str(id), "canvas")
histo2c = histo2.Clone()
histo3 = histo1.Clone("histo3")
if ((scaled =="1") and (new_entries != 0) and (ref_entries != 0)):
rescale_factor = new_entries / ref_entries
histo2c.Scale(rescale_factor)
if (histo2c.GetMaximum() > histo1.GetMaximum()):
histo1.SetMaximum(histo2c.GetMaximum() * 1.1)
self.cnv.SetCanvasSize(960, 900)
self.cnv.Clear()
self.cnv.SetFillColor(10)
self.cnv.SetBorderMode(1)
pad1 = ROOT.TPad(str(id), "pad1", 0, 0.25, 1.0, 1.0) # ,0,0,0
pad1.SetBottomMargin(0.05)
pad1.Draw()
pad1.cd()
if err == "1":
newDrawOptions ="E1 P"
else:
newDrawOptions = "hist"
histo1.SetStats(1)
histo1.Draw(newDrawOptions) #
histo1.SetLineStyle(0)
histo1.SetLineWidth(2)
self.RenderHisto(histo1)
if ("ELE_LOGY" in histo1.GetOption() and histo1.GetMaximum() > 0):
if (re.search('etaEff_all', filename) or re.search('ptEff_all', filename)):
print('accord')
pad1.SetLogy(0)
else:
pad1.SetLogy(1)
gPad.Update()
statBox1 = histo1.GetListOfFunctions().FindObject("stats")
statBox1.SetTextColor(kRed)
statBox1.SetBorderSize(2)
statBox1.SetFillColorAlpha(18, 0.35) # https://root.cern.ch/doc/master/classTAttFill.html
statBox1.SetY2NDC(0.995)
statBox1.SetY1NDC(0.755)
statBox1.SetX2NDC(0.995)
statBox1.SetX1NDC(0.795)
gPad.Update()
histo2c.Draw("sames hist") # "" same
histo2c.SetStats(1)
self.RenderHisto(histo2c)
if ("ELE_LOGY" in histo2c.GetOption() and histo2c.GetMaximum() > 0):
if (re.search('etaEff_all', filename) or re.search('ptEff_all', filename)):
print('accord')
pad1.SetLogy(0)
else:
pad1.SetLogy(1)
self.cnv.Update()
statBox2 = histo2c.GetListOfFunctions().FindObject("stats")
statBox2.SetTextColor(kBlue)
y1 = statBox1.GetY1NDC()
y2 = statBox1.GetY2NDC()
statBox2.SetY1NDC(2*y1-y2)
statBox2.SetY2NDC(y1)
statBox2.SetBorderSize(2)
statBox2.SetFillColorAlpha(18, 0.35)
statBox2.SetX2NDC(0.995)
statBox2.SetX1NDC(0.795)
newDrawOptions = "sames "
if err == "1":
newDrawOptions += "E1 P"
else:
newDrawOptions += "hist"
histo1.Draw(newDrawOptions)
histo2c.Draw("sames hist")
self.cnv.cd()
pad2 = ROOT.TPad(str(id), "pad2", 0, 0.05, 1.00, 0.26) # ,0,0,0
pad2.SetTopMargin(0.025)
pad2.SetBottomMargin(0.3)
pad2.SetBorderMode(0)
pad2.SetGridy()
pad2.Draw()
pad2.cd()
histo3.Divide(histo2c) # divide by the scaled nb of events
histo3.SetLineColor(kBlack)
histo3.SetMaximum(2.)
histo3.SetMinimum(0.)
histo3.SetStats(0)
histo3.Sumw2()
histo3.SetMarkerStyle(21)
histo3.Draw("ep")
histo1.SetMarkerColor(kRed)
histo1.SetLineWidth(3)
histo1.SetLineColor(kRed)
histo1.GetYaxis().SetTitleSize(25)
histo1.GetYaxis().SetTitleFont(43)
histo1.GetYaxis().SetTitleOffset(2.00)
histo1.GetZaxis().SetTitleSize(0.05)
histo1.SetMarkerStyle(21)
histo1.SetMarkerSize(0.8)
histo2c.SetLineColor(kBlue)
histo2c.SetMarkerColor(kBlue)
histo2c.SetLineWidth(3)
histo3.SetTitle("")
# Y axis ratio plot settings
histo3.GetYaxis().SetTitle("ratio h1/h2 ")
histo3.GetYaxis().SetNdivisions(505)
histo3.GetYaxis().SetTitleSize(20)
histo3.GetYaxis().SetTitleFont(43)
histo3.GetYaxis().SetTitleOffset(1.55)
histo3.GetYaxis().SetLabelFont(43) # Absolute font size in pixel (precision 3)
histo3.GetYaxis().SetLabelSize(15)
# X axis ratio plot settings
histo3.GetXaxis().SetTitleSize(20)
histo3.GetXaxis().SetTitleFont(43)
histo3.GetXaxis().SetLabelFont(43) # Absolute font size in pixel (precision 3)
histo3.GetXaxis().SetLabelSize(15)
self.cnv.Draw()
self.cnv.Update()
#self.cnv.SaveAs(filename)
self.cnv.Print(filename)
self.cnv.Close()
return
Arnaud