6 from AthenaMonitoring
import AthMonitorCfgHelper
7 helper = AthMonitorCfgHelper(flags,
'LArHVCorrMonAlgCfg')
9 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
11 from TileGeoModel.TileGMConfig
import TileGMCfg
13 from LArCalibUtils.LArHVScaleConfig
import LArHVScaleCfg
16 from AthenaConfiguration.ComponentFactory
import CompFactory
19 acc.merge(helper.result())
24 larHVCorrAlg = helper.addAlgorithm(algoinstance,
'larHVCorrMonAlg')
27 hvCorrGroupName=
"LArHVCorrMonGroup"
31 larHVCorrAlg.HVCorrMonGroupName=hvCorrGroupName
33 larHVCorrAlg.EtaGranularity=delta_eta
35 larHVCorrAlg.EtaGranularity=delta_phi
37 larHVCorrAlg.NumberOfLBs=num_LB
39 larHVCorrAlg.ErrorThreshold=threshold
42 from LArMonitoring.GlobalVariables
import lArDQGlobals
43 larHVCorr_hist_path=
'HVCorrection/'
46 hvCorrGroup = helper.addGroup( larHVCorrAlg,
47 hvCorrGroupName,
'/LAr/'
51 hvCorrGroup.defineHistogram(
'etaEMBA,phiEMBA;LArHVCorrectionEMBA',
52 title=
'HV deviation (nominal - corrected) - EMBA;#eta;#phi',
54 path=larHVCorr_hist_path,
57 xbins=
int(lArDQGlobals.HVeta_EMB[
"EMBAPS"][2]/delta_eta),xmin=lArDQGlobals.HVeta_EMB[
"EMBAPS"][1],xmax=lArDQGlobals.HVeta_EMB[
"EMBAPS"][2],
58 ybins=lArDQGlobals.HVphi_EMB[
"EMBAPS"][0],ymin=lArDQGlobals.HVphi_EMB[
"EMBAPS"][1],ymax=lArDQGlobals.HVphi_EMB[
"EMBAPS"][2],
59 merge=
'weightedAverage')
61 hvCorrGroup.defineHistogram(
'etaEMBC,phiEMBC;LArHVCorrectionEMBC',
62 title=
'HV deviation (nominal - corrected) - EMBA;#eta;#phi',
64 path=larHVCorr_hist_path,
67 xbins=
int(lArDQGlobals.HVeta_EMB[
"EMBAPS"][2]/delta_eta),xmax=lArDQGlobals.HVeta_EMB[
"EMBAPS"][1]-0.01,xmin=-lArDQGlobals.HVeta_EMB[
"EMBAPS"][2]-0.01,
68 ybins=lArDQGlobals.HVphi_EMB[
"EMBAPS"][0],ymin=lArDQGlobals.HVphi_EMB[
"EMBAPS"][1],ymax=lArDQGlobals.HVphi_EMB[
"EMBAPS"][2],
69 merge=
'weightedAverage')
71 hvCorrGroup.defineHistogram(
'LB,nonnominalEMBA;NDeviatingChannelsEMBA',
72 title=
'Number of channels per LB with HV corr>'+
str(100*threshold)+
' - EMBA;LumiBlock',
74 path=larHVCorr_hist_path,
75 xbins=num_LB,xmin=0.5,xmax=num_LB+0.5,
76 merge=
'weightedAverage')
78 hvCorrGroup.defineHistogram(
'LB,nonnominalEMBC;NDeviatingChannelsEMBC',
79 title=
'Number of channels per LB with HV corr>'+
str(100*threshold)+
' - EMBC;LumiBlock',
81 path=larHVCorr_hist_path,
82 xbins=num_LB,xmin=0.5,xmax=num_LB+0.5,
83 merge=
'weightedAverage')
86 hvCorrGroup.defineHistogram(
'etaEMECA,phiEMECA;LArHVCorrectionEMECA',
87 title=
'HV deviation (nominal - corrected) - EMECA;#eta;#phi',
89 path=larHVCorr_hist_path,
92 xbins=lArDQGlobals.HVeta_EMEC[
"EMECA"],
93 ybins=lArDQGlobals.HVphi_EMEC[
"EMECA"],
94 merge=
'weightedAverage')
96 hvCorrGroup.defineHistogram(
'etaEMECC,phiEMECC;LArHVCorrectionEMECC',
97 title=
'HV deviation (nominal - corrected) - EMECA;#eta;#phi',
99 path=larHVCorr_hist_path,
101 weight=
'hvcorrEMECC',
102 xbins=lArDQGlobals.HVeta_EMEC[
"EMECC"],
103 ybins=lArDQGlobals.HVphi_EMEC[
"EMECC"],
104 merge=
'weightedAverage')
106 hvCorrGroup.defineHistogram(
'LB,nonnominalEMECA;NDeviatingChannelsEMECA',
107 title=
'Number of channels per LB with HV corr>'+
str(100*threshold)+
' - EMECA;LumiBlock',
109 path=larHVCorr_hist_path,
110 xbins=num_LB,xmin=0.5,xmax=num_LB+0.5,
111 merge=
'weightedAverage')
113 hvCorrGroup.defineHistogram(
'LB,nonnominalEMECC;NDeviatingChannelsEMECC',
114 title=
'Number of channels per LB with HV corr>'+
str(100*threshold)+
' - EMECC;LumiBlock',
116 path=larHVCorr_hist_path,
117 xbins=num_LB,xmin=0.5,xmax=num_LB+0.5,
118 merge=
'weightedAverage')
121 hvCorrGroup.defineHistogram(
'etaHECA,phiHECA;LArHVCorrectionHECA',
122 title=
'HV deviation (nominal - corrected) - HECA;#eta;#phi',
124 path=larHVCorr_hist_path,
127 xbins=lArDQGlobals.HVeta_HECFcal[
"HECA"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECA"][1], xmax=lArDQGlobals.HVeta_HECFcal[
"HECA"][2],
128 ybins=lArDQGlobals.HVphi_HECFcal[
"HECA"][0], ymin=lArDQGlobals.HVphi_HECFcal[
"HECA"][1], ymax=lArDQGlobals.HVphi_HECFcal[
"HECA"][2],
129 merge=
'weightedAverage')
131 hvCorrGroup.defineHistogram(
'etaHECC,phiHECC;LArHVCorrectionHECC',
132 title=
'HV deviation (nominal - corrected) - HECA;#eta;#phi',
134 path=larHVCorr_hist_path,
137 xbins=lArDQGlobals.HVeta_HECFcal[
"HECC"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"HECC"][1], xmax=lArDQGlobals.HVeta_HECFcal[
"HECC"][2],
138 ybins=lArDQGlobals.HVphi_HECFcal[
"HECC"][0], ymin=lArDQGlobals.HVphi_HECFcal[
"HECC"][1], ymax=lArDQGlobals.HVphi_HECFcal[
"HECC"][2],
139 merge=
'weightedAverage')
141 hvCorrGroup.defineHistogram(
'LB,nonnominalHECA;NDeviatingChannelsHECA',
142 title=
'Number of channels per LB with HV corr>'+
str(100*threshold)+
' - HECA;LumiBlock',
144 path=larHVCorr_hist_path,
145 xbins=num_LB,xmin=0.5,xmax=num_LB+0.5,
146 merge=
'weightedAverage')
148 hvCorrGroup.defineHistogram(
'LB,nonnominalHECC;NDeviatingChannelsHECC',
149 title=
'Number of channels per LB with HV corr>'+
str(100*threshold)+
' - HECC;LumiBlock',
151 path=larHVCorr_hist_path,
152 xbins=num_LB,xmin=0.5,xmax=num_LB+0.5,
153 merge=
'weightedAverage')
156 hvCorrGroup.defineHistogram(
'etaFCALA,phiFCALA;LArHVCorrectionFCALA',
157 title=
'HV deviation (nominal - corrected) - FCALA;#eta;#phi',
159 path=larHVCorr_hist_path,
161 weight=
'hvcorrFCALA',
162 xbins=lArDQGlobals.HVeta_HECFcal[
"FCalA"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"FCalA"][1], xmax=lArDQGlobals.HVeta_HECFcal[
"FCalA"][2],
163 ybins=lArDQGlobals.HVphi_HECFcal[
"FCalA"][0], ymin=lArDQGlobals.HVphi_HECFcal[
"FCalA"][1], ymax=lArDQGlobals.HVphi_HECFcal[
"FCalA"][2],
164 merge=
'weightedAverage')
166 hvCorrGroup.defineHistogram(
'etaFCALC,phiFCALC;LArHVCorrectionFCALC',
167 title=
'HV deviation (nominal - corrected) - FCALA;#eta;#phi',
169 path=larHVCorr_hist_path,
171 weight=
'hvcorrFCALC',
172 xbins=lArDQGlobals.HVeta_HECFcal[
"FCalC"][0],xmin=lArDQGlobals.HVeta_HECFcal[
"FCalC"][1], xmax=lArDQGlobals.HVeta_HECFcal[
"FCalC"][2],
173 ybins=lArDQGlobals.HVphi_HECFcal[
"FCalC"][0], ymin=lArDQGlobals.HVphi_HECFcal[
"FCalC"][1], ymax=lArDQGlobals.HVphi_HECFcal[
"FCalC"][2],
174 merge=
'weightedAverage')
176 hvCorrGroup.defineHistogram(
'LB,nonnominalFCALA;NDeviatingChannelsFCALA',
177 title=
'Number of channels per LB with HV corr>'+
str(100*threshold)+
' - FCALA;LumiBlock',
179 path=larHVCorr_hist_path,
180 xbins=num_LB,xmin=0.5,xmax=num_LB+0.5,
181 merge=
'weightedAverage')
183 hvCorrGroup.defineHistogram(
'LB,nonnominalFCALC;NDeviatingChannelsFCALC',
184 title=
'Number of channels per LB with HV corr>'+
str(100*threshold)+
' - FCALC;LumiBlock',
186 path=larHVCorr_hist_path,
187 xbins=num_LB,xmin=0.5,xmax=num_LB+0.5,
188 merge=
'weightedAverage')
191 if __name__==
'__main__':
194 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
197 nightly =
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
198 file =
'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
199 flags.Input.Files = [nightly+file]
200 flags.Input.isMC =
False
201 flags.Output.HISTFileName =
'LArHVCorrMonOutput.root'
205 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
206 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg