In [1]:
import ROOT, sys
sys.path.append('../python/')
inputFile = ROOT.TFile.Open("/data/hunyadi/CMSSW/PhaseIEfficiencyPlotter_2017_04_02/CMSSW_9_1_0_pre3/src/DPGAnalysis/PhaseIEfficiencyPlotter/histograms_delayscan.root", "READ")
In [2]:
for key in ROOT.gDirectory.GetListOfKeys():
print key.GetTitle()
The delay scenarios should have been printed out ("Delay -9999.00" is saved for unknown delay scenarios or simulations).
First, we define a helper function to make it easy to create the required canvases:
In [3]:
def createTwoByNCanvas(name, title, width, height, plotDirectory, plotNames):
canvas = ROOT.TCanvas(name, title, width, height)
canvas.Divide(2, int((len(plotNames) + 1) / 2))
for index, plotName in enumerate(plotNames):
canvas.cd(index + 1)
plot = ROOT.gDirectory.Get(plotDirectory + "/" + plotName)
if plot: plot.Draw("COLZ")
else: print "Missing plot: ", plotName
return canvas
To validate the plots, we will only look at the contents of the first directory. This code draws the cluster and rechit occupancies on the layers and the forward region:
In [4]:
# ROOT.enableJSVis()
ROOT.gStyle.SetPalette(1)
In [5]:
mainDir = ROOT.gDirectory.Get(
ROOT.gDirectory.GetListOfKeys().First().GetTitle())
The possible plot directories can be listed with this code:
In [6]:
directoryTitleList = []
for directory in mainDir.GetListOfKeys():
directoryTitleList += [directory.GetTitle()]
for index, directoryTitle in enumerate(directoryTitleList):
sys.stdout.write("%-35s " % directoryTitle)
if index % 3 == 2: print ""
In [7]:
canvas = createTwoByNCanvas("ClusterOccupancyCanvas", "Cluster Occupancy on the ROCs", 900, 1200,
mainDir.GetTitle() + "/" + "clusterOccupancyROCPlots",
["clusterOccupancyROCPlots_Layer1",
"clusterOccupancyROCPlots_Layer2",
"clusterOccupancyROCPlots_Layer3",
"clusterOccupancyROCPlots_Layer4",
"clusterOccupancyROCPlots_AllDisks"]
)
canvas.Draw()
In [8]:
canvas = createTwoByNCanvas("ClusterPhiVsZCanvas", "Cluster occupancy, phi vs Z", 900, 1200,
mainDir.GetTitle() + "/" + "clusterPhiVsZPlots",
["clusterPhiVsZPlots_Layer1",
"clusterPhiVsZPlots_Layer2",
"clusterPhiVsZPlots_Layer2",
"clusterPhiVsZPlots_Layer4"]
)
canvas.Draw()
In [9]:
canvas = createTwoByNCanvas("ClusterGlyVsGlxCanvas", "Cluster occupancy, Y vs X", 900, 1200,
mainDir.GetTitle() + "/" + "clusterGlyVsGlxPlots",
["clusterGlyVsGlxPlots_Disk1",
"clusterGlyVsGlxPlots_Disk2",
"clusterGlyVsGlxPlots_Disk3",
"clusterGlyVsGlxPlots_Disk4",
"clusterGlyVsGlxPlots_Disk5",
"clusterGlyVsGlxPlots_Disk6"]
)
canvas.Draw()
In [10]:
canvas = createTwoByNCanvas("RechitOccupancyCanvas", "Rechit Occupancy on the ROCs", 900, 1200,
mainDir.GetTitle() + "/" + "rechitOccupancyROCPlots",
["rechitOccupancyROCPlots_Layer1_Hits",
"rechitOccupancyROCPlots_Layer2_Hits",
"rechitOccupancyROCPlots_Layer3_Hits",
"rechitOccupancyROCPlots_Layer4_Hits",
"rechitOccupancyROCPlots_AllDisks_Hits"]
)
canvas.Draw()
In [11]:
canvas = createTwoByNCanvas("rechitOccupancyPhiVsZCanvas", "Rechit occupancy, phi vs Z", 900, 1200,
mainDir.GetTitle() + "/" + "rechitOccupancyPhiVsZPlots",
["rechitOccupancyPhiVsZPlots_Layer1_Hits",
"rechitOccupancyPhiVsZPlots_Layer2_Hits",
"rechitOccupancyPhiVsZPlots_Layer2_Hits",
"rechitOccupancyPhiVsZPlots_Layer4_Hits"]
)
canvas.Draw()
In [12]:
canvas = createTwoByNCanvas("RechitOccupancyGlyVsGlxCanvas", "Rechit occupancy, Y vs X", 900, 1200,
mainDir.GetTitle() + "/" + "rechitOccupancyGlyVsGlxPlots",
["rechitOccupancyGlyVsGlxPlots_Disk1_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk2_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk3_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk4_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk5_Hits",
"rechitOccupancyGlyVsGlxPlots_Disk6_Hits"]
)
canvas.Draw()
In [ ]:
In [ ]: