ATLAS Offline Software
DiTauToolsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 def SeedJetBuilderCfg(flags, name="DiTauRec_SeedJetBuilder", **kwargs):
7  """Configure the seed jet builder"""
9  acc.setPrivateTools(CompFactory.SeedJetBuilder(name, **kwargs))
10  return acc
11 
12 
13 def SubjetBuilderCfg(flags, name="DiTauRec_SubjetBuilder", **kwargs):
14  """Configure the subjet builder"""
15  acc = ComponentAccumulator()
16 
17  kwargs.setdefault("Rsubjet", 0.2)
18  kwargs.setdefault("ptminsubjet", 10000)
19 
20  acc.setPrivateTools(CompFactory.SubjetBuilder(name, **kwargs))
21  return acc
22 
23 def TVAToolCfg(flags, name="TVATool_forDiTaus", **kwargs):
24  """Configure the TVA tool"""
25  acc = ComponentAccumulator()
26 
27  kwargs.setdefault("TrackParticleContainer", "InDetTrackParticles")
28  kwargs.setdefault("TrackVertexAssociation", "JetTrackVtxAssoc_forDiTaus")
29  kwargs.setdefault("VertexContainer", "PrimaryVertices")
30  kwargs.setdefault("MaxTransverseDistance", 2.5) # in mm
31  kwargs.setdefault("MaxLongitudinalDistance", 2) # in mm
32 
33  acc.setPrivateTools(CompFactory.TrackVertexAssociationTool(name, **kwargs))
34  return acc
35 
36 def JetAlgCfg(flags, name="DiTauRec_JetAlgorithm", **kwargs): # Name changed wrt legacy config DiTauRec_TVATool
37  """Configure the JetAlgorithm"""
38  acc = ComponentAccumulator()
39 
40  tools = [acc.popToolsAndMerge(TVAToolCfg(flags))]
41  kwargs.setdefault("Tools", tools)
42 
43  acc.addEventAlgo(CompFactory.JetAlgorithm(name, **kwargs))
44  return acc
45 
46 # require TrackVertexAssociation to be produced by TVA tool - see above
47 def VertexFinderCfg(flags, name="DiTauRec_VertexFinder", **kwargs):
48  """Configure the vertex finder"""
49  acc = ComponentAccumulator()
50 
51  kwargs.setdefault("PrimVtxContainerName", "PrimaryVertices")
52  kwargs.setdefault("AssociatedTracks", "GhostTrack")
53  kwargs.setdefault("TrackVertexAssociation", "JetTrackVtxAssoc_forDiTaus")
54 
55  acc.setPrivateTools(CompFactory.VertexFinder(name, **kwargs))
56  return acc
57 
58 def DiTauTrackFinderCfg(flags, name="DiTauRec_DiTauTrackFinder", **kwargs):
59  """Configure the di-tau track finder"""
60  acc = ComponentAccumulator()
61 
62  kwargs.setdefault("MaxDrJet", 1.0)
63  kwargs.setdefault("MaxDrSubjet", 0.2)
64  kwargs.setdefault("MaxNTracksSubjet", -1)
65  kwargs.setdefault("TrackParticleContainer", "InDetTrackParticles")
66 
67  if "TrackSelectorTool" not in kwargs:
68  from InDetConfig.InDetTrackSelectorToolConfig import TauRecInDetTrackSelectorToolCfg
69  InDetTrackSelectorTool = acc.popToolsAndMerge(TauRecInDetTrackSelectorToolCfg(flags))
70  acc.addPublicTool(InDetTrackSelectorTool)
71  kwargs.setdefault("TrackSelectorTool", InDetTrackSelectorTool)
72 
73  acc.setPrivateTools(CompFactory.DiTauTrackFinder(name, **kwargs))
74  return acc
75 
76 def ClusterFinderCfg(flags, name="DiTauRec_ClusterFinder", **kwargs):
77  """Configure the cluster finder"""
78  acc = ComponentAccumulator()
79 
80  kwargs.setdefault("ClusterContainer", "CaloCalTopoClusters")
81  kwargs.setdefault("Rsubjet", 0.2)
82 
83  ClusterFinder = CompFactory.ClusterFinder(name, **kwargs)
84  acc.setPrivateTools(ClusterFinder)
85  return acc
86 
87 def CellFinderCfg(flags, name="DiTauRec_CellFinder", **kwargs):
88  """Configure the cell finder"""
89  acc = ComponentAccumulator()
90 
91  kwargs.setdefault("ClusterContainer", "CaloCalTopoClusters")
92  kwargs.setdefault("CellContainer", "AllCalo")
93  kwargs.setdefault("Rsubjet", 0.2)
94 
95  CellFinder = CompFactory.CellFinder(name, **kwargs)
96  acc.setPrivateTools(CellFinder)
97  return acc
98 
99 
100 def IDVarCalculatorCfg(flags, name="DiTauRec_IDVarCalculator", **kwargs):
101  """Configure the IDVarCalculator"""
102  acc = ComponentAccumulator()
103  acc.setPrivateTools(CompFactory.IDVarCalculator(name, **kwargs))
104  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.InDetTrackSelectorToolConfig.TauRecInDetTrackSelectorToolCfg
def TauRecInDetTrackSelectorToolCfg(flags, name='tauRec_InDetTrackSelectorTool', **kwargs)
Definition: InDetTrackSelectorToolConfig.py:197
DiTauToolsConfig.IDVarCalculatorCfg
def IDVarCalculatorCfg(flags, name="DiTauRec_IDVarCalculator", **kwargs)
Definition: DiTauToolsConfig.py:100
DiTauToolsConfig.DiTauTrackFinderCfg
def DiTauTrackFinderCfg(flags, name="DiTauRec_DiTauTrackFinder", **kwargs)
Definition: DiTauToolsConfig.py:58
DiTauToolsConfig.ClusterFinderCfg
def ClusterFinderCfg(flags, name="DiTauRec_ClusterFinder", **kwargs)
Definition: DiTauToolsConfig.py:76
DiTauToolsConfig.SeedJetBuilderCfg
def SeedJetBuilderCfg(flags, name="DiTauRec_SeedJetBuilder", **kwargs)
Definition: DiTauToolsConfig.py:6
DiTauToolsConfig.CellFinderCfg
def CellFinderCfg(flags, name="DiTauRec_CellFinder", **kwargs)
Definition: DiTauToolsConfig.py:87
DiTauToolsConfig.JetAlgCfg
def JetAlgCfg(flags, name="DiTauRec_JetAlgorithm", **kwargs)
Definition: DiTauToolsConfig.py:36
DiTauToolsConfig.SubjetBuilderCfg
def SubjetBuilderCfg(flags, name="DiTauRec_SubjetBuilder", **kwargs)
Definition: DiTauToolsConfig.py:13
DiTauToolsConfig.VertexFinderCfg
def VertexFinderCfg(flags, name="DiTauRec_VertexFinder", **kwargs)
Definition: DiTauToolsConfig.py:47
DiTauToolsConfig.TVAToolCfg
def TVAToolCfg(flags, name="TVATool_forDiTaus", **kwargs)
Definition: DiTauToolsConfig.py:23