5 '''@file SCTHitNoiseMonAlg.py
8 @brief New style configuration of SCTHitNoiseMonAlg
16 return "Layer " +
str(m_layerStr) +
" Side " +
str(m_sideStr)
18 return "Disk " +
str(m_layerStr) +
" Side " +
str(m_sideStr)
23 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
26 from AthenaMonitoring
import AthMonitorCfgHelper
27 helper = AthMonitorCfgHelper(inputFlags,
'SCTHitsNoiseMonCfg')
29 from AthenaConfiguration.ComponentFactory
import CompFactory
30 myMonAlg = helper.addAlgorithm(CompFactory.SCTHitsNoiseMonAlg,
'SCTHitsNoiseMonAlg')
31 myMonAlg.TriggerChain =
""
34 myMonAlg.doTrigger = (
not inputFlags.Input.isMC
and inputFlags.DQ.useTrigger)
36 myMonAlg.doOnlineMon = inputFlags.Common.isOnline
38 from ROOT
import SCT_Monitoring
as sctMon
42 dimension = [sctMon.N_REGIONS]
44 MonGroupArray = helper.addArray(dimension,myMonAlg,
"SCTHitsNoiseMonitor",
"SCT")
46 myMonGroupGeneral = helper.addGroup(
48 "SCTHitsNoiseMonitorGeneral",
54 abbreviations = [
"ECm",
"",
"ECp"]
55 names = [
"Endcap C",
"Barrel",
"Endcap A"]
56 path = [
"SCTEC",
"SCTB",
"SCTEA"]
57 noiseAbbreviations = [
"ECC",
"BAR",
"ECA"]
58 titleAbbreviations = [
"ECm",
"BAR",
"ECp"]
59 limits = [ sctMon.N_DISKS*2, sctMon.N_BARRELS*2, sctMon.N_DISKS*2 ]
61 for isub
in range(sctMon.N_REGIONS):
62 for i
in range(limits[isub]):
64 HitsMapName =
"hitsmap" + abbreviations[isub] +
"_" +
str(i//2) +
"_" +
str(i%2)
65 HitsMapTitle =
"SCT Hitmap for " + names[isub] +
": " +
Title(i,isub)
66 MonGroupArray[isub].
defineHistogram(varname=
"eta_"+HitsMapName+
",phi_"+HitsMapName+
";"+HitsMapName,
68 title= HitsMapTitle +
";Index in the direction of #eta;Index in the direction of #phi",
69 path= path[isub] +
"/hits",
70 xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5,
71 ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5 , ymax=sctMon.l_phibin[isub]+0.5,
72 weight=
"numberOfStrips_"+HitsMapName,
75 if myMonAlg.doOnlineMon:
76 HitsMapRecentName =
"hitsmaprecent" + abbreviations[isub] +
"_" +
str(i//2) +
"_" +
str(i%2)
77 HitsMapRecentTitle =
"SCT Hitmap for recent event for " + names[isub] +
": " +
Title(i,isub)
78 MonGroupArray[isub].
defineHistogram(varname=
"eta_"+HitsMapName+
",phi_"+HitsMapName+
";"+HitsMapRecentName,
80 title= HitsMapRecentTitle +
";Index in the direction of #eta;Index in the direction of #phi",
81 path= path[isub] +
"/hits",
82 xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5,
83 ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5 , ymax=sctMon.l_phibin[isub]+0.5,
84 weight=
"numberOfStrips_"+HitsMapName,
85 opt=
'kLBNHistoryDepth=30,kAlwaysCreate')
87 streamhitmap =
"mapsOfHitsOnTracks" + abbreviations[isub] +
"_" +
"trackhitsmap_" +
str(i//2) +
"_" +
str(i%2)
88 histotitle =
"SCT hits on tracks for " + names[isub] +
" " +
Title(i,isub)
89 MonGroupArray[isub].
defineHistogram(varname=
"eta_"+streamhitmap +
",phi_"+streamhitmap +
";"+streamhitmap,
91 title= histotitle +
";Index in the direction of #eta;Index in the direction of #phi",
92 path= path[isub] +
"/hits/mapsOfHitsOnTracks/",
93 xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5,
94 ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5 , ymax=sctMon.l_phibin[isub]+0.5,
97 occMap =
"occupancymap" + abbreviations[isub] +
"_" +
str(i//2) +
"_" +
str(i%2)
98 hitoccupancy =
"hitoccupancymap" + abbreviations[isub] +
"_" +
str(i//2) +
"_" +
str(i%2)
99 histotitleR =
"SCT Hit Occupancy map for " + names[isub] +
": " +
Title(i,isub)
100 MonGroupArray[isub].
defineHistogram(varname=
"eta_"+occMap +
",phi_"+occMap +
",HO_"+occMap+
";" + hitoccupancy,
102 title= histotitleR +
";Index in the direction of #eta;Index in the direction of #phi",
103 path= path[isub] +
"/Noise",
104 xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5,
105 ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5, ymax=sctMon.l_phibin[isub]+0.5,
108 noiseoccupancy =
"noiseoccupancymaptrigger" + abbreviations[isub] +
"_" +
str(i//2) +
"_" +
str(i%2)
109 m_NOTriggerItem =
"L1_RD0_EMPTY"
110 histotitletrigger =
"SCT Noise Occupancy map for " + m_NOTriggerItem +
" Trigger and " + names[isub] +
": " +
Title(i,isub)
111 MonGroupArray[isub].
defineHistogram(varname=
"eta_"+occMap +
",phi_"+occMap +
",NO_"+occMap+
";" + noiseoccupancy,
113 title= histotitletrigger +
";Index in the direction of #eta;Index in the direction of #phi",
114 cutmask=
"IsSelectedTrigger_"+occMap,
115 path= path[isub] +
"/Noise",
116 xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5,
117 ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5, ymax=sctMon.l_phibin[isub]+0.5,
120 if myMonAlg.doOnlineMon:
121 noiseoccupancyrecent =
"noiseoccupancymaprecent" + abbreviations[isub] +
"_" +
str(i//2) +
"_" +
str(i%2)
122 histotitlerecent =
"SCT Noise Occupancy map for " + m_NOTriggerItem +
" recent events and " + names[isub] +
": " +
Title(i,isub)
123 MonGroupArray[isub].
defineHistogram(varname=
"eta_"+occMap +
",phi_"+occMap +
",NO_"+occMap+
";" + noiseoccupancyrecent,
125 title= histotitlerecent +
";Index in the direction of #eta;Index in the direction of #phi",
126 cutmask=
"IsSelectedTriggerRecent_"+occMap,
127 path= path[isub] +
"/Noise",
128 xbins=sctMon.n_etabins[isub], xmin=sctMon.f_etabin[isub]-0.5, xmax=sctMon.l_etabin[isub]+0.5,
129 ybins=sctMon.n_phibins[isub], ymin=sctMon.f_phibin[isub]-0.5, ymax=sctMon.l_phibin[isub]+0.5,
130 opt =
'kLBNHistoryDepth=30,kAlwaysCreate')
136 MonGroupArray[isub].
defineHistogram(varname=
"LB,HO;"+ noiseAbbreviations[isub] +
"HO_vsLB",
138 title=
"HO vs LB for all region (SP noise)" +
";LumiBlock;Hit Occupancy [10^{-5}]",
139 path= path[isub] +
"/Noise",
140 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
143 MonGroupArray[isub].
defineHistogram(varname=
"LB,HO;"+ noiseAbbreviations[isub] +
"HOTrigger_vsLB",
145 title=
"HO with trigger vs LB for all region (SP noise)" +
";LumiBlock;Hit Occupancy [10^{-5}]",
146 cutmask=
"IsSelectedTrigger",
147 path= path[isub] +
"/Noise",
148 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
151 MonGroupArray[isub].
defineHistogram(varname=
"LB,NO;"+ noiseAbbreviations[isub] +
"NO_vsLB",
153 title=
"NO vs LB for all region (SP noise)" +
";LumiBlock;Hit Occupancy [10^{-5}]",
154 path= path[isub] +
"/Noise",
155 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
158 MonGroupArray[isub].
defineHistogram(varname=
"LB,NO;"+ noiseAbbreviations[isub] +
"NOTrigger_vsLB",
160 title=
"NO with Trigger vs LB for all region (SP noise)" +
";LumiBlock;Hit Occupancy [10^{-5}]",
161 cutmask=
"IsSelectedTrigger",
162 path= path[isub] +
"/Noise",
163 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
166 MonGroupArray[isub].
defineHistogram(varname=
"LBHits,numberOfHitsFromSPs;" +
"h_HSPHitsTrigger"+titleAbbreviations[isub]+
"_vsLB",
168 title=
"Average num of SP Hits in " + titleAbbreviations[isub] +
" with trigger vs LB" +
";LumiBlock;Average number of SP Hits",
169 cutmask=
"isSelectedTriggerHits",
170 path= path[isub] +
"/Noise",
171 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5)
173 MonGroupArray[isub].
defineHistogram(varname=
"LBHits,numberOfHitsFromSPs;" +
"h_HSPHits"+titleAbbreviations[isub]+
"_vsLB",
175 title=
"Average num of SP Hits in " + titleAbbreviations[isub] +
" vs LB" +
";LumiBlock;Average number of SP Hits",
176 path= path[isub] +
"/Noise",
177 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
180 MonGroupArray[isub].
defineHistogram(varname=
"LBHits,numberOfHitsFromAllRDOs;" +
"h_HallHitsTrigger"+titleAbbreviations[isub]+
"_vsLB",
182 title=
"Average num of all Hits in " + titleAbbreviations[isub] +
" with trigger vs LB" +
";LumiBlock;Average number of SP Hits",
183 cutmask=
"isSelectedTriggerHits",
184 path= path[isub] +
"/Noise",
185 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
188 MonGroupArray[isub].
defineHistogram(varname=
"LBHits,numberOfHitsFromAllRDOs;" +
"h_HallHits"+titleAbbreviations[isub]+
"_vsLB",
190 title=
"Average num of all Hits in " + titleAbbreviations[isub] +
" vs LB" +
";LumiBlock;Average number of SP Hits",
191 path= path[isub] +
"/Noise",
192 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
196 myMonGroupGeneral.defineHistogram(varname=
"clu_size",
198 title=
"SCT Cluster Size" +
";Cluster Size;Num of Events",
200 xbins=200, xmin = 0, xmax = 200,
203 myMonGroupGeneral.defineHistogram(varname=
"LB,HO;"+
"HO_vsLB",
205 title=
"HO vs LB for all region (SP noise)" +
";LumiBlock;Hit Occupancy [10^{-5}]",
207 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
210 myMonGroupGeneral.defineHistogram(varname=
"LB,HO;"+
"HOTrigger_vsLB",
212 title=
"HO with trigger vs LB for all region (SP noise)" +
";LumiBlock;Hit Occupancy [10^{-5}]",
213 cutmask=
"IsSelectedTrigger",
215 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
218 myMonGroupGeneral.defineHistogram(varname=
"LB,NO;"+
"NO_vsLB",
220 title=
"NO vs LB for all region (SP noise)" +
";LumiBlock;Hit Occupancy [10^{-5}]",
222 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
225 myMonGroupGeneral.defineHistogram(varname=
"LB,NO;"+
"NOTrigger_vsLB",
227 title=
"NO with Trigger vs LB for all region (SP noise)" +
";LumiBlock;Hit Occupancy [10^{-5}]",
228 cutmask=
"IsSelectedTrigger",
230 xbins=sctMon.NBINS_LBs, xmin = 0.5, xmax = sctMon.NBINS_LBs + 0.5,
233 myMonGroupGeneral.defineHistogram(varname=
"Bec_TBinFracAll,TBin_TBinFracAll;" +
"TBinFracAll",
235 title=
"fraction of 01X for each region" +
"; ;Fraction of 01X",
237 xbins= sctMon.N_REGIONS, xmin = 0., xmax = sctMon.N_REGIONS,
241 myMonGroupGeneral.defineHistogram(varname=
"sct_hits",
243 title=
"Total SCT Hits;Total SCT Hits;Entries",
244 path=
"/hits/summary",
245 xbins= sctMon.N_NOISE_HIT_BINS, xmin = sctMon.FIRST_NOISE_HIT_BIN, xmax = sctMon.LAST_NOISE_HIT_BIN,
248 result.merge(helper.result())