11 const edm::Handle<std::vector<pat::Electron> >& elecs,
15 std::vector<int>&
match,
16 const unsigned int iComb) {
20 for (
unsigned idx = 0; idx < match.size(); ++idx) {
41 if (!genEvt->isFullLeptonic() || !genEvt->lepton() || !genEvt->leptonBar()) {
50 match.push_back(iLepBar);
53 match.push_back(iLep);
59 if (genEvt->leptonBar()->isElectron()) {
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) {
133 if (genEvt->isTtBar() && genEvt->isFullLeptonic() && genEvt->neutrino() && genEvt->neutrinoBar()) {
134 double momXNu = genEvt->neutrino()->px();
135 double momYNu = genEvt->neutrino()->py();
136 double momXNuBar = genEvt->neutrinoBar()->px();
137 double momYNuBar = genEvt->neutrinoBar()->py();
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));
reco::ShallowClonePtrCandidate * leptonBar_
reco::LeafCandidate * recNuBar
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
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.
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_
reco::ShallowClonePtrCandidate * lepton_
int findMatchingLepton(const reco::GenParticle *, const edm::Handle< std::vector< O > > &)
reco::ShallowClonePtrCandidate * bBar_
std::string jetCorrectionLevel_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
~TtFullLepHypGenMatch() override
reco::ShallowClonePtrCandidate * b_
double phi() const final
momentum azimuthal angle
genEvtToken_(mayConsume< TtGenEvent >(genEvt_))
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
double eta() const final
momentum pseudorapidity