Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:20

0001 #ifndef TtSemiLepJetCombMVATrainer_h
0002 #define TtSemiLepJetCombMVATrainer_h
0003 
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 #include "FWCore/Framework/interface/EDAnalyzer.h"
0007 #include "FWCore/Framework/interface/Frameworkfwd.h"
0008 #include "FWCore/Framework/interface/MakerMacros.h"
0009 #include "FWCore/Framework/interface/ESHandle.h"
0010 #include "FWCore/Utilities/interface/InputTag.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 
0013 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
0014 #include "DataFormats/PatCandidates/interface/MET.h"
0015 #include "DataFormats/PatCandidates/interface/Jet.h"
0016 
0017 #include "AnalysisDataFormats/TopObjects/interface/TopGenEvent.h"
0018 #include "AnalysisDataFormats/TopObjects/interface/TtGenEvent.h"
0019 #include "AnalysisDataFormats/TopObjects/interface/TtSemiLepEvtPartons.h"
0020 
0021 #include "PhysicsTools/MVAComputer/interface/HelperMacros.h"
0022 #include "PhysicsTools/MVAComputer/interface/MVAComputerCache.h"
0023 
0024 #ifndef TtSemiLepJetCombMVARcd_defined  // to avoid conflicts with the TtSemiLepJetCombMVAComputer
0025 #define TtSemiLepJetCombMVARcd_defined
0026 MVA_COMPUTER_CONTAINER_DEFINE(TtSemiLepJetCombMVA);  // defines TtSemiLepJetCombMVARcd
0027 #endif
0028 
0029 class TtSemiLepJetCombMVATrainer : public edm::EDAnalyzer {
0030 public:
0031   explicit TtSemiLepJetCombMVATrainer(const edm::ParameterSet&);
0032   ~TtSemiLepJetCombMVATrainer() override;
0033 
0034 private:
0035   void beginJob() override;
0036   void analyze(const edm::Event& evt, const edm::EventSetup& setup) override;
0037   void endJob() override;
0038 
0039   WDecay::LeptonType readLeptonType(const std::string& str);
0040 
0041   edm::EDGetTokenT<TtGenEvent> genEvtToken_;
0042   edm::EDGetTokenT<edm::View<reco::RecoCandidate> > lepsToken_;
0043   edm::EDGetTokenT<std::vector<pat::Jet> > jetsToken_;
0044   edm::EDGetTokenT<std::vector<pat::MET> > metsToken_;
0045   edm::EDGetTokenT<std::vector<std::vector<int> > > matchingToken_;
0046 
0047   int maxNJets_;
0048 
0049   WDecay::LeptonType leptonType_;
0050 
0051   PhysicsTools::MVAComputerCache mvaComputer;
0052 
0053   unsigned int nEvents[5];
0054 };
0055 
0056 #endif