ATLAS Offline Software
Loading...
Searching...
No Matches
SCTLorentzMonAlg Namespace Reference

Functions

 SCTLorentzMonAlgConfig (flags)

Detailed Description

@file SCTLorentzMonAlg.py
@author Susumu Oda
@date 2019-04-02
@brief Based on AthenaMonitoring/ExampleMonitorAlgorithm.py

Function Documentation

◆ SCTLorentzMonAlgConfig()

SCTLorentzMonAlg.SCTLorentzMonAlgConfig ( flags)

Definition at line 11 of file SCTLorentzMonAlg.py.

11def SCTLorentzMonAlgConfig(flags):
12
13
16 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
17 result = ComponentAccumulator()
18
19 # The following class will make a sequence, configure algorithms, and link
20 # them to GenericMonitoringTools
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 # # If for some really obscure reason you need to instantiate an algorithm
47 # # yourself, the AddAlgorithm method will still configure the base
48 # # properties and add the algorithm to the monitoring sequence.
49 # helper.AddAlgorithm(myExistingAlg)
50
51
52
54 myMonAlg.TriggerChain = ''
55 # myMonAlg.RandomHist = True
56
57
60
61
62 # set up conditions
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 # # Then, add a tool that doesn't have its own configuration function. In
70 # # this example, no accumulator is returned, so no merge is necessary.
71 # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
72 # myMonAlg.MyDomainTool = MyDomainTool()
73
74 # Add a generic monitoring tool (a "group" in old language). The returned
75 # object here is the standard GenericMonitoringTool.
76 myMonGroup = helper.addGroup(
77 myMonAlg,
78 "SCTLorentzMonitor",
79 "SCT/GENERAL/"
80 )
81
82
84 N_BARRELS = 4
85 nSides = 2 # 0: Side 0, 1: Side 1
86 nSurfaces = 2 # 0: 100, 1: 111
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, # ; means alias
99 type="TProfile",
100 title=histTitle+";#phi to Wafer;Num of Strips",
101 path="lorentz", # path cannot be "".
102 xbins=360, xmin=-90., xmax=90.)
103
104 myMonGroup.defineHistogram(varname=xVar+","+yVar+";"+histName + "_e0p5", # ; means alias
105 type="TProfile",
106 title=histTitle+"(|#eta| < 0.5);#phi to Wafer;Num of Strips",
107 path="lorentz", # path cannot be "".
108 xbins=360, xmin=-90., xmax=90.,
109 cutmask="isCentral")
110 nEndcaps = 2
111 nDisks = 9
112 nSides = 2 # 0: Side 0, 1: Side 1
113 nEta = 3 # outer, middle, inner
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, # ; means alias
136 type="TProfile",
137 title=histTitle+";#phi to Wafer;Num of Strips",
138 path="lorentz", # path cannot be "".
139 xbins=360, xmin=-90., xmax=90.)
140
141
147
148 # # Otherwise, merge with result object and return
149 result.merge(helper.result())
150 return result
151