ATLAS Offline Software
Loading...
Searching...
No Matches
ResolutionsConfig.py
Go to the documentation of this file.
2# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3#
4# create all the histograms for the Resolutions plots - this will get called
5# once for each tool for configured chain - we can set the HistPath upstream
6# master tool
7
8
9from TrigIDR4Monitoring.HistUtils import defineHisto
10from TrigIDR4Monitoring.HistUtils import resplot
11
12
13def Resolutions_builder( monTool, mypath, chain, cs ) :
14
15 # what is this "inclusive" nonsense ? If we want the "inclusive" anything, we just
16 # need to take the integral over any of the differential variables, it literally serves
17 # no purpuse, since yuou can not have a differential resolution vs "inclusive", you can
18 # have lietarly only the basic integrated residuals, and the intergrated efficiency
19 # those are the only things that you can have "inclusive" so for N track parameters,
20 # there are literally N residuals, and 1 efficiency, and those will have their own
21 # plots in any case - so will probably drop the "inclusive" as it is more trouble than
22
23 parNames = [ "inclusive", "pt", "eta", "d0", "z0", "qoverp", "ptqopt", "theta", "phi", "z0sin" ]
24 sigma = [ 1, 20, 0.02, 0.2, 1, 50, 0.1, 0.02, 0.02, 1 ]
25 ranges = [ 1, 100, 4.0, 50, 200, 5, 5, 3.2, 3.2, 200 ]
26
27 mypath = mypath + "/Resolutions"
28
29 from TrigIDR4Monitoring.HistUtils import ptbins_mb
30 from TrigIDR4Monitoring.HistUtils import ptbins_default
31
32 if "mb" in chain : ptbins = ptbins_mb
33 else: ptbins = ptbins_default
34
35 # from HistUtils import vnbins_full
36 # from HistUtils import vnbins_short
37
38 # vnbins = vnbins_full
39
40 from TrigIDR4Monitoring.HistUtils import d0bins_default
41 from TrigIDR4Monitoring.HistUtils import d0bins_lrt
42
43 if "LRT" in chain : d0bins = d0bins_lrt
44 else: d0bins = d0bins_default
45
46
47 for parName, sig, rng in zip(parNames, sigma, ranges):
48
49
51
52 # what we really want are plots of the residuals of each variable ve pt, or vs eta
53 # or vs z, or even d0
54
55 defineHisto( monTool, "pull_"+parName, path=mypath, type="TH1F", title="pull_"+parName, xbins=100, xmin=-10, xmax=10 )
56 defineHisto( monTool, "res_"+parName, path=mypath, type="TH1F", title="res_"+parName, xbins=100, xmin=-sig, xmax=sig )
57 defineHisto( monTool, "sigma_"+parName, path=mypath, type="TH1F", title="sigma_"+parName, xbins=100, xmin=0, xmax=sig )
58 defineHisto( monTool, "significance_"+parName, path=mypath, type="TH1F", title="significance_"+parName, xbins=100, xmin=-3, xmax=3 )
59
60 if parName == "pt" :
61 defineHisto( monTool, "corr_test_vs_ref_"+parName, path=mypath, type="TH2F", title="corr_"+parName, xbins=ptbins, ybins=ptbins )
62 elif parName == "d0" :
63 defineHisto( monTool, "corr_test_vs_ref_"+parName, path=mypath, type="TH2F", title="corr_"+parName, xbins=d0bins, ybins=d0bins )
64 else:
65 defineHisto( monTool, "corr_test_vs_ref_"+parName, path=mypath, type="TH2F", title="corr_"+parName, xbins=100, xmin=-rng, xmax=rng, ybins=100, ymin=-rng, ymax=rng )
66
67
68 # differential resolutions
69
70 if parName != "inclusive" :
71
72 ptname = f"resolution_{parName}_vs_pt"
73 etaname = f"resolution_{parName}_vs_eta"
74 z0name = f"resolution_{parName}_vs_z0"
75
76 resplot( monTool, namespace=ptname, path=mypath, label=f"{parName} vs pt", xbins=ptbins, ybins=100, ymin=-sig, ymax=sig )
77 resplot( monTool, namespace=etaname, path=mypath, label=f"{parName} vs eta", xbins=32, xmin=-4, xmax=4, ybins=100, ymin=-sig, ymax=sig )
78 resplot( monTool, namespace=z0name, path=mypath, label=f"{parName} vs z0", xbins=25, xmin=-200, xmax=200, ybins=100, ymin=-sig, ymax=sig )
79
80# # resolutions vs pt
81# defineHisto( monTool, "2D", namespace=ptname, path=f"{mypath}/{ptname}", type="TH2F", title=f"2D ({parName} vs pt)", xbins=ptbins, ybins=100, ymin=-sig, ymax=sig )
82# defineHisto( monTool, "1D", path=f"{mypath}/{ptname}", type="TH1F", title=f"1D ({parName})", xbins=100, xmin=-sig, xmax=sig )
83# defineHisto( monTool, "mean", path=f"{mypath}/{ptname}", type="TH1F", title=f"mean {parName} vs pt", xbins=ptbins )
84# defineHisto( monTool, "sigma", path=f"{mypath}/{ptname}", type="TH1F", title=f"sigma {parName} vs pt", xbins=ptbins )
85
86# # resolutions vs eta
87# defineHisto( monTool, "2D", namespace=etaname, path=f"{mypath}/{etaname}", type="TH2F", title=f"2D ({parName} vs eta)", xbins=32, xmin=-4, xmax=4, ybins=100, ymin=-sig, ymax=sig )
88# defineHisto( monTool, "1D", path=f"{mypath}/{etaname}", type="TH1F", title=f"1D ({parName})", xbins=100, xmin=-sig, xmax=sig )
89# defineHisto( monTool, "mean", path=f"{mypath}/{etaname}", type="TH1F", title=f"mean {parName} vs eta", xbins=32, xmin=-4, xmax=4 )
90# defineHisto( monTool, "sigma", path=f"{mypath}/{etaname}", type="TH1F", title=f"sigma {parName} vs eta", xbins=32, xmin=-4, xmax=4 )
91
92
93# #resolutions vs zo
94# defineHisto( monTool, "2D", namespace=z0name, path=f"{mypath}/{z0name}", type="TH2F", title=f"2D ({parName} vs z0)", xbins=25, xmin=-200, xmax=200, ybins=100, ymin=-sig, ymax=sig )
95# defineHisto( monTool, "1D", path=f"{mypath}/{z0name}", type="TH1F", title=f"1D ({parName})", xbins=100, xmin=-sig, xmax=sig )
96# defineHisto( monTool, "mean", path=f"{mypath}/{z0name}", type="TH1F", title=f"mean {parName} vs z0", xbins=25, xmin=-200, xmax=200 )
97# defineHisto( monTool, "sigma", path=f"{mypath}/{z0name}", type="TH1F", title=f"sigma {parName} vs z0", xbins=25, xmin=-200, xmax=200 )
98
99
Resolutions_builder(monTool, mypath, chain, cs)