ATLAS Offline Software
Functions | Variables
TrigSPTRKMonitoringMT Namespace Reference

Functions

def TrigSPTRK (configFlags, highGranularity=False)
 

Variables

 log
 
 flags
 
 Environment
 
 NumConcurrentEvents
 
 HISTFileName
 
 cfg
 
 highGranularity
 
 withDetails
 

Function Documentation

◆ TrigSPTRK()

def TrigSPTRKMonitoringMT.TrigSPTRK (   configFlags,
  highGranularity = False 
)

Definition at line 16 of file TrigSPTRKMonitoringMT.py.

16 def TrigSPTRK(configFlags, highGranularity=False):
17 
18  from AthenaMonitoring import AthMonitorCfgHelper
19 
20  monConfig = AthMonitorCfgHelper(configFlags, "HLTMBSPTRKMonAlg")
21 
22  from AthenaConfiguration.ComponentFactory import CompFactory
23 
24  alg = monConfig.addAlgorithm(CompFactory.HLTMinBiasTrkMonAlg, "HLTMBSPTRKMonAlg")
25 
26  from InDetConfig.InDetTrackSelectionToolConfig import InDetTrackSelectionTool_LoosePrimary_Cfg
27  trkSel = monConfig.resobj.popToolsAndMerge(InDetTrackSelectionTool_LoosePrimary_Cfg(configFlags))
28  alg.TrackSelectionTool = trkSel
29 
30  ZFinderCollection = 'HLT_vtx_z'
31  if ZFinderCollection in configFlags.Input.Collections:
32  log.info("Enabled z finder data reading")
33  alg.zFinderDataKey = ZFinderCollection
34 
35  from TrigConfigSvc.TriggerConfigAccess import getHLTMonitoringAccess
36  monAccess = getHLTMonitoringAccess(configFlags)
37 
38  spChains = getMinBiasChains(monAccess, '(pix|hmt)')
39  spTrkChains = getMinBiasChains(monAccess, '(sptrk|excl|hmt|_mb_sp_)')
40 
41  log.info(f'Monitoring {len(spChains)} SpacePoints chains')
42  log.debug([name for name, _ in spChains])
43  log.info(f'Monitoring {len(spTrkChains)} Tracking chains')
44  log.debug([name for name, _ in spTrkChains])
45 
46  alg.triggerListTrackingMon = [name for name, _ in spTrkChains]
47  alg.triggerListSpacePointsMon = [name for name, _ in spChains]
48 
49  # Set track and cluster multiplicity histograms binning
50  nbins = 400 if highGranularity else 50
51  nTrkMax = 400
52  nSctCl = 5000
53  nPixBar = 2000
54  nPixEC = 500
55 
56  for chain, group in spChains:
57  mbSpGroup = monConfig.addGroup(alg, f'{chain}_SpacePoints', topPath=f"HLT/MinBiasMon/{group}/SpacePoints/{chain}/")
58 
59  mbSpGroup.defineHistogram("PixelCL;PixelCLNarrowRange", title="Number of SP in whole Pixels detector for all events", xbins=100, xmin=0, xmax=100)
60  mbSpGroup.defineHistogram("PixelCL;PixelCLWideRange", title="Number of SP in whole Pixels detector for all events", xbins=250, xmin=0, xmax=nPixBar)
61  mbSpGroup.defineHistogram("PixBarr_SP", title="Number of SP for all events in Barrel", xbins=250, xmin=0, xmax=nPixBar)
62  mbSpGroup.defineHistogram("PixECA_SP", title="Number of SP for all events in ECA", xbins=250, xmin=0, xmax=nPixEC)
63  mbSpGroup.defineHistogram("PixECC_SP", title="Number of SP for all events in ECC", xbins=250, xmin=0, xmax=nPixEC)
64  mbSpGroup.defineHistogram("SctTot;SctTotNarrowRange", title="Number of SP in whole SCT detector for all events", xbins=100, xmin=0, xmax=100)
65  mbSpGroup.defineHistogram("SctTot;SctTotWideRange", title="Number of SP in whole SCT detector for all events", xbins=250, xmin=0, xmax=nSctCl)
66  mbSpGroup.defineHistogram("SctBarr_SP", title="Number of SCT_SP for all events in Barrel", xbins=250, xmin=0, xmax=nSctCl)
67  mbSpGroup.defineHistogram("SctECA_SP", title="Number of SCT_SP for all events in ECA", xbins=250, xmin=0, xmax=nSctCl)
68  mbSpGroup.defineHistogram("SctECC_SP", title="Number of SCT_SP for all events in ECC", xbins=250, xmin=0, xmax=nSctCl)
69  mbSpGroup.defineHistogram("SctECA_SP,SctECC_SP", type="TH2F", title=";SctECA_SP;SctECC_SP", xbins=nbins, xmin=0, xmax=nSctCl, ybins=nbins, ymin=0, ymax=nSctCl)
70  mbSpGroup.defineHistogram("PixECA_SP,PixECC_SP", type="TH2F", title=";PixECA_SP;PixECC_SP", xbins=nbins, xmin=0, xmax=nPixEC, ybins=nbins, ymin=0, ymax=nPixEC)
71  mbSpGroup.defineHistogram("SctBarr_SP,PixBarr_SP", type="TH2F", title=";SctBarr_SP;PixBarr_SP", xbins=nbins, xmin=0, xmax=nSctCl, ybins=nbins, ymin=0, ymax=nPixBar)
72  mbSpGroup.defineHistogram("SctECA_SP,PixECA_SP", type="TH2F", title=";SctECA_SP;PixECA_SP", xbins=nbins, xmin=0, xmax=nSctCl, ybins=nbins, ymin=0, ymax=nPixEC)
73  mbSpGroup.defineHistogram("SctECC_SP,PixECC_SP", type="TH2F", title=";SctECC_SP;PixECC_SP", xbins=nbins, xmin=0, xmax=nSctCl, ybins=nbins, ymin=0, ymax=nPixEC)
74  mbSpGroup.defineHistogram("SctTot,PixelCL", type="TH2F", title=";Number of SP in whole SCT detector for all events;Number of SP in whole Pixels detector for all events", xbins=nbins, xmin=0, xmax=4000, ybins=nbins, ymin=0, ymax=4000)
75 
76  for chain, group in spTrkChains:
77  mbSpTrkGroup = monConfig.addGroup(alg, f'{chain}_Tracking', topPath=f"HLT/MinBiasMon/{group}/Tracking/{chain}/")
78 
79  # 1D distributions
80  mbSpTrkGroup.defineHistogram("nTrkOffline", title="Number of tracks reconstructed offline;track counts", xbins=200, xmin=-1, xmax=400)
81  mbSpTrkGroup.defineHistogram("nTrkOffline;nTrkOfflineLowMult", title="Number of tracks reconstructed offline;track counts", xbins=50, xmin=-1, xmax=50)
82  mbSpTrkGroup.defineHistogram("nTrkOnline;nTrkOnlineLowMult", title="Number of tracks reconstructed online;track counts", xbins=50, xmin=-1, xmax=50)
83 
84  mbSpTrkGroup.defineHistogram("trkPt", cutmask="trkMask", title="Offline selected tracks pt;p_{T} [GeV]", xbins=100, xmin=0, xmax=5)
85  mbSpTrkGroup.defineHistogram("trkEta", cutmask="trkMask", title="Offline selected tracks eta;#eta", xbins=50, xmin=-2.5, xmax=2.5)
86  mbSpTrkGroup.defineHistogram("trkPhi", cutmask="trkMask", title="Offline selected tracks phi;#phi", xbins=64, xmin=-math.pi, xmax=math.pi)
87  mbSpTrkGroup.defineHistogram("trkHits", title="Offline selected tracks, hits per track;number of hits", xbins=15, xmin=-0.5, xmax=15 - 0.5)
88 
89  mbSpTrkGroup.defineHistogram("onlTrkPt", title="Online tracks pt;p_{T} [GeV]", xbins=100, xmin=0, xmax=5)
90  mbSpTrkGroup.defineHistogram("onlTrkEta", title="Online tracks eta;#eta", xbins=50, xmin=-2.5, xmax=2.5)
91  mbSpTrkGroup.defineHistogram("onlTrkPhi", title="Online tracks phi;#phi", xbins=64, xmin=-math.pi, xmax=math.pi)
92  mbSpTrkGroup.defineHistogram("onlTrkHits", title="Online hits per track;number of hits", xbins=15, xmin=-0.5, xmax=15 - 0.5)
93  mbSpTrkGroup.defineHistogram("onlTrkZ0", title="Online track z_{0};z_{0}[mm]", xbins=40, xmin=-200, xmax=200)
94  mbSpTrkGroup.defineHistogram("onlTrkD0", title="Online track d_{0};d_{0}[mm]", xbins=40, xmin=-20, xmax=20)
95 
96  mbSpTrkGroup.defineHistogram("trkD0", cutmask="trkMask", title="Offline selected tracks D0;d_{0} [mm]", xbins=40, xmin=-20, xmax=20)
97  mbSpTrkGroup.defineHistogram("trkZ0wrtPV", cutmask="trkMask", title="Offline selected tracks Z0 wrt PV;z_{0}[mm]", xbins=40, xmin=-20, xmax=20)
98  mbSpTrkGroup.defineHistogram("trkZ0", cutmask="trkMask", title="Offline selected tracks Z0;z_{0}[mm]", xbins=40, xmin=-200, xmax=200)
99 
100  mbSpTrkGroup.defineHistogram("onlineOfflineVtxDelta", title=";(offline - online) vertex z[mm]", xbins=200, xmin=-200, xmax=200)
101 
102  # 2D maps
103  mbSpTrkGroup.defineHistogram('trkEta,trkPt', cutmask='trkMask', type='TH2F', title='Offline selected tracks pT/eta correlation;#eta;p_{T} [GeV]', xbins=50, xmin=-2.5, xmax=2.5, ybins=50, ymin=0, ymax=5)
104  mbSpTrkGroup.defineHistogram('onlTrkEta,onlTrkPt', type='TH2F', title='Online tracks pT/eta correlation;#eta;p_{T} [GeV]', xbins=50, xmin=-2.5, xmax=2.5, ybins=50, ymin=0, ymax=5)
105 
106  mbSpTrkGroup.defineHistogram('trkEta,trkPhi', cutmask='trkMask', type='TH2F', title='Offline selected tracks eta/phi correlation;#eta;#varphi', xbins=50, xmin=-2.5, xmax=2.5, ybins=50, ymin=-math.pi, ymax=math.pi)
107  mbSpTrkGroup.defineHistogram('onlTrkEta,onlTrkPhi', type='TH2F', title='Online tracks eta/phi correlation;#eta;#varphi', xbins=50, xmin=-2.5, xmax=2.5, ybins=50, ymin=-math.pi, ymax=math.pi)
108 
109  mbSpTrkGroup.defineHistogram("nTrkOnline,nTrkOffline", type="TH2F", title=";N online tracks;N offline tracks", xbins=nbins, xmin=0, xmax=nTrkMax, ybins=nbins, ymin=0, ymax=nTrkMax)
110  mbSpTrkGroup.defineHistogram("nTrkOfflineVtx,nTrkOffline", type="TH2F", title=";N offline tracks with Vtx cut;N offline tracks", xbins=nbins, xmin=0, xmax=nTrkMax, ybins=nbins, ymin=0, ymax=nTrkMax)
111  mbSpTrkGroup.defineHistogram("nTrkOnline,zFinderWeight", type="TH2F", title=";N online tracks;ZFinder weight", xbins=nbins, xmin=0, xmax=nTrkMax, ybins=nbins, ymin=0, ymax=nTrkMax)
112  mbSpTrkGroup.defineHistogram("nTrkOffline,zFinderWeight", type="TH2F", title=";N online tracks;ZFinder weight", xbins=nbins, xmin=0, xmax=nTrkMax, ybins=nbins, ymin=0, ymax=nTrkMax)
113  mbSpTrkGroup.defineHistogram("nTrkOfflineVtx,zFinderWeight", type="TH2F", title=";N offline tracks with Vtx cut;ZFinder weight", xbins=nbins, xmin=0, xmax=nTrkMax, ybins=nbins, ymin=0, ymax=nTrkMax)
114  mbSpTrkGroup.defineHistogram("nTrkOfflineVtx,nTrkOnlineVtx", type="TH2F", title=";N offline tracks with Vtx cut;N online tracks with Vtx cut;", xbins=nbins, xmin=0, xmax=nTrkMax, ybins=nbins, ymin=0, ymax=nTrkMax)
115 
116  # Ratios
117  mbSpTrkGroup.defineHistogram("nTrkOnline", title="Number of tracks reconstructed online;track counts", xbins=200, xmin=-1, xmax=400)
118  mbSpTrkGroup.defineHistogram("nTrkRatio", title="Number of tracks reconstructed online/offline;track counts online/offline", xbins=200, xmin=-1, xmax=4)
119  mbSpTrkGroup.defineHistogram("trkSelOfflineRatio", title="Number of tracks reconstructed offline(selected)/offline; N sel/all", xbins=200, xmin=0.1, xmax=1.9)
120 
121  return monConfig.result()
122 
123 

