ATLAS Offline Software
Loading...
Searching...
No Matches
TRTPlotConfig.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 TRTPlot_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 + "/TRTHits"
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 # why do we want a histogram of the "innermost" layer hits ?? That should just be 0, 1, or 2 surely ? What is the point
51 # of any of these sort of histograms, just have a plot of the "hit layers" then you can have one histogram for
52 # *all* the layers, instead of essentially one histogram per layer. And anyway what is the "InnerMostPixelHits" ?
53 # the number of hits on the "innerMost Layer" or the Layer with the innermost hit ?
54 defineHisto( monTool, "NTRTHits", namespace=dir,path=mpath, type="TH1F", title="NInnerMostPixelHits", xbins=61, xmin=-0.5, xmax=60.5 )
55 defineHisto( monTool, "NTRTHighThresholdHits", namespace=dir,path=mpath, type="TH1F", title="NInnerMostPixelEndcapHits", xbins=61, xmin=-0.5, xmax=60.5 )
56
57 for var, bins in varConfig.items():
58
59 stub = "_vs_"+var
60
61 defineHisto( monTool, f"NTRTHits{stub}", namespace=dir, path=mpath, type="TProfile", title="NTRTHits", **bins )
62 defineHisto( monTool, f"NTRTHighThresholdHits{stub}", namespace=dir, path=mpath, type="TProfile", title="NTRTHighThresholdHits", **bins )
63
64
65 return monTool
66
TRTPlot_builder(monTool, mypath, chain, cs)