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);
66 sort(seljets.begin(),seljets.end(),JetwithHigherPt());
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";
edm::EDGetTokenT< edm::View< pat::MET > > METsToken_
bool isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
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)
def setup(process, global_tag, zero_tesla=False)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
const_iterator begin() const
edm::EDGetTokenT< TtGenEvent > genEvtToken_
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_