14 muonsToken_ (consumes<
edm::
View<
pat::
Muon> >(cfg.getParameter<
edm::InputTag>(
"muons"))),
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;
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 isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
void analyze(const edm::Event &evt, const edm::EventSetup &setup) override
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)
def setup(process, global_tag, zero_tesla=False)
TtSemiLepSignalSelMVATrainer(const edm::ParameterSet &)
~TtSemiLepSignalSelMVATrainer() override
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.
WDecay::LeptonType semiLeptonicChannel() const
return decay channel; all leptons including taus are allowed
edm::EDGetTokenT< edm::View< pat::Muon > > muonsToken_
bool isNull() const
Checks for null.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const_iterator end() const
double DeltaR(const math::XYZTLorentzVector &v1, const math::XYZTLorentzVector &v2)
edm::EDGetTokenT< edm::View< pat::Electron > > electronsToken_