14 const edm::Handle<std::vector<pat::Electron > >& elecs,
18 std::vector<int>&
match,
19 const unsigned int iComb)
24 for(
unsigned idx=0;
idx<match.size(); ++
idx){
43 if( !genEvt->isFullLeptonic() || !genEvt->lepton() || !genEvt->leptonBar() ){
44 match.push_back( -1 );
45 match.push_back( -1 );
46 match.push_back( -1 );
47 match.push_back( -1 );
53 match.push_back( iLepBar );
56 match.push_back( iLep );
59 match.push_back( -1 );
60 match.push_back( -1 );
63 if(genEvt->leptonBar()->isElectron()){
67 match.push_back( iLepBar );
69 match.push_back( -1 );
70 match.push_back( -1 );
74 match.push_back( iLep );
78 match.push_back( -1 );
82 match.push_back( iLepBar );
86 match.push_back( iLep );
88 match.push_back( -1 );
93 match.push_back( -1 );
94 match.push_back( -1 );
99 match.push_back( iLepBar );
102 match.push_back( iLep );
105 match.push_back( -1 );
106 match.push_back( -1 );
107 match.push_back( -1 );
108 match.push_back( -1 );
114 if( !mets->empty() ){
120 template <
typename O>
126 for(
unsigned i=0;
i<leps->size(); ++
i){
127 double dR =
deltaR(genLep->
eta(), genLep->
phi(), (*leps)[
i].eta(), (*leps)[
i].phi());
128 if(minDR<0 || dR<minDR){
143 if( genEvt->isTtBar() && genEvt->isFullLeptonic() && genEvt->neutrino() && genEvt->neutrinoBar() ){
144 double momXNu = genEvt->neutrino() ->px();
145 double momYNu = genEvt->neutrino() ->py();
146 double momXNuBar = genEvt->neutrinoBar()->px();
147 double momYNuBar = genEvt->neutrinoBar()->py();
149 double momXMet = mets->at(0).px();
150 double momYMet = mets->at(0).py();
152 double momXNeutrino = 0.5*(momXNu - momXNuBar + momXMet);
153 double momYNeutrino = 0.5*(momYNu - momYNuBar + momYMet);
154 double momXNeutrinoBar = momXMet - momXNeutrino;
155 double momYNeutrinoBar = momYMet - momYNeutrino;
160 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
reco::LeafCandidate * recNu
candidates needed for the genmatch hypothesis
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
TtFullLepHypGenMatch(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
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...
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_
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets