15 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"))),
18 electronsToken_ (consumes< edm::
View<pat::Electron> >(cfg.getParameter<edm::InputTag>(
"elecs")))
20 produces< double >(
"DiscSel");
32 std::auto_ptr< double > pOutDisc (
new double);
40 std::vector<PhysicsTools::Calibration::VarProcessor*> processors
41 = (calibContainer->find(
"ttSemiLepSignalSelMVA")).getProcessors();
46 if(!MET_handle.
isValid())
return;
51 if(!jet_handle.
isValid())
return;
52 const std::vector<pat::Jet>
jets = *jet_handle;
53 unsigned int nJets = 0;
54 std::vector<pat::Jet> seljets;
55 for(std::vector<pat::Jet>::const_iterator it = jets.begin(); it != jets.end(); it++) {
57 if(it->pt()>30. && fabs(it->eta())<2.4) {
58 seljets.push_back(*it);
65 if(!muon_handle.
isValid())
return;
68 std::vector<pat::Muon> selMuons;
72 if(it->pt()>30 && fabs(it->eta())<2.1 && (it->pt()/(it->pt()+it->trackIso()+it->caloIso()))>0.95 && it->isGlobalMuon()){
73 if(gltr.
isNull())
continue;
74 if((gltr->chi2()/gltr->ndof())<10 && trtr->numberOfValidHits()>11) {
76 for(std::vector<pat::Jet>::const_iterator ajet = seljets.begin(); ajet != seljets.end(); ajet++) {
79 double tmpdR =
DeltaR(muon,jet);
80 if(tmpdR<dRmin) dRmin = tmpdR;
84 selMuons.push_back(*it);
92 if(!electron_handle.
isValid())
return;
96 if(it->pt()>30 && fabs(it->eta())<2.4 && (it->pt()/(it->pt()+it->trackIso()+it->caloIso()))>0.95 && it->isElectronIDAvailable(
"eidTight"))
98 if(it->electronID(
"eidTight")==1) nelectrons++;
107 nelectrons > 0 ) discrim = -1.;
119 evt.
put(pOutDisc,
"DiscSel");
137 double dPhi = fabs(v1.Phi() - v2.Phi());
145 double dR = TMath::Sqrt((v1.Eta()-v2.Eta())*(v1.Eta()-v2.Eta())+dPhi*dPhi);
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
~TtSemiLepSignalSelMVAComputer()
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)
double DeltaPhi(const math::XYZTLorentzVector &v1, const math::XYZTLorentzVector &v2)
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.
void get(HolderT &iHolder) const
double DeltaR(const math::XYZTLorentzVector &v1, const math::XYZTLorentzVector &v2)
edm::EDGetTokenT< edm::View< pat::Muon > > muonsToken_
virtual void produce(edm::Event &evt, const edm::EventSetup &setup)
edm::EDGetTokenT< edm::View< pat::MET > > METsToken_
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
#define MVA_COMPUTER_CONTAINER_IMPLEMENT(N)
TtSemiLepSignalSelMVAComputer(const edm::ParameterSet &)
const_iterator begin() const
edm::EDGetTokenT< edm::View< pat::Electron > > electronsToken_
const_iterator end() const
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")