8#ifndef KLFITTERNANALYSISALGORITHMS_RUNKLFITTERALG_H_
9#define KLFITTERNANALYSISALGORITHMS_RUNKLFITTERALG_H_
33#include "KLFitter/BoostedLikelihoodTopLeptonJets.h"
34#include "KLFitter/DetectorAtlas_8TeV.h"
35#include "KLFitter/Fitter.h"
36#include "KLFitter/LikelihoodTTHLeptonJets.h"
37#include "KLFitter/LikelihoodTTZTrilepton.h"
38#include "KLFitter/LikelihoodTopAllHadronic.h"
39#include "KLFitter/LikelihoodTopLeptonJets.h"
40#include "KLFitter/LikelihoodTopLeptonJets_Angular.h"
41#include "KLFitter/LikelihoodTopLeptonJets_JetAngles.h"
42#include "KLFitter/Permutations.h"
51 virtual StatusCode
execute()
final;
56 const std::vector<const xAOD::Electron *> &selected_electrons,
57 const std::vector<const xAOD::Muon *> &selected_muons,
58 KLFitter::Particles *myParticles);
60 StatusCode
add_jets(
const std::vector<const xAOD::Jet *> &selected_jets,
61 KLFitter::Particles *myParticles);
64 KLFitter::Particles *inputParticles,
71 KLFitter::Particles *inputParticles,
72 const size_t maxJets);
75 const std::vector<size_t> &electron_indices,
76 const std::vector<size_t> &muon_indices,
77 const std::vector<size_t> &jet_indices);
80 std::vector<const T *>
sortPt(
const std::vector<const T *> &particles,
81 std::vector<size_t> &indices) {
82 std::vector<std::pair<const T *, size_t>> particle_index(particles.size());
84 for (
const T *
const p : particles) {
85 particle_index[indx] = {p, indx};
89 particle_index.begin(), particle_index.end(),
90 [](std::pair<const T *, size_t> &
x, std::pair<const T *, size_t> &
y) {
91 return x.first->pt() > y.first->pt();
93 std::vector<const T *> sorted_particles(particles.size());
95 indices.resize(particles.size());
96 for (
auto &elem : particle_index) {
97 sorted_particles[indx] = elem.first;
98 indices[indx] = elem.second;
101 return sorted_particles;
109 this,
"electrons",
"",
"the electron container to use"};
111 this,
"electronSelection",
"",
"the selection on the input electrons"};
114 this,
"muons",
"",
"the muon container to use"};
116 this,
"muonSelection",
"",
"the selection on the input muons"};
119 this,
"jets",
"",
"the jet container to use"};
121 "the selection on the input jets"};
124 this,
"met",
"",
"the MET container to use"};
127 this,
"eventInfo",
"EventInfo",
128 "the EventInfo container to read selection deciosions from"};
134 "the output KLFitterResultContainer"};
137 "Name of the selection on which this "
138 "KLFitter instance is allowed to run"};
141 Gaudi::Property<std::string>
m_leptonType{
this,
"LeptonType",
"kUndefined",
142 "Define the lepton type"};
143 Gaudi::Property<std::string>
m_LHType{
this,
"LHType",
"kUndefined",
144 "Define the Likelihood type"};
146 this,
"TransferFunctionsPath",
147 "dev/AnalysisTop/KLFitterTFs/mc12a/akt4_LCtopo_PP6/",
148 "Path to transfer functions"};
150 this,
"JetSelectionMode",
"kBtagPriorityFourJets",
151 "Define the behavior for selecting jets"};
153 this,
"BTaggingMethod",
"kNotag",
154 "Method for accounting b-tagging information"};
156 this,
"BTaggingDecoration",
"",
157 "Name of the btag decision decoration for jets"};
158 Gaudi::Property<std::string>
m_METterm{
this,
"METterm",
"Final",
159 "Which MET term should be used"};
161 this,
"TopMass", 172.5,
162 "The mass of top quark used in KLFitter likelihood (assuming the fixed "
163 "m_top mode is used)"};
165 this,
"TopMassFixed",
true,
166 "If the top quark mass is fixed in the likelihood to the value of "
167 "TopMass parameter"};
169 this,
"SaveAllPermutations",
false,
170 "Whether to store only the permutation with highest KLFitter event "
171 "probability, or all"};
173 this,
"FailOnLessThanXJets",
false,
174 "Fail if kLeadingX or kBtagPriorityXJets is set and the number of jets "
175 "in the event is less than X"};
191 KLFitter::LikelihoodTopLeptonJets_JetAngles::LeptonType
193 KLFitter::LikelihoodTopLeptonJets_Angular::LeptonType
196 KLFitter::BoostedLikelihoodTopLeptonJets::LeptonType
201 std::unique_ptr<KLFitter::LikelihoodTopLeptonJets_JetAngles>
203 std::unique_ptr<KLFitter::LikelihoodTopLeptonJets_Angular>
206 std::unique_ptr<KLFitter::LikelihoodTopAllHadronic>
208 std::unique_ptr<KLFitter::BoostedLikelihoodTopLeptonJets>
212 this,
"btagEffTool",
"",
"the b-tagging efficiency tool"};
a class managing the property to configure the list of systematics to process
a data handle for reading systematics varied input data
a data handle for reading systematically varied selection properties from objects
a data handle for writing systematics varied input data
Class to wrap a set of SystematicVariations.
the (new) base class for EventLoop algorithms
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
StatusCode evaluatePermutations(const CP::SystematicSet &sys, const std::vector< size_t > &electron_indices, const std::vector< size_t > &muon_indices, const std::vector< size_t > &jet_indices)
CP::SysWriteHandle< xAOD::KLFitterResultContainer, xAOD::KLFitterResultAuxContainer > m_outHandle
KLFitter::LikelihoodTTZTrilepton::LeptonType m_leptonTypeKLFitterEnum_TTZ
virtual StatusCode initialize() final
StatusCode retrieveEfficiencies(const xAOD::Jet *jet, float *eff, float *ineff)
size_t m_njetsRequirement
std::unique_ptr< KLFitter::LikelihoodTopLeptonJets_JetAngles > m_myLikelihood_JetAngles
CP::SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
std::unique_ptr< KLFitter::LikelihoodTTHLeptonJets > m_myLikelihood_TTH
Gaudi::Property< std::string > m_transferFunctionsPath
StatusCode setJetskLeadingN(const std::vector< const xAOD::Jet * > &jets, KLFitter::Particles *inputParticles, const size_t njets)
CP::SysListHandle m_systematicsList
std::unique_ptr< SG::ConstAccessor< char > > m_bTagDecoAcc
std::unique_ptr< KLFitter::DetectorAtlas_8TeV > m_myDetector
CP::SysReadSelectionHandle m_muonSelection
StatusCode execute_syst(const CP::SystematicSet &sys)
CP::SysReadHandle< xAOD::ElectronContainer > m_electronsHandle
KLFEnums::JetSelectionMode m_jetSelectionModeEnum
std::unique_ptr< KLFitter::LikelihoodTTZTrilepton > m_myLikelihood_TTZ
KLFEnums::LeptonType m_leptonTypeEnum
std::vector< const T * > sortPt(const std::vector< const T * > &particles, std::vector< size_t > &indices)
Gaudi::Property< bool > m_fixedTopMass
CP::SysReadHandle< xAOD::JetContainer > m_jetsHandle
std::unique_ptr< KLFitter::LikelihoodTopLeptonJets > m_myLikelihood
Gaudi::Property< std::string > m_leptonType
KLFitter::BoostedLikelihoodTopLeptonJets::LeptonType m_leptonTypeKLFitterEnum_BoostedLJets
KLFitter::LikelihoodTopLeptonJets_Angular::LeptonType m_leptonTypeKLFitterEnum_Angular
std::unique_ptr< KLFitter::BoostedLikelihoodTopLeptonJets > m_myLikelihood_BoostedLJets
Gaudi::Property< std::string > m_bTaggingMethod
StatusCode add_leptons(const std::vector< const xAOD::Electron * > &selected_electrons, const std::vector< const xAOD::Muon * > &selected_muons, KLFitter::Particles *myParticles)
Gaudi::Property< bool > m_saveAllPermutations
Gaudi::Property< std::string > m_METterm
CP::SysReadHandle< xAOD::MissingETContainer > m_metHandle
KLFEnums::Likelihood m_LHTypeEnum
CP::SysReadSelectionHandle m_selection
KLFitter::LikelihoodBase::BtaggingMethod m_bTaggingMethodEnum
ToolHandle< IBTaggingEfficiencyTool > m_btagging_eff_tool
Gaudi::Property< std::string > m_bTagDecoration
KLFitter::LikelihoodTopLeptonJets_JetAngles::LeptonType m_leptonTypeKLFitterEnum_JetAngles
StatusCode setJetskBtagPriority(const std::vector< const xAOD::Jet * > &jets, KLFitter::Particles *inputParticles, const size_t maxJets)
KLFEnums::JetSelectionMode m_jetSelectionModeKLFitterEnum
CP::SysReadHandle< xAOD::MuonContainer > m_muonsHandle
std::unique_ptr< KLFitter::LikelihoodTopLeptonJets_Angular > m_myLikelihood_Angular
KLFitter::LikelihoodTTHLeptonJets::LeptonType m_leptonTypeKLFitterEnum_TTH
Gaudi::Property< bool > m_failOnLessThanXJets
CP::SysReadSelectionHandle m_electronSelection
virtual StatusCode execute() final
Gaudi::Property< std::string > m_jetSelectionMode
KLFitter::LikelihoodTopLeptonJets::LeptonType m_leptonTypeKLFitterEnum
StatusCode add_jets(const std::vector< const xAOD::Jet * > &selected_jets, KLFitter::Particles *myParticles)
CP::SysReadSelectionHandle m_jetSelection
Gaudi::Property< std::string > m_LHType
std::unique_ptr< KLFitter::Fitter > m_myFitter
Gaudi::Property< float > m_massTop
std::unique_ptr< KLFitter::LikelihoodTopAllHadronic > m_myLikelihood_AllHadronic
Auxiliary container for xAOD::KLFitterResultContainer.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Jet_v1 Jet
Definition of the current "jet version".
DataVector< xAOD::KLFitterResult > KLFitterResultContainer
Definition of the KLFitterResultContainer type.