Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:15

0001 #include "PhysicsTools/JetMCUtils/interface/combination.h"
0002 
0003 #include "TopQuarkAnalysis/TopEventSelection/plugins/TtFullHadSignalSelMVAComputer.h"
0004 #include "TopQuarkAnalysis/TopEventSelection/interface/TtFullHadSignalSelEval.h"
0005 
0006 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
0007 
0008 #include "DataFormats/Common/interface/TriggerResults.h"
0009 #include "FWCore/Framework/interface/TriggerNamesService.h"
0010 #include "FWCore/ServiceRegistry/interface/Service.h"
0011 #include "DataFormats/PatCandidates/interface/Flags.h"
0012 
0013 TtFullHadSignalSelMVAComputer::TtFullHadSignalSelMVAComputer(const edm::ParameterSet& cfg)
0014     : mvaToken_(esConsumes()),
0015       jetsToken_(consumes<std::vector<pat::Jet> >(cfg.getParameter<edm::InputTag>("jets"))),
0016       putToken_(produces("DiscSel")) {}
0017 
0018 void TtFullHadSignalSelMVAComputer::produce(edm::Event& evt, const edm::EventSetup& setup) {
0019   mvaComputer.update(&setup.getData(mvaToken_), "ttFullHadSignalSelMVA");
0020 
0021   const auto& jets = evt.get(jetsToken_);
0022 
0023   //calculation of InputVariables
0024   //see TopQuarkAnalysis/TopTools/interface/TtFullHadSignalSel.h
0025   //                             /src/TtFullHadSignalSel.cc
0026   //all objects, jets, which are needed for the calculation
0027   //of the input-variables have to be passed to this class
0028   TtFullHadSignalSel selection(jets);
0029 
0030   double discrim = evaluateTtFullHadSignalSel(mvaComputer, selection);
0031 
0032   evt.emplace(putToken_, discrim);
0033 }
0034 
0035 // implement the plugins for the computer container
0036 // -> register TtFullHadSignalSelMVARcd
0037 // -> define TtFullHadSignalSelMVAFileSource
0038 MVA_COMPUTER_CONTAINER_IMPLEMENT(TtFullHadSignalSelMVA);