Variable Documentation

◆ cfg

TrigSPTRKMonitoringMT.cfg

Definition at line 142 of file TrigSPTRKMonitoringMT.py.

◆ Environment

TrigSPTRKMonitoringMT.Environment

Definition at line 128 of file TrigSPTRKMonitoringMT.py.

◆ flags

TrigSPTRKMonitoringMT.flags

Definition at line 127 of file TrigSPTRKMonitoringMT.py.

◆ highGranularity

TrigSPTRKMonitoringMT.highGranularity

Definition at line 145 of file TrigSPTRKMonitoringMT.py.

◆ HISTFileName

TrigSPTRKMonitoringMT.HISTFileName

Definition at line 131 of file TrigSPTRKMonitoringMT.py.

◆ log

TrigSPTRKMonitoringMT.log

Definition at line 13 of file TrigSPTRKMonitoringMT.py.

◆ NumConcurrentEvents

TrigSPTRKMonitoringMT.NumConcurrentEvents

Definition at line 129 of file TrigSPTRKMonitoringMT.py.

◆ withDetails

TrigSPTRKMonitoringMT.withDetails

Definition at line 150 of file TrigSPTRKMonitoringMT.py.

python.TriggerConfigAccess.getHLTMonitoringAccess
HLTMonitoringAccess getHLTMonitoringAccess(flags=None)
Definition: TriggerConfigAccess.py:256
python.InDetTrackSelectionToolConfig.InDetTrackSelectionTool_LoosePrimary_Cfg
def InDetTrackSelectionTool_LoosePrimary_Cfg(flags, name="InDetTrackSelectionTool_LoosePrimary", **kwargs)
Configs based on CutLevel LoosePrimary #####.
Definition: InDetTrackSelectionToolConfig.py:54
TrigSPTRKMonitoringMT.TrigSPTRK
def TrigSPTRK(configFlags, highGranularity=False)
Definition: TrigSPTRKMonitoringMT.py:16
utils.getMinBiasChains
def getMinBiasChains(monAccess, wildcard='')
Definition: Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/utils.py:7