20 std::vector<int>&
match,
21 const unsigned int iComb)
override;
39 std::vector<int>&
match,
40 const unsigned int iComb) {
74 match.push_back(iLepBar);
77 match.push_back(iLep);
83 if (
genEvt->leptonBar()->isElectron()) {
87 match.push_back(iLepBar);
94 match.push_back(iLep);
101 match.push_back(iLepBar);
105 match.push_back(iLep);
117 match.push_back(iLepBar);
120 match.push_back(iLep);
131 if (!
mets->empty()) {
137 template <
typename O>
142 for (
unsigned i = 0;
i <
leps->size(); ++
i) {
143 double dR =
deltaR(genLep->
eta(), genLep->
phi(), (*leps)[
i].eta(), (*leps)[
i].phi());
158 double momXNu =
genEvt->neutrino()->px();
159 double momYNu =
genEvt->neutrino()->py();
160 double momXNuBar =
genEvt->neutrinoBar()->px();
161 double momYNuBar =
genEvt->neutrinoBar()->py();
163 double momXMet =
mets->at(0).px();
164 double momYMet =
mets->at(0).py();
166 double momXNeutrino = 0.5 * (momXNu - momXNuBar + momXMet);
167 double momYNeutrino = 0.5 * (momYNu - momYNuBar + momYMet);
168 double momXNeutrinoBar = momXMet - momXNeutrino;
169 double momYNeutrinoBar = momYMet - momYNeutrino;
172 momXNeutrino, momYNeutrino, 0,
sqrt(momXNeutrino * momXNeutrino + momYNeutrino * momYNeutrino));
173 recNu = std::make_unique<reco::LeafCandidate>(0, recNuFM);
178 sqrt(momXNeutrinoBar * momXNeutrinoBar + momYNeutrinoBar * momYNeutrinoBar));
179 recNuBar = std::make_unique<reco::LeafCandidate>(0, recNuBarFM);
std::unique_ptr< reco::LeafCandidate > recNu
candidates needed for the genmatch hypothesis
std::unique_ptr< reco::ShallowClonePtrCandidate > leptonBar_
int key_
hypothesis key (to be set by the buildKey function)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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 &)
#define DEFINE_FWK_MODULE(type)
void buildMatchingNeutrinos(edm::Event &, const edm::Handle< std::vector< pat::MET > > &)
void buildKey() override
build the event hypothesis key
edm::EDGetTokenT< TtGenEvent > genEvtToken_
int findMatchingLepton(const reco::GenParticle *, const edm::Handle< std::vector< O > > &)
std::unique_ptr< reco::LeafCandidate > recNuBar
std::string jetCorrectionLevel_
std::unique_ptr< reco::ShallowClonePtrCandidate > lepton_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::unique_ptr< reco::ShallowClonePtrCandidate > b_
std::unique_ptr< reco::ShallowClonePtrCandidate > makeCandidate(const edm::Handle< C > &handle, const int &idx)
use one object in a collection to set a ShallowClonePtrCandidate
double phi() const final
momentum azimuthal angle
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
std::unique_ptr< reco::ShallowClonePtrCandidate > bBar_
double eta() const final
momentum pseudorapidity