-
Notifications
You must be signed in to change notification settings - Fork 3
/
plotHistos.py
56 lines (48 loc) · 1.75 KB
/
plotHistos.py
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
44
45
46
47
48
49
50
51
52
53
54
55
import ROOT
from tools.drawCanvas import drawCanvas
# General configuration
runCfg = {
"outFile": "jetPlots.root",
"printDir": "./jetPlots", # optional
"formats": ["png"], # optional
"batch": True, # optional
}
# Will hold the canvases
canvasCfg = []
# The graphs we want to include in the first canvas
###### TCHE ##########################
myTH1s = [
{
"file": "/home/fynu/swertz/CMS_tasks/BTagTrackSel/myTrees/btagCutsOnly/jetHistos_TC_btagCutsOnly.root", # file where the graph is stored
"key": "Bjets/TCHE_DiscrEff", # name/path/... of the graph inside the file
"name": "bTag cuts", # name to be used in the legend
"color": ROOT.kBlue,
"lineStyle": 1, # (default 1)
"lineWidth": 3, # (default 1)
},
{
"file": "../myTrees/jetHistos_TC_btagCuts_MLP_Nplus5_noSel.root", # file where the graph is stored
"key": "Lightjets/TCHE", # name/path/... of the graph inside the file
"name": "Lightjets", # name to be used in the legend
"color": ROOT.kBlue,
"lineStyle": 1, # (default 1)
"lineWidth": 3, # (default 1)
},
]
# The first canvas
myCanvas = {
"name": "TCHE_discr", # Name of the canvas for the output ROOT/png/... files
"xSize": 800,
"ySize": 600,
"title": "TCHE discriminant", # optional
"norm": True, # optional
"grid": "xy", # optional
"xTitle": "TCHE", # optional
"yTitle": "Arbitrary scale", # optional
"legPos": "bl", # t/b, l/r
"hists": myTH1s,
}
canvasCfg.append(myCanvas)
# We're all set!
if __name__ == "__main__":
drawCanvas(runCfg, canvasCfg, mode = "TH1")