diff --git a/PhysicsTools/HepMCCandAlgos/test/TestGenParticleCandidates.cc b/PhysicsTools/HepMCCandAlgos/test/TestGenParticleCandidates.cc deleted file mode 100755 index 2eae9a92e269c..0000000000000 --- a/PhysicsTools/HepMCCandAlgos/test/TestGenParticleCandidates.cc +++ /dev/null @@ -1,58 +0,0 @@ -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "DataFormats/Common/interface/Handle.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "FWCore/Utilities/interface/EDMException.h" -using namespace std; -using namespace edm; -using namespace reco; - -class TestGenParticleCandidates : public EDAnalyzer { -private: - bool dumpHepMC_; -public: - explicit TestGenParticleCandidates( const ParameterSet & cfg ) : - srcToken_( consumes( cfg.getParameter( "src" ) ) ) { - } -private: - void analyze( const Event & evt, const EventSetup&) override { - Handle gen; - evt.getByToken( srcToken_, gen ); - size_t n = gen->size(); - if (n == 0) - throw Exception(errors::EventCorruption) - << "No particles in genParticleCandidates\n"; - for(size_t i = 0; i < n; ++ i) { - const Candidate & p = (*gen)[i]; - size_t nd = p.numberOfDaughters(); - if(nd==0 && p.status()==3) - throw Exception(errors::EventCorruption) - << "Particle with no daughters and status " << p.status() - << ", pdgId = " << p.pdgId() << "\n"; - for(size_t j = 0; j < nd; ++ j ) { - const Candidate * d = p.daughter(j); - size_t nm = d->numberOfMothers(); - bool noMother = true; - for(size_t k = 0; k < nm; ++ k ) { - if(d->mother(k)==&p) { - noMother = false; - break; - } - } - if(noMother) - throw Exception(errors::EventCorruption) - << "Inconsistent mother/daughter relation, pdgId = " << d->pdgId() << "\n"; - } - } - } - EDGetTokenT srcToken_; -}; - -#include "FWCore/Framework/interface/MakerMacros.h" - -DEFINE_FWK_MODULE( TestGenParticleCandidates ); - - - diff --git a/TopQuarkAnalysis/TopEventSelection/plugins/TtFullHadSignalSelMVATrainer.h b/TopQuarkAnalysis/TopEventSelection/plugins/TtFullHadSignalSelMVATrainer.h deleted file mode 100644 index d0d99a8cab704..0000000000000 --- a/TopQuarkAnalysis/TopEventSelection/plugins/TtFullHadSignalSelMVATrainer.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef TtFullHadSignalSelMVATrainer_h -#define TtFullHadSignalSelMVATrainer_h - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "PhysicsTools/MVAComputer/interface/HelperMacros.h" -#include "PhysicsTools/MVAComputer/interface/MVAComputerCache.h" - -#include "AnalysisDataFormats/TopObjects/interface/TtEvent.h" -#include "DataFormats/PatCandidates/interface/Jet.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -#ifndef TtFullHadSignalSelMVARcd_defined // to avoid conflicts with the TtFullHadSignalSelMVAComputer -#define TtFullHadSignalSelMVARcd_defined -MVA_COMPUTER_CONTAINER_DEFINE(TtFullHadSignalSelMVA); // defines TtFullHadSignalSelMVA -#endif - -class TtFullHadSignalSelMVATrainer : public edm::EDAnalyzer { -public: - explicit TtFullHadSignalSelMVATrainer(const edm::ParameterSet&); - ~TtFullHadSignalSelMVATrainer() override; - -private: - void analyze(const edm::Event& evt, const edm::EventSetup& setup) override; - void beginJob() override; - - edm::EDGetTokenT > jetsToken_; - edm::EDGetTokenT genEvtToken_; - - int whatData_; - int maxEv_; - int selEv; - double weight_; - - PhysicsTools::MVAComputerCache mvaComputer; -}; - -#endif diff --git a/TopQuarkAnalysis/TopEventSelection/plugins/TtSemiLepSignalSelMVATrainer.h b/TopQuarkAnalysis/TopEventSelection/plugins/TtSemiLepSignalSelMVATrainer.h deleted file mode 100644 index c0c84c88888cb..0000000000000 --- a/TopQuarkAnalysis/TopEventSelection/plugins/TtSemiLepSignalSelMVATrainer.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef TtSemiLepSignalSelMVATrainer_h -#define TtSemiLepSignalSelMVATrainer_h - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "PhysicsTools/MVAComputer/interface/HelperMacros.h" -#include "PhysicsTools/MVAComputer/interface/MVAComputerCache.h" - -#include "AnalysisDataFormats/TopObjects/interface/TtEvent.h" -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/PatCandidates/interface/Jet.h" -#include "DataFormats/PatCandidates/interface/Muon.h" -#include "DataFormats/PatCandidates/interface/Electron.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -#ifndef TtSemiLepSignalSelMVARcd_defined // to avoid conflicts with the TtSemiSignalSelMVAComputer -#define TtSemiLepSignalSelMVARcd_defined -MVA_COMPUTER_CONTAINER_DEFINE(TtSemiLepSignalSelMVA); // defines TtSemiLepSignalSelMVA -#endif - -class TtSemiLepSignalSelMVATrainer : public edm::EDAnalyzer { -public: - explicit TtSemiLepSignalSelMVATrainer(const edm::ParameterSet&); - ~TtSemiLepSignalSelMVATrainer() override; - -private: - void analyze(const edm::Event& evt, const edm::EventSetup& setup) override; - void beginJob() override; - - double DeltaPhi(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2); - double DeltaR(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2); - - // pt sorting stuff - struct JetwithHigherPt { - bool operator()(const pat::Jet& j1, const pat::Jet& j2) const { return j1.pt() > j2.pt(); }; - }; - - edm::EDGetTokenT > muonsToken_; - edm::EDGetTokenT > electronsToken_; - edm::EDGetTokenT > jetsToken_; - edm::EDGetTokenT > METsToken_; - edm::EDGetTokenT genEvtToken_; - - int lepChannel_; - int whatData_; - int maxEv_; - int selEv; - - PhysicsTools::MVAComputerCache mvaComputer; -}; - -#endif diff --git a/TopQuarkAnalysis/TopEventSelection/python/TtFullHadSignalSelMVATrainer_cfi.py b/TopQuarkAnalysis/TopEventSelection/python/TtFullHadSignalSelMVATrainer_cfi.py deleted file mode 100644 index e98a4e6c2a5df..0000000000000 --- a/TopQuarkAnalysis/TopEventSelection/python/TtFullHadSignalSelMVATrainer_cfi.py +++ /dev/null @@ -1,24 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# -# module to make mvaTraining for jet parton associations -# -buildTraintree = cms.EDAnalyzer("TtFullHadSignalSelMVATrainer", - #input tags used in the example - jets = cms.InputTag("selectedPatJets"), - - #three possibilities: - # whatData=-1: in your training-file both, signal and background events are available - # whatData=1: your training-file contains only signal events - # whatData=0: your training-file contains only background events - whatData = cms.int32(1), - - #maximum number of training events to be used - # maxEv = -1: all events are used - # for example maxEv = 5000: writes only the first 5000 events to the training tree - maxEv = cms.int32(-1), - #event weight to be put here: - # standard is set to 1, so no weight is applied - # for example if different samples with different integrated luminosities have to be combined - weight = cms.double(1.0) -) diff --git a/TopQuarkAnalysis/TopEventSelection/python/TtSemiLepSignalSelMVATrainer_cfi.py b/TopQuarkAnalysis/TopEventSelection/python/TtSemiLepSignalSelMVATrainer_cfi.py deleted file mode 100644 index e78e3b890927b..0000000000000 --- a/TopQuarkAnalysis/TopEventSelection/python/TtSemiLepSignalSelMVATrainer_cfi.py +++ /dev/null @@ -1,30 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# -# module to make mvaTraining for jet parton associations -# -buildTraintree = cms.EDAnalyzer("TtSemiLepSignalSelMVATrainer", - #input tags used in the example - muons = cms.InputTag("selectedPatMuons"), - elecs = cms.InputTag("selectedPatElectrons"), - jets = cms.InputTag("cleanPatJets"), - mets = cms.InputTag("patMETs"), - - # ------------------------------------------------ - # select semileptonic signal channel - # (all others are taken as background for training) - # 1: electron, 2: muon, 3: tau - # ------------------------------------------------ - lepChannel = cms.int32(2), - - #three possibilities: - # whatData=-1: in your training-file both, signal and background events are available - # whatData=1: your training-file contains only signal events - # whatData=0: your training-file contains only background events - whatData = cms.int32(1), - - #maximum number of training events to be used - # maxEv = -1: all events are used - # for example maxEv = 5000: writes only the first 5000 events to the training tree - maxEv = cms.int32(-1), -) diff --git a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMVATrainer.h b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMVATrainer.h deleted file mode 100644 index 55905de3673ff..0000000000000 --- a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMVATrainer.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef TtSemiLepJetCombMVATrainer_h -#define TtSemiLepJetCombMVATrainer_h - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/PatCandidates/interface/Jet.h" - -#include "AnalysisDataFormats/TopObjects/interface/TopGenEvent.h" -#include "AnalysisDataFormats/TopObjects/interface/TtGenEvent.h" -#include "AnalysisDataFormats/TopObjects/interface/TtSemiLepEvtPartons.h" - -#include "PhysicsTools/MVAComputer/interface/HelperMacros.h" -#include "PhysicsTools/MVAComputer/interface/MVAComputerCache.h" - -#ifndef TtSemiLepJetCombMVARcd_defined // to avoid conflicts with the TtSemiLepJetCombMVAComputer -#define TtSemiLepJetCombMVARcd_defined -MVA_COMPUTER_CONTAINER_DEFINE(TtSemiLepJetCombMVA); // defines TtSemiLepJetCombMVARcd -#endif - -class TtSemiLepJetCombMVATrainer : public edm::EDAnalyzer { -public: - explicit TtSemiLepJetCombMVATrainer(const edm::ParameterSet&); - ~TtSemiLepJetCombMVATrainer() override; - -private: - void beginJob() override; - void analyze(const edm::Event& evt, const edm::EventSetup& setup) override; - void endJob() override; - - WDecay::LeptonType readLeptonType(const std::string& str); - - edm::EDGetTokenT genEvtToken_; - edm::EDGetTokenT > lepsToken_; - edm::EDGetTokenT > jetsToken_; - edm::EDGetTokenT > metsToken_; - edm::EDGetTokenT > > matchingToken_; - - int maxNJets_; - - WDecay::LeptonType leptonType_; - - PhysicsTools::MVAComputerCache mvaComputer; - - unsigned int nEvents[5]; -}; - -#endif diff --git a/TopQuarkAnalysis/TopJetCombination/python/TtSemiLepJetCombMVATrainer_cfi.py b/TopQuarkAnalysis/TopJetCombination/python/TtSemiLepJetCombMVATrainer_cfi.py deleted file mode 100644 index 7064b3b858c5d..0000000000000 --- a/TopQuarkAnalysis/TopJetCombination/python/TtSemiLepJetCombMVATrainer_cfi.py +++ /dev/null @@ -1,30 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# -# module to perform MVA training for jet-parton association -# -trainTtSemiLepJetCombMVA = cms.EDAnalyzer("TtSemiLepJetCombMVATrainer", - #------------------------------------------------- - # sources (leptons, jets, MET, jet-parton matching) - #------------------------------------------------- - leps = cms.InputTag("selectedPatMuons"), - jets = cms.InputTag("selectedPatJets"), - mets = cms.InputTag("patMETs"), - matching = cms.InputTag("ttSemiLepJetPartonMatch"), - - # ------------------------------------------------ - # select semileptonic signal channel - # (all others are taken as background for training) - # either "kElec", "kMuon" or "kTau" - # ------------------------------------------------ - leptonType = cms.string("kMuon"), - - # ------------------------------------------------ - # maximum number of jets to be considered - # (has to be >= 4, can be set to -1 if you - # want to take all) - # ------------------------------------------------ - maxNJets = cms.int32(4) -) - -