ATLAS Offline Software
Functions | Variables
PlotCalibrationTiming Namespace Reference

Functions

def PlotCalibrationTiming (input_file_name=None)
 

Variables

 parser
 
 action
 
 type
 
 dest
 
 help
 
 options
 
 args
 

Function Documentation

◆ PlotCalibrationTiming()

def PlotCalibrationTiming.PlotCalibrationTiming (   input_file_name = None)

Definition at line 11 of file PlotCalibrationTiming.py.

11 def PlotCalibrationTiming(input_file_name=None):
12 
13  if input_file_name is None:
14  print ("No input file name, assuming output.root")
15  input_file_name = "output.root"
16 
17  gStyle.SetPalette(1)
18  gStyle.SetOptStat(0)
19  gStyle.SetOptFit(0)
20  gStyle.SetCanvasColor(10)
21  gStyle.SetFrameFillColor(10)
22  gStyle.SetStatY(0.85)
23  gStyle.SetStatX(0.85)
24 
25 
26  c1 = TCanvas('c1','Example',200,10,700,500)
27  c1.Divide(8,9)
28 
29  graphs = TFile(input_file_name)
30  graphs.cd('ADC/FineTime')
31  key_list = gDirectory.GetListOfKeys()
32 
33  run_directory_name = None # find name of directory with histos
34 
35  try:
36  for iii in key_list:
37  iii_str = str(iii)
38  line = iii_str.split("\"")
39  for name in line:
40  if 'run#' in name:
41  run_directory_name = name
42  if run_directory_name is None:
43  raise NameError
44  except Exception:
45  print ("ERROR, the file doesn't contain run# directory!")
46  sys.exit(1)
47 
48 
49  print ("Entering directory: ", run_directory_name)
50  gDirectory.cd(run_directory_name)
51 
52 
53  c1.Print("CalibrationTimingPlots.ps[")
54 
55  ppm_em_2d_profile_etaPhi_adc_fineTime.SetMinimum(-10.) # noqa: F821
56  ppm_em_2d_profile_etaPhi_adc_fineTime.SetMaximum(10.) # noqa: F821
57  ppm_em_2d_profile_etaPhi_adc_fineTime.Draw("colz") # noqa: F821
58  c1.Print("CalibrationTimingPlots.ps")
59 
60 
61  ppm_had_2d_profile_etaPhi_adc_fineTime.SetMinimum(-10.) # noqa: F821
62  ppm_had_2d_profile_etaPhi_adc_fineTime.SetMaximum(10.) # noqa: F821
63  ppm_had_2d_profile_etaPhi_adc_fineTime.Draw("colz") # noqa: F821
64  c1.Print("CalibrationTimingPlots.ps")
65 
66 # now produce histograms for each partition
67  directory_content = gDirectory.GetListOfKeys()
68 
69 
70  gStyle.SetOptStat(111111)
71  partition_histos=[]
72  for key in directory_content:
73  print (key," Class name= ", key.GetClassName(), " Name=", key.GetName())
74  if key.GetClassName() == 'TDirectoryFile':
75  print ("OK, I will create new histogram for this partition!")
76  print ("Name of partition is: ", key.GetName())
77  partition_histos.append(TH1F(key.GetName()+'_his','Timing distribution for partition: '+key.GetName(),100,-10.,10.))
78  gDirectory.cd()
79  gDirectory.cd("/ADC/FineTime/"+run_directory_name+"/"+key.GetName())
80 
81  list_of_histos = gDirectory.GetListOfKeys()
82  for his_key in list_of_histos:
83  #timing_value=his_key.ReadObj().GetMaximum()
84  timing_value=his_key.ReadObj().GetBinContent(2)
85  partition_histos[-1].Fill(timing_value)
86 
87 
88  for iHisto in partition_histos:
89  iHisto.Draw()
90  c1.Print("CalibrationTimingPlots.ps")
91 
92  c1.Print("CalibrationTimingPlots.ps]")
93 
94  os.system("ps2pdf CalibrationTimingPlots.ps")
95 
96  print ("Finished!")
97 
98 

Variable Documentation

◆ action

PlotCalibrationTiming.action

Definition at line 104 of file PlotCalibrationTiming.py.

◆ args

PlotCalibrationTiming.args

Definition at line 105 of file PlotCalibrationTiming.py.

◆ dest

PlotCalibrationTiming.dest

Definition at line 104 of file PlotCalibrationTiming.py.

◆ help

PlotCalibrationTiming.help

Definition at line 104 of file PlotCalibrationTiming.py.

◆ options

PlotCalibrationTiming.options

Definition at line 105 of file PlotCalibrationTiming.py.

◆ parser

PlotCalibrationTiming.parser

Definition at line 103 of file PlotCalibrationTiming.py.

◆ type

PlotCalibrationTiming.type

Definition at line 104 of file PlotCalibrationTiming.py.

PlotCalibrationTiming.PlotCalibrationTiming
def PlotCalibrationTiming(input_file_name=None)
Definition: PlotCalibrationTiming.py:11
str
Definition: BTagTrackIpAccessor.cxx:11
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24