ATLAS Offline Software
PixelMonitoringConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 #
4 from AthenaConfiguration.Enums import BeamType
5 
7  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9  forceOnline = False # for testing of online monitoring and 100LB histograms
10  doHitMonAlg = True
11  doClusterMonAlg = True
12  doErrorMonAlg = True
13  doMVAMonAlg = True #allowed only if online, see below
14 
15  # run on RAW only
16  if flags.DQ.Environment in ('online', 'tier0', 'tier0Raw'):
17  if forceOnline:
18  isOnline = True
19  else:
20  isOnline = flags.Common.isOnline
21  if not isOnline: doMVAMonAlg=False
22  kwargsHitMonAlg = { 'doOnline' : isOnline, #Histograms for online (GlobalMonitoring) running
23  'doLumiBlock' : not isOnline, #Turn on/off histograms stored every 1(20) lumi block(s)
24  'doFEPlots' : True, #Turn on/off per FE-I3 histograms
25  'RDOName' : 'PixelRDOs',
26  }
27 
28  kwargsClusMonAlg = { 'doOnline' : isOnline, #Histograms for online (GlobalMonitoring) running
29  'doLumiBlock' : not isOnline, #Turn on/off histograms stored every 1(20) lumi block(s)
30  'doLowOccupancy' : flags.Beam.Type is BeamType.Cosmics, #Setting up 1D histogram ranges and binnings, if False, high occupancy i.e. collisions settings will be used
31  'doHeavyIonMon' : flags.Reco.EnableHI, #Setting up 1D histogram ranges and binnings for heavy ions
32  'doFEPlots' : True, #Turn on/off per FE-I3 histograms
33  'ClusterName' : 'PixelClusters',
34  'TrackName' : 'CombinedInDetTracks',
35  }
36 
37  kwargsErrMonAlg = { 'doOnline' : isOnline, #Histograms for online (GlobalMonitoring) running
38  'doLumiBlock' : not isOnline #Turn on/off histograms stored every 1(20) lumi block(s)
39  }
40 
41  kwargsMVAMonAlg = { 'calibFolder' : '20220503',
42  'RDOName' : 'PixelRDOs',
43  'ClusterName' : 'PixelClusters',
44  'TrackParticleContainerName' : 'InDetTrackParticles',
45  }
46 
47  if doHitMonAlg or doClusterMonAlg or doErrorMonAlg or doMVAMonAlg:
48  from PixelConditionsAlgorithms.PixelConditionsConfig import PixelDetectorElementStatusAlgActiveOnlyCfg
50 
51  from AthenaMonitoring import AthMonitorCfgHelper
52  helper = AthMonitorCfgHelper(flags, "NewPixelMonitoring")
53 
54  from AthenaConfiguration.ComponentFactory import CompFactory
55  from AthenaMonitoring.FilledBunchFilterToolConfig import FilledBunchFilterToolCfg
56 
57  if doHitMonAlg:
58  from PixelMonitoring.PixelAthHitMonAlgCfg import PixelAthHitMonAlgCfg
59  pixelAthHitMonAlg = helper.addAlgorithm(CompFactory.PixelAthHitMonAlg, 'PixelAthHitMonAlg', addFilterTools = [FilledBunchFilterToolCfg(flags)])
60  kwargsHitMonAlg.setdefault( 'PixelDetElStatus', 'PixelDetectorElementStatus' )
61  kwargsHitMonAlg.setdefault( 'PixelDetElStatusActiveOnly', 'PixelDetectorElementStatusActiveOnly')
62  for k, v in kwargsHitMonAlg.items():
63  setattr(pixelAthHitMonAlg, k, v)
64  PixelAthHitMonAlgCfg(helper, pixelAthHitMonAlg, **kwargsHitMonAlg)
65 
66  if doClusterMonAlg:
67  from PixelMonitoring.PixelAthClusterMonAlgCfg import PixelAthClusterMonAlgCfg
68  pixelAthClusterMonAlg = helper.addAlgorithm(CompFactory.PixelAthClusterMonAlg, 'PixelAthClusterMonAlg', addFilterTools = [FilledBunchFilterToolCfg(flags)])
69  kwargsClusMonAlg.setdefault( 'PixelDetElStatus', 'PixelDetectorElementStatus' )
70  kwargsClusMonAlg.setdefault( 'PixelDetElStatusActiveOnly', 'PixelDetectorElementStatusActiveOnly')
71  for k, v in kwargsClusMonAlg.items():
72  setattr(pixelAthClusterMonAlg, k, v)
73 
74  from InDetConfig.InDetTrackSelectionToolConfig import InDetTrackSelectionTool_TightPrimary_TrackTools_Cfg
75  TrackSelectionTool = acc.popToolsAndMerge(
77  flags, maxNPixelHoles = 2)) # Default for TightPrimary is 0
78  if flags.Beam.Type is not BeamType.Cosmics:
79  TrackSelectionTool.maxD0 = 2
80  TrackSelectionTool.maxZ0 = 150
81 
82  pixelAthClusterMonAlg.TrackSelectionTool = TrackSelectionTool
83 
84  from InDetConfig.InDetTrackHoleSearchConfig import (
85  InDetTrackHoleSearchToolCfg)
86  pixelAthClusterMonAlg.HoleSearchTool = acc.popToolsAndMerge(
88 
89  from InDetConfig.InDetTestPixelLayerConfig import InDetTestPixelLayerToolInnerCfg
90  pixelAthClusterMonAlg.TestPixelLayerTool = acc.popToolsAndMerge (InDetTestPixelLayerToolInnerCfg (flags,'TestPixelLayerTool'))
91 
92  PixelAthClusterMonAlgCfg(helper, pixelAthClusterMonAlg, **kwargsClusMonAlg)
93 
94  if doErrorMonAlg:
95  from PixelMonitoring.PixelAthErrorMonAlgCfg import PixelAthErrorMonAlgCfg
96  pixelAthMonAlgErrorMonAlg = helper.addAlgorithm(CompFactory.PixelAthErrorMonAlg, 'PixelAthErrorMonAlg', addFilterTools = [FilledBunchFilterToolCfg(flags)])
97  kwargsErrMonAlg.setdefault( 'PixelDetElStatusActiveOnly', 'PixelDetectorElementStatusActiveOnly')
98  kwargsErrMonAlg.setdefault( 'PixelByteStreamErrs', 'PixelByteStreamErrs')
99  kwargsErrMonAlg.setdefault( 'UseByteStreamFEI4', not flags.Input.isMC)
100  kwargsErrMonAlg.setdefault( 'UseByteStreamFEI3', not flags.Input.isMC)
101  kwargsErrMonAlg.setdefault( 'UseByteStreamRD53', False)
102  for k, v in kwargsErrMonAlg.items():
103  setattr(pixelAthMonAlgErrorMonAlg, k, v)
104  PixelAthErrorMonAlgCfg(helper, pixelAthMonAlgErrorMonAlg, **kwargsErrMonAlg)
105 
106  if doMVAMonAlg:
107  from PixelMonitoring.PixelAthMVAMonAlgCfg import PixelAthMVAMonAlgCfg
108  pixelAthMVAMonAlg = helper.addAlgorithm(CompFactory.PixelAthMVAMonAlg, 'PixelAthMVAMonAlg', addFilterTools = [FilledBunchFilterToolCfg(flags)])
109  kwargsMVAMonAlg.setdefault( 'PixelDetElStatus', 'PixelDetectorElementStatus' )
110  kwargsMVAMonAlg.setdefault( 'PixelDetElStatusActiveOnly', 'PixelDetectorElementStatusActiveOnly')
111  for k, v in kwargsMVAMonAlg.items():
112  setattr(pixelAthMVAMonAlg, k, v)
113 
114  from InDetConfig.InDetTrackSelectionToolConfig import InDetTrackSelectionTool_TightPrimary_TrackTools_Cfg
115  TrackSelectionTool = acc.popToolsAndMerge(
117  maxNPixelHoles
118 = 1)) # Default for TightPrimary is 0
119  if flags.Beam.Type is not BeamType.Cosmics:
120  TrackSelectionTool.maxD0 = 2
121  TrackSelectionTool.maxZ0 = 150
122 
123  from InDetConfig.InDetTrackHoleSearchConfig import InDetTrackHoleSearchToolCfg
124  pixelAthMVAMonAlg.TrackSelectionTool = TrackSelectionTool
125  pixelAthMVAMonAlg.HoleSearchTool = acc.popToolsAndMerge(InDetTrackHoleSearchToolCfg(flags))
126  from TrkConfig.AtlasExtrapolatorConfig import InDetExtrapolatorCfg
127  pixelAthMVAMonAlg.Extrapolator = acc.popToolsAndMerge(InDetExtrapolatorCfg(flags))
128  PixelAthMVAMonAlgCfg(helper, pixelAthMVAMonAlg, **kwargsMVAMonAlg)
129 
130  acc.merge(helper.result())
131 
132  return acc
133 
PixelAthMVAMonAlgCfg
Definition: PixelAthMVAMonAlgCfg.py:1
python.FilledBunchFilterToolConfig.FilledBunchFilterToolCfg
def FilledBunchFilterToolCfg(AthConfigFlags flags)
Definition: FilledBunchFilterToolConfig.py:9
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.InDetTrackSelectionToolConfig.InDetTrackSelectionTool_TightPrimary_TrackTools_Cfg
def InDetTrackSelectionTool_TightPrimary_TrackTools_Cfg(flags, name="InDetTrackSelectionTool_TightPrimary", **kwargs)
Definition: InDetTrackSelectionToolConfig.py:78
PixelMonitoringConfig.PixelMonitoringConfig
def PixelMonitoringConfig(flags)
Definition: PixelMonitoringConfig.py:6
PixelAthHitMonAlgCfg
Definition: PixelAthHitMonAlgCfg.py:1
PixelConditionsConfig.PixelDetectorElementStatusAlgActiveOnlyCfg
def PixelDetectorElementStatusAlgActiveOnlyCfg(flags, name="PixelDetectorElementStatusAlgActiveOnly", **kwargs)
Definition: PixelConditionsConfig.py:405
PixelAthErrorMonAlgCfg
Definition: PixelAthErrorMonAlgCfg.py:1
PixelAthClusterMonAlgCfg
Definition: PixelAthClusterMonAlgCfg.py:1
python.InDetTrackHoleSearchConfig.InDetTrackHoleSearchToolCfg
def InDetTrackHoleSearchToolCfg(flags, name='InDetHoleSearchTool', **kwargs)
Definition: InDetTrackHoleSearchConfig.py:8
python.AtlasExtrapolatorConfig.InDetExtrapolatorCfg
def InDetExtrapolatorCfg(flags, name='InDetExtrapolator', **kwargs)
Definition: AtlasExtrapolatorConfig.py:315