ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParticleImpactParameters.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/TrackParticleImpactParameters.py
5# @author scott snyder <snyder@bnl.gov>
6# @date 2009
7# @brief Add to a D3PD object blocks filling in impact parameter information.
8#
9
10
11from D3PDMakerCoreComps.SimpleAssociation import SimpleAssociation
12from AthenaConfiguration.ComponentFactory import CompFactory
13
14D3PD = CompFactory.D3PD
15
16
17def TrackParticleImpactParameters (TPD3PDObject,
18 prefix = 'track',
19 beam_suffix = 'beam',
20 pv_suffix = 'pv',
21 pvunbiased_suffix = 'pvunbiased'):
22 """Add to a D3PD object blocks filling in impact parameter information.
23
24TPD3PDObject should be a D3PD object for a TrackParticle
25(could be an association). This will add information for impact
26parameters with respect to the beam spot and the primary vertex,
27and the unbiased impact parameter with respect to the primary vertex.
28The variable names are constructed using the prefix and *_suffix
29arguments."""
30
31
32 #
33 # Beamspot
34 #
35 BSPerigeeAssoc = SimpleAssociation \
36 (TPD3PDObject,
38 blockname = prefix + 'BSPerigeeAssoc',
39 prefix = prefix)
40 def _trackToVertexHook (c, flags, acc, prefix, *args, **kw):
41 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
42 acc.merge(BeamSpotCondAlgCfg(flags))
43 from TrackToVertex.TrackToVertexConfig import InDetTrackToVertexCfg
44 c.Associator.TrackToVertexTool = acc.popToolsAndMerge (InDetTrackToVertexCfg (flags))
45 return
46 BSPerigeeAssoc.defineHook (_trackToVertexHook)
47 BSPerigeeAssoc.defineBlock (1, prefix + 'Impact' + beam_suffix,
49 FillThetaAndQoverP = False,
50 FillPhi = False,
51 Suffix = beam_suffix,
52 DefaultValue = -9999)
53 BSCovarAssoc = SimpleAssociation \
54 (BSPerigeeAssoc,
56 blockname = prefix + 'BSPerigeeCovarAssoc')
57 BSCovarAssoc.defineBlock (1, prefix + 'ImpactSig' + beam_suffix,
59 Suffix = beam_suffix)
60
61 #
62 # Primary vertex
63 #
64 PVPerigeeAssoc = SimpleAssociation \
65 (TPD3PDObject,
67 blockname = prefix + 'PVPerigeeAssoc',
68 prefix = prefix)
69 PVPerigeeAssoc.defineHook (_trackToVertexHook)
70 PVPerigeeAssoc.defineBlock (1, prefix + 'Impact' + pv_suffix,
72 FillThetaAndQoverP = False,
73 FillPhi = False,
74 Suffix = pv_suffix,
75 DefaultValue = -9999)
76 PVCovarAssoc = SimpleAssociation \
77 (PVPerigeeAssoc,
79 blockname = prefix + 'PVPerigeeCovarAssoc')
80 PVCovarAssoc.defineBlock (1, prefix + 'ImpactSig' + pv_suffix,
82 Suffix = pv_suffix)
83
Fill d0/z0 uncertainties from an ErrorMatrix.
Associate from a Perigee to its ErrorMatrix.
Associate from a VxCandidate to its perigee at the beam spot.
Associate from a VxCandidate to its perigee at primary vertex.