ATLAS Offline Software
Loading...
Searching...
No Matches
AnalysisCommon/ParticleJetTools/python/JetParticleAssociationAlgConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5from math import inf
6
7# this function is only used below
8def JetParticleAssociationCfg(ConfigFlags, jetCollName, partcollname, assocname, **options):
9
10 acc=ComponentAccumulator()
11
12 options["coneSizeFitPar1"] = +0.239
13 options["coneSizeFitPar2"] = -1.220
14 options["coneSizeFitPar3"] = -1.64e-5
15 options["InputParticleContainer"] = partcollname
16 options["OutputDecoration"] = assocname
17
18 # -- create the association tool
19 acc.setPrivateTools(
20 CompFactory.JetParticleShrinkingConeAssociation(
21 JetContainer=jetCollName, **options))
22
23 return acc
24
25
27 ConfigFlags,
28 JetCollection,
29 InputParticleCollection,
30 OutputParticleDecoration,
31 MinimumJetPt=None,
32 MinimumJetPtFlag=None):
33
34 acc=ComponentAccumulator()
35 jetcol = JetCollection
36 name=(jetcol + "_" + OutputParticleDecoration + "_assoc").lower()
37 if MinimumJetPt is None:
38 MinimumJetPt = ConfigFlags.BTagging.minimumJetPtForTrackAssociation
39 if MinimumJetPt > 0.0 and MinimumJetPtFlag is None:
40 ptflag = f'{OutputParticleDecoration}OverPtThreshold'
41 elif MinimumJetPtFlag is not None:
42 ptflag = MinimumJetPtFlag
43 else:
44 ptflag = ''
45
46 # -- create the association algorithm
47 acc.addEventAlgo(CompFactory.JetDecorationAlg(
48 name=name,
49 JetContainer=jetcol,
50 Decorators=[
51 acc.popToolsAndMerge(
53 ConfigFlags,
54 jetcol,
55 InputParticleCollection,
56 OutputParticleDecoration,
57 MinimumJetPt=MinimumJetPt,
58 PassPtFlag=ptflag,
59 ))
60 ]
61 ))
62
63 return acc
64
65def JetParticleFixedConeAssociationAlgCfg(ConfigFlags, fixedConeRadius, JetCollection="", InputParticleCollection="", OutputParticleDecoration="", **options):
66
67 acc=ComponentAccumulator()
68 jetcol = JetCollection
69
70 options['JetContainer'] = jetcol
71 options['Decorators'] = [CompFactory.JetParticleShrinkingConeAssociation(
72 InputParticleContainer=InputParticleCollection,
73 OutputDecoration=OutputParticleDecoration,
74 coneSizeFitPar1=fixedConeRadius,
75 coneSizeFitPar2=-inf,
76 coneSizeFitPar3=0,
77 **options)]
78 options['name'] = (jetcol + "_" + OutputParticleDecoration + "_assoc").lower()
79
80 # -- create the association algorithm
81 acc.addEventAlgo(CompFactory.JetDecorationAlg(**options))
82
83 return acc
JetParticleAssociationCfg(ConfigFlags, jetCollName, partcollname, assocname, **options)
JetParticleAssociationAlgCfg(ConfigFlags, JetCollection, InputParticleCollection, OutputParticleDecoration, MinimumJetPt=None, MinimumJetPtFlag=None)
JetParticleFixedConeAssociationAlgCfg(ConfigFlags, fixedConeRadius, JetCollection="", InputParticleCollection="", OutputParticleDecoration="", **options)