ATLAS Offline Software
Loading...
Searching...
No Matches
SiHitPlotConfig.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 each analysis - this will get called once for each
5# configured chain - we can set the HistPath either already here, or from the c++
6# code
7
8
9# actually create the monTool to go along with a specific chain
10# stores the histogram, binning, creates all the histograms etc
11
12from TrigIDR4Monitoring.HistUtils import defineHisto
13
14def SiHitPlot_builder( monTool, mypath, chain, cs ) :
15
16 from TrigIDR4Monitoring.HistUtils import ptbins_mb
17 from TrigIDR4Monitoring.HistUtils import ptbins_default
18
19 if "mb" in chain : ptbins = ptbins_mb
20 else: ptbins = ptbins_default
21
22 # from TrigIDR4Monitoring.HistUtils import vnbins_full
23 # from TrigIDR4Monitoring.HistUtils import vnbins_short
24
25 # vnbins = vnbins_full
26
27
28 from TrigIDR4Monitoring.HistUtils import d0bins_default
29 from TrigIDR4Monitoring.HistUtils import d0bins_lrt
30
31 if "LRT" in chain : d0bins = d0bins_lrt
32 else: d0bins = d0bins_default
33
34
35 npath = mypath + "/SiHits"
36
37 varConfig = {
38 "pt": {"xbins": ptbins},
39 "eta": {"xbins": 40, "xmin": -4, "xmax": 4},
40 "phi": {"xbins": 20, "xmin": -3.142, "xmax": 3.142},
41 "d0": {"xbins": d0bins}
42 }
43
44 for dir in [ "reference", "test" ]:
45
46 mpath = npath+"/"+dir
47
48 # oh dear, just so many histograms, so many ...
49
50
51
52 # why do we want a histogram of the "innermost" layer hits ?? That should just be 0, 1, or 2 surely ? What is the point
53 # of any of these sort of histograms, just have a plot of the "hit layers" then you can have one histogram for
54 # *all* the layers, instead of essentially one histogram per layer. And anyway what is the "InnerMostPixelHits" ?
55 # the number of hits on the "innerMost Layer" or the Layer with the innermost hit ?
56 defineHisto( monTool, "NInnerMostPixelHits", namespace=dir,path=mpath, type="TH1F", title="NInnerMostPixelHits", xbins=21, xmin=-0.5, xmax=20.5 )
57 defineHisto( monTool, "NInnerMostPixelEndcapHits", namespace=dir,path=mpath, type="TH1F", title="NInnerMostPixelEndcapHits", xbins=21, xmin=-0.5, xmax=20.5 )
58 # defineHisto( monTool, "NNextToInnerMostPixelHits", namespace=dir, path=mpath, type="TH1F", title="NNextToInnerMostPixelHits", xbins=21, xmin=-0.5, xmax=20.5 )
59 # defineHisto( monTool, "NNextToInnerMostPixelEndcapHits", namespace=dir, path=mpath, type="TH1F", title="NNextToInnerMostPixelEndcapHits", xbins=21, xmin=-0.5, xmax=20.5 )
60 defineHisto( monTool, "NInnerMostPixelSharedHits", namespace=dir, path=mpath, type="TH1F", title="NInnerMostPixelSharedHits", xbins=21, xmin=-0.5, xmax=20.5 )
61 defineHisto( monTool, "NInnerMostPixelSharedEndcapHits", namespace=dir, path=mpath, type="TH1F", title="NInnerMostPixelSharedEndcapHits", xbins=21, xmin=-0.5, xmax=20.5 )
62 defineHisto( monTool, "NPixelHits", namespace=dir, path=mpath, type="TH1F", title="NPixelHits", xbins=21, xmin=-0.5, xmax=20.5 )
63 defineHisto( monTool, "NPixelHoles", namespace=dir, path=mpath, type="TH1F", title="NPixelHoles", xbins=11, xmin=-0.5, xmax=10.5 )
64 defineHisto( monTool, "NPixelSharedHits", namespace=dir, path=mpath, type="TH1F", title="NPixelSharedHits", xbins=21, xmin=-0.5, xmax=20.5 )
65 # defineHisto( monTool, "NPixeldEdx", namespace=dir, path=mpath, type="TH1F", title="NPixeldEdx", xbins=20, xmin=-0.5, xmax=100 ) # what units ??
66 defineHisto( monTool, "NSCTHits", namespace=dir, path=mpath, type="TH1F", title="NSCTHits", xbins=21, xmin=-0.5, xmax=20.5 )
67 defineHisto( monTool, "NSCTHoles", namespace=dir, path=mpath, type="TH1F", title="NSCTHoles", xbins=11, xmin=-0.5, xmax=10.5 )
68 defineHisto( monTool, "NSCTSharedHits", namespace=dir, path=mpath, type="TH1F", title="NSCTSharedHits", xbins=21, xmin=-0.5, xmax=20.5 )
69 # defineHisto( monTool, "NInnerMostPixelOutliers", namespace=dir, path=mpath, type="TH1F", title="NInnerMostPixelOutliers", xbins=21, xmin=-0.5, xmax=20.5 )
70 # defineHisto( monTool, "NInnerMostPixelEndcapOutliers", namespace=dir, path=mpath, type="TH1F", title="NInnerMostPixelEndcapOutliers", xbins=21, xmin=-0.5, xmax=20.5 )
71 # defineHisto( monTool, "NInnerMostPixelSplitHits", namespace=dir, path=mpath, type="TH1F", title="NInnerMostPixelSplitHits", xbins=21, xmin=-0.5, xmax=20.5 )
72 # defineHisto( monTool, "NInnerMostPixelSplitEndcapHits", namespace=dir, path=mpath, type="TH1F", title="NInnerMostPixelSplitEndcapHits", xbins=21, xmin=-0.5, xmax=20.5 )
73 # defineHisto( monTool, "NExpectedInnerMostPixelHits", namespace=dir, path=mpath, type="TH1F", title="NExpectedInnerMostPixelHits", xbins=21, xmin=-0.5, xmax=20.5 )
74 # defineHisto( monTool, "NExpectedNextToInnerMostPixelHits", namespace=dir, path=mpath, type="TH1F", title="NExpectedNextToInnerMostPixelHits", xbins=21, xmin=-0.5, xmax=20.5 )
75 # defineHisto( monTool, "NPixelOutliers", namespace=dir, path=mpath, type="TH1F", title="NPixelOutliers", xbins=21, xmin=-0.5, xmax=20.5 )
76 # defineHisto( monTool, "NPixelContribLayers", namespace=dir, path=mpath, type="TH1F", title="NPixelContribLayers", xbins=21, xmin=-0.5, xmax=20.5 )
77 # defineHisto( monTool, "NPixelSplitHits", namespace=dir, path=mpath, type="TH1F", title="NPixelSplitHits", xbins=21, xmin=-0.5, xmax=20.5 )
78 # defineHisto( monTool, "NPixelGangedHits", namespace=dir, path=mpath, type="TH1F", title="NPixelGangedHits", xbins=21, xmin=-0.5, xmax=20.5 )
79 # defineHisto( monTool, "NPixelGangedHitsFlaggedFakes", namespace=dir, path=mpath, type="TH1F", title="NPixelGangedHitsFlaggedFakes", xbins=21, xmin=-0.5, xmax=20.5 )
80 # defineHisto( monTool, "NPixelDeadSensors", namespace=dir, path=mpath, type="TH1F", title="NPixelDeadSensors", xbins=21, xmin=-0.5, xmax=20.5 )
81 # defineHisto( monTool, "NSCTOutliers", namespace=dir, path=mpath, type="TH1F", title="NSCTOutliers", xbins=21, xmin=-0.5, xmax=20.5 )
82 # defineHisto( monTool, "NSCTDoubleHoles", namespace=dir, path=mpath, type="TH1F", title="NSCTDoubleHoles", xbins=21, xmin=-0.5, xmax=20.5 )
83 # defineHisto( monTool, "NSCTDeadSensors", namespace=dir, path=mpath, type="TH1F", title="NSCTDeadSensors", xbins=21, xmin=-0.5, xmax=20.5 )
84
85 for var, bins in varConfig.items():
86
87 stub = "_vs_"+var
88
89 defineHisto( monTool, "NInnerMostPixelHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NInnerMostPixelHits", **bins )
90 defineHisto( monTool, "NInnerMostPixelEndcapHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NInnerMostPixelEndcapHits", **bins )
91 # defineHisto( monTool, "NNextToInnerMostPixelHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NNextToInnerMostPixelHits", **bins )
92 # defineHisto( monTool, "NNextToInnerMostPixelEndcapHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NNextToInnerMostPixelEndcapHits", **bins )
93 defineHisto( monTool, "NInnerMostPixelSharedHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NInnerMostPixelSharedHits", **bins )
94 defineHisto( monTool, "NInnerMostPixelSharedEndcapHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NInnerMostPixelSharedEndcapHits", **bins )
95 defineHisto( monTool, "NPixelHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixelHits", **bins )
96 defineHisto( monTool, "NPixelHoles"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixelHoles", **bins )
97 defineHisto( monTool, "NPixelSharedHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixelSharedHits", **bins )
98 # defineHisto( monTool, "NPixeldEdx"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixeldEdx", **bins )
99 defineHisto( monTool, "NSCTHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NSCTHits", **bins )
100 defineHisto( monTool, "NSCTHoles"+stub, namespace=dir, path=mpath, type="TProfile", title="NSCTHoles", **bins )
101 defineHisto( monTool, "NSCTSharedHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NSCTSharedHits", **bins )
102 # defineHisto( monTool, "NInnerMostPixelOutliers"+stub, namespace=dir, path=mpath, type="TProfile", title="NInnerMostPixelOutliers", **bins )
103 # defineHisto( monTool, "NInnerMostPixelEndcapOutliers"+stub, namespace=dir, path=mpath, type="TProfile", title="NInnerMostPixelEndcapOutliers", **bins )
104 # defineHisto( monTool, "NInnerMostPixelSplitHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NInnerMostPixelSplitHits", **bins )
105 # defineHisto( monTool, "NInnerMostPixelSplitEndcapHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NInnerMostPixelSplitEndcapHits", **bins )
106 # defineHisto( monTool, "NExpectedInnerMostPixelHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NExpectedInnerMostPixelHits", **bins )
107 # defineHisto( monTool, "NExpectedNextToInnerMostPixelHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NExpectedNextToInnerMostPixelHits", **bins )
108 # defineHisto( monTool, "NPixelOutliers"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixelOutliers", **bins )
109 # defineHisto( monTool, "NPixelContribLayers"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixelContribLayers", **bins )
110 # defineHisto( monTool, "NPixelSplitHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixelSplitHits", **bins )
111 # defineHisto( monTool, "NPixelGangedHits"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixelGangedHits", **bins )
112 # defineHisto( monTool, "NPixelGangedHitsFlaggedFakes"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixelGangedHitsFlaggedFakes", **bins )
113 # defineHisto( monTool, "NPixelDeadSensors"+stub, namespace=dir, path=mpath, type="TProfile", title="NPixelDeadSensors", **bins )
114 # defineHisto( monTool, "NSCTOutliers"+stub, namespace=dir, path=mpath, type="TProfile", title="NSCTOutliers", **bins )
115 # defineHisto( monTool, "NSCTDoubleHoles"+stub, namespace=dir, path=mpath, type="TProfile", title="NSCTDoubleHoles", **bins )
116 # defineHisto( monTool, "NSCTDeadSensors"+stub, namespace=dir, path=mpath, type="TProfile", title="NSCTDeadSensors", **bins )
117
118 return monTool
119
SiHitPlot_builder(monTool, mypath, chain, cs)