19 muons_ (cfg.getParameter<edm::InputTag>(
"muons")),
20 jets_ (cfg.getParameter<edm::InputTag>(
"jets")),
21 METs_ (cfg.getParameter<edm::InputTag>(
"mets")),
22 electrons_ (cfg.getParameter<edm::InputTag>(
"elecs"))
24 produces< double >(
"DiscSel");
36 std::auto_ptr< double > pOutDisc (
new double);
43 setup.get<TtSemiLepSignalSelMVARcd>().
get( calibContainer );
44 std::vector<PhysicsTools::Calibration::VarProcessor*> processors
45 = (calibContainer->find(
"ttSemiLepSignalSelMVA")).getProcessors();
50 if(!MET_handle.
isValid())
return;
55 if(!jet_handle.
isValid())
return;
56 const std::vector<pat::Jet>
jets = *jet_handle;
57 unsigned int nJets = 0;
58 std::vector<pat::Jet> seljets;
59 for(std::vector<pat::Jet>::const_iterator it = jets.begin(); it != jets.end(); it++) {
61 if(it->pt()>30. && fabs(it->eta())<2.4) {
62 seljets.push_back(*it);
69 if(!muon_handle.
isValid())
return;
72 std::vector<pat::Muon> selMuons;
76 if(it->pt()>30 && fabs(it->eta())<2.1 && (it->pt()/(it->pt()+it->trackIso()+it->caloIso()))>0.95 && it->isGlobalMuon()){
77 if(gltr.
isNull())
continue;
78 if((gltr->chi2()/gltr->ndof())<10 && trtr->numberOfValidHits()>11) {
80 for(std::vector<pat::Jet>::const_iterator ajet = seljets.begin(); ajet != seljets.end(); ajet++) {
83 double tmpdR =
DeltaR(muon,jet);
84 if(tmpdR<dRmin) dRmin = tmpdR;
88 selMuons.push_back(*it);
96 if(!electron_handle.
isValid())
return;
100 if(it->pt()>30 && fabs(it->eta())<2.4 && (it->pt()/(it->pt()+it->trackIso()+it->caloIso()))>0.95 && it->isElectronIDAvailable(
"eidTight"))
102 if(it->electronID(
"eidTight")==1) nelectrons++;
111 nelectrons > 0 ) discrim = -1.;
123 evt.
put(pOutDisc,
"DiscSel");
141 double dPhi = fabs(v1.Phi() - v2.Phi());
149 double dR = TMath::Sqrt((v1.Eta()-v2.Eta())*(v1.Eta()-v2.Eta())+dPhi*dPhi);
double DeltaR(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
~TtSemiLepSignalSelMVAComputer()
double evaluateTtSemiLepSignalSel(PhysicsTools::MVAComputerCache &mvaComputer, const TtSemiLepSignalSel &sigsel, float weight=1., const bool training=false, const bool isSignal=false)
static bool test(uint32_t val, uint32_t mask)
PhysicsTools::MVAComputerCache mvaComputer
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool isNull() const
Checks for null.
double dPhi(double phi1, double phi2)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produce(edm::Event &evt, const edm::EventSetup &setup)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double DeltaPhi(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2)
#define MVA_COMPUTER_CONTAINER_IMPLEMENT(N)
TtSemiLepSignalSelMVAComputer(const edm::ParameterSet &)
const_iterator begin() const
const_iterator end() const
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")