6 NoisyFEBDefStr="(>30 chan
with Q>4000)
",
9 MNBTight_PsVetoFEBDefStr=
"",
10 MNBLooseFEBDefStr=
""):
12 from AthenaMonitoring
import AthMonitorCfgHelper
13 helper = AthMonitorCfgHelper(flags,
'LArNoisyROMonAlgCfg')
15 from AthenaConfiguration.ComponentFactory
import CompFactory
16 NoisyFEBDefStr=
"(>"+
str(flags.LAr.NoisyRO.BadChanPerFEB)+
" chan with Q>"+
str(flags.LAr.NoisyRO.CellQuality)+
")"
17 NoisyHVlineDefStr=
"(>"+
str(flags.LAr.NoisyRO.BadHVCut)+
" HVlines with >"+
str(flags.LAr.NoisyRO.BadHVlineFrac)+
" channels with Q>"+
str(flags.LAr.NoisyRO.CellQuality)+
")"
19 MNBTightFEBDefStr=
"(>"+
str(flags.LAr.NoisyRO.MNBTightCut)+
" chan with Q>"+
str(flags.LAr.NoisyRO.CellQuality)+
")"
20 MNBTight_PsVetoFEBDefStr=
"(>"+
str(flags.LAr.NoisyRO.MNBTight_PsVetoCut[0])+
" chan with Q>"+
str(flags.LAr.NoisyRO.CellQuality)+
") + PS veto (<"+
str(flags.LAr.NoisyRO.MNBTight_PsVetoCut[1])+
" channels)"
21 MNBLooseFEBDefStr=
"(>"+
str(flags.LAr.NoisyRO.MNBLooseCut)+
" chan with Q>"+
str(flags.LAr.NoisyRO.CellQuality)+
")"
23 return LArNoisyROMonConfigCore(helper,CompFactory.LArNoisyROMonAlg, flags, inKey, NoisyFEBDefStr, NoisyHVlineDefStr, MNBTightFEBDefStr, MNBTight_PsVetoFEBDefStr, MNBLooseFEBDefStr)
28 NoisyFEBDefStr="(>30 chan
with Q>4000)
",
31 MNBTight_PsVetoFEBDefStr=
"",
32 MNBLooseFEBDefStr=
""):
35 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
37 from LArBadChannelTool.LArBadFebsConfig
import LArKnownBadFebCfg, LArKnownMNBFebCfg
41 larNoisyROMonAlg = helper.addAlgorithm(algoinstance,
'larNoisyROMonAlg')
43 NoisyROMonGroupName=
"LArNoisyROMonGroup"
45 from LArMonitoring.GlobalVariables
import lArDQGlobals
47 larNoisyROMonAlg.NoisyROGroupName=NoisyROMonGroupName
48 larNoisyROMonAlg.SubDetNames=lArDQGlobals.SubDet[0:2]
49 larNoisyROMonAlg.PartitionNames=lArDQGlobals.Partitions[0:4]
51 larNoisyROMonAlg.storeLooseMNBFEBs=
True
53 larNoisyROMonAlg.inputKey=inKey
55 if not flags.Common.isOnline:
56 larNoisyROMonAlg.HVMapKey=
"LArHVIdMap"
60 LArNoisyROMonForceTrigger
62 LArNoisyROMonForceTrigger =
False
64 EFNoiseBurstTriggersList=[
65 "HLT_larnoiseburst_L1XE60",
66 "HLT_larnoiseburst_L1XE70",
67 "HLT_larnoiseburst_L1XE80",
68 "HLT_larnoiseburst_L1J100",
69 "HLT_larnoiseburst_L1J40_XE60",
70 "HLT_larnoiseburst_L1J40_XE50",
71 "HLT_larpsall_L1J12_FIRSTEMPTY",
72 "HLT_larpsall_L1J30_FIRSTEMPTY",
73 "HLT_larpsallem_L1EM7_FIRSTEMPTY"
75 L1NoiseBurstTriggersList = [
90 if flags.DQ.useTrigger
or LArNoisyROMonForceTrigger:
91 larNoisyROMonAlg.doTrigger =
True
92 larNoisyROMonAlg.EFNoiseBurstTriggers = EFNoiseBurstTriggersList
93 larNoisyROMonAlg.L1NoiseBurstTriggers = L1NoiseBurstTriggersList
95 larNoisyROMonAlg.doTrigger =
False
96 larNoisyROMonAlg.EFNoiseBurstTriggers = []
97 larNoisyROMonAlg.L1NoiseBurstTriggers = []
99 noisyROGroup = helper.addGroup(
106 larNoisyRO_hist_path=
'Summary/'
109 noisyROGroup.defineTree(
'time,time_ns,algo;LArNoise',path=larNoisyRO_hist_path,
110 treedef=
'time/i:time_ns/i:algo/b')
112 noisyROGroup.defineTree(
'candidate_MNB_time,candidate_MNB_time_ns,n_candidate_MNBTight_FEB,n_candidate_MNBTight_PsVeto_FEB,n_candidate_MNBLoose_FEB,v_candidate_MNBTightFEB,v_candidate_MNBTight_PsVetoFEB,v_candidate_MNBLooseFEB;CandidateMNBFebs',path=larNoisyRO_hist_path,
113 treedef=
'candidate_MNB_time/i:candidate_MNB_time_ns/i:n_candidate_MNBTight_FEB/i:n_candidate_MNBTight_PsVeto_FEB/i:n_candidate_MNBLoose_FEB/i:v_candidate_MNBTightFEB/vector<int>:v_candidate_MNBTight_PsVetoFEB/vector<int>:v_candidate_MNBLooseFEB/vector<int>')
116 noisyROGroup.defineHistogram(
'n_noisyFEBs;NoisyFEB',
117 title=
'Number of noisy FEB '+ NoisyFEBDefStr +
' per event;# of noisy FEB',
119 path=larNoisyRO_hist_path,
120 xbins=lArDQGlobals.noisyFEB_Bins,xmin=lArDQGlobals.noisyFEB_Min,xmax=lArDQGlobals.noisyFEB_Max)
121 noisyROGroup.defineHistogram(
'n_noisyHVlines;NoisyHVlines',
122 title=
'Number of noisy HVlines '+ NoisyHVlineDefStr +
' per event;# of noisy HVlines',
124 path=larNoisyRO_hist_path,
125 xbins=lArDQGlobals.noisyFEB_Bins,xmin=lArDQGlobals.noisyFEB_Min,xmax=lArDQGlobals.noisyFEB_Max)
126 noisyROGroup.defineHistogram(
'LBN;LBN',type=
'TH1I',
127 title=
'Event counter per LB',
128 path=larNoisyRO_hist_path,
129 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
131 for subdet
in range(0,2):
132 hist_path=
'/LAr/NoisyRO/'+lArDQGlobals.SubDet[subdet]+
'/'
133 slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
134 slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
135 slot_n =
int(slot_up - slot_low)
136 ft_low = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
137 ft_up = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
138 ft_n =
int(ft_up - ft_low)
140 darray = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larNoisyROMonAlg,lArDQGlobals.SubDet[subdet],topPath=
'/')
142 darray.defineHistogram(
'slotBad,FTBad;KnownBadFEB', title=
'Known Bad FEBs {0} ; Slot ; FT',
143 type=
'TH2I', path=hist_path,
144 xbins=slot_n,xmin=slot_low,xmax=slot_up,
145 ybins=ft_n, ymin=ft_low, ymax=ft_up,
148 darray.defineHistogram(
'slotMNB,FTMNB;MNBKnownFEB', title=
'Known MNB FEBs {0} ; Slot ; FT',
149 type=
'TH2I', path=hist_path,
150 xbins=slot_n,xmin=slot_low,xmax=slot_up,
151 ybins=ft_n, ymin=ft_low, ymax=ft_up,
155 darray.defineHistogram(
'slotNoisy,FTNoisy;NoisyFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+NoisyFEBDefStr+
' (only vetoed events) ; Slot ; FT',
156 type=
'TH2I', path=hist_path,
157 xbins=slot_n,xmin=slot_low,xmax=slot_up,
158 ybins=ft_n, ymin=ft_low, ymax=ft_up)
160 darray.defineHistogram(
'slotTight,FTTight;MNBTightFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBTightFEBDefStr+
' (only vetoed events) ; Slot ; FT',
161 type=
'TH2I', path=hist_path,
162 xbins=slot_n,xmin=slot_low,xmax=slot_up,
163 ybins=ft_n, ymin=ft_low, ymax=ft_up)
165 darray.defineHistogram(
'slotTightCan,FTTightCan;CandidateMNBTightFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBTightFEBDefStr+
' (only vetoed events) ; Slot ; FT',
166 type=
'TH2I', path=hist_path,
167 xbins=slot_n,xmin=slot_low,xmax=slot_up,
168 ybins=ft_n, ymin=ft_low, ymax=ft_up)
170 darray.defineHistogram(
'slot_PsVetoTight,FT_PsVetoTight;MNBTight_PsVetoFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBTight_PsVetoFEBDefStr+
' (only vetoed events) ; Slot ; FT',
171 type=
'TH2I', path=hist_path,
172 xbins=slot_n,xmin=slot_low,xmax=slot_up,
173 ybins=ft_n, ymin=ft_low, ymax=ft_up)
175 darray.defineHistogram(
'slot_PsVetoTightCan,FT_PsVetoTightCan;CandidateMNBTight_PsVetoFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBTight_PsVetoFEBDefStr+
' (only vetoed events) ; Slot ; FT',
176 type=
'TH2I', path=hist_path,
177 xbins=slot_n,xmin=slot_low,xmax=slot_up,
178 ybins=ft_n, ymin=ft_low, ymax=ft_up)
180 darray.defineHistogram(
'slotLoose,FTLoose;MNBLooseFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBLooseFEBDefStr+
' (only vetoed events) ; Slot ; FT',
181 type=
'TH2I', path=hist_path,
182 xbins=slot_n,xmin=slot_low,xmax=slot_up,
183 ybins=ft_n, ymin=ft_low, ymax=ft_up)
185 darray.defineHistogram(
'slotLooseCan,FTLooseCan;CandidateMNBLooseFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBLooseFEBDefStr+
' (only vetoed events) ; Slot ; FT',
186 type=
'TH2I', path=hist_path,
187 xbins=slot_n,xmin=slot_low,xmax=slot_up,
188 ybins=ft_n, ymin=ft_low, ymax=ft_up)
191 darray.defineHistogram(
'LBStd;NoisyEvent',type=
'TH1I', path=hist_path,
192 title=
'Yield of events flagged as RNB-Standard - {0} ; Luminosity Block; Number of events',
193 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
195 darray.defineHistogram(
'LBSat;SaturatedNoisyEvent',type=
'TH1I', path=hist_path,
196 title=
'Yield of events flagged as RNB-Saturated - {0} ; Luminosity Block',
197 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
199 darray.defineHistogram(
'LBMNBTight;MNBTightEvent',type=
'TH1I', path=hist_path,
200 title=
'Yield of events flagged as MNB-Tight - {0} ; Luminosity Block',
201 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
203 darray.defineHistogram(
'LBMNBTight_PsVeto;MNBTight_PsVetoEvent',type=
'TH1I', path=hist_path,
204 title=
'Yield of events flagged as MNB-Tight_PsVeto - {0} ; Luminosity Block',
205 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
207 darray.defineHistogram(
'LBMNBLoose;MNBLooseEvent',type=
'TH1I', path=hist_path,
208 title=
'Yield of events flagged as MNB-Loose - {0} ; Luminosity Block',
209 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
212 darray.defineHistogram(
'LBStd_Veto;NoisyEvent_TimeVeto',type=
'TH1I', path=hist_path,
213 title=
'Yield of events flagged as RNB-Standard not vetoed by time window - {0} ; Luminosity Block',
214 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
216 darray.defineHistogram(
'LBSat_Veto;SaturatedNoisyEvent_TimeVeto',type=
'TH1I', path=hist_path,
217 title=
'Yield of events flagged as RNB-Saturated not vetoed by time window - {0} ; Luminosity Block',
218 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
220 darray.defineHistogram(
'LBMNBTight_Veto;MNBTightEvent_TimeVeto',type=
'TH1I', path=hist_path,
221 title=
'Yield of events flagged as MNB-Tight not vetoed by time window - {0} ; Luminosity Block',
222 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
224 darray.defineHistogram(
'LBMNBTight_PsVeto_Veto;MNBTight_PsVetoEvent_TimeVeto',type=
'TH1I', path=hist_path,
225 title=
'Yield of events flagged as MNB-Tight_PsVeto not vetoed by time window - {0} ; Luminosity Block',
226 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
228 darray.defineHistogram(
'LBMNBLoose_Veto;MNBLooseEvent_TimeVeto',type=
'TH1I', path=hist_path,
229 title=
'Yield of events flagged as MNB-Loose not vetoed by time window - {0} ; Luminosity Block',
230 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
233 if larNoisyROMonAlg.doTrigger:
234 siz=len(larNoisyROMonAlg.EFNoiseBurstTriggers)
235 darray.defineHistogram(
'Triggers;NoisyEventTrigger',type=
'TH1I', path=hist_path,
236 title=
'Trigger fired for RNB flagged events - {0} ; Special trigger fired',
237 xbins=siz+1,xmin=0.5,xmax=siz+1.5,
238 xlabels=larNoisyROMonAlg.EFNoiseBurstTriggers.append(
"NONE"))
240 l1siz=len(larNoisyROMonAlg.L1NoiseBurstTriggers)
241 darray.defineHistogram(
'L1Triggers;NoisyEventL1Term',type=
'TH1I', path=hist_path,
242 title=
'L1 term fired for RNB flagged events - {0} ; Special trigger fired',
243 xbins=l1siz+1,xmin=0.5,xmax=l1siz+1.5,
244 xlabels=larNoisyROMonAlg.L1NoiseBurstTriggers.append(
"NONE"))
245 for subdet
in range(0,4):
246 darray1 = helper.addArray([[
"HV"+ sd
for sd
in lArDQGlobals.Partitions[2*subdet:2*subdet+2]]],larNoisyROMonAlg,lArDQGlobals.SubDet[subdet],topPath=
'/')
248 darray1.defineHistogram(
'LBHV;HVlineNoisyEvent',type=
'TH1I', path=hist_path,
249 title=
'Yield of events flagged by HVlines flag - {0} ; Luminosity Block; Number of events',
250 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
252 darray1.defineHistogram(
'LBHV_Veto;HVlineNoisyEvent_TimeVeto',type=
'TH1I', path=hist_path,
253 title=
'Yield of events flagged by HVlines flag not vetoed by time window - {0} ; Luminosity Block',
254 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
257 cfg.merge(helper.result())
261 if __name__==
'__main__':
267 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
269 from LArMonitoring.LArMonConfigFlags
import addLArMonFlags
270 flags.addFlagsCategory(
"LArMon", addLArMonFlags)
272 nightly =
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/q431/21.0/v1/'
273 file =
'myESD.pool.root'
275 flags.Input.Files = [nightly+file]
276 flags.Input.isMC =
False
277 flags.DQ.useTrigger =
True
279 flags.Output.HISTFileName =
'LArNoisyROMonitoringOutput.root'
281 flags.Exec.OutputLevel=INFO
285 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
286 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
292 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
293 from TileGeoModel.TileGMConfig
import TileGMCfg
296 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
298 from LArCalibUtils.LArHVScaleConfig
import LArHVScaleCfg
301 from LArCellRec.LArNoisyROSummaryConfig
import LArNoisyROSummaryCfg
303 noisyROSumm.getEventAlgo(
"LArNoisyROAlg").OutputKey=
"LArNoisyROSummary_recomputed"
304 cfg.merge(noisyROSumm)