15 const edm::Handle<std::vector<pat::Electron > >& elecs,
19 std::vector<int>&
match,
20 const unsigned int iComb)
25 for(
unsigned idx=0;
idx<match.size(); ++
idx){
44 if( !genEvt->isFullLeptonic() || !genEvt->lepton() || !genEvt->leptonBar() ){
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 );
64 if(genEvt->leptonBar()->isElectron()){
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){
144 if( genEvt->isTtBar() && genEvt->isFullLeptonic() && genEvt->neutrino() && genEvt->neutrinoBar() ){
145 double momXNu = genEvt->neutrino() ->px();
146 double momYNu = genEvt->neutrino() ->py();
147 double momXNuBar = genEvt->neutrinoBar()->px();
148 double momYNuBar = genEvt->neutrinoBar()->py();
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));
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
virtual float phi() const
momentum azimuthal angle
reco::LeafCandidate * recNu
candidates needed for the genmatch hypothesis
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Class derived from the TopGenEvent for ttbar events.
virtual float eta() const
momentum pseudorapidity
TtFullLepHypGenMatch(const edm::ParameterSet &)
virtual 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)
build event hypothesis from the reco objects of a semi-leptonic event
void buildMatchingNeutrinos(edm::Event &, const edm::Handle< std::vector< pat::MET > > &)
double deltaR(double eta1, double eta2, double phi1, double phi2)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
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.
reco::ShallowClonePtrCandidate * b_
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