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())