ATLAS Offline Software
Loading...
Searching...
No Matches
egammaTruthD3PDObject.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 egammaD3PDMaker/python/egammaTruthD3PDObject.py
5# @author scott snyder <snyder@bnl.gov>
6# @date Mar, 2011
7# @brief Configure egtruth D3PD object.
8#
9# This is meant to reproduce the egtruth block from the CBNTs.
10#
11
12
13from D3PDMakerCoreComps.D3PDObject import make_SGDataVector_D3PDObject
14from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
15from D3PDMakerCoreComps.SimpleAssociation import SimpleAssociation
16from AthenaConfiguration.ComponentFactory import CompFactory
17
18D3PD = CompFactory.D3PD
19
20
21#FIXME:
22egammaTruth_sgkey = 'egammaTruth'
23
24
25egammaTruthD3PDObject = make_SGDataVector_D3PDObject \
26 ('DataVector<xAOD::TruthParticle_v1>',
27 egammaTruth_sgkey,
28 'egtruth_',
29 'egammaTruthD3PDObject')
30
31def _egammaTruthAlgHook (c, flags, acc, *args, **kw):
32 from egammaD3PDAnalysis.egammaTruthParticleConfig \
33 import egammaTruthParticleCfg
34 acc.merge (egammaTruthParticleCfg (flags))
35 return
36egammaTruthD3PDObject.defineHook (_egammaTruthAlgHook)
37
38egammaTruthD3PDObject.defineBlock (0, 'TruthKin',
40 WriteM = False)
41
42egammaTruthD3PDObject.defineBlock (0, 'TruthInfo',
43 # TruthD3PDMaker
45egammaTruthD3PDObject.defineBlock (
46 0, 'CaloPos',
48 AuxPrefix = D3PDMakerFlags.EgammaUserDataPrefix,
49 Vars = ['etaCalo #Eta position of the impact of the track in calorimeter sampling 2',
50 'phiCalo #Phi position of the impact of the track in calorimeter sampling 2'])
51egammaTruthD3PDObject.defineBlock (
52 0, 'TruthIso',
54 AuxPrefix = D3PDMakerFlags.EgammaUserDataPrefix,
55 Vars = ['Etcone20'])
56
57
58ProdVertexAssoc = SimpleAssociation \
59 (egammaTruthD3PDObject,
60 # TruthD3PDMaker
62 level = 1,
63 prefix = 'vx_',
64 blockname = 'ProdVert')
65ProdVertexAssoc.defineBlock (
66 1, 'ProdVertPos',
68 Vars = ['x', 'y', 'z', 'uid'])
69
Copy aux data to D3PD.
Block filler tool for a four-momentum.
Associate from a TruthParticle to its GenVertex production vertex.
_egammaTruthAlgHook(c, flags, acc, *args, **kw)