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
57 LArNoisyROMonForceTrigger
59 LArNoisyROMonForceTrigger =
False
61 EFNoiseBurstTriggersList=[
62 "HLT_larnoiseburst_L1XE60",
63 "HLT_larnoiseburst_L1XE70",
64 "HLT_larnoiseburst_L1XE80",
65 "HLT_larnoiseburst_L1J100",
66 "HLT_larnoiseburst_L1J40_XE60",
67 "HLT_larnoiseburst_L1J40_XE50",
68 "HLT_larpsall_L1J12_FIRSTEMPTY",
69 "HLT_larpsall_L1J30_FIRSTEMPTY",
70 "HLT_larpsallem_L1EM7_FIRSTEMPTY"
72 L1NoiseBurstTriggersList = [
87 if flags.DQ.useTrigger
or LArNoisyROMonForceTrigger:
88 larNoisyROMonAlg.doTrigger =
True
89 larNoisyROMonAlg.EFNoiseBurstTriggers = EFNoiseBurstTriggersList
90 larNoisyROMonAlg.L1NoiseBurstTriggers = L1NoiseBurstTriggersList
92 larNoisyROMonAlg.doTrigger =
False
93 larNoisyROMonAlg.EFNoiseBurstTriggers = []
94 larNoisyROMonAlg.L1NoiseBurstTriggers = []
96 noisyROGroup = helper.addGroup(
103 larNoisyRO_hist_path=
'Summary/'
106 noisyROGroup.defineTree(
'time,time_ns,algo;LArNoise',path=larNoisyRO_hist_path,
107 treedef=
'time/i:time_ns/i:algo/b')
109 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,
110 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>')
113 noisyROGroup.defineHistogram(
'n_noisyFEBs;NoisyFEB',
114 title=
'Number of noisy FEB '+ NoisyFEBDefStr +
' per event;# of noisy FEB',
116 path=larNoisyRO_hist_path,
117 xbins=lArDQGlobals.noisyFEB_Bins,xmin=lArDQGlobals.noisyFEB_Min,xmax=lArDQGlobals.noisyFEB_Max)
118 noisyROGroup.defineHistogram(
'n_noisyHVlines;NoisyHVlines',
119 title=
'Number of noisy HVlines '+ NoisyHVlineDefStr +
' per event;# of noisy HVlines',
121 path=larNoisyRO_hist_path,
122 xbins=lArDQGlobals.noisyFEB_Bins,xmin=lArDQGlobals.noisyFEB_Min,xmax=lArDQGlobals.noisyFEB_Max)
123 noisyROGroup.defineHistogram(
'LBN;LBN',type=
'TH1I',
124 title=
'Event counter per LB',
125 path=larNoisyRO_hist_path,
126 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
128 for subdet
in range(0,2):
129 hist_path=
'/LAr/NoisyRO/'+lArDQGlobals.SubDet[subdet]+
'/'
130 slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
131 slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
132 slot_n =
int(slot_up - slot_low)
133 ft_low = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
134 ft_up = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
135 ft_n =
int(ft_up - ft_low)
137 darray = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larNoisyROMonAlg,lArDQGlobals.SubDet[subdet],topPath=
'/')
140 darray.defineHistogram(
'slotBad,FTBad;KnownBadFEB', title=
'Known Bad FEBs {0} ; Slot ; FT',
141 type=
'TH2I', path=hist_path,
142 xbins=slot_n,xmin=slot_low,xmax=slot_up,
143 ybins=ft_n, ymin=ft_low, ymax=ft_up,
146 darray.defineHistogram(
'slotMNB,FTMNB;MNBKnownFEB', title=
'Known MNB FEBs {0} ; Slot ; FT',
147 type=
'TH2I', path=hist_path,
148 xbins=slot_n,xmin=slot_low,xmax=slot_up,
149 ybins=ft_n, ymin=ft_low, ymax=ft_up,
153 darray.defineHistogram(
'slotNoisy,FTNoisy;NoisyFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+NoisyFEBDefStr+
' (only vetoed events) ; Slot ; FT',
154 type=
'TH2I', path=hist_path,
155 xbins=slot_n,xmin=slot_low,xmax=slot_up,
156 ybins=ft_n, ymin=ft_low, ymax=ft_up)
158 darray.defineHistogram(
'slotTight,FTTight;MNBTightFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBTightFEBDefStr+
' (only vetoed events) ; Slot ; FT',
159 type=
'TH2I', path=hist_path,
160 xbins=slot_n,xmin=slot_low,xmax=slot_up,
161 ybins=ft_n, ymin=ft_low, ymax=ft_up)
163 darray.defineHistogram(
'slotTightCan,FTTightCan;CandidateMNBTightFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBTightFEBDefStr+
' (only vetoed events) ; Slot ; FT',
164 type=
'TH2I', path=hist_path,
165 xbins=slot_n,xmin=slot_low,xmax=slot_up,
166 ybins=ft_n, ymin=ft_low, ymax=ft_up)
168 darray.defineHistogram(
'slot_PsVetoTight,FT_PsVetoTight;MNBTight_PsVetoFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBTight_PsVetoFEBDefStr+
' (only vetoed events) ; Slot ; FT',
169 type=
'TH2I', path=hist_path,
170 xbins=slot_n,xmin=slot_low,xmax=slot_up,
171 ybins=ft_n, ymin=ft_low, ymax=ft_up)
173 darray.defineHistogram(
'slot_PsVetoTightCan,FT_PsVetoTightCan;CandidateMNBTight_PsVetoFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBTight_PsVetoFEBDefStr+
' (only vetoed events) ; Slot ; FT',
174 type=
'TH2I', path=hist_path,
175 xbins=slot_n,xmin=slot_low,xmax=slot_up,
176 ybins=ft_n, ymin=ft_low, ymax=ft_up)
178 darray.defineHistogram(
'slotLoose,FTLoose;MNBLooseFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBLooseFEBDefStr+
' (only vetoed events) ; Slot ; FT',
179 type=
'TH2I', path=hist_path,
180 xbins=slot_n,xmin=slot_low,xmax=slot_up,
181 ybins=ft_n, ymin=ft_low, ymax=ft_up)
183 darray.defineHistogram(
'slotLooseCan,FTLooseCan;CandidateMNBLooseFEBPerEvt', title=
'Yield of events with {0} FEB noisy -'+MNBLooseFEBDefStr+
' (only vetoed events) ; Slot ; FT',
184 type=
'TH2I', path=hist_path,
185 xbins=slot_n,xmin=slot_low,xmax=slot_up,
186 ybins=ft_n, ymin=ft_low, ymax=ft_up)
189 darray.defineHistogram(
'LBStd;NoisyEvent',type=
'TH1I', path=hist_path,
190 title=
'Yield of events flagged as RNB-Standard - {0} ; Luminosity Block; Number of events',
191 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
193 darray.defineHistogram(
'LBSat;SaturatedNoisyEvent',type=
'TH1I', path=hist_path,
194 title=
'Yield of events flagged as RNB-Saturated - {0} ; Luminosity Block',
195 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
197 darray.defineHistogram(
'LBMNBTight;MNBTightEvent',type=
'TH1I', path=hist_path,
198 title=
'Yield of events flagged as MNB-Tight - {0} ; Luminosity Block',
199 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
201 darray.defineHistogram(
'LBMNBTight_PsVeto;MNBTight_PsVetoEvent',type=
'TH1I', path=hist_path,
202 title=
'Yield of events flagged as MNB-Tight_PsVeto - {0} ; Luminosity Block',
203 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
205 darray.defineHistogram(
'LBMNBLoose;MNBLooseEvent',type=
'TH1I', path=hist_path,
206 title=
'Yield of events flagged as MNB-Loose - {0} ; Luminosity Block',
207 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
210 darray.defineHistogram(
'LBStd_Veto;NoisyEvent_TimeVeto',type=
'TH1I', path=hist_path,
211 title=
'Yield of events flagged as RNB-Standard not vetoed by time window - {0} ; Luminosity Block',
212 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
214 darray.defineHistogram(
'LBSat_Veto;SaturatedNoisyEvent_TimeVeto',type=
'TH1I', path=hist_path,
215 title=
'Yield of events flagged as RNB-Saturated not vetoed by time window - {0} ; Luminosity Block',
216 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
218 darray.defineHistogram(
'LBMNBTight_Veto;MNBTightEvent_TimeVeto',type=
'TH1I', path=hist_path,
219 title=
'Yield of events flagged as MNB-Tight not vetoed by time window - {0} ; Luminosity Block',
220 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
222 darray.defineHistogram(
'LBMNBTight_PsVeto_Veto;MNBTight_PsVetoEvent_TimeVeto',type=
'TH1I', path=hist_path,
223 title=
'Yield of events flagged as MNB-Tight_PsVeto not vetoed by time window - {0} ; Luminosity Block',
224 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
226 darray.defineHistogram(
'LBMNBLoose_Veto;MNBLooseEvent_TimeVeto',type=
'TH1I', path=hist_path,
227 title=
'Yield of events flagged as MNB-Loose not vetoed by time window - {0} ; Luminosity Block',
228 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
231 if larNoisyROMonAlg.doTrigger:
232 siz=len(larNoisyROMonAlg.EFNoiseBurstTriggers)
233 darray.defineHistogram(
'Triggers;NoisyEventTrigger',type=
'TH1I', path=hist_path,
234 title=
'Trigger fired for RNB flagged events - {0} ; Special trigger fired',
235 xbins=siz+1,xmin=0.5,xmax=siz+1.5,
236 xlabels=larNoisyROMonAlg.EFNoiseBurstTriggers.append(
"NONE"))
238 l1siz=len(larNoisyROMonAlg.L1NoiseBurstTriggers)
239 darray.defineHistogram(
'L1Triggers;NoisyEventL1Term',type=
'TH1I', path=hist_path,
240 title=
'L1 term fired for RNB flagged events - {0} ; Special trigger fired',
241 xbins=l1siz+1,xmin=0.5,xmax=l1siz+1.5,
242 xlabels=larNoisyROMonAlg.L1NoiseBurstTriggers.append(
"NONE"))
243 for subdet
in range(0,4):
244 darray1 = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larNoisyROMonAlg,lArDQGlobals.SubDet[subdet],topPath=
'/')
246 darray1.defineHistogram(
'LBHV;HVlineNoisyEvent',type=
'TH1I', path=hist_path,
247 title=
'Yield of events flagged by HVlines flag - {0} ; Luminosity Block; Number of events',
248 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
250 darray1.defineHistogram(
'LBHV_Veto;HVlineNoisyEvent_TimeVeto',type=
'TH1I', path=hist_path,
251 title=
'Yield of events flagged by HVlines flag not vetoed by time window - {0} ; Luminosity Block',
252 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
255 cfg.merge(helper.result())
259 if __name__==
'__main__':
265 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
267 from LArMonitoring.LArMonConfigFlags
import addLArMonFlags
268 flags.addFlagsCategory(
"LArMon", addLArMonFlags)
270 nightly =
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/q431/21.0/v1/'
271 file =
'myESD.pool.root'
273 flags.Input.Files = [nightly+file]
274 flags.Input.isMC =
False
275 flags.DQ.useTrigger =
True
277 flags.Output.HISTFileName =
'LArNoisyROMonitoringOutput.root'
279 flags.Exec.OutputLevel=INFO
283 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
284 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
290 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
291 from TileGeoModel.TileGMConfig
import TileGMCfg
294 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
296 from LArCalibUtils.LArHVScaleConfig
import LArHVScaleCfg
299 from LArCellRec.LArNoisyROSummaryConfig
import LArNoisyROSummaryCfg
301 noisyROSumm.getEventAlgo(
"LArNoisyROAlg").OutputKey=
"LArNoisyROSummary_recomputed"
302 cfg.merge(noisyROSumm)