ATLAS Offline Software
Loading...
Searching...
No Matches
TruthSelectorBase.py
Go to the documentation of this file.
2# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3#
4
5'''
6@file InDetSelectionConfig.py
7@author M. Aparo
8@date 02-10-2023
9@brief CA-based python configurations for selection tools in this package
10'''
11
12from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
13from AthenaConfiguration.ComponentFactory import CompFactory
14
15
16
17def TruthPerigeeDecoratorCfg( flags, name="InDetPhysValTruthDecoratorAlg", **kwargs ):
18 '''
19 create decoration algorithm which decorates
20 truth particles with track parameters at the perigee.
21 '''
22 acc = ComponentAccumulator()
23
24 from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
25 extrapolator = acc.popToolsAndMerge( AtlasExtrapolatorCfg( flags ) )
26 acc.addPublicTool( extrapolator )
27 kwargs.setdefault( "Extrapolator", extrapolator )
28
29 # what is this for ???
30 # kwargs.setdefault( 'TruthParticleIndexDecoration', 'origTruthIndex' )
31 kwargs.setdefault( "TruthParticleIndexDecoration", "" )
32
33 acc.addEventAlgo( CompFactory.InDetPhysValTruthDecoratorAlg( name, **kwargs ) )
34 return acc
35
36
37
38
39def TruthSelectorBaseCfg( flags, name="TruthSelectionBaseTool", **kwargs ) :
40 '''
41 Copy of InDetPhysValMonitoring.InDetPhysValMonitoringConfig InDetRttTruthSelectionToolCfg
42 to handle flags internally in IDTPM2, i.e. not relying on IDPVM's (default) flags
43 '''
44 acc = ComponentAccumulator()
45
46 # iflags, iname = get_flags( flags, name )
47
48
49 kwargs.setdefault( "requireStable", True )
50 kwargs.setdefault( "requireCharged", True )
51
52 # whny are these flags all set to none somewhere ??
53 # this configuration is far, far, FAR too complicated,
54 # setting should be set in ONE PLACE, and ONE PLACE ONLY
55 # unless the user explicitly wants to change some later
56
57 # values in case the geometry is not set, AAAAARRRGH!!!!!
58 # this is all so a***d up, what about mineEta ?? minEta is
59 # set elsewhere, why isn;t everything set consistently ?
60 if kwargs.get("maxEta") is None:
61 kwargs["maxEta"] = 2.5
62 else:
63 # this clause won't do anything, because it is already set
64 kwargs.setdefault( "maxEta", 2.5 )
65
66 if kwargs.get("minPt") is None:
67 # values in case the geometry is not set
68 kwargs["minPt"] = 500
69 else:
70 kwargs.setdefault( "minPt", 500 )
71
72 if flags.has( "Detector.GeometryITk" ) :
73 # do anything is the parameter is already set
74 kwargs.setdefault( "maxEta", 4.0 if flags.Detector.GeometryITk else 2.5 )
75 kwargs.setdefault( "minPt", 1000 if flags.Detector.GeometryITk else 500 )
76
77 kwargs.setdefault( "requireOnlyPrimary", True )
78 kwargs.setdefault( "maxProdVertRadius", 300. )
79
80 kwargs.setdefault( "ancestorList", [] )
81 kwargs.setdefault( "requireSiHit", 0 )
82 kwargs.setdefault( "Extrapolator", None )
83
84 acc.setPrivateTools( CompFactory.AthTruthSelectionTool( name, **kwargs ) )
85 return acc
86
87
88
TruthSelectorBaseCfg(flags, name="TruthSelectionBaseTool", **kwargs)
TruthPerigeeDecoratorCfg(flags, name="InDetPhysValTruthDecoratorAlg", **kwargs)