15 std::vector<int>&
match,
16 const unsigned int iComb) {
20 for (
unsigned idx = 0;
idx < match.size(); ++
idx) {
50 match.push_back(iLepBar);
53 match.push_back(iLep);
63 match.push_back(iLepBar);
70 match.push_back(iLep);
77 match.push_back(iLepBar);
81 match.push_back(iLep);
93 match.push_back(iLepBar);
96 match.push_back(iLep);
107 if (!
mets->empty()) {
113 template <
typename O>
118 for (
unsigned i = 0;
i <
leps->size(); ++
i) {
119 double dR =
deltaR(genLep->
eta(), genLep->
phi(), (*leps)[
i].eta(), (*leps)[
i].phi());
120 if (minDR < 0 || dR < minDR) {
139 double momXMet =
mets->at(0).px();
140 double momYMet =
mets->at(0).py();
142 double momXNeutrino = 0.5 * (momXNu - momXNuBar + momXMet);
143 double momYNeutrino = 0.5 * (momYNu - momYNuBar + momYMet);
144 double momXNeutrinoBar = momXMet - momXNeutrino;
145 double momYNeutrinoBar = momYMet - momYNeutrino;
148 momXNeutrino, momYNeutrino, 0,
sqrt(momXNeutrino * momXNeutrino + momYNeutrino * momYNeutrino));
154 sqrt(momXNeutrinoBar * momXNeutrinoBar + momYNeutrinoBar * momYNeutrinoBar));
bool isElectron() const override
reco::ShallowClonePtrCandidate * leptonBar_
reco::LeafCandidate * recNuBar
double eta() const final
momentum pseudorapidity
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double px() const final
x coordinate of momentum vector
const reco::GenParticle * lepton(bool excludeTauLeptons=false) const
get lepton for semi-leptonic or full leptonic decays
reco::LeafCandidate * recNu
candidates needed for the genmatch hypothesis
void buildHypo(edm::Event &evt, const edm::Handle< std::vector< pat::Electron > > &elecs, const edm::Handle< std::vector< pat::Muon > > &mus, const edm::Handle< std::vector< pat::Jet > > &jets, const edm::Handle< std::vector< pat::MET > > &mets, std::vector< int > &match, const unsigned int iComb) override
build event hypothesis from the reco objects of a semi-leptonic event
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool isFullLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as full leptonic
Class derived from the TopGenEvent for ttbar events.
TtFullLepHypGenMatch(const edm::ParameterSet &)
void buildMatchingNeutrinos(edm::Event &, const edm::Handle< std::vector< pat::MET > > &)
edm::EDGetTokenT< TtGenEvent > genEvtToken_
double py() const final
y coordinate of momentum vector
reco::ShallowClonePtrCandidate * lepton_
int findMatchingLepton(const reco::GenParticle *, const edm::Handle< std::vector< O > > &)
reco::ShallowClonePtrCandidate * bBar_
std::string jetCorrectionLevel_
const reco::GenParticle * neutrino(bool excludeTauLeptons=false) const
get neutrino for semi-leptonic or full leptonic decays
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
~TtFullLepHypGenMatch() override
const reco::GenParticle * neutrinoBar(bool excludeTauLeptons=false) const
get anti-neutrino for semi-leptonic or full leptonic decays
reco::ShallowClonePtrCandidate * b_
double phi() const final
momentum azimuthal angle
bool isTtBar() const
check if the event can be classified as ttbar
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
const reco::GenParticle * leptonBar(bool excludeTauLeptons=false) const
get anti-lepton for semi-leptonic or full leptonic decays