ATLAS Offline Software
Functions | Variables
PlotRamps Namespace Reference

Functions

def passesSelection (gain, offset)
 
def PlotRamps (input_file_name=None)
 

Variables

 parser
 
 action
 
 type
 
 dest
 
 help
 
 options
 
 args
 

Function Documentation

◆ passesSelection()

def PlotRamps.passesSelection (   gain,
  offset 
)

Definition at line 8 of file PlotRamps.py.

8 def passesSelection(gain,offset):
9  if ((gain > 0.5 and gain <1.6) and (offset > -10 and offset < 10)):
10  return True
11  else:
12  return False
13 
14 

◆ PlotRamps()

def PlotRamps.PlotRamps (   input_file_name = None)

Definition at line 15 of file PlotRamps.py.

15 def PlotRamps(input_file_name=None):
16 
17  if input_file_name is None:
18  print ("No input file name, assuming graphs.root")
19  input_file_name = "graphs.root"
20 
21  gStyle.SetPalette(1)
22  gStyle.SetOptStat(111111)
23  gStyle.SetOptFit(11)
24  gStyle.SetCanvasColor(10)
25  gStyle.SetFrameFillColor(10)
26  gStyle.SetTitleFillColor(0)
27  gStyle.SetTitleBorderSize(1)
28  gStyle.SetStatBorderSize(1)
29  gStyle.SetStatFontSize(0.075)
30  gStyle.SetStatY(0.6)
31  gStyle.SetStatX(1.)
32 
33  gStyle.SetTitleFontSize(0.075)
34 
35  gStyle.SetPadTopMargin(0.10)
36  gStyle.SetPadBottomMargin(0.12)
37  gStyle.SetPadRightMargin(0.12)
38  gStyle.SetPadLeftMargin(0.12)
39  gStyle.SetHatchesSpacing(4.0)
40 
41  c1 = TCanvas('c1','Example',200,10,700,500)
42  c1.Divide(8,9)
43 
44  graphs = TFile(input_file_name)
45  key_list = graphs.GetListOfKeys()
46 
47  nPlot = 0
48  nPage = 0
49 
50  c1.Print("rampPlots.pdf(")
51 
52  list_of_histos=[]
53 
54  for iii in key_list:
55  list_of_histos.append(iii.GetName())
56 
57 # list_of_histos.sort()
58 
59  list_of_histos_dec=[int(iii,base = 16) for iii in list_of_histos]
60  list_of_histos_dec.sort()
61  list_of_histos = [hex(iii) for iii in list_of_histos_dec]
62 
63 # for iii in list_of_histos:
64 # print (iii)
65 
66  page_ppm = list_of_histos[0][:-4]
67 
68  for my_name in list_of_histos:
69 
70  my_graph = gDirectory.Get(my_name)
71  graph_ppm = my_name[:-4]
72 
73  if (nPlot % 64) == 0 or (not graph_ppm == page_ppm): # end of page
74  if (nPage==0) and (nPlot==0):
75  print ("start plotting")
76  else:
77  c1.cd(0)
78  ppm_number=page_ppm[-1]
79  ppm_crate =page_ppm[2:-2]
80  if len(ppm_crate) == 0:
81  ppm_crate='0'
82  title = "PP " + ppm_crate + " PPM " + ppm_number
83  ltit = TPaveLabel(0.35,0.90,0.65,1.0,title)
84  ltit.SetTextAlign(22)
85  ltit.SetTextSize(0.70)
86  ltit.SetFillStyle(0)
87  ltit.SetBorderSize(0)
88  ltit.Draw()
89 
90 # print (title, " ", ppm_crate, " ", ppm_number )
91  c1.Print("rampPlots.pdf")
92  c1.Clear()
93  c1.Divide(8,9)
94  nPage = nPage+1
95  page_ppm = graph_ppm
96  nPlot=0
97 
98  c1.cd(nPlot % 64 +1+8)
99  my_graph.SetMarkerStyle(21)
100  my_graph.SetMarkerSize(0.75)
101  my_graph.SetLineWidth(1)
102 
103  my_graph.GetYaxis().SetRangeUser(0.,my_graph.GetXaxis().GetXmax())
104 
105  my_graph.GetXaxis().SetTitleSize(0.04)
106  my_graph.GetYaxis().SetTitleSize(0.04)
107  my_graph.GetXaxis().SetTitleOffset(1.5)
108  my_graph.GetYaxis().SetTitleOffset(1.5)
109 # my_graph.GetXaxis().SetLabelSize(0.03)
110 # my_graph.GetYaxis().SetLabelSize(0.03)
111  my_graph.GetXaxis().SetLabelSize(0.04)
112  my_graph.GetYaxis().SetLabelSize(0.04)
113 
114  my_graph.GetXaxis().SetLabelOffset(0.04)
115  my_graph.GetYaxis().SetLabelOffset(0.015)
116  my_graph.GetXaxis().SetTitle("L1Calo energies")
117  my_graph.GetYaxis().SetTitle("Calo energies")
118 
119  function_list = my_graph.GetListOfFunctions()
120  offset = function_list[0].GetParameter(0)
121  slope = function_list[0].GetParameter(1)
122  if not passesSelection(slope,offset):
123  gPad.SetFrameFillColor(kYellow)
124 
125  my_graph.Draw("APL")
126  nPlot = nPlot+1
127 
128 
129  c1.cd(0)
130  ppm_number=page_ppm[-1]
131  ppm_crate =page_ppm[2:-2]
132  if len(ppm_crate) == 0:
133  ppm_crate='0'
134  title = "PP " + ppm_crate + " PPM " + ppm_number
135  ltit = TPaveLabel(0.35,0.90,0.65,1.0,title)
136  ltit.SetTextAlign(22)
137  ltit.SetTextSize(0.70)
138  ltit.SetFillStyle(0)
139  ltit.SetBorderSize(0)
140  ltit.Draw()
141 
142  c1.Print("rampPlots.pdf")
143 
144  c1.Print("rampPlots.pdf)")
145  print ("Finished!")
146 

Variable Documentation

◆ action

PlotRamps.action

Definition at line 152 of file PlotRamps.py.

◆ args

PlotRamps.args

Definition at line 153 of file PlotRamps.py.

◆ dest

PlotRamps.dest

Definition at line 152 of file PlotRamps.py.

◆ help

PlotRamps.help

Definition at line 152 of file PlotRamps.py.

◆ options

PlotRamps.options

Definition at line 153 of file PlotRamps.py.

◆ parser

PlotRamps.parser

Definition at line 151 of file PlotRamps.py.

◆ type

PlotRamps.type

Definition at line 152 of file PlotRamps.py.

CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
PlotRamps.PlotRamps
def PlotRamps(input_file_name=None)
Definition: PlotRamps.py:15
PlotRamps.passesSelection
def passesSelection(gain, offset)
Definition: PlotRamps.py:8