ATLAS Offline Software
Functions
SCTTracksMonAlg Namespace Reference

Functions

def SCTTracksMonAlgConfig (flags)
 

Function Documentation

◆ SCTTracksMonAlgConfig()

def SCTTracksMonAlg.SCTTracksMonAlgConfig (   flags)
Function to configures some algorithms in the monitoring system.

Definition at line 10 of file SCTTracksMonAlg.py.

10 def SCTTracksMonAlgConfig(flags):
11  '''Function to configures some algorithms in the monitoring system.'''
12 
15  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
16  result = ComponentAccumulator()
17 
18  # The following class will make a sequence, configure algorithms, and link
19  # them to GenericMonitoringTools
20  from AthenaMonitoring import AthMonitorCfgHelper
21  helper = AthMonitorCfgHelper(flags, 'SCTTracksMonCfg')
22 
23 
24 
30  from AthenaConfiguration.ComponentFactory import CompFactory
31  from TrkConfig.TrkResidualPullCalculatorConfig import (
32  ResidualPullCalculatorCfg)
33  myMonAlg = helper.addAlgorithm(CompFactory.SCTTracksMonAlg, 'SCTTracksMonAlg',
34  ResPullCalc = result.popToolsAndMerge(
36 
37  from AthenaConfiguration.Enums import BeamType
38  if flags.Beam.Type is BeamType.Collisions:
39  from AthenaMonitoring.FilledBunchFilterToolConfig import FilledBunchFilterToolCfg
40  myMonAlg.FilterTools += [result.popToolsAndMerge(FilledBunchFilterToolCfg(flags))]
41 
42  doTrigger = False
43  if not flags.Input.isMC:
44  if flags.Trigger.doHLT:
45  doTrigger = True
46  myMonAlg.doTrigger = doTrigger
47 
48  # # If for some really obscure reason you need to instantiate an algorithm
49  # # yourself, the AddAlgorithm method will still configure the base
50  # # properties and add the algorithm to the monitoring sequence.
51  # helper.AddAlgorithm(myExistingAlg)
52 
53 
54 
56  myMonAlg.TriggerChain = ''
57  # myMonAlg.RandomHist = True
58 
59  from TrkConfig.TrkTrackSummaryToolConfig import InDetTrackSummaryToolCfg
60  myMonAlg.TrackSummaryTool = result.popToolsAndMerge(InDetTrackSummaryToolCfg(flags))
61 
62 
65 
66  # # Then, add a tool that doesn't have its own configuration function. In
67  # # this example, no accumulator is returned, so no merge is necessary.
68  # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
69  # myMonAlg.MyDomainTool = MyDomainTool()
70 
71  # Add a generic monitoring tool (a "group" in old language). The returned
72  # object here is the standard GenericMonitoringTool.
73  myMonGroup = helper.addGroup(
74  myMonAlg,
75  "SCTTracksMonitor",
76  "SCT/GENERAL/"
77  )
78 
79 
81  regionNames = ["EndCapC", "Barrel", "EndCapA"]
82  N_REGIONS = len(regionNames)
83  s_triggerNames = ["RNDM", "BPTX", "L1CAL", "TGC", "RPC", "MBTS", "COSM", "Calib"]
84  N_TRIGGER_TYPES = len(s_triggerNames)
85  N_HIT_BINS = 50
86  FIRST_HIT_BIN = 0
87  LAST_HIT_BIN = N_HIT_BINS-FIRST_HIT_BIN-1 # This is already defined in SCT_MonitoringNumbers.h
88  myMonGroup.defineHistogram(varname="trk_N", # ; means alias
89  type="TH1F",
90  title="Number of tracks"+";Number of Tracks",
91  path="tracks", # path cannot be "".
92  xbins=400, xmin=0., xmax=4000.)
93  myMonGroup.defineHistogram(varname="trk_chi2", # ; means alias
94  type="TH1F",
95  title="Track #chi^{2} div ndf"+";Number of track #chi^{2}/NDF",
96  path="tracks", # path cannot be "".
97  xbins=150, xmin=0., xmax=150.)
98  myMonGroup.defineHistogram(varname="trk_d0", # ; means alias
99  type="TH1F",
100  title="Track d0"+";d0 [mm]",
101  path="tracks", # path cannot be "".
102  xbins=160, xmin=-40., xmax=40.)
103  myMonGroup.defineHistogram(varname="trk_z0", # ; means alias
104  type="TH1F",
105  title="Track z0"+";z0 [mm]",
106  path="tracks", # path cannot be "".
107  xbins=200, xmin=-200., xmax=200.)
108  myMonGroup.defineHistogram(varname="trk_phi", # ; means alias
109  type="TH1F",
110  title="Track Phi"+";#phi [rad]",
111  path="tracks", # path cannot be "".
112  xbins=160, xmin=-4., xmax=4.)
113  myMonGroup.defineHistogram(varname="trk_pt", # ; means alias
114  type="TH1F",
115  title="Track P_{T}"+";P_{T} [GeV]",
116  path="tracks", # path cannot be "".
117  xbins=150, xmin=0., xmax=150.)
118  myMonGroup.defineHistogram(varname="trk_sct_hits", # ; means alias
119  type="TH1F",
120  title="SCT HITS per single Track"+";Num of Hits",
121  path="tracks", # path cannot be "".
122  xbins=N_HIT_BINS, xmin=FIRST_HIT_BIN, xmax=LAST_HIT_BIN)
123  myMonGroup.defineHistogram(varname="trk_eta", # ; means alias
124  type="TH1F",
125  title="Track Eta"+";#eta",
126  path="tracks", # path cannot be "".
127  xbins=160, xmin=-4., xmax=4.)
128 
129  myMonGroup.defineHistogram(varname="trackTriggers", # ; means alias
130  type="TH1I",
131  title="Tracks for different trigger types",
132  path="tracks", # path cannot be "".
133  xbins=N_TRIGGER_TYPES, xmin=-0.5, xmax=7.5, xlabels=s_triggerNames)
134  myMonGroup.defineHistogram(varname="region"+","+"hitsRegion"+";"+"SCTTrackRate", # ; means alias
135  type="TProfile",
136  title="Track per event for SCT regions",
137  path="tracks", # path cannot be "".
138  xbins=3, xmin=0.0, xmax=3.0, xlabels=regionNames)
139  myMonGroup.defineHistogram(varname="tracksPerRegion", # ; means alias
140  type="TH1F",
141  title="Number of tracks in eta regions",
142  path="tracks", # path cannot be "".
143  xbins=N_REGIONS, xmin=0, xmax=N_REGIONS, xlabels=regionNames)
144 
145 
146  for region in regionNames:
147  myMonGroup.defineHistogram(varname="total"+region+"Residual",
148  title="Overall Residual Distribution for the "+region+";Residual [mm]",
149  type="TH1F", path="tracks",
150  xbins=100, xmin=-0.5, xmax=0.5)
151  myMonGroup.defineHistogram(varname="total"+region+"Pull",
152  title="Overall Pull Distribution for the "+region+";Pull",
153  type="TH1F", path="tracks",
154  xbins=100, xmin=-5, xmax=5)
155 
161 
162  # # Otherwise, merge with result object and return
163  result.merge(helper.result())
164  return result
165 
python.FilledBunchFilterToolConfig.FilledBunchFilterToolCfg
def FilledBunchFilterToolCfg(AthConfigFlags flags)
Definition: FilledBunchFilterToolConfig.py:9
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
SCTTracksMonAlg.SCTTracksMonAlgConfig
def SCTTracksMonAlgConfig(flags)
Definition: SCTTracksMonAlg.py:10
python.TrkTrackSummaryToolConfig.InDetTrackSummaryToolCfg
def InDetTrackSummaryToolCfg(flags, name='InDetTrackSummaryTool', **kwargs)
Definition: TrkTrackSummaryToolConfig.py:22
python.TrkResidualPullCalculatorConfig.ResidualPullCalculatorCfg
def ResidualPullCalculatorCfg(flags, name='ResidualPullCalculator', **kwargs)
Definition: TrkResidualPullCalculatorConfig.py:6