ATLAS Offline Software
Loading...
Searching...
No Matches
PerigeeAssociation.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from D3PDMakerCoreComps.SimpleAssociation import SimpleAssociation
4from D3PDMakerCoreComps.flagTestLOD import flagTestLOD, deferFlag
5from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
6from AthenaConfiguration.ComponentFactory import CompFactory
7
8D3PD = CompFactory.D3PD
9
10def perigeeLOD (expr, flags):
11 func = flagTestLOD (expr, flags)
12 def perigeeLODFunc (reqlev, args, hookargs):
13 if not func (reqlev, args, hookargs): return False
14 if not args.get('FillPerigee',True) or hookargs.has_key ('_didTQP'):
15 args['FillThetaAndQoverP'] = False
16 else:
17 args['FillThetaAndQoverP'] = True
18 hookargs['_didTQP'] = True
19 return True
20 return perigeeLODFunc
21
22
23def PerigeeAssociation (parent, associator, blockname, suffix='',
24 flags = D3PDMakerFlags.Track,
25 fillMomName = 'False',
26 levelName = None,
27 **kw):
28
29 perigeeAssoc = SimpleAssociation (parent, associator, **kw)
30
31 perigeeAssoc.defineBlock (perigeeLOD ('%s or %s>0' %(fillMomName,levelName),
32 flags),
33 blockname,
35 Suffix = suffix,
36 FillPerigee = deferFlag('%s>0'%levelName,flags),
37 FillMomentum = deferFlag(fillMomName,flags))
38
39 perigeeCovarianceAssoc = SimpleAssociation (
40 perigeeAssoc,
42 blockname = blockname + 'Assoc',
43 level = flagTestLOD('%s>=2'%levelName, flags))
44
45 perigeeCovarianceAssoc.defineBlock (
46 flagTestLOD('%s>=2'%levelName,flags),
47 blockname + 'Error',
49 Error = deferFlag ('storeDiagonalCovarianceAsErrors', flags),
50 DiagCovariance = deferFlag('not storeDiagonalCovarianceAsErrors',flags),
51 OffDiagCovariance = False,
52 IsTrackPerigee = True,
53 Suffix = suffix)
54
55 perigeeCovarianceAssoc.defineBlock (flagTestLOD('%s>=3'%levelName,flags),
56 blockname + 'OffDiagCovariance',
58 Error = False,
59 DiagCovariance = False,
60 OffDiagCovariance = True,
61 IsTrackPerigee = True,
62 Suffix = suffix)
63
64 return perigeeAssoc
Block filler tool for error and covariance matrix.
Associate from a Perigee to its ErrorMatrix.