Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef TtSemiLepSignalSelMVATrainer_h
0002 #define TtSemiLepSignalSelMVATrainer_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 "PhysicsTools/MVAComputer/interface/HelperMacros.h"
0014 #include "PhysicsTools/MVAComputer/interface/MVAComputerCache.h"
0015 
0016 #include "AnalysisDataFormats/TopObjects/interface/TtEvent.h"
0017 #include "DataFormats/PatCandidates/interface/MET.h"
0018 #include "DataFormats/PatCandidates/interface/Jet.h"
0019 #include "DataFormats/PatCandidates/interface/Muon.h"
0020 #include "DataFormats/PatCandidates/interface/Electron.h"
0021 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
0022 
0023 #ifndef TtSemiLepSignalSelMVARcd_defined  // to avoid conflicts with the TtSemiSignalSelMVAComputer
0024 #define TtSemiLepSignalSelMVARcd_defined
0025 MVA_COMPUTER_CONTAINER_DEFINE(TtSemiLepSignalSelMVA);  // defines TtSemiLepSignalSelMVA
0026 #endif
0027 
0028 class TtSemiLepSignalSelMVATrainer : public edm::EDAnalyzer {
0029 public:
0030   explicit TtSemiLepSignalSelMVATrainer(const edm::ParameterSet&);
0031   ~TtSemiLepSignalSelMVATrainer() override;
0032 
0033 private:
0034   void analyze(const edm::Event& evt, const edm::EventSetup& setup) override;
0035   void beginJob() override;
0036 
0037   double DeltaPhi(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2);
0038   double DeltaR(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2);
0039 
0040   // pt sorting stuff
0041   struct JetwithHigherPt {
0042     bool operator()(const pat::Jet& j1, const pat::Jet& j2) const { return j1.pt() > j2.pt(); };
0043   };
0044 
0045   edm::EDGetTokenT<edm::View<pat::Muon> > muonsToken_;
0046   edm::EDGetTokenT<edm::View<pat::Electron> > electronsToken_;
0047   edm::EDGetTokenT<std::vector<pat::Jet> > jetsToken_;
0048   edm::EDGetTokenT<edm::View<pat::MET> > METsToken_;
0049   edm::EDGetTokenT<TtGenEvent> genEvtToken_;
0050 
0051   int lepChannel_;
0052   int whatData_;
0053   int maxEv_;
0054   int selEv;
0055 
0056   PhysicsTools::MVAComputerCache mvaComputer;
0057 };
0058 
0059 #endif