ATLAS Offline Software
KLFitterTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 // $Id: KLFitterTool.h 788027 2016-12-04 18:30:45Z aknue $
6 #ifndef ANALYSISTOP_TOPEVENTRECONSTRCUTIONTOOLS_KLFITTERTOOL_H
7 #define ANALYSISTOP_TOPEVENTRECONSTRCUTIONTOOLS_KLFITTERTOOL_H
8 
9 // Framework include(s):
10 #include "AsgTools/AsgTool.h"
12 #include "xAODJet/JetContainer.h"
15 
16 
17 // KLFitter include(s):
18 #include "KLFitter/Fitter.h"
19 #include "KLFitter/LikelihoodTopLeptonJets.h"
20 #include "KLFitter/LikelihoodTTHLeptonJets.h"
21 #include "KLFitter/LikelihoodTopLeptonJets_JetAngles.h"
22 #include "KLFitter/LikelihoodTopLeptonJets_Angular.h"
23 #include "KLFitter/LikelihoodTTZTrilepton.h"
24 #include "KLFitter/LikelihoodTopAllHadronic.h"
25 #include "KLFitter/BoostedLikelihoodTopLeptonJets.h"
26 #include "KLFitter/PhysicsConstants.h"
27 #include "KLFitter/LikelihoodBase.h"
28 #include "KLFitter/DetectorAtlas_8TeV.h"
29 #include "KLFitter/Permutations.h"
30 
31 // system include(s):
32 #include <iostream>
33 #include <sstream>
34 #include <vector>
35 #include <cmath>
36 #include <memory>
37 
38 
47 
48 // Forware declare
49 namespace KLFitter {
50  class Particles;
51 }
52 
53 namespace top {
54  class Event;
55  class TopConfig;
56 
58  namespace KLFitterJetSelection {
64  };
65  }
66 
67 
68  class KLFitterTool final: public asg::AsgTool {
69  public:
71  explicit KLFitterTool(const std::string& name);
73  virtual ~KLFitterTool() {}
74 
76  virtual StatusCode initialize();
78  virtual StatusCode execute(const top::Event&);
80  virtual StatusCode finalize();
81  private:
82  // set jets depending on selection mode
83  bool setJets(const top::Event&, KLFitter::Particles* inputParticles);
84  bool setJetskLeadingThree(const top::Event&, KLFitter::Particles* inputParticles);
85  bool setJetskLeadingFour(const top::Event&, KLFitter::Particles* inputParticles);
86  bool setJetskLeadingFive(const top::Event&, KLFitter::Particles* inputParticles);
87  bool setJetskLeadingSix(const top::Event&, KLFitter::Particles* inputParticles);
88  bool setJetskLeadingSeven(const top::Event&, KLFitter::Particles* inputParticles);
89  bool setJetskLeadingEight(const top::Event&, KLFitter::Particles* inputParticles);
90 
91  bool setJetskLeadingX(const top::Event& event, KLFitter::Particles* inputParticles, const unsigned int);
92 
93 
94  bool setJetskBtagPriorityThreeJets(const top::Event&, KLFitter::Particles* inputParticles);
95  bool setJetskBtagPriorityFourJets(const top::Event&, KLFitter::Particles* inputParticles);
96  bool setJetskBtagPriorityFiveJets(const top::Event&, KLFitter::Particles* inputParticles);
97  bool setJetskBtagPrioritySixJets(const top::Event&, KLFitter::Particles* inputParticles);
98  bool setJetskBtagPrioritySevenJets(const top::Event&, KLFitter::Particles* inputParticles);
99  bool setJetskBtagPriorityEightJets(const top::Event&, KLFitter::Particles* inputParticles);
100 
101  bool setJetskBtagPriority(const top::Event&, KLFitter::Particles* inputParticles, const unsigned int maxJets);
102 
103  // configuration
104  std::shared_ptr<top::TopConfig> m_config;
105  float m_massTop;
106  // commented out variables are unused. experts please check and remove
107  // float m_bTagCutValue;
109  bool findOption(std::vector<std::string> full_options, std::string option, std::string& op_value);
110 
111  // Tools and functions for btagging
112  ToolHandle<IBTaggingEfficiencyTool> m_btagging_eff_tool;
113  bool HasTag(const xAOD::Jet& jet, double& weight) const;
114  void retrieveEfficiencies(const xAOD::Jet& jet, float* efficiency, float* inefficiency);
115 
119 
120  std::string m_selectionName;
121  std::string m_leptonType;
122  std::string m_customParameters;
123  std::string m_LHType;
130 
131  std::unique_ptr<KLFitter::LikelihoodTopLeptonJets> m_myLikelihood;
132  std::unique_ptr<KLFitter::LikelihoodTTHLeptonJets> m_myLikelihood_TTH;
133  std::unique_ptr<KLFitter::LikelihoodTopLeptonJets_JetAngles> m_myLikelihood_JetAngles;
134  std::unique_ptr<KLFitter::LikelihoodTopLeptonJets_Angular> m_myLikelihood_Angular;
135  std::unique_ptr<KLFitter::LikelihoodTTZTrilepton> m_myLikelihood_TTZ;
136  std::unique_ptr<KLFitter::LikelihoodTopAllHadronic> m_myLikelihood_AllHadronic;
137  std::unique_ptr<KLFitter::BoostedLikelihoodTopLeptonJets> m_myLikelihood_BoostedLJets;
138 
139  std::unique_ptr<KLFitter::DetectorAtlas_8TeV> m_myDetector;
140 
142  KLFitter::LikelihoodBase::BtaggingMethod m_bTaggingMethodKLFitterEnum;
143 
145  std::unique_ptr<KLFitter::Fitter> m_myFitter;
146  };
147 }
148 #endif
top::KLFitterTool::m_leptonTypeKLFitterEnum_JetAngles
KLFitter::LikelihoodTopLeptonJets_JetAngles::LeptonType m_leptonTypeKLFitterEnum_JetAngles
Definition: KLFitterTool.h:126
top::KLFitterTool::m_myFitter
std::unique_ptr< KLFitter::Fitter > m_myFitter
The KLFitter.
Definition: KLFitterTool.h:145
KLFitter
Interface to KLFitter.
Definition: KLFitterTool.h:49
top::KLFitterTool::m_leptonTypeKLFitterEnum_BoostedLJets
KLFitter::BoostedLikelihoodTopLeptonJets::LeptonType m_leptonTypeKLFitterEnum_BoostedLJets
Definition: KLFitterTool.h:129
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::KLFitterJetSelection::kLeadingSix
@ kLeadingSix
Definition: KLFitterTool.h:60
top::KLFitterTool::setJetskBtagPriorityThreeJets
bool setJetskBtagPriorityThreeJets(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:973
top::KLFitterTool::m_config
std::shared_ptr< top::TopConfig > m_config
Definition: KLFitterTool.h:104
top::KLFitterTool::m_myDetector
std::unique_ptr< KLFitter::DetectorAtlas_8TeV > m_myDetector
Definition: KLFitterTool.h:139
top::KLFitterTool::setJetskLeadingEight
bool setJetskLeadingEight(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:932
top::KLFitterTool::setJetskBtagPriorityFourJets
bool setJetskBtagPriorityFourJets(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:977
top::KLFitterTool::m_customParameters
std::string m_customParameters
Definition: KLFitterTool.h:122
Event
Definition: trigbs_orderedMerge.cxx:42
top::KLFitterTool::m_leptonTypeKLFitterEnum_TTZ
KLFitter::LikelihoodTTZTrilepton::LeptonType m_leptonTypeKLFitterEnum_TTZ
Definition: KLFitterTool.h:128
top::KLFitterTool::setJetskBtagPriorityEightJets
bool setJetskBtagPriorityEightJets(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:993
top::KLFitterTool::m_LHType
std::string m_LHType
Definition: KLFitterTool.h:123
top::KLFitterTool::m_transferFunctionsPathPrefix
std::string m_transferFunctionsPathPrefix
KLFitter parameters, to be set by input file.
Definition: KLFitterTool.h:117
top::KLFitterTool::setJetskLeadingSeven
bool setJetskLeadingSeven(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:928
top::KLFitterJetSelection::kBtagPrioritySevenJets
@ kBtagPrioritySevenJets
Definition: KLFitterTool.h:63
top::KLFitterTool::m_jetSelectionModeKLFitterEnum
top::KLFitterJetSelection::JetSelectionMode m_jetSelectionModeKLFitterEnum
Definition: KLFitterTool.h:141
top::KLFitterTool::m_selectionName
std::string m_selectionName
Definition: KLFitterTool.h:120
top::KLFitterTool::m_myLikelihood_AllHadronic
std::unique_ptr< KLFitter::LikelihoodTopAllHadronic > m_myLikelihood_AllHadronic
Definition: KLFitterTool.h:136
top::KLFitterTool::setJetskBtagPriorityFiveJets
bool setJetskBtagPriorityFiveJets(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:981
top::KLFitterTool::m_massTop
float m_massTop
Definition: KLFitterTool.h:105
top::KLFitterTool::setJetskLeadingSix
bool setJetskLeadingSix(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:924
top::KLFitterTool::m_isWorkingPoint
bool m_isWorkingPoint
Definition: KLFitterTool.h:108
top::KLFitterJetSelection::kBtagPriorityFourJets
@ kBtagPriorityFourJets
Definition: KLFitterTool.h:62
top::KLFitterTool::m_transferFunctionsPath
std::string m_transferFunctionsPath
Definition: KLFitterTool.h:118
top::KLFitterTool::~KLFitterTool
virtual ~KLFitterTool()
Destructor.
Definition: KLFitterTool.h:73
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
top::KLFitterTool::m_myLikelihood_TTZ
std::unique_ptr< KLFitter::LikelihoodTTZTrilepton > m_myLikelihood_TTZ
Definition: KLFitterTool.h:135
IBTaggingEfficiencyTool.h
top::KLFitterTool::setJetskLeadingThree
bool setJetskLeadingThree(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:912
efficiency
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition: dependence.cxx:128
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
top::KLFitterJetSelection::kBtagPriorityEightJets
@ kBtagPriorityEightJets
Definition: KLFitterTool.h:63
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
top::KLFitterTool::m_leptonTypeKLFitterEnum_TTH
KLFitter::LikelihoodTTHLeptonJets::LeptonType m_leptonTypeKLFitterEnum_TTH
Definition: KLFitterTool.h:125
top::KLFitterTool::m_leptonType
std::string m_leptonType
Definition: KLFitterTool.h:121
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
top::KLFitterTool::execute
virtual StatusCode execute(const top::Event &)
Function executing the tool.
Definition: KLFitterTool.cxx:358
top::KLFitterJetSelection::kLeadingThree
@ kLeadingThree
Definition: KLFitterTool.h:60
top::KLFitterTool::m_myLikelihood_TTH
std::unique_ptr< KLFitter::LikelihoodTTHLeptonJets > m_myLikelihood_TTH
Definition: KLFitterTool.h:132
makePlot.Particles
Particles
Definition: makePlot.py:25
top::KLFitterTool::m_leptonTypeKLFitterEnum
KLFitter::LikelihoodTopLeptonJets::LeptonType m_leptonTypeKLFitterEnum
Definition: KLFitterTool.h:124
top::KLFitterTool::setJetskBtagPrioritySixJets
bool setJetskBtagPrioritySixJets(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:985
top::KLFitterTool::setJets
bool setJets(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:860
top::KLFitterTool::m_myLikelihood_JetAngles
std::unique_ptr< KLFitter::LikelihoodTopLeptonJets_JetAngles > m_myLikelihood_JetAngles
Definition: KLFitterTool.h:133
top::KLFitterTool
Definition: KLFitterTool.h:68
top::KLFitterJetSelection::kLeadingFive
@ kLeadingFive
Definition: KLFitterTool.h:60
top::KLFitterTool::HasTag
bool HasTag(const xAOD::Jet &jet, double &weight) const
Definition: KLFitterTool.cxx:825
top::KLFitterJetSelection::kBtagPriorityFiveJets
@ kBtagPriorityFiveJets
Definition: KLFitterTool.h:62
top::KLFitterTool::setJetskBtagPrioritySevenJets
bool setJetskBtagPrioritySevenJets(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:989
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
top::KLFitterTool::setJetskLeadingFive
bool setJetskLeadingFive(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:920
top::KLFitterTool::m_myLikelihood_Angular
std::unique_ptr< KLFitter::LikelihoodTopLeptonJets_Angular > m_myLikelihood_Angular
Definition: KLFitterTool.h:134
top::KLFitterTool::setJetskLeadingX
bool setJetskLeadingX(const top::Event &event, KLFitter::Particles *inputParticles, const unsigned int)
Definition: KLFitterTool.cxx:936
top::KLFitterTool::m_btagging_eff_tool
ToolHandle< IBTaggingEfficiencyTool > m_btagging_eff_tool
Definition: KLFitterTool.h:112
top::KLFitterJetSelection::kLeadingFour
@ kLeadingFour
Definition: KLFitterTool.h:60
top::KLFitterJetSelection::JetSelectionMode
JetSelectionMode
Definition: KLFitterTool.h:59
top::LeptonType
LeptonType
Definition: PseudoTopReco.h:36
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
top::KLFitterTool::m_bTaggingMethodKLFitterEnum
KLFitter::LikelihoodBase::BtaggingMethod m_bTaggingMethodKLFitterEnum
Definition: KLFitterTool.h:142
JetContainer.h
top::KLFitterTool::KLFitterTool
KLFitterTool(const std::string &name)
Constructor.
Definition: KLFitterTool.cxx:17
top::KLFitterJetSelection::kLeadingSeven
@ kLeadingSeven
Definition: KLFitterTool.h:61
Tokenize.h
top::KLFitterTool::findOption
bool findOption(std::vector< std::string > full_options, std::string option, std::string &op_value)
Config helpers.
Definition: KLFitterTool.cxx:339
JetAuxContainer.h
top::KLFitterTool::initialize
virtual StatusCode initialize()
Function initialising the tool.
Definition: KLFitterTool.cxx:39
top::KLFitterTool::retrieveEfficiencies
void retrieveEfficiencies(const xAOD::Jet &jet, float *efficiency, float *inefficiency)
Definition: KLFitterTool.cxx:839
top::KLFitterTool::m_leptonTypeKLFitterEnum_Angular
KLFitter::LikelihoodTopLeptonJets_Angular::LeptonType m_leptonTypeKLFitterEnum_Angular
Definition: KLFitterTool.h:127
top::KLFitterJetSelection::kBtagPriorityThreeJets
@ kBtagPriorityThreeJets
Definition: KLFitterTool.h:61
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
AsgTool.h
top::KLFitterTool::m_myLikelihood
std::unique_ptr< KLFitter::LikelihoodTopLeptonJets > m_myLikelihood
Definition: KLFitterTool.h:131
top::KLFitterTool::finalize
virtual StatusCode finalize()
Function finalizing the tool.
Definition: KLFitterTool.cxx:1067
top::KLFitterTool::setJetskBtagPriority
bool setJetskBtagPriority(const top::Event &, KLFitter::Particles *inputParticles, const unsigned int maxJets)
Definition: KLFitterTool.cxx:997
top::KLFitterTool::setJetskLeadingFour
bool setJetskLeadingFour(const top::Event &, KLFitter::Particles *inputParticles)
Definition: KLFitterTool.cxx:916
top::KLFitterJetSelection::kBtagPrioritySixJets
@ kBtagPrioritySixJets
Definition: KLFitterTool.h:62
top::KLFitterTool::m_myLikelihood_BoostedLJets
std::unique_ptr< KLFitter::BoostedLikelihoodTopLeptonJets > m_myLikelihood_BoostedLJets
Definition: KLFitterTool.h:137
top::KLFitterJetSelection::kLeadingEight
@ kLeadingEight
Definition: KLFitterTool.h:61