5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from AthenaMonitoring.DQConfigFlags
import DQDataType
12 _get_monitoring_mode_success =
False
19 monitored_mumu_list = []
20 monitored_mumux_list = []
21 monitored_elel_list = []
23 __acceptable_keys_list=[
'useMonGroups']
26 basePath =
'HLT/BphysMon'
31 from AthenaCommon.Logging
import logging
32 self.
__logger = logging.getLogger(
'TrigBphysMonAlgBuilder' )
35 for key,value
in kwargs.items():
37 setattr(self,key,value)
42 self.
__logger.
info(
"TrigBphysMonToolBuilder.configureMode()")
45 self.
__logger.warning(
"Error getting monitoring mode, default monitoring lists will be used.")
58 class TrigBphysInfo(
object):
68 return True if self.chain().startswith(
'L1')
else False
71 if "_bBmumu_" in self.chain()
or "_bDimu_" in self.chain()
or "_bJpsimumu_" in self.chain()
or "_bUpsimumu_" in self.chain() :
73 elif "_bBmumux_" in self.chain() :
75 elif "_bBee" in self.chain() :
80 def getTopoVariant(self):
81 splits = self.chain().
split(
"_")
82 for i
in range(len(splits)) :
83 if splits[i] ==
"bBmumux" :
87 return TrigBphysInfo(trigger)
92 self.
__logger.
info(
"TrigBphysMonToolBuilder.get_monitoring_mode()")
98 elif self.
data_type is DQDataType.Collisions:
101 elif self.
data_type is DQDataType.HeavyIon:
104 elif self.
data_type is DQDataType.Cosmics:
113 self.
__logger.
info(
"TrigBphysMonToolBuilder.setProperties()")
121 self.
__logger.
info(
" We run on MC, don't care about streams")
128 from TrigConfigSvc.TriggerConfigAccess
import getHLTMonitoringAccess
130 monitoring_bphys=moniAccess.monitoredChains(signatures=
"bphysMon",monLevels=[
"shifter",
"t0",
"val"])
134 self.
__logger.warning(
' No chains found in bphysMon groups')
135 if (
not self.
useMonGroups)
or (len(monitoring_bphys) == 0) :
138 'HLT_2mu4_bDimu_L12MU3V',
139 'HLT_2mu4_bJpsimumu_L12MU3V',
141 'HLT_2mu4_bBmumux_BpmumuKp_L12MU3V',
142 'HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V',
143 'HLT_2mu4_bBmumux_BdmumuKst_L12MU3V',
145 'HLT_2e5_lhvloose_bBeeM6000_L1BKeePrimary',
146 'HLT_e5_lhvloose_bBeeM6000_L1BKeePrimary',
149 for chain
in monitoring_bphys :
151 if info.getTopo() ==
"MuMu" :
153 elif info.getTopo() ==
"MuMuX" :
155 elif info.getTopo() ==
"ElEl" :
165 'HLT_DiElecPrecisionGSF',
166 'HLT_NoMuonDiElecPrecisionGSF',
175 if self.
helper.flags.Common.doExpressProcessing :
177 self.
__logger.
info(
" Processing Express stream, will enable requireExplicitESDecision")
180 self.
__logger.
info(
" Processing a normal stream, won't check ES decision")
187 self.
__logger.
info(
"TrigBphysMonToolBuilder.configureMonitor()")
188 self.
bphysMonAlg = self.
helper.addAlgorithm( CompFactory.TrigBphysMonitorAlgorithm,
"TrigBphysMonAlg" )
197 from TrkConfig.AtlasExtrapolatorConfig
import AtlasExtrapolatorCfg
199 acc.addPublicTool(AtlasExtrapolator)
201 from InDetConfig.InDetConversionFinderToolsConfig
import BPHY_VertexPointEstimatorCfg
202 self.
bphysMonAlg.VertexPointEstimator = acc.popToolsAndMerge(
205 from TrkConfig.TrkVKalVrtFitterConfig
import BPHY_TrkVKalVrtFitterCfg
206 self.
bphysMonAlg.VertexFitter = acc.popToolsAndMerge(
209 from TrkConfig.TrkVertexAnalysisUtilsConfig
import V0ToolsCfg
222 self.
__logger.
info(
"TrigBphysMonToolBuilder.configureHistograms()")
235 monGroupName =
'Container_'+container
236 monGroupPath =
'Containers/'+container
242 monGroup.defineHistogram(
'ncandidates',title=
'Number of Bphys candidates;number of candidates;Entries',
243 xbins=10,xmin=-0.5,xmax=9.5)
245 monGroup.defineHistogram(
'bphys_mass',title=
'Bphys object mass;m [GeV];Events / (0.1 GeV)',
246 xbins=150,xmin=0.0,xmax=15.0)
251 for chain
in fullChainList :
252 monGroupName =
'Chain_'+chain
253 monGroupPath =
'Chains/'+chain
274 for chain
in fullOfflDimuList :
275 monGroupName =
'OfflineDimu_'+chain
276 monGroupPath =
'OfflineDimu/'+chain
287 currentMonGroup.defineHistogram(
'ncandidates',title=
'Number of Bphys candidates;number of candidates;Entries',
288 xbins=10,xmin=-0.5,xmax=9.5)
293 if objStr ==
'dimu' :
295 objSign =
'#mu^{+}#mu^{-}'
299 elif objStr ==
'diel' :
300 objTitle =
'Dielectron'
301 objSign =
'e^{+}e^{-}'
302 currentMonGroup.defineHistogram(objStr+
'_mass',title=f
'{objTitle} mass;m({objSign}) [GeV];Events / (0.1 GeV)',
303 xbins=150,xmin=0.0,xmax=15.0)
304 currentMonGroup.defineHistogram(objStr+
'_fitmass',title=f
'{objTitle} fitted mass;m({objSign}) [GeV];Events / (0.1 GeV)',
305 xbins=150,xmin=0.0,xmax=15.0)
306 currentMonGroup.defineHistogram(objStr+
'_pt',title=f
'{objTitle} transverse momentum;p_{{T}}({objSign}) [GeV];Events / (1 GeV)',
307 xbins=80,xmin=0.0,xmax=80.0)
308 currentMonGroup.defineHistogram(objStr+
'_y',title=f
'{objTitle} rapidity;y({objSign}) [GeV];Events / (0.1)',
309 xbins=50,xmin=-2.5,xmax=2.5)
310 currentMonGroup.defineHistogram(objStr+
'_chi2',title=f
'{objTitle} #chi^{{2}};#chi^{{2}}({objSign});Events / (0.5)',
311 xbins=80,xmin=0.0,xmax=40.0)
312 if objStr ==
'dimu' or objStr ==
'diel' :
313 currentMonGroup.defineHistogram(objStr+
'_dR',title=f
'{objTitle} dR;dR({objSign});Events / (0.01)',
314 xbins=100,xmin=0.0,xmax=1.0)
315 currentMonGroup.defineHistogram(objStr+
'_deta',title=f
'{objTitle} d#eta;d#eta({objSign});Events / (0.01)',
316 xbins=100,xmin=0.0,xmax=1.0)
317 currentMonGroup.defineHistogram(objStr+
'_dphi',title=f
'{objTitle} dEphi;d#phi({objSign});Events / (0.04)',
318 xbins=80,xmin=0.0,xmax=3.2)
320 currentMonGroup.defineHistogram(objStr+
'_Lxy',title=f
'{objTitle} Lxy;L_{{xy}}({objSign}) [mm];Events / (0.2 mm)',
321 xbins=125,xmin=-5.,xmax=20.0)
322 currentMonGroup.defineHistogram(objStr+
'_LxySig',title=f
'{objTitle} Lxy significance;L_{{xy}}/#sigma(L_{{xy}})({objSign});Events / (0.5)',
323 xbins=90,xmin=-5,xmax=40.)
331 elif lepStr ==
'el' :
335 self.
__logger.warning(
"TrigBphysMonToolBuilder.bookLeptonHists(): wrong lepStr passed: %s, while el or mu expected; won't book anything", lepStr)
337 currentMonGroup.defineHistogram(lepStr+
'1_pt',title=f
'{lepTitle}1 transverse momentum;p_{{T}}({lepSign}) [GeV];Events / (1 GeV)',
338 xbins=40,xmin=0.0,xmax=40.0)
339 currentMonGroup.defineHistogram(lepStr+
'1_eta',title=f
'{lepTitle}1 pseudorapidity;#eta({lepSign});Events / (0.1)',
340 xbins=54,xmin=-2.7,xmax=2.7)
341 currentMonGroup.defineHistogram(lepStr+
'1_d0',title=f
'{lepTitle}1 d0;d_{{0}}({lepSign});Events / (0.2 mm)',
342 xbins=100,xmin=-10.,xmax=10.)
343 currentMonGroup.defineHistogram(lepStr+
'2_pt',title=f
'{lepTitle}2 transverse momentum;p_{{T}}({lepSign}) [GeV];Events / (1 GeV)',
344 xbins=40,xmin=0.0,xmax=40.0)
345 currentMonGroup.defineHistogram(lepStr+
'2_eta',title=f
'{lepTitle}2 pseudorapidity;#eta({lepSign});Events / (0.1)',
346 xbins=54,xmin=-2.7,xmax=2.7)
347 currentMonGroup.defineHistogram(lepStr+
'2_d0',title=f
'{lepTitle}2 d0;d_{{0}}({lepSign});Events / (0.2 mm)',
348 xbins=100,xmin=-10.,xmax=10.)
351 currentMonGroup.defineHistogram(
'trk_pt',title=
'Track transverse momentum;p_{T}(trk) [GeV];Events / (0.5 GeV)',
352 xbins=40,xmin=0.0,xmax=20.0)
353 currentMonGroup.defineHistogram(
'trk_eta',title=
'Track pseudorapidity;#eta(trk);Events / (0.1)',
354 xbins=54,xmin=-2.7,xmax=2.7)
355 currentMonGroup.defineHistogram(
'trk_d0',title=
'Track d0;d_{0}(trk);Events / (0.2 mm)',
356 xbins=100,xmin=-10.,xmax=10.)