ATLAS Offline Software
Loading...
Searching...
No Matches
BadCellsFromCOOLPrint.py
Go to the documentation of this file.
2# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration.
3#
4#**************************************************************
5#
6#============================================================
7#=== graphic tuning of the histograms
8#============================================================
9
10from ROOT import *
11from array import array
12gStyle.SetOptStat(0)
13gStyle.SetFrameBorderMode(0)
14gStyle.SetCanvasBorderMode(0)
15gStyle.SetPadBorderMode(0)
16gStyle.SetPadColor(0)
17gStyle.SetCanvasColor(0)
18gStyle.SetStatColor(0)
19gStyle.SetFrameFillColor(10)
20gStyle.SetTitleFillColor(10)
21gStyle.SetFillColor(10)
22def set_palette(ncontours=50):
23 """Set a color palette from a given RGB list
24 stops, red, green and blue should all be lists of the same length
25 see set_decent_colors for an example"""
26
27 stops = [0.00, 0.25, 0.75, 1.00]
28 red = [0.00, 1.00, 1.00, 1.00]
29 green = [1.00, 1.00, 0.70, 0.00]
30 blue = [0.00, 0.00, 0.00, 0.00]
31
32 s = array('d', stops)
33 r = array('d', red)
34 g = array('d', green)
35 b = array('d', blue)
36
37 npoints = len(s)
38 TColor.CreateGradientColorTable(npoints, s, r, g, b, ncontours)
39 gStyle.SetNumberContours(ncontours)
40
41
42f = TFile('tileBadCells.root')
44c1 = TCanvas("c1","c1",0,0,700,600)
45for cell in ['','A','BC','D','Gap']:
46 c1.SetGridx(1)
47 c1.SetGridy(1)
48 c1.SetTickx(1)
49 c1.SetTicky(1)
50 h = f.Get('m_h_badCell'+cell)
51 h.SetMaximum(3)
52 h.Draw('colz')
53 c1.SetFrameFillColor(kGreen)
54 h.SetXTitle("#eta")
55 h.SetYTitle("#phi")
56 h.GetXaxis().SetTitleOffset(0.8)
57 h.GetYaxis().SetTitleOffset(0.8)
58
59 c1.Update()
60 c1.SaveAs("tileBadCells%s.png" % cell)
STL class.