ATLAS Offline Software
xAODTrackSummaryFiller.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 #
4 # @file TrackD3PDMaker/python/xAODTrackSummaryFiller.py
5 # @author scott snyder <snyder@bnl.gov>
6 # @date Jul 2014
7 # @brief Configure filler for xAOD track summary data.
8 #
9 
10 
11 from AthenaConfiguration.ComponentFactory import CompFactory
12 
13 D3PD = CompFactory.D3PD
14 
15 
16 HitSum = 'HitSum'
17 HoleSum = 'HoleSum'
18 IDHits = 'IDHits'
19 IDHoles = 'IDHoles'
20 IDSharedHits = 'IDSharedHits'
21 IDOutliers = 'IDOutliers'
22 PixelInfoPlus = 'PixelInfoPlus'
23 SCTInfoPlus = 'SCTInfoPlus'
24 TRTInfoPlus = 'TRTInfoPlus'
25 InfoPlus = 'InfoPlus'
26 ExpectBLayer = 'ExpectBLayer'
27 MuonHits = 'MuonHits'
28 MuonHoles = 'MuonHoles'
29 Outliers = 'Outliers'
30 StdDev = 'StdDev'
31 
32 
33 sumvars = [
34  # ID hits
35  [ IDHits, 'nBLHits = numberOfInnermostPixelLayerHits'],
36  [ [IDHits, HitSum], 'nPixHits = numberOfPixelHits'],
37  [ [IDHits, HitSum], 'nSCTHits = numberOfSCTHits'],
38  [ [IDHits, HitSum], 'nTRTHits = numberOfTRTHits'],
39  [ IDHits, 'nTRTHighTHits = numberOfTRTHighThresholdHits'],
40  [ IDHits, 'nTRTXenonHits = numberOfTRTXenonHits'],
41 
42  # ID holes + dead sensors - needed for appropriate cutting
43  [ [IDHoles, HoleSum], 'nPixHoles = numberOfPixelHoles'],
44  [ [IDHoles, HoleSum], 'nSCTHoles = numberOfSCTHoles'],
45  [ [IDHoles, HoleSum], 'nTRTHoles = numberOfTRTHoles'],
46  [ IDHoles, 'nPixelDeadSensors = numberOfPixelDeadSensors'],
47  [ IDHoles, 'nSCTDeadSensors = numberOfSCTDeadSensors'],
48 
49  # ID shared & Split hits
50  [ IDSharedHits, 'nBLSharedHits = numberOfInnermostPixelLayerSharedHits'],
51  [ IDSharedHits, 'nPixSharedHits = numberOfPixelSharedHits'],
52  [ IDSharedHits, 'nSCTSharedHits = numberOfSCTSharedHits'],
53  [ IDSharedHits, 'nBLayerSplitHits = numberOfInnermostPixelLayerSplitHits'],
54  [ IDSharedHits, 'nPixSplitHits = numberOfPixelSplitHits'],
55 
56  # ID outliers
57  [ IDOutliers, 'nBLayerOutliers = numberOfInnermostPixelLayerOutliers'],
58  [ IDOutliers, 'nPixelOutliers = numberOfPixelOutliers'],
59  [ IDOutliers, 'nSCTOutliers = numberOfSCTOutliers'],
60  [ IDOutliers, 'nTRTOutliers = numberOfTRTOutliers'],
61  [ IDOutliers, 'nTRTHighTOutliers = numberOfTRTHighThresholdOutliers'],
62 
63  # Pixel info plus
64  [ PixelInfoPlus, 'nContribPixelLayers =numberOfContribPixelLayers'],
65  [ PixelInfoPlus, 'nGangedPixels = numberOfGangedPixels'],
66  [ PixelInfoPlus, 'nGangedFlaggedFakes = numberOfGangedFlaggedFakes'],
67  [ PixelInfoPlus, 'nPixelSpoiltHits = numberOfPixelSpoiltHits'],
68 
69  # SCT info plus
70  [ SCTInfoPlus, 'nSCTDoubleHoles = numberOfSCTDoubleHoles'],
71  [ SCTInfoPlus, 'nSCTSpoiltHits = numberOfSCTSpoiltHits'],
72 
73  # TRT info plus
74  [ TRTInfoPlus, 'nTRTDeadStraws = numberOfTRTDeadStraws'],
75  [ TRTInfoPlus, 'nTRTTubeHits = numberOfTRTTubeHits'],
76 
77  # Info plus
78  [ InfoPlus, 'nOutliersOnTrack = numberOfOutliersOnTrack'],
79  [ InfoPlus, 'standardDeviationOfChi2OS =standardDeviationOfChi2OS'],
80 
81  # Expect BLayer hit
82  [ ExpectBLayer, 'expectInnermostPixelLayerHit = expectInnermostPixelLayerHit'],
83 
84  # Muon hits
85  [ [MuonHits, HitSum], 'nprecisionLayers = numberOfPrecisionLayers'],
86  [ [MuonHits, HitSum], 'nphiLayers = numberOfPhiLayers'],
87  [ [MuonHits, HitSum], 'ntrigEtaLayers = numberOfTriggerEtaLayers'],
88 
89  # Muon holes
90  [ [MuonHoles, HoleSum], 'nprecisionHoleLayers = numberOfPrecisionHoleLayers'],
91  [ [MuonHoles, HoleSum], 'nphiHoleLayers = numberOfPhiHoleLayers'],
92  [ [MuonHoles, HoleSum], 'ntrigEtaHoleLayers = numberOfTriggerEtaHoleLayers'],
93 
94  # Other
95  [ Outliers, 'nOutliersOnTrack = numberOfOutliersOnTrack'],
96  [ StdDev, 'standardDeviationOf Chi2OS'],
97 
98  ]
99 
100 
101 
102 def xAODTrackSummaryFiller (obj, lod, blockName,
103  IDHits = True,
104  IDHoles = True,
105  IDSharedHits = True,
106  IDOutliers = False,
107  PixelInfoPlus = False,
108  SCTInfoPlus = False,
109  TRTInfoPlus = False,
110  InfoPlus = False,
111  MuonHits = True,
112  MuonHoles = False,
113  ExpectBLayer = True,
114  HitSum = True,
115  HoleSum = True,
116  FullInfo = False,
117  Outliers = False,
118  StdDev = False,
119  **kw):
120  varlist = []
121  for tags, v in sumvars:
122  if not isinstance(tags, list): tags = [tags]
123  sel = FullInfo
124  for t in tags:
125  sel += eval(t)
126  if sel:
127  v = v + '< unsigned char:0'
128  varlist.append (v)
129 
130  obj.defineBlock (lod, blockName,
132  Vars = varlist,
133  **kw)
134  return
135 
136 
D3PD::AuxDataFillerTool
Copy aux data to D3PD.
Definition: AuxDataFillerTool.h:35
python.xAODTrackSummaryFiller.xAODTrackSummaryFiller
def xAODTrackSummaryFiller(obj, lod, blockName, IDHits=True, IDHoles=True, IDSharedHits=True, IDOutliers=False, PixelInfoPlus=False, SCTInfoPlus=False, TRTInfoPlus=False, InfoPlus=False, MuonHits=True, MuonHoles=False, ExpectBLayer=True, HitSum=True, HoleSum=True, FullInfo=False, Outliers=False, StdDev=False, **kw)
Definition: xAODTrackSummaryFiller.py:102