9 from AthenaMonitoring
import AthMonitorCfgHelper
10 helper = AthMonitorCfgHelper(flags,
'CaloBaselineMonCfg')
12 if not flags.DQ.enableLumiAccess:
13 print(
'This algo needs Lumi access, returning empty config')
15 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
16 cfg=ComponentAccumulator()
17 cfg.merge(helper.result())
20 return helper.result()
22 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
24 from TileGeoModel.TileGMConfig
import TileGMCfg
25 cfg.merge(TileGMCfg(flags))
26 from LArCellRec.LArCollisionTimeConfig
import LArCollisionTimeCfg
27 cfg.merge(LArCollisionTimeCfg(flags))
28 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
29 cfg.merge(CaloNoiseCondAlgCfg(flags))
31 caloBaselineMonAlg = helper.addAlgorithm(CompFactory.CaloBaselineMonAlg,
'caloBaselineMonAlg')
33 GroupName=
"CaloBaseLineMon"
34 caloBaselineMonAlg.MonGroupName = GroupName
36 caloBaselineMonAlg.EnableLumi =
True
38 partList = [
"EM",
"HEC+FCal"]
39 caloBaselineMonAlg.partionList = partList
41 caloBaselineMonAlg.nbOfEtaBins = etaBins
43 caloBaselineMonAlg.minimumEta = minEta
45 caloBaselineMonAlg.maximumEta = maxEta
48 tmp_CaloBaselineMon = {
"useBadLBTool":
False,
49 "useReadyFilterTool":
False,
50 "useLArNoisyAlg":
False,
51 "useBeamBackgroundRemoval":
False,
52 "useLArCollisionFilter":
False,
53 "pedestalMon_BCIDmin":0,
54 "bcidtoolMon_BCIDmax":0}
55 binlabels=[
"TotalEvents",
"ATLAS Ready",
"with Good LAr LB",
"with No LAr Collision",
"with No Beam Background",
"with No Trigger Filter",
"with No LArError"]
56 if not (flags.Common.isOnline ==
'online' or flags.Input.isMC ):
57 tmp_CaloBaselineMon[
"useBadLBTool"]=
True
58 tmp_CaloBaselineMon[
"useReadyFilterTool"]=
True
59 tmp_CaloBaselineMon[
"useLArNoisyAlg"] =
True
68 tmp_CaloBaselineMon[
"bcidtoolMon_BCIDmax"] = 144
70 tmp_CaloBaselineMon[
"TriggerChain"] =
""
72 from AthenaMonitoring.AtlasReadyFilterConfig
import AtlasReadyFilterCfg
73 from AthenaMonitoring.BadLBFilterToolConfig
import LArBadLBFilterToolCfg
75 caloBaselineMonAlg.useBadLBTool = tmp_CaloBaselineMon[
"useBadLBTool"]
76 caloBaselineMonAlg.BadLBTool = cfg.popToolsAndMerge(LArBadLBFilterToolCfg(flags))
78 from LumiBlockComps.BunchCrossingCondAlgConfig
import BunchCrossingCondAlgCfg
79 cfg.merge(BunchCrossingCondAlgCfg(flags))
81 caloBaselineMonAlg.useReadyFilterTool = tmp_CaloBaselineMon[
"useReadyFilterTool"]
82 caloBaselineMonAlg.ReadyFilterTool = cfg.popToolsAndMerge(AtlasReadyFilterCfg(flags))
83 caloBaselineMonAlg.useLArCollisionFilterTool = tmp_CaloBaselineMon[
"useLArCollisionFilter"]
84 caloBaselineMonAlg.useLArNoisyAlg = tmp_CaloBaselineMon[
"useLArNoisyAlg"]
85 caloBaselineMonAlg.useBeamBackgroundRemoval = tmp_CaloBaselineMon[
"useBeamBackgroundRemoval"]
86 caloBaselineMonAlg.pedestalMon_BCIDmin = tmp_CaloBaselineMon[
"pedestalMon_BCIDmin"]
87 caloBaselineMonAlg.bcidtoolMon_BCIDmax = tmp_CaloBaselineMon[
"bcidtoolMon_BCIDmax"]
88 caloBaselineMonAlg.TriggerChain = tmp_CaloBaselineMon[
"TriggerChain"]
89 if not caloBaselineMonAlg.useReadyFilterTool:
90 binlabels[1] =
"ATLAS Ready-OFF"
91 if not caloBaselineMonAlg.useBadLBTool:
92 binlabels[2] =
"Good LAr LB-OFF"
93 if not caloBaselineMonAlg.useLArCollisionFilterTool:
94 binlabels[3] =
"LAr collision-OFF"
95 if not caloBaselineMonAlg.useBeamBackgroundRemoval:
96 binlabels[4] =
"Beam backgr.-OFF"
97 if not caloBaselineMonAlg.useLArNoisyAlg:
98 binlabels[5] =
"LAr Error Veto-OFF"
101 etaBinWidth = [
None] * len(partList)
102 for i
in range(0,len(partList)):
103 etaBinWidth[i] = (maxEta[i] - minEta[i]) / etaBins[i]
105 if caloBaselineMonAlg.pedestalMon_BCIDmin > 0:
108 doPedestalMon =
False
109 if caloBaselineMonAlg.bcidtoolMon_BCIDmax > 0:
112 doBcidtoolMon =
False
114 baselineGroup = helper.addGroup(
117 '/CaloMonitoring/'+GroupName+
'/'
120 gen_hist_path=
'General/'
122 from CaloMonitoring.CaloMonAlgBase
import CaloBaseHistConfig
123 CaloBaseHistConfig(baselineGroup,gen_hist_path,binlabels)
128 baselineGroup.defineHistogram(
'BCID;h1BCID_pedestalMon',
129 title=
'BCID used for baseline monitoring;BCID;Nb of events / BCID',
130 type=
'TH1I', path=gen_hist_path,
131 xbins=BCID0_nbins+1, xmin=-0.5, xmax=BCID0_nbins+0.5)
133 baselineGroup.defineHistogram(
'BCID;h1BCID_BCIDToolMon',
134 title=
'BCID used for BCIDTool monitoring;BCID;Nb of events / BCID',
135 type=
'TH1I', path=gen_hist_path,
136 xbins=BCID0_nbins+1, xmin=-0.5, xmax=BCID0_nbins+0.5)
138 part_hist_path=
'AllCalo'+tmp_CaloBaselineMon[
"TriggerChain"]+
'/'
140 for part
in partList:
142 str_auxTitle =
" Empty BCID > "+str(tmp_CaloBaselineMon[
"pedestalMon_BCIDmin"])+
"BCID away from last train"
144 baselineGroup.defineHistogram(
'pedEta_'+part+
',sumPedEta_'+part+
';hprof1d_pedestalMon_'+part+
'_AllEta',
145 title=
'Pedestal baseline ( '+str_auxTitle+
');Eta;E_T/(#Delta#eta.#Delta#phi.#mu)[MeV]',
146 type=
'TProfile', path=part_hist_path,
147 xbins=etaBins[idx], xmin=minEta[idx], xmax=maxEta[idx])
149 baselineGroup.defineHistogram(
'LB_'+part+
',sumPedEta_'+part+
';hprof1d_pedestalMon_'+part+
'_LB',
150 title=
'Pedestal baseline ( '+str_auxTitle+
');Luminosity block;E_T/(#Delta#eta.#Delta#phi.#mu)[MeV]',
151 type=
'TProfile', path=part_hist_path,
152 xbins=LB_nbins, xmin=0, xmax=LB_nbins)
154 str_auxTitle =
" BCID in bunch train "
155 baselineGroup.defineHistogram(
'bcidEta_'+part+
',sumBCIDEta_'+part+
';hprof1d_bcidtoolMon_'+part+
'_AllEta',
156 title=
'BCIDTool baseline ( '+str_auxTitle+
');Eta;E_T/(#Delta#eta.#Delta#phi.#mu)[MeV]',
157 type=
'TProfile', path=part_hist_path,
158 xbins=etaBins[idx], xmin=minEta[idx], xmax=maxEta[idx])
160 baselineGroup.defineHistogram(
'LB_'+part+
',sumBCIDEta_'+part+
';hprof1d_bcidtoolMon_'+part+
'_LB',
161 title=
'BCIDTool baseline ( '+str_auxTitle+
');Luminosity block;E_T/(#Delta#eta.#Delta#phi.#mu)[MeV]',
162 type=
'TProfile', path=part_hist_path,
163 xbins=LB_nbins, xmin=0, xmax=LB_nbins)
165 part_hist_path=
'/CaloMonitoring/'+GroupName+
'/AllCalo'+tmp_CaloBaselineMon[
"TriggerChain"]+
'/'
167 for part
in partList:
168 darray = helper.addArray([etaBins[idx]],caloBaselineMonAlg,part)
170 str_auxTitle =
" Empty BCID > "+str(tmp_CaloBaselineMon[
"pedestalMon_BCIDmin"])+
"BCID away from last train"
172 darray.defineHistogram(
'etaBCID_'+part+
',sumPedEta_'+part+
';hprof_pedestalMon_'+part,
173 title=
'Pedestal baseline ( '+str_auxTitle+
');Luminosity block;E_T/(#Delta#eta.#Delta#phi.#mu)[MeV]',
174 type=
'TProfile', path=part_hist_path,
175 xbins=BCID0_nbins+1, xmin=-0.5, xmax=BCID0_nbins+0.5)
177 str_auxTitle =
" BCID in bunch train "
179 darray.defineHistogram(
'etaBCID_'+part+
',sumBCIDEta_'+part+
';hprof_bcidtoolMon_'+part,
180 title=
'BCIDTool baseline ( '+str_auxTitle+
');Luminosity block;E_T/(#Delta#eta.#Delta#phi.#mu)[MeV]',
181 type=
'TProfile', path=part_hist_path,
182 xbins=BCID0_nbins+1, xmin=-0.5, xmax=BCID0_nbins+0.5)
187 cfg.merge(helper.result())