ATLAS Offline Software
InDetAlgorithmConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 '''@file InDetAlgorithmConfig.py
6 @author M. Aparo
7 @date 02-10-2023
8 @brief CA-based python configurations for the event algorithms in this package
9 '''
10 
11 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
12 from AthenaConfiguration.ComponentFactory import CompFactory
13 
14 
15 def TruthHitDecoratorAlgCfg( flags, name="InDetPhysValTruthDecoratorAlg", **kwargs ):
16  '''
17  create decoration algorithm which decorates
18  truth particles with track parameters at the perigee.
19  '''
20  acc = ComponentAccumulator()
21 
22  from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
23  extrapolator = acc.popToolsAndMerge( AtlasExtrapolatorCfg( flags ) )
24  acc.addPublicTool( extrapolator )
25  kwargs.setdefault( "Extrapolator", extrapolator )
26 
27  if flags.Detector.GeometryITk :
28  kwargs.setdefault( "PixelClusterContainerName", "ITkPixelClusters" )
29  kwargs.setdefault( "SCTClusterContainerName", "ITkStripClusters" )
30 
31  kwargs.setdefault( 'TruthParticleIndexDecoration', '' ) # FIXME - tech effs
32  # 'origTruthIndex' if flags.PhysVal.IDPVM.doTechnicalEfficiency else '' )
33 
34 
35  acc.addEventAlgo( CompFactory.InDetPhysValTruthDecoratorAlg( name, **kwargs ) )
36  return acc
37 
38 
39 def OfflineElectronDecoratorAlgCfg( flags, name="OfflineElectronDecoratorAlg", **kwargs ):
40  acc = ComponentAccumulator()
41  acc.addEventAlgo( CompFactory.IDTPM.OfflineElectronDecoratorAlg( name, **kwargs ) )
42  return acc
43 
44 
45 def OfflineElectronGSFDecoratorAlgCfg( flags, name="OfflineElectronGSFDecoratorAlg", **kwargs ):
46  acc = ComponentAccumulator()
47  kwargs.setdefault( "OfflineTrkParticleContainerName", "GSFTrackParticles" )
48  kwargs.setdefault( "useGSF", True )
49  acc.addEventAlgo( CompFactory.IDTPM.OfflineElectronDecoratorAlg( name, **kwargs ) )
50  return acc
51 
52 
53 def OfflineMuonDecoratorAlgCfg( flags, name="OfflineMuonDecoratorAlg", **kwargs ):
54  acc = ComponentAccumulator()
55  acc.addEventAlgo( CompFactory.IDTPM.OfflineMuonDecoratorAlg( name, **kwargs ) )
56  return acc
57 
58 
59 def OfflineMuonCombDecoratorAlgCfg( flags, name="OfflineMuonDecoratorAlg", **kwargs ):
60  acc = ComponentAccumulator()
61  kwargs.setdefault( "OfflineTrkParticleContainerName", "CombinedMuonTrackParticles" )
62  kwargs.setdefault( "useCombinedMuonTracks", True )
63  acc.addEventAlgo( CompFactory.IDTPM.OfflineMuonDecoratorAlg( name, **kwargs ) )
64  return acc
65 
66 
67 def OfflineTauBDT1prongDecoratorAlgCfg( flags, name="OfflineTauBDT1prongDecoratorAlg", **kwargs ):
68  acc = ComponentAccumulator()
69  kwargs.setdefault( "Prefix", "LinkedTauBDT1prong_" )
70  kwargs.setdefault( "TauType", "BDT" )
71  kwargs.setdefault( "TauNprongs", 1 )
72  acc.addEventAlgo( CompFactory.IDTPM.OfflineTauDecoratorAlg( name, **kwargs ) )
73  return acc
74 
75 
76 def OfflineTauBDT3prongDecoratorAlgCfg( flags, name="OfflineTauBDT3prongDecoratorAlg", **kwargs ):
77  acc = ComponentAccumulator()
78  kwargs.setdefault( "Prefix", "LinkedTauBDT3prong_" )
79  kwargs.setdefault( "TauType", "BDT" )
80  kwargs.setdefault( "TauNprongs", 3 )
81  acc.addEventAlgo( CompFactory.IDTPM.OfflineTauDecoratorAlg( name, **kwargs ) )
82  return acc
83 
84 
85 def OfflineTauRNN1prongDecoratorAlgCfg( flags, name="OfflineTauRNN1prongDecoratorAlg", **kwargs ):
86  acc = ComponentAccumulator()
87  kwargs.setdefault( "Prefix", "LinkedTauRNN1prong_" )
88  kwargs.setdefault( "TauType", "RNN" )
89  kwargs.setdefault( "TauNprongs", 1 )
90  acc.addEventAlgo( CompFactory.IDTPM.OfflineTauDecoratorAlg( name, **kwargs ) )
91  return acc
92 
93 
94 def OfflineTauRNN3prongDecoratorAlgCfg( flags, name="OfflineTauRNN3prongDecoratorAlg", **kwargs ):
95  acc = ComponentAccumulator()
96  kwargs.setdefault( "Prefix", "LinkedTauRNN3prong_" )
97  kwargs.setdefault( "TauType", "RNN" )
98  kwargs.setdefault( "TauNprongs", 3 )
99  acc.addEventAlgo( CompFactory.IDTPM.OfflineTauDecoratorAlg( name, **kwargs ) )
100  return acc
101 
102 
103 def OfflineObjectDecoratorAlgCfg( flags, name="OfflineObjectDecoratorAlg", **kwargs ):
104  '''
105  create decoration algorithm(s) to decorate offline tracks with a link to
106  the offline object they correspond to in the event reconstruction
107  '''
108  acc = ComponentAccumulator()
109 
110  objStrList = []
111  tauTypeList = []
112  for trkAnaName in flags.PhysVal.IDTPM.trkAnaNames:
113  objStr = getattr( flags.PhysVal.IDTPM, trkAnaName+".SelectOfflineObject" )
114  if objStr : objStrList.append( objStr )
115  tauType = getattr( flags.PhysVal.IDTPM, trkAnaName+".TauType" )
116  if tauType : tauTypeList.append( tauType )
117 
118  if "Electron" in objStrList:
119  acc.merge( OfflineElectronDecoratorAlgCfg(flags) )
120 
121  if "ElectronGSF" in objStrList:
122  acc.merge( OfflineElectronGSFDecoratorAlgCfg(flags) )
123 
124  if "Muon" in objStrList:
125  acc.merge( OfflineMuonDecoratorAlgCfg(flags) )
126 
127  if "MuonComb" in objStrList:
128  acc.merge( OfflineMuonCombDecoratorAlgCfg(flags) )
129 
130  if "Tau" in objStrList:
131  if "BDT" in tauTypeList:
132  acc.merge( OfflineTauBDT1prongDecoratorAlgCfg(flags) )
133  acc.merge( OfflineTauBDT3prongDecoratorAlgCfg(flags) )
134  if "RNN" in tauTypeList:
135  acc.merge( OfflineTauRNN1prongDecoratorAlgCfg(flags) )
136  acc.merge( OfflineTauRNN3prongDecoratorAlgCfg(flags) )
137 
138  return acc
InDetAlgorithmConfig.OfflineMuonDecoratorAlgCfg
def OfflineMuonDecoratorAlgCfg(flags, name="OfflineMuonDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:53
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.AtlasExtrapolatorConfig.AtlasExtrapolatorCfg
def AtlasExtrapolatorCfg(flags, name='AtlasExtrapolator')
Definition: AtlasExtrapolatorConfig.py:63
InDetAlgorithmConfig.OfflineObjectDecoratorAlgCfg
def OfflineObjectDecoratorAlgCfg(flags, name="OfflineObjectDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:103
InDetAlgorithmConfig.OfflineTauBDT3prongDecoratorAlgCfg
def OfflineTauBDT3prongDecoratorAlgCfg(flags, name="OfflineTauBDT3prongDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:76
InDetAlgorithmConfig.OfflineTauRNN1prongDecoratorAlgCfg
def OfflineTauRNN1prongDecoratorAlgCfg(flags, name="OfflineTauRNN1prongDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:85
InDetAlgorithmConfig.OfflineTauBDT1prongDecoratorAlgCfg
def OfflineTauBDT1prongDecoratorAlgCfg(flags, name="OfflineTauBDT1prongDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:67
InDetAlgorithmConfig.OfflineElectronDecoratorAlgCfg
def OfflineElectronDecoratorAlgCfg(flags, name="OfflineElectronDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:39
InDetAlgorithmConfig.TruthHitDecoratorAlgCfg
def TruthHitDecoratorAlgCfg(flags, name="InDetPhysValTruthDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:15
InDetAlgorithmConfig.OfflineElectronGSFDecoratorAlgCfg
def OfflineElectronGSFDecoratorAlgCfg(flags, name="OfflineElectronGSFDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:45
InDetAlgorithmConfig.OfflineMuonCombDecoratorAlgCfg
def OfflineMuonCombDecoratorAlgCfg(flags, name="OfflineMuonDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:59
InDetAlgorithmConfig.OfflineTauRNN3prongDecoratorAlgCfg
def OfflineTauRNN3prongDecoratorAlgCfg(flags, name="OfflineTauRNN3prongDecoratorAlg", **kwargs)
Definition: InDetAlgorithmConfig.py:94