11def SCTLorentzMonAlgConfig(flags):
12
13
16 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
17 result = ComponentAccumulator()
18
19
20
21 from AthenaMonitoring import AthMonitorCfgHelper
22 helper = AthMonitorCfgHelper(flags, 'SCTLorentzMonCfg')
23
24
25
31 from AthenaConfiguration.ComponentFactory import CompFactory
32 from InDetConfig.InDetAssociationToolsConfig import InDetPRDtoTrackMapToolGangedPixelsCfg
33 from InDetConfig.InDetTrackHoleSearchConfig import InDetTrackHoleSearchToolCfg
34 from TrkConfig.TrkTrackSummaryToolConfig import InDetTrackSummaryToolCfg
35
36 myMonAlg = helper.addAlgorithm(
37 CompFactory.SCTLorentzMonAlg,
38 'SCTLorentzMonAlg',
39 HoleSearch = result.popToolsAndMerge(
40 InDetTrackHoleSearchToolCfg(flags)),
41 AssociationTool = result.popToolsAndMerge(
42 InDetPRDtoTrackMapToolGangedPixelsCfg(flags)),
43 TrackSummaryTool = result.popToolsAndMerge(
44 InDetTrackSummaryToolCfg(flags)))
45
46
47
48
49
50
51
52
54 myMonAlg.TriggerChain = ''
55
56
57
60
61
62
63 from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConfig import SCT_DetectorElementCondAlgCfg
64 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
65
66 result.merge(SCT_DetectorElementCondAlgCfg(flags))
67 result.merge(BeamSpotCondAlgCfg(flags))
68
69
70
71
72
73
74
75
76 myMonGroup = helper.addGroup(
77 myMonAlg,
78 "SCTLorentzMonitor",
79 "SCT/GENERAL/"
80 )
81
82
84 N_BARRELS = 4
85 nSides = 2
86 nSurfaces = 2
87 surfaceNames = ["_100", "_111"]
88 surfaceNames2 = ["_100_", "_111_"]
89 surfaceTitles = ["100 - ", "111 - "]
90 sideNames = ["_0", "_1"]
91 for l in range(N_BARRELS):
92 for iSurface in range(nSurfaces):
93 for side in range(nSides):
94 xVar =
"phiToWafer_"+
str(l)+surfaceNames[iSurface]+sideNames[side]
95 yVar =
"nStrip_"+
str(l)+surfaceNames[iSurface]+sideNames[side]
96 histTitle = surfaceTitles[iSurface]+
"Inc. Angle vs nStrips for Layer Side"+
str(l)+
str(side)
97 histName =
"h_phiVsNstrips"+surfaceNames2[iSurface]+
str(l)+
"Side"+
str(side)
98 myMonGroup.defineHistogram(varname=xVar+","+yVar+";"+histName,
99 type="TProfile",
100 title=histTitle+";#phi to Wafer;Num of Strips",
101 path="lorentz",
102 xbins=360, xmin=-90., xmax=90.)
103
104 myMonGroup.defineHistogram(varname=xVar+","+yVar+";"+histName + "_e0p5",
105 type="TProfile",
106 title=histTitle+"(|#eta| < 0.5);#phi to Wafer;Num of Strips",
107 path="lorentz",
108 xbins=360, xmin=-90., xmax=90.,
109 cutmask="isCentral")
110 nEndcaps = 2
111 nDisks = 9
112 nSides = 2
113 nEta = 3
114 endcapNames = ["ECA", "ECC"]
115 etaNames = ["outer", "middle", "inner"]
116 sideNames = ["_0", "_1"]
117 for e in range(nEndcaps):
118 for d in range(nDisks):
119 for iEta in range(nEta):
120 sensorType = "HPK"
121 if ((d == 1 and iEta == 1) or
122 (d == 3 and iEta == 1) or
123 (d == 4 and iEta >= 1) or
124 (d == 5 and iEta == 2) or
125 (d == 7 and iEta == 1)):
126 sensorType = "CiS"
127 elif (d == 2 and iEta == 1):
128 sensorType = "Both"
129
130 for side in range(nSides):
131 xVar =
"phiToWafer_"+endcapNames[e]+
str(d)+
"_"+etaNames[iEta]+sideNames[side]
132 yVar =
"nStrip_"+endcapNames[e]+
str(d)+
"_"+etaNames[iEta]+sideNames[side]
133 histTitle =
"111 (" + sensorType +
") - Inc. Angle vs nStrips for " + endcapNames[e] +
" Disk Eta Side"+
str(d)+
str(iEta)+
str(side)
134 histName =
"h_phiVsNstrips_"+endcapNames[e]+
str(d)+
"_"+etaNames[iEta]+
"_Side"+
str(side)
135 myMonGroup.defineHistogram(varname=xVar+","+yVar+";"+histName,
136 type="TProfile",
137 title=histTitle+";#phi to Wafer;Num of Strips",
138 path="lorentz",
139 xbins=360, xmin=-90., xmax=90.)
140
141
147
148
149 result.merge(helper.result())
150 return result
151