6 '''Function to configures some algorithms in the monitoring system.'''
8 from AthenaMonitoring
import AthMonitorCfgHelper
9 helper = AthMonitorCfgHelper(flags,
'LArAffectedRegionsAlgCfg')
11 from AthenaConfiguration.ComponentFactory
import CompFactory
14 return helper.result()
19 larAffectedRegAlg = helper.addAlgorithm(algoinstance,
'larAffectedRegAlg')
22 affectedRegGroupName=
"LArAffectedRegionsMonGroup"
26 larAffectedRegAlg.AffectedRegionsGroupName=affectedRegGroupName
27 larAffectedRegAlg.IsOnline = flags.DQ.Environment==
'online'
30 from LArMonitoring.GlobalVariables
import lArDQGlobals
31 larAffReg_hist_path=
'AffectedRegions/'
35 group_name_ending=
"EMBPS"
36 larAffectedRegAlg.EMBPSname=group_name_ending
37 affectedRegGroupEMBPS = helper.addGroup(
39 affectedRegGroupName+group_name_ending,
45 affectedRegGroupEMBPS.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsEMBAPS',
46 title=
'HV Affected Regions - EMBA - Presampler;#eta;#phi',
48 path=larAffReg_hist_path,
50 xbins=lArDQGlobals.HVeta_EMB[
"EMBAPS"][0],xmin=lArDQGlobals.HVeta_EMB[
"EMBAPS"][1],xmax=lArDQGlobals.HVeta_EMB[
"EMBAPS"][2],
51 ybins=lArDQGlobals.HVphi_EMB[
"EMBAPS"][0],ymin=lArDQGlobals.HVphi_EMB[
"EMBAPS"][1],ymax=lArDQGlobals.HVphi_EMB[
"EMBAPS"][2],
52 merge=
'weightedAverage'
54 affectedRegGroupEMBPS.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsEMBCPS',
55 title=
'HV Affected Regions - EMBC - Presampler;#eta;#phi',
57 path=larAffReg_hist_path,
59 xbins=lArDQGlobals.HVeta_EMB[
"EMBCPS"][0],xmin=lArDQGlobals.HVeta_EMB[
"EMBCPS"][1],xmax=lArDQGlobals.HVeta_EMB[
"EMBCPS"][2],
60 ybins=lArDQGlobals.HVphi_EMB[
"EMBCPS"][0],ymin=lArDQGlobals.HVphi_EMB[
"EMBCPS"][1],ymax=lArDQGlobals.HVphi_EMB[
"EMBCPS"][2],
61 merge=
'weightedAverage'
66 group_name_ending=
"EMB"
67 larAffectedRegAlg.EMBname=group_name_ending
68 affectedRegGroupEMB = helper.addGroup(
70 affectedRegGroupName+group_name_ending,
75 affectedRegGroupEMB.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsEMBA',
76 title=
'HV Affected Regions - EMBA - Samplings 1-3;#eta;#phi',
78 path=larAffReg_hist_path,
80 xbins=lArDQGlobals.HVeta_EMB[
"EMBA"][0],xmin=lArDQGlobals.HVeta_EMB[
"EMBA"][1],xmax=lArDQGlobals.HVeta_EMB[
"EMBA"][2],
81 ybins=lArDQGlobals.HVphi_EMB[
"EMBA"][0],ymin=lArDQGlobals.HVphi_EMB[
"EMBA"][1],ymax=lArDQGlobals.HVphi_EMB[
"EMBA"][2],
82 merge=
'weightedAverage'
84 affectedRegGroupEMB.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsEMBC',
85 title=
'HV Affected Regions - EMBC - Samplings 1-3;#eta;#phi',
87 path=larAffReg_hist_path,
89 xbins=lArDQGlobals.HVeta_EMB[
"EMBC"][0],xmin=lArDQGlobals.HVeta_EMB[
"EMBC"][1],xmax=lArDQGlobals.HVeta_EMB[
"EMBC"][2],
90 ybins=lArDQGlobals.HVphi_EMB[
"EMBC"][0],ymin=lArDQGlobals.HVphi_EMB[
"EMBC"][1],ymax=lArDQGlobals.HVphi_EMB[
"EMBC"][2],
91 merge=
'weightedAverage'
96 group_name_ending=
"EMECPS"
97 larAffectedRegAlg.EMECPSname=group_name_ending
98 affectedRegGroupEMECPS = helper.addGroup(
100 affectedRegGroupName+group_name_ending,
105 affectedRegGroupEMECPS.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsEMECAPS',
106 title=
'HV Affected Regions - EMECA - Presampler;#eta;#phi',
108 path=larAffReg_hist_path,
110 xbins=lArDQGlobals.HVeta_EMEC[
"EMECAPS"],
111 ybins=lArDQGlobals.HVphi_EMEC[
"EMECAPS"],
112 merge=
'weightedAverage'
114 affectedRegGroupEMECPS.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsEMECCPS',
115 title=
'HV Affected Regions - EMECC - Presampler;#eta;#phi',
117 path=larAffReg_hist_path,
119 xbins=lArDQGlobals.HVeta_EMEC[
"EMECCPS"],
120 ybins=lArDQGlobals.HVphi_EMEC[
"EMECCPS"],
121 merge=
'weightedAverage'
126 group_name_ending=
"EMEC"
127 larAffectedRegAlg.EMECname=group_name_ending
128 affectedRegGroupEMEC = helper.addGroup(
130 affectedRegGroupName+group_name_ending,
135 affectedRegGroupEMEC.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsEMECA',
136 title=
'HV Affected Regions - EMECA - Samplings 1-3;#eta;#phi',
138 path=larAffReg_hist_path,
140 xbins=lArDQGlobals.HVeta_EMEC[
"EMECA"],
141 ybins=lArDQGlobals.HVphi_EMEC[
"EMECA"],
142 merge=
'weightedAverage'
144 affectedRegGroupEMEC.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsEMECC',
145 title=
'HV Affected Regions - EMECC - Samplings 1-3;#eta;#phi',
147 path=larAffReg_hist_path,
149 xbins=lArDQGlobals.HVeta_EMEC[
"EMECC"],
150 ybins=lArDQGlobals.HVphi_EMEC[
"EMECC"],
151 merge=
'weightedAverage'
156 group_name_ending=
"HEC0"
157 larAffectedRegAlg.HEC0name=group_name_ending
158 affectedRegGroupHEC0 = helper.addGroup(
160 affectedRegGroupName+group_name_ending,
165 affectedRegGroupHEC0.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsHECA0',
166 title=
'HV Affected Regions - HECA - Layer 1;#eta;#phi',
168 path=larAffReg_hist_path,
170 xbins=lArDQGlobals.HVeta_HECFcal[
"HECA"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECA"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"HECA"][2],
171 ybins=lArDQGlobals.HVphi_HECFcal[
"HECA"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"HECA"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"HECA"][2],
172 merge=
'weightedAverage'
174 affectedRegGroupHEC0.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsHECC0',
175 title=
'HV Affected Regions - HECC - Layer 1;#eta;#phi',
177 path=larAffReg_hist_path,
179 xbins=lArDQGlobals.HVeta_HECFcal[
"HECC"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECC"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"HECC"][2],
180 ybins=lArDQGlobals.HVphi_HECFcal[
"HECC"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"HECC"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"HECC"][2],
181 merge=
'weightedAverage'
185 group_name_ending=
"HEC1"
186 larAffectedRegAlg.HEC1name=group_name_ending
187 affectedRegGroupHEC1 = helper.addGroup(
189 affectedRegGroupName+group_name_ending,
194 affectedRegGroupHEC1.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsHECA1',
195 title=
'HV Affected Regions - HECA - Layer 2;#eta;#phi',
197 path=larAffReg_hist_path,
199 xbins=lArDQGlobals.HVeta_HECFcal[
"HECA"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECA"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"HECA"][2],
200 ybins=lArDQGlobals.HVphi_HECFcal[
"HECA"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"HECA"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"HECA"][2],
201 merge=
'weightedAverage'
203 affectedRegGroupHEC1.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsHECC1',
204 title=
'HV Affected Regions - HECC - Layer 2;#eta;#phi',
206 path=larAffReg_hist_path,
208 xbins=lArDQGlobals.HVeta_HECFcal[
"HECC"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECC"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"HECC"][2],
209 ybins=lArDQGlobals.HVphi_HECFcal[
"HECC"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"HECC"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"HECC"][2],
210 merge=
'weightedAverage'
214 group_name_ending=
"HEC2"
215 larAffectedRegAlg.HEC2name=group_name_ending
216 affectedRegGroupHEC2 = helper.addGroup(
218 affectedRegGroupName+group_name_ending,
223 affectedRegGroupHEC2.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsHECA2',
224 title=
'HV Affected Regions - HECA - Layer 3;#eta;#phi',
226 path=larAffReg_hist_path,
228 xbins=lArDQGlobals.HVeta_HECFcal[
"HECA"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECA"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"HECA"][2],
229 ybins=lArDQGlobals.HVphi_HECFcal[
"HECA"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"HECA"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"HECA"][2],
230 merge=
'weightedAverage'
232 affectedRegGroupHEC2.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsHECC2',
233 title=
'HV Affected Regions - HECC - Layer 3;#eta;#phi',
235 path=larAffReg_hist_path,
237 xbins=lArDQGlobals.HVeta_HECFcal[
"HECC"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECC"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"HECC"][2],
238 ybins=lArDQGlobals.HVphi_HECFcal[
"HECC"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"HECC"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"HECC"][2],
239 merge=
'weightedAverage'
243 group_name_ending=
"HEC3"
244 larAffectedRegAlg.HEC3name=group_name_ending
245 affectedRegGroupHEC3 = helper.addGroup(
247 affectedRegGroupName+group_name_ending,
252 affectedRegGroupHEC3.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsHECA3',
253 title=
'HV Affected Regions - HECA - Layer 4;#eta;#phi',
255 path=larAffReg_hist_path,
257 xbins=lArDQGlobals.HVeta_HECFcal[
"HECA"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECA"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"HECA"][2],
258 ybins=lArDQGlobals.HVphi_HECFcal[
"HECA"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"HECA"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"HECA"][2],
259 merge=
'weightedAverage'
261 affectedRegGroupHEC3.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsHECC3',
262 title=
'HV Affected Regions - HECC - Layer 4;#eta;#phi',
264 path=larAffReg_hist_path,
266 xbins=lArDQGlobals.HVeta_HECFcal[
"HECC"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECC"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"HECC"][2],
267 ybins=lArDQGlobals.HVphi_HECFcal[
"HECC"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"HECC"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"HECC"][2],
268 merge=
'weightedAverage'
272 group_name_ending=
"FCal0"
273 larAffectedRegAlg.FCal0name=group_name_ending
274 affectedRegGroupFCal0 = helper.addGroup(
276 affectedRegGroupName+group_name_ending,
281 affectedRegGroupFCal0.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsFCalA0',
282 title=
'HV Affected Regions - FCalA - Layer 1;#eta;#phi',
284 path=larAffReg_hist_path,
286 xbins=lArDQGlobals.HVeta_HECFcal[
"FCalA"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"FCalA"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"FCalA"][2],
287 ybins=lArDQGlobals.HVphi_HECFcal[
"FCalA"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"FCalA"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"FCalA"][2],
288 merge=
'weightedAverage'
290 affectedRegGroupFCal0.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsFCalC0',
291 title=
'HV Affected Regions - FCalC - Layer 1;#eta;#phi',
293 path=larAffReg_hist_path,
295 xbins=lArDQGlobals.HVeta_HECFcal[
"FCalC"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"FCalC"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"FCalC"][2],
296 ybins=lArDQGlobals.HVphi_HECFcal[
"FCalC"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"FCalC"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"FCalC"][2],
297 merge=
'weightedAverage'
301 group_name_ending=
"FCal1"
302 larAffectedRegAlg.FCal1name=group_name_ending
303 affectedRegGroupFCal1 = helper.addGroup(
305 affectedRegGroupName+group_name_ending,
310 affectedRegGroupFCal1.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsFCalA1',
311 title=
'HV Affected Regions - FCalA - Layer 2;#eta;#phi',
313 path=larAffReg_hist_path,
315 xbins=lArDQGlobals.HVeta_HECFcal[
"FCalA"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"FCalA"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"FCalA"][2],
316 ybins=lArDQGlobals.HVphi_HECFcal[
"FCalA"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"FCalA"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"FCalA"][2],
317 merge=
'weightedAverage'
319 affectedRegGroupFCal1.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsFCalC1',
320 title=
'HV Affected Regions - FCalC - Layer 2;#eta;#phi',
322 path=larAffReg_hist_path,
324 xbins=lArDQGlobals.HVeta_HECFcal[
"FCalC"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"FCalC"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"FCalC"][2],
325 ybins=lArDQGlobals.HVphi_HECFcal[
"FCalC"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"FCalC"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"FCalC"][2],
326 merge=
'weightedAverage'
330 group_name_ending=
"FCal2"
331 larAffectedRegAlg.FCal2name=group_name_ending
332 affectedRegGroupFCal2 = helper.addGroup(
334 affectedRegGroupName+group_name_ending,
339 affectedRegGroupFCal2.defineHistogram(
'etaPOS,phi;RAW_LArAffectedRegionsFCalA2',
340 title=
'HV Affected Regions - FCalA - Layer 3;#eta;#phi',
342 path=larAffReg_hist_path,
344 xbins=lArDQGlobals.HVeta_HECFcal[
"FCalA"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"FCalA"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"FCalA"][2],
345 ybins=lArDQGlobals.HVphi_HECFcal[
"FCalA"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"FCalA"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"FCalA"][2],
346 merge=
'weightedAverage'
348 affectedRegGroupFCal2.defineHistogram(
'etaNEG,phi;RAW_LArAffectedRegionsFCalC2',
349 title=
'HV Affected Regions - FCalC - Layer 3;#eta;#phi',
351 path=larAffReg_hist_path,
353 xbins=lArDQGlobals.HVeta_HECFcal[
"FCalC"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"FCalC"][1],xmax=lArDQGlobals.HVeta_HECFcal[
"FCalC"][2],
354 ybins=lArDQGlobals.HVphi_HECFcal[
"FCalC"][0],ymin=lArDQGlobals.HVphi_HECFcal[
"FCalC"][1],ymax=lArDQGlobals.HVphi_HECFcal[
"FCalC"][2],
355 merge=
'weightedAverage'
359 if __name__==
'__main__':
362 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
365 from LArMonitoring.LArMonConfigFlags
import addLArMonFlags
366 flags.addFlagsCategory(
"LArMon", addLArMonFlags)
368 from AthenaConfiguration.TestDefaults
import defaultTestFiles
369 flags.Input.Files = defaultTestFiles.RAW_RUN2
371 flags.Output.HISTFileName =
'LArAffectedRegionsOutput.root'
372 flags.DQ.enableLumiAccess =
False
373 flags.DQ.useTrigger =
False
377 from CaloRec.CaloRecoConfig
import CaloRecoCfg
385 f=
open(
"AffectedRegionsMonMaker.pkl",
"wb")