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"))),
20 produces< double >(
"DiscSel");
32 std::unique_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.;
137 double dPhi = fabs(v1.Phi() - v2.Phi());
145 double dR = TMath::Sqrt((v1.Eta()-v2.Eta())*(v1.Eta()-v2.Eta())+dPhi*dPhi);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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)
def setup(process, global_tag, zero_tesla=False)
PhysicsTools::MVAComputerCache mvaComputer
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const_iterator begin() const
~TtSemiLepSignalSelMVAComputer() override
double DeltaR(const math::XYZTLorentzVector &v1, const math::XYZTLorentzVector &v2)
edm::EDGetTokenT< edm::View< pat::Muon > > muonsToken_
bool isNull() const
Checks for null.
edm::EDGetTokenT< edm::View< pat::MET > > METsToken_
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
#define MVA_COMPUTER_CONTAINER_IMPLEMENT(N)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
TtSemiLepSignalSelMVAComputer(const edm::ParameterSet &)
edm::EDGetTokenT< edm::View< pat::Electron > > electronsToken_
const_iterator end() const
void produce(edm::Event &evt, const edm::EventSetup &setup) override
bool get(HolderT &iHolder) const