20 muons_ (cfg.getParameter<edm::InputTag>(
"muons")),
21 electrons_ (cfg.getParameter<edm::InputTag>(
"elecs")),
22 jets_ (cfg.getParameter<edm::InputTag>(
"jets")),
23 METs_ (cfg.getParameter<edm::InputTag>(
"mets")),
24 lepChannel_(cfg.getParameter<int>(
"lepChannel")),
25 whatData_ (cfg.getParameter<int>(
"whatData")),
26 maxEv_ (cfg.getParameter<int>(
"maxEv"))
49 if(!MET_handle.
isValid())
return;
54 if(!jet_handle.
isValid())
return;
55 const std::vector<pat::Jet>
jets = *jet_handle;
56 unsigned int nJets = 0;
57 std::vector<pat::Jet> seljets;
59 for(std::vector<pat::Jet>::const_iterator it = jets.begin(); it != jets.end(); it++) {
62 if(it->et()>30. && fabs(it->eta())<2.4) {
63 seljets.push_back(*it);
75 if(!muon_handle.isValid())
return;
78 std::vector<pat::Muon> selMuons;
82 if(it->pt()>30 && fabs(it->eta())<2.1 && (it->pt()/(it->pt()+it->trackIso()+it->caloIso()))>0.95 && it->isGlobalMuon()){
83 if(gltr.
isNull())
continue;
84 if((gltr->chi2()/gltr->ndof())<10 && trtr->numberOfValidHits()>=11) {
87 for(std::vector<pat::Jet>::const_iterator ajet = seljets.begin(); ajet != seljets.end(); ajet++) {
90 double tmpdR =
DeltaR(muon,jet);
91 if(tmpdR<dRmin) dRmin = tmpdR;
96 selMuons.push_back(*it);
102 if(nmuons!=1)
return;
106 if(!electron_handle.
isValid())
return;
110 if(it->pt()>30 && fabs(it->eta())<2.4 && (it->pt()/(it->pt()+it->trackIso()+it->caloIso()))>0.95 && it->isElectronIDAvailable(
"eidTight"))
112 if(it->electronID(
"eidTight")==1) nelectrons++;
115 if(nelectrons>0)
return;
150 if(genEvt->isSemiLeptonic() && genEvt->semiLeptonicChannel() ==
lepChannel_) {
160 else std::cout<<
"Config File Error!! Please check <whatData> in TtSemiLepSignalSelMVATrainer.cfi";
167 std::cout<<
"Config File Error!! Please check <whatData> in TtSemiLepSignalSelMVATrainer.cfi"<<std::endl;;
174 double dPhi = fabs(v1.Phi() - v2.Phi());
182 double dR = TMath::Sqrt((v1.Eta()-v2.Eta())*(v1.Eta()-v2.Eta())+dPhi*dPhi);
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
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)
bool isNull() const
Checks for null.
double dPhi(double phi1, double phi2)
virtual void analyze(const edm::Event &evt, const edm::EventSetup &setup)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
~TtSemiLepSignalSelMVATrainer()
const_iterator begin() const
const_iterator end() const
double DeltaR(const math::XYZTLorentzVector &v1, const math::XYZTLorentzVector &v2)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")