ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
TrackD3PDMaker
python
xAODVertexD3PDObject.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
from
D3PDMakerCoreComps.flagTestLOD
import
flagTestLOD, deferFlag
4
from
D3PDMakerCoreComps.D3PDObject
import
make_SGDataVector_D3PDObject
5
from
D3PDMakerCoreComps.SimpleAssociation
import
SimpleAssociation
6
from
D3PDMakerCoreComps.ContainedVectorMultiAssociation
import
ContainedVectorMultiAssociation
7
from
D3PDMakerConfig.D3PDMakerFlags
import
D3PDMakerFlags
8
from
AthenaConfiguration.ComponentFactory
import
CompFactory
9
10
D3PD = CompFactory.D3PD
11
12
13
def
DefinexAODVertexD3PDObject
(object,
14
trackTarget='trk',
15
trackPrefix='trk_',
16
flags = D3PDMakerFlags.Track):
17
18
# Position
19
object.defineBlock (flagTestLOD(
'vertexPositionLevelOfDetails>=1'
, flags),
20
'Position'
,
21
D3PD.AuxDataFillerTool
,
22
Vars = [
'x'
,
'y'
,
'z'
])
23
24
# Covariance Matrix
25
CovarianceAssoc = SimpleAssociation \
26
(object,
27
D3PD.VertexCovarianceAssociationTool
,
28
level = flagTestLOD(
'vertexPositionLevelOfDetails>=2'
, flags))
29
30
31
CovarianceAssoc.defineBlock (
32
flagTestLOD(
'vertexPositionLevelOfDetails>=2'
, flags),
33
'Error'
,
34
D3PD.CovarianceFillerTool
,
35
Error = deferFlag (
'storeDiagonalCovarianceAsErrors'
, flags),
36
DiagCovariance = deferFlag(
'not storeDiagonalCovarianceAsErrors'
,flags),
37
OffDiagCovariance =
False
,
38
IsPosition =
True
)
39
40
CovarianceAssoc.defineBlock (flagTestLOD(
'vertexPositionLevelOfDetails>=3'
, flags),
41
'Covariance'
,
42
D3PD.CovarianceFillerTool
,
43
Error =
False
,
44
DiagCovariance =
False
,
45
OffDiagCovariance =
True
,
46
IsPosition =
True
)
47
48
# Type
49
object.defineBlock (flagTestLOD(
'storeVertexType'
, flags),
50
'Type'
,
51
D3PD.AuxDataFillerTool
,
52
Vars = [
'type = vertexType'
])
53
54
# Fit Quality
55
object.defineBlock (flagTestLOD(
'storeVertexFitQuality'
, flags),
56
'FitQuality'
,
57
D3PD.AuxDataFillerTool
,
58
Vars = [
'chi2 = chiSquared'
,
'ndof = numberDoF'
])
59
60
# Kine
61
object.defineBlock (flagTestLOD(
'storeVertexKinematics'
, flags),
62
'Kine'
,
63
D3PD.VertexKineFillerTool
)
64
65
# Track Association
66
TrackAssoc = ContainedVectorMultiAssociation \
67
(object,
68
D3PD.VertexTrackParticleAssociationTool
,
69
trackPrefix,
70
level = flagTestLOD (
'storeVertexTrackAssociation or storeVertexTrackIndexAssociation'
,
71
flags))
72
73
TrackAssoc.defineBlock (
74
flagTestLOD (
'storeVertexTrackAssociation or storeVertexTrackIndexAssociation'
, flags),
75
'TrkFitQuality'
,
76
D3PD.AuxDataFillerTool
,
77
Vars = [
'chi2 = chiSquared'
])
78
79
PerigeeAssoc = SimpleAssociation \
80
(TrackAssoc,
81
D3PD.TrackParticlePerigeeAtPVAssociationTool
)
82
def
_trackToVertexHook (c, flags, acc, *args, **kw):
83
from
TrackToVertex.TrackToVertexConfig
import
InDetTrackToVertexCfg
84
c.Associator.TrackToVertexTool = acc.popToolsAndMerge (InDetTrackToVertexCfg (flags))
85
return
86
PerigeeAssoc.defineHook (_trackToVertexHook)
87
PerigeeAssoc.defineBlock (flagTestLOD (
'storeVertexTrackAssociation or storeVertexTrackIndexAssociation'
, flags),
88
'Trk'
,
89
D3PD.PerigeeFillerTool
)
90
91
TrackAssoc.defineBlock (
92
flagTestLOD (
'storeVertexTrackIndexAssociation'
, flags),
93
'TrackAssocIndex'
,
94
D3PD.IndexFillerTool
,
95
Target = trackTarget)
96
return
97
98
99
def
BuildxAODVertexD3PDObject
(_prefix='vx_',
100
_label='vx',
101
_sgkey=D3PDMakerFlags.VertexSGKey,
102
_object_name='PrimaryVertexD3PDObject',
103
trackTarget='trk',
104
trackPrefix='trk_'):
105
106
object = make_SGDataVector_D3PDObject (
107
'DataVector<xAOD::Vertex_v1>'
,
108
_sgkey,
109
_prefix,
110
_object_name,
111
#default_allowMissing = True,
112
allow_args = [
'storeVertexTrackAssociation'
,
113
'storeVertexTrackIndexAssociation'
,
114
'storeDiagonalCovarianceAsErrors'
,
115
'storeVertexType'
,
116
'storeVertexFitQuality'
,
117
'storeVertexKinematics'
,
118
'storeVertexPurity'
,
119
'vertexPositionLevelOfDetails'
,
120
'doTruth'
])
121
122
DefinexAODVertexD3PDObject
(object,
123
trackTarget,
124
trackPrefix)
125
126
return
object
127
128
129
#
130
# Additional arguments that can be passed to this D3PDObject:
131
# storeVertexAssociation
132
# storeVertexTrackIndexAssociation
133
#
134
PrimaryxAODVertexD3PDObject =
BuildxAODVertexD3PDObject
(
135
_prefix=
'vx_'
,
136
_label=
'vx'
,
137
_sgkey=
'VxPrimaryCandidate'
,
138
_object_name=
'PrimaryVertexD3PDObject'
,
139
trackTarget=
'trk'
,
140
trackPrefix=
'trk_'
)
D3PD::AuxDataFillerTool
Copy aux data to D3PD.
Definition
AuxDataFillerTool.h:35
D3PD::CovarianceFillerTool
Block filler tool for error and covariance matrix.
Definition
CovarianceFillerTool.h:31
D3PD::IndexFillerTool
Fill an index of an object within a container.
Definition
IndexFillerTool.h:32
D3PD::PerigeeFillerTool
Definition
PerigeeFillerTool.h:15
D3PD::TrackParticlePerigeeAtPVAssociationTool
Associate from a VxCandidate to its perigee at primary vertex.
Definition
TrackParticlePerigeeAtPVAssociationTool.h:33
D3PD::VertexCovarianceAssociationTool
Associate from a VxCandidate to its Position ErrorMatrix.
Definition
VertexCovarianceAssociationTool.h:33
D3PD::VertexKineFillerTool
Block filler tool for vertex kinematics, from attached tracks.
Definition
VertexKineFillerTool.h:29
D3PD::VertexTrackParticleAssociationTool
Definition
VertexTrackParticleAssociationTool.h:28
python.xAODVertexD3PDObject.BuildxAODVertexD3PDObject
BuildxAODVertexD3PDObject(_prefix='vx_', _label='vx', _sgkey=D3PDMakerFlags.VertexSGKey, _object_name='PrimaryVertexD3PDObject', trackTarget='trk', trackPrefix='trk_')
Definition
xAODVertexD3PDObject.py:104
python.xAODVertexD3PDObject.DefinexAODVertexD3PDObject
DefinexAODVertexD3PDObject(object, trackTarget='trk', trackPrefix='trk_', flags=D3PDMakerFlags.Track)
Definition
xAODVertexD3PDObject.py:16
Generated on
for ATLAS Offline Software by
1.17.0