ATLAS Offline Software
HFClassificationCommonConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 
9 
10 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11 from AthenaConfiguration.ComponentFactory import CompFactory
12 from DerivationFrameworkMCTruth.HFDSIDList import DSIDList
13 
14 def DFCommonMatchingToolCfg(flags, **kwargs):
15 
16 
19 
20  acc = ComponentAccumulator()
21  # Configure the tool that matches each truth particle to the closest jet.
22  # Parameters:
23  # -m_jetPtCut: Cut on the pt of the jets.
24  # -m_jetEtaCut: Cut on the eta of the jets.
25  # -m_drCut: Upper limit for the delta R between the particle and the jet to perform the matching.
26  kwargs.setdefault("jetPtCut", 15000.)
27  kwargs.setdefault("jetEtaCut", 2.5)
28  kwargs.setdefault("drCut", 0.3)
29  acc.setPrivateTools(CompFactory.DerivationFramework.JetMatchingTool(name='DFCommonJetMatchingTool', **kwargs))
30  return acc
31 
32 
33 def DFCommonHadronOriginClassifierCfg(flags, **kwargs):
34  acc = ComponentAccumulator()
35 
38 
39  # Configure the tool that determines the origin of the HF hadrons.
40  # Parameters:
41  # -DSID: DSID of the sample that is being processed.
42  kwargs.setdefault("DSID", int(flags.Input.MCChannelNumber))
43  acc.setPrivateTools(CompFactory.DerivationFramework.HadronOriginClassifier(name='DFCommonHadronOriginClassifier', **kwargs))
44  return acc
45 
46 
48  acc = ComponentAccumulator()
49 
52 
53  # Configure the tool that computes the HF Classification.
54  # Parameters:
55  # -m_jetPtCut: Cut on the pt of the jets.
56  # -m_jetEtaCut: Cut on the eta of the jets.
57  # -m_leadingHadronPtCut: Cut on the pt of the leading hadron.
58  # -m_leadingHadronPtRatioCut: Cut on the ratio between the pt of the leading hadron and the pt of its associated jet.
59  kwargs.setdefault("jetPtCut", 15000.)
60  kwargs.setdefault("jetEtaCut", 2.5)
61  kwargs.setdefault("leadingHadronPtCut", 5000.)
62  kwargs.setdefault("leadingHadronPtRatioCut", -1)
63  acc.setPrivateTools(CompFactory.DerivationFramework.ClassifyAndCalculateHFTool(name='DFCommonClassifyAndCalculateHFTool', **kwargs))
64  return acc
65 
66 
67 def ClassifyAndCalculateHFAugmentationCfg(flags, mc_channel_number, **kwargs):
68 
69  """Configure and add the tools to compute and add the HF classifier in the derivation"""
70 
71  acc = ComponentAccumulator()
72 
73 
76 
77  # Configure the tool that adds the HF Classification in the derivation file.
78  # Parameters:
79  # -ClassifyAndComputeHFtool: It computes the HF classifier.
80  # -HadronOriginClassifierTool: It determines the origin of the HF hadrons.
81  # -ClassifyAndComputeHFtool: It matches the hadrons with the jets.
82  # Tools:
83  # -jetCollectionName: It contains the name of the jets container.
84  # -TruthParticleContainerName: It contains the name of the truth particles container.
85  # -hfDecorationName: It contains the name used to save the HF classifier.
86  # -SimplehfDecorationName: It contains the name used to save the simple HF classifier.
87  kwargs.setdefault("jetCollectionName", "AntiKt4TruthDressedWZJets")
88  kwargs.setdefault("TruthParticleContainerName", "TruthParticles")
89  kwargs.setdefault("hfDecorationName", "HF_Classification")
90  kwargs.setdefault("SimplehfDecorationName", "HF_SimpleClassification")
91  kwargs.setdefault("HadronOriginIDDecorationName", "HFHadronOriginID")
92  kwargs.setdefault("ClassifyAndComputeHFtool", acc.addPublicTool(acc.popToolsAndMerge(DFCommonClassifyAndCalculateHFToolCfg(flags))))
93  kwargs.setdefault("HadronOriginClassifierTool", acc.addPublicTool(acc.popToolsAndMerge(DFCommonHadronOriginClassifierCfg(flags))))
94  kwargs.setdefault("JetMatchingTool", acc.addPublicTool(acc.popToolsAndMerge(DFCommonMatchingToolCfg(flags))))
95  acc.setPrivateTools(CompFactory.DerivationFramework.ClassifyAndCalculateHFAugmentation(name = "DFCommonClassifyAndCalculateHFAugmentation", **kwargs))
96  return acc
97 
98 
99 #Configuration of the tools to compute the HF Classification of the ttbar+jets events.
101 
102  """HF Classification configuration."""
103 
104  acc = ComponentAccumulator()
105 
106  #Check the the DSID of the considered sample is in the list of ttbar samples.
107  mc_channel_number = int(flags.Input.MCChannelNumber)
108  if mc_channel_number > 0:
109  if mc_channel_number in DSIDList:
110  #In this case, the DSID is in the list so configure the tools.
111  #Configure the tool that adds the HF Classification in the derivation file.
112  CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
113  acc.addEventAlgo(CommonAugmentation(name = "HFClassificationCommonKernel",
114  AugmentationTools = [acc.addPublicTool(acc.popToolsAndMerge(ClassifyAndCalculateHFAugmentationCfg(flags, mc_channel_number)))]))
115 
116  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.HFClassificationCommonConfig.DFCommonMatchingToolCfg
def DFCommonMatchingToolCfg(flags, **kwargs)
Definition: HFClassificationCommonConfig.py:14
python.HFClassificationCommonConfig.ClassifyAndCalculateHFAugmentationCfg
def ClassifyAndCalculateHFAugmentationCfg(flags, mc_channel_number, **kwargs)
Definition: HFClassificationCommonConfig.py:67
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
python.HFClassificationCommonConfig.DFCommonClassifyAndCalculateHFToolCfg
def DFCommonClassifyAndCalculateHFToolCfg(flags, **kwargs)
Definition: HFClassificationCommonConfig.py:47
python.HFClassificationCommonConfig.HFClassificationCommonCfg
def HFClassificationCommonCfg(flags)
Definition: HFClassificationCommonConfig.py:100
python.HFClassificationCommonConfig.DFCommonHadronOriginClassifierCfg
def DFCommonHadronOriginClassifierCfg(flags, **kwargs)
Definition: HFClassificationCommonConfig.py:33