7 genEvtToken_( consumes<
TtGenEvent>(
edm::InputTag(
"genEvt" ) ) )
19 std::vector<int>&
match,
20 const unsigned int iComb)
25 for(
unsigned idx=0;
idx<match.size(); ++
idx){
45 match.push_back( -1 );
46 match.push_back( -1 );
47 match.push_back( -1 );
48 match.push_back( -1 );
54 match.push_back( iLepBar );
57 match.push_back( iLep );
60 match.push_back( -1 );
61 match.push_back( -1 );
68 match.push_back( iLepBar );
70 match.push_back( -1 );
71 match.push_back( -1 );
75 match.push_back( iLep );
79 match.push_back( -1 );
83 match.push_back( iLepBar );
87 match.push_back( iLep );
89 match.push_back( -1 );
94 match.push_back( -1 );
95 match.push_back( -1 );
100 match.push_back( iLepBar );
103 match.push_back( iLep );
106 match.push_back( -1 );
107 match.push_back( -1 );
108 match.push_back( -1 );
109 match.push_back( -1 );
115 if( !
mets->empty() ){
121 template <
typename O>
127 for(
unsigned i=0;
i<
leps->size(); ++
i){
128 double dR =
deltaR(genLep->
eta(), genLep->
phi(), (*leps)[
i].eta(), (*leps)[
i].phi());
129 if(minDR<0 || dR<minDR){
150 double momXMet =
mets->at(0).px();
151 double momYMet =
mets->at(0).py();
153 double momXNeutrino = 0.5*(momXNu - momXNuBar + momXMet);
154 double momYNeutrino = 0.5*(momYNu - momYNuBar + momYMet);
155 double momXNeutrinoBar = momXMet - momXNeutrino;
156 double momYNeutrinoBar = momYMet - momYNeutrino;
161 math::XYZTLorentzVector recNuBarFM(momXNeutrinoBar,momYNeutrinoBar,0,
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