ATLAS Offline Software
PerigeeAssociation.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.SimpleAssociation import SimpleAssociation
4 from D3PDMakerCoreComps.flagTestLOD import flagTestLOD, deferFlag
5 from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 
8 D3PD = CompFactory.D3PD
9 
10 def 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 
23 def 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
D3PD::PerigeeFillerTool
Definition: PerigeeFillerTool.h:15
D3PD::CovarianceFillerTool
Block filler tool for error and covariance matrix.
Definition: CovarianceFillerTool.h:31
python.PerigeeAssociation.perigeeLOD
def perigeeLOD(expr, flags)
Definition: PerigeeAssociation.py:10
D3PD::PerigeeCovarianceAssociationTool
Associate from a Perigee to its ErrorMatrix.
Definition: PerigeeCovarianceAssociationTool.h:28
python.flagTestLOD.deferFlag
def deferFlag(expr, flags, gdict={})
Definition: flagTestLOD.py:103
python.flagTestLOD.flagTestLOD
def flagTestLOD(expr, flags, hook=None)
Definition: flagTestLOD.py:20
python.PerigeeAssociation.PerigeeAssociation
def PerigeeAssociation(parent, associator, blockname, suffix='', flags=D3PDMakerFlags.Track, fillMomName='False', levelName=None, **kw)
Definition: PerigeeAssociation.py:23