forked from AliceO2Group/Run3AnalysisValidation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplottogether.py
More file actions
executable file
·43 lines (35 loc) · 983 Bytes
/
plottogether.py
File metadata and controls
executable file
·43 lines (35 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
"""
Script to plot together canvases in different files
"""
from sys import argv
from ROOT import TColor, TFile # , TLegend
def main(filename, canvases):
f = TFile(filename, "READ")
f.ls()
cols = ["#e41a1c", "#377eb8", "#4daf4a"]
cols = [TColor.GetColor(i) for i in cols]
print("Canvases", canvases)
canname = canvases[0]
canname.split("_folder_")[-1]
can = f.Get(canname)
lcan = can.GetListOfPrimitives()
lcan.FindObject("TPave").SetHeader("")
can.Draw()
print(can)
# leg = TLegend(0.7, 0.7, 0.9, 0.9)
for i in canvases[1:]:
print("Getting", i)
c = f.Get(i)
lp = c.GetListOfPrimitives()
# lp.ls()
for j in lp:
if "TH1" not in j.ClassName():
continue
print(j)
can.cd()
j.Draw("sameHIST")
can.Update()
return can
res = main(argv[1], argv[2:])
input("Press enter to continue")