14 muonsToken_ (consumes< edm::
View<pat::
Muon> >(cfg.getParameter<edm::
InputTag>(
"muons"))),
15 electronsToken_ (consumes< edm::
View<pat::
Electron> >(cfg.getParameter<edm::
InputTag>(
"elecs"))),
16 jetsToken_ (consumes< std::vector<pat::
Jet> >(cfg.getParameter<edm::
InputTag>(
"jets"))),
17 METsToken_ (consumes<edm::
View<pat::
MET> >(cfg.getParameter<edm::
InputTag>(
"mets"))),
19 lepChannel_(cfg.getParameter<int>(
"lepChannel")),
20 whatData_ (cfg.getParameter<int>(
"whatData")),
21 maxEv_ (cfg.getParameter<int>(
"maxEv"))
44 if(!MET_handle.
isValid())
return;
49 if(!jet_handle.
isValid())
return;
50 const std::vector<pat::Jet>
jets = *jet_handle;
51 unsigned int nJets = 0;
52 std::vector<pat::Jet> seljets;
54 for(std::vector<pat::Jet>::const_iterator it = jets.begin(); it != jets.end(); it++) {
57 if(it->et()>30. && fabs(it->eta())<2.4) {
58 seljets.push_back(*it);
70 if(!muon_handle.isValid())
return;
73 std::vector<pat::Muon> selMuons;
77 if(it->pt()>30 && fabs(it->eta())<2.1 && (it->pt()/(it->pt()+it->trackIso()+it->caloIso()))>0.95 && it->isGlobalMuon()){
78 if(gltr.
isNull())
continue;
79 if((gltr->chi2()/gltr->ndof())<10 && trtr->numberOfValidHits()>=11) {
82 for(std::vector<pat::Jet>::const_iterator ajet = seljets.begin(); ajet != seljets.end(); ajet++) {
85 double tmpdR =
DeltaR(muon,jet);
86 if(tmpdR<dRmin) dRmin = tmpdR;
90 selMuons.push_back(*it);
100 if(!electron_handle.
isValid())
return;
104 if(it->pt()>30 && fabs(it->eta())<2.4 && (it->pt()/(it->pt()+it->trackIso()+it->caloIso()))>0.95 && it->isElectronIDAvailable(
"eidTight"))
106 if(it->electronID(
"eidTight")==1) nelectrons++;
109 if(nelectrons>0)
return;
144 if(genEvt->isSemiLeptonic() && genEvt->semiLeptonicChannel() ==
lepChannel_) {
154 else std::cout<<
"Config File Error!! Please check <whatData> in TtSemiLepSignalSelMVATrainer.cfi";
161 std::cout<<
"Config File Error!! Please check <whatData> in TtSemiLepSignalSelMVATrainer.cfi"<<std::endl;;
168 double dPhi = fabs(v1.Phi() - v2.Phi());
176 double dR = TMath::Sqrt((v1.Eta()-v2.Eta())*(v1.Eta()-v2.Eta())+dPhi*dPhi);
edm::EDGetTokenT< edm::View< pat::MET > > METsToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double evaluateTtSemiLepSignalSel(PhysicsTools::MVAComputerCache &mvaComputer, const TtSemiLepSignalSel &sigsel, float weight=1., const bool training=false, const bool isSignal=false)
PhysicsTools::MVAComputerCache mvaComputer
static bool test(uint32_t val, uint32_t mask)
#define MVA_TRAINER_IMPLEMENT(N)
TtSemiLepSignalSelMVATrainer(const edm::ParameterSet &)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
double DeltaPhi(const math::XYZTLorentzVector &v1, const math::XYZTLorentzVector &v2)
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
const_iterator begin() const
edm::EDGetTokenT< TtGenEvent > genEvtToken_
Class derived from the TopGenEvent for ttbar events.
double dPhi(double phi1, double phi2)
virtual void analyze(const edm::Event &evt, const edm::EventSetup &setup)
edm::EDGetTokenT< edm::View< pat::Muon > > muonsToken_
bool isNull() const
Checks for null.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
~TtSemiLepSignalSelMVATrainer()
const_iterator end() const
double DeltaR(const math::XYZTLorentzVector &v1, const math::XYZTLorentzVector &v2)
edm::EDGetTokenT< edm::View< pat::Electron > > electronsToken_
genEvtToken_(mayConsume< TtGenEvent >(genEvt_))
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")