8 '''Function to configure LVL1 PPM Sim algorithm in the monitoring system.'''
12 from AthenaConfiguration.ComponentFactory
import CompFactory
13 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
17 from AthenaMonitoring
import AthMonitorCfgHelper
18 helper = AthMonitorCfgHelper(flags,
'PPMSimBSMonitoringCfg')
21 PPMSimBSMonAlg = helper.addAlgorithm(CompFactory.PPMSimBSMonitorAlgorithm,
'PPMSimBSMonAlg')
24 from DetDescrCnvSvc.DetDescrCnvSvcConfig
import DetDescrCnvSvcCfg
27 from TrigT1CaloCondSvc.L1CaloCondConfig
import L1CaloCondAlgCfg
30 from TrigConfxAOD.TrigConfxAODConfig
import getxAODConfigSvc
34 groupName =
'PPMSimBSMonitor'
35 PPMSimBSMonAlg.PackageName = groupName
42 etabins = [-4.9,-4.475,-4.050,-3.625,-3.2,-3.1,-2.9,
43 -2.7,-2.5,-2.4,-2.3,-2.2,-2.1,-2.0,-1.9,
44 -1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,
45 -1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,
46 -0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,
47 0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,
48 1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.7,2.9,
49 3.1,3.2,3.625,4.050,4.475,4.9]
58 trigPath =
"/PPM/Errors/Data_Simulation"
65 group_names = {
"peakf":
"Peakfinder",
"satBcid":
"SaturatedBCID"}
66 mismatch_map= {
"NonZeroMatches":
"Data/Simulation Non-Zero Matches",
"ZeroMatches":
"Data/Simulation Zero Matches",
"DataNoSim":
"Data but no Simulation",
"SimNoData":
"Simulation but no Data"}
70 histPath = trigPath+
'/PPMBcidSim'
71 for names
in group_names:
72 for elem
in mismatch_map:
73 group_bcidsim = helper.addGroup(PPMSimBSMonAlg,
'group_Mismatch_{0}_{1}'.
format(names, elem), mainDir)
74 group_bcidsim.defineHistogram(
'etaTT_2D,phiTT_2D;ppm_2d_etaPhi_tt_'+names+
'_'+elem, title=
'PPM '+group_names[names]+
' ' + mismatch_map[elem], type=
'TH2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phibins, opt=
'kAlwaysCreate')
82 histPath_CP = trigPath+
'/PPMLUTSim'
83 histPath_JEP = trigPath+
'/PPMLUTSim'
84 lut_map = {
"SimEqData":
"Data/Simulation Non-zero Matches",
"SimNeData":
"Data/Simulation Non-zero Mismatches",
"SimNoData":
"Simulation but no Data",
"DataNoSim":
"Data but no Simulation" }
85 group_names_lut = {
"lutCp": [
"CP", histPath_CP],
"lutJep": [
"JEP", histPath_JEP] }
88 for names
in group_names_lut:
90 group_lut_em = helper.addGroup(PPMSimBSMonAlg,
'groupLUT{0}_EM_{1}'.
format(group_names_lut[names][0],elem), mainDir)
91 group_lut_em.defineHistogram(
'etaTT_2D,phiTT_2D;ppm_em_2d_etaPhi_tt_'+names+
'_'+elem, title=
'PPM LUT-'+group_names_lut[names][0]+
' EM ' + lut_map[elem], type=
'TH2D', path=group_names_lut[names][1], xbins=etabins, ybins=phibins, ymin=phimin, ymax=phibins, opt=
'kAlwaysCreate')
94 for names
in group_names_lut:
96 group_lut_had = helper.addGroup(PPMSimBSMonAlg,
'groupLUT{0}_HAD_{1}'.
format(group_names_lut[names][0],elem), mainDir)
97 group_lut_had.defineHistogram(
'etaTT_2D,phiTT_2D;ppm_had_2d_etaPhi_tt_'+names+
'_'+elem, title=
'PPM LUT-'+group_names_lut[names][0]+
' HAD ' + lut_map[elem], type=
'TH2D', path=group_names_lut[names][1], xbins=etabins, ybins=phibins, ymin=phimin, ymax=phibins, opt=
'kAlwaysCreate')
105 nModulesPerCrate = 16
107 histPath = trigPath+
'/MismatchEventNumbers'
109 y = 2 * (nModulesPerCrate + 16 * (nCrates % 2) )
114 crate_map= [
"cr0cr1",
"cr2cr3",
"cr4cr5",
"cr6cr7"]
116 for elem
in crate_map:
118 group_Error= helper.addGroup(PPMSimBSMonAlg,
'group_Error_{}'.
format(elem), mainDir)
119 group_Error.defineHistogram(
'eventMonitor,y_2D;ppm_2d_LUT_MismatchEvents_'+ elem, title=
'PPM LUT Mismatch Event Numbers;Events with Error/Mismatch;Crate/Module', type=
'TH2I', path=histPath,xbins=10,xmin=0, xmax=10, ybins=y, ymin=0, ymax=y,ylabels=yErrorLabels,opt=
'kAlwaysCreate')
123 acc = helper.result()