13 if input_file_name
is None:
14 print (
"No input file name, assuming output.root")
15 input_file_name =
"output.root"
20 gStyle.SetCanvasColor(10)
21 gStyle.SetFrameFillColor(10)
26 c1 = TCanvas(
'c1',
'Example',200,10,700,500)
29 graphs = TFile(input_file_name)
30 graphs.cd(
'ADC/FineTime')
31 key_list = gDirectory.GetListOfKeys()
33 run_directory_name =
None
38 line = iii_str.split(
"\"")
41 run_directory_name = name
42 if run_directory_name
is None:
45 print (
"ERROR, the file doesn't contain run# directory!")
49 print (
"Entering directory: ", run_directory_name)
50 gDirectory.cd(run_directory_name)
53 c1.Print(
"CalibrationTimingPlots.ps[")
55 ppm_em_2d_profile_etaPhi_adc_fineTime.SetMinimum(-10.)
56 ppm_em_2d_profile_etaPhi_adc_fineTime.SetMaximum(10.)
57 ppm_em_2d_profile_etaPhi_adc_fineTime.Draw(
"colz")
58 c1.Print(
"CalibrationTimingPlots.ps")
61 ppm_had_2d_profile_etaPhi_adc_fineTime.SetMinimum(-10.)
62 ppm_had_2d_profile_etaPhi_adc_fineTime.SetMaximum(10.)
63 ppm_had_2d_profile_etaPhi_adc_fineTime.Draw(
"colz")
64 c1.Print(
"CalibrationTimingPlots.ps")
67 directory_content = gDirectory.GetListOfKeys()
70 gStyle.SetOptStat(111111)
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.))
79 gDirectory.cd(
"/ADC/FineTime/"+run_directory_name+
"/"+key.GetName())
81 list_of_histos = gDirectory.GetListOfKeys()
82 for his_key
in list_of_histos:
84 timing_value=his_key.ReadObj().GetBinContent(2)
85 partition_histos[-1].Fill(timing_value)
88 for iHisto
in partition_histos:
90 c1.Print(
"CalibrationTimingPlots.ps")
92 c1.Print(
"CalibrationTimingPlots.ps]")
94 os.system(
"ps2pdf CalibrationTimingPlots.ps")