ATLAS Offline Software
Functions
CaloBaselineMonAlg Namespace Reference

Functions

def CaloBaselineMonConfig (flags, isTopLevel=True)
 

Function Documentation

◆ CaloBaselineMonConfig()

def CaloBaselineMonAlg.CaloBaselineMonConfig (   flags,
  isTopLevel = True 
)

Definition at line 7 of file CaloBaselineMonAlg.py.

7 def CaloBaselineMonConfig(flags, isTopLevel=True):
8 
9  from AthenaMonitoring import AthMonitorCfgHelper
10  helper = AthMonitorCfgHelper(flags,'CaloBaselineMonCfg')
11 
12  if not flags.DQ.enableLumiAccess:
13  print('This algo needs Lumi access, returning empty config')
14  if isTopLevel:
15  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
17  cfg.merge(helper.result())
18  return cfg
19  else:
20  return helper.result()
21 
22  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
23  cfg = LArGMCfg(flags)
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))
30 
31  caloBaselineMonAlg = helper.addAlgorithm(CompFactory.CaloBaselineMonAlg,'caloBaselineMonAlg')
32 
33  GroupName="CaloBaseLineMon"
34  caloBaselineMonAlg.MonGroupName = GroupName
35 
36  caloBaselineMonAlg.EnableLumi = True
37 
38  partList = ["EM","HEC+FCal"]
39  caloBaselineMonAlg.partionList = partList
40  etaBins = [16,19]
41  caloBaselineMonAlg.nbOfEtaBins = etaBins
42  minEta = [0.,1.2]
43  caloBaselineMonAlg.minimumEta = minEta
44  maxEta = [3.2,5.]
45  caloBaselineMonAlg.maximumEta = maxEta
46 
47  # config settings based on flags
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
60 
61  # FIXME when trigger stream flag is added:
62  #if rec.triggerStream()=='CosmicCalo':
63  # tmp_CaloBaselineMon["useLArCollisionFilter"] = True
64  # tmp_CaloBaselineMon["pedestalMon_BCIDmin"] = 40
65  # tmp_CaloBaselineMon["TriggerChain"] = "HLT_noalg_cosmiccalo_L1RD1_EMPTY"
66 
67  #if rec.triggerStream()=='ZeroBias':
68  tmp_CaloBaselineMon["bcidtoolMon_BCIDmax"] = 144
69  #tmp_CaloBaselineMon["TriggerChain"] = "HLT_noalg_zb_L1ZB"
70  tmp_CaloBaselineMon["TriggerChain"] = ""
71 
72  from AthenaMonitoring.AtlasReadyFilterConfig import AtlasReadyFilterCfg
73  from AthenaMonitoring.BadLBFilterToolConfig import LArBadLBFilterToolCfg
74 
75  caloBaselineMonAlg.useBadLBTool = tmp_CaloBaselineMon["useBadLBTool"]
76  caloBaselineMonAlg.BadLBTool = cfg.popToolsAndMerge(LArBadLBFilterToolCfg(flags))
77 
78  from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
79  cfg.merge(BunchCrossingCondAlgCfg(flags))
80 
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"
99 
100  # eta bins computation (should be tha same as in C++ code
101  etaBinWidth = [None] * len(partList)
102  for i in range(0,len(partList)):
103  etaBinWidth[i] = (maxEta[i] - minEta[i]) / etaBins[i]
104  # bool to decide which monitoring to do
105  if caloBaselineMonAlg.pedestalMon_BCIDmin > 0:
106  doPedestalMon = True
107  else:
108  doPedestalMon = False
109  if caloBaselineMonAlg.bcidtoolMon_BCIDmax > 0:
110  doBcidtoolMon = True
111  else:
112  doBcidtoolMon = False
113 
114  baselineGroup = helper.addGroup(
115  caloBaselineMonAlg,
116  GroupName,
117  '/CaloMonitoring/'+GroupName+'/'
118  )
119 
120  gen_hist_path='General/'
121 
122  from CaloMonitoring.CaloMonAlgBase import CaloBaseHistConfig
123  CaloBaseHistConfig(baselineGroup,gen_hist_path,binlabels)
124 
125  BCID0_nbins=3563
126  LB_nbins=3000
127 
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)
132 
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)
137 
138  part_hist_path='AllCalo'+tmp_CaloBaselineMon["TriggerChain"]+'/'
139  idx=0
140  for part in partList:
141  if doPedestalMon:
142  str_auxTitle = " Empty BCID > "+str(tmp_CaloBaselineMon["pedestalMon_BCIDmin"])+"BCID away from last train"
143 
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])
148 
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)
153  if doBcidtoolMon:
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])
159 
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)
164 
165  part_hist_path='/CaloMonitoring/'+GroupName+'/AllCalo'+tmp_CaloBaselineMon["TriggerChain"]+'/'
166  idx=0
167  for part in partList:
168  darray = helper.addArray([etaBins[idx]],caloBaselineMonAlg,part)
169  if doPedestalMon:
170  str_auxTitle = " Empty BCID > "+str(tmp_CaloBaselineMon["pedestalMon_BCIDmin"])+"BCID away from last train"
171 
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)
176  if doBcidtoolMon:
177  str_auxTitle = " BCID in bunch train "
178 
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)
183  idx=idx+1
184 
185 
186  #if isTopLevel:
187  cfg.merge(helper.result())
188  return cfg
189  #else:
190  # return helper.result()
191 
192 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
CaloMonAlgBase.CaloBaseHistConfig
def CaloBaseHistConfig(group, histpath, binlabels)
Definition: CaloMonAlgBase.py:5
CaloBaselineMonAlg.CaloBaselineMonConfig
def CaloBaselineMonConfig(flags, isTopLevel=True)
Definition: CaloBaselineMonAlg.py:7
python.BunchCrossingCondAlgConfig.BunchCrossingCondAlgCfg
def BunchCrossingCondAlgCfg(flags)
Definition: BunchCrossingCondAlgConfig.py:8
python.BadLBFilterToolConfig.LArBadLBFilterToolCfg
def LArBadLBFilterToolCfg(inputFlags, origDbTag=None)
Definition: BadLBFilterToolConfig.py:100
python.CaloNoiseCondAlgConfig.CaloNoiseCondAlgCfg
def CaloNoiseCondAlgCfg(flags, noisetype="totalNoise")
Definition: CaloNoiseCondAlgConfig.py:11
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.AtlasReadyFilterConfig.AtlasReadyFilterCfg
def AtlasReadyFilterCfg(flags)
Definition: AtlasReadyFilterConfig.py:10
LArCollisionTimeConfig.LArCollisionTimeCfg
def LArCollisionTimeCfg(configFlags, cutIteration=False)
Definition: LArCollisionTimeConfig.py:8
str
Definition: BTagTrackIpAccessor.cxx:11
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7