13 return (vtx.z()-pv.z()) - ((vtx.x()-pv.x())*p4.x()+(vtx.y()-pv.y())*p4.y())/p4.pt() * p4.z()/p4.pt();
23 vector<LorentzVector> *trks_trk_p4 =
new vector<LorentzVector>;
25 if(trks_trk_p4->size()<2)
return;
28 vector<LorentzVector> *trks_vertex_p4 =
new vector<LorentzVector>;
32 vector<LorentzVector> *vertex_position =
new vector<LorentzVector>;
36 vector<LorentzVector> *pfcands_p4 =
new vector<LorentzVector>;
40 vector<int> *pfcands_charge =
new vector<int>;
44 vector<int> *pfcands_trkidx =
new vector<int>;
48 vector<LorentzVector> *hyp_ll_p4 =
new vector<LorentzVector>;
52 vector<LorentzVector> *hyp_lt_p4 =
new vector<LorentzVector>;
56 const unsigned int npfcands = pfcands_p4->size();
57 const unsigned int nhyps = hyp_ll_p4->size();
63 for(
unsigned int ihyp = 0 ; ihyp < nhyps ; ihyp++ ){
73 metx -= hyp_ll_p4->at(ihyp).Px();
74 metx -= hyp_lt_p4->at(ihyp).Px();
75 mety -= hyp_ll_p4->at(ihyp).Py();
76 mety -= hyp_lt_p4->at(ihyp).Py();
86 for(
unsigned int ipf = 0 ; ipf < npfcands ; ipf++ ){
89 if( pfcands_charge->at(ipf) == 0 )
continue;
92 double dRll =
deltaR( hyp_ll_p4->at(ihyp).eta() , hyp_ll_p4->at(ihyp).phi() , pfcands_p4->at(ipf).eta() , pfcands_p4->at(ipf).phi());
93 double dRlt =
deltaR( hyp_lt_p4->at(ihyp).eta() , hyp_lt_p4->at(ihyp).phi() , pfcands_p4->at(ipf).eta() , pfcands_p4->at(ipf).phi());
94 if( dRll < drcut_ || dRlt < drcut_ )
continue;
97 int trkidx = pfcands_trkidx->at(ipf);
98 if( trkidx < 0 )
continue;
99 double dzpv =
TrkMETdzPV( trks_vertex_p4->at(trkidx) , trks_trk_p4->at(trkidx), vertex_position->at(0) );
100 if( fabs(dzpv) > dzcut_ )
continue;
104 metx -= pfcands_p4->at(ipf).Px();
105 mety -= pfcands_p4->at(ipf).Py();
106 sumet += pfcands_p4->at(ipf).Pt();
110 hww.
trk_met().push_back (
sqrt(metx*metx+mety*mety) );
111 hww.
trk_metPhi().push_back ( atan2(mety,metx) );
std::vector< float > & trk_met()
std::vector< LorentzVector > & trks_vertex_p4()
std::vector< int > & pfcands_charge()
std::vector< LorentzVector > & trks_trk_p4()
std::vector< float > & trk_metPhi()
std::vector< LorentzVector > & pfcands_p4()
double deltaR(const T1 &t1, const T2 &t2)
std::vector< int > & pfcands_trkidx()
std::vector< LorentzVector > & hyp_ll_p4()
std::vector< LorentzVector > & vtxs_position()
double TrkMETdzPV(const LorentzVector &vtx, const LorentzVector &p4, const LorentzVector &pv)
XYZPointD XYZPoint
point in space with cartesian internal representation
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
std::vector< LorentzVector > & hyp_lt_p4()
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
math::PtEtaPhiELorentzVectorF LorentzVector
void SetVars(HWW &, const edm::Event &, const edm::EventSetup &)