Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:52

0001 // -*- C++ -*-
0002 //
0003 // Package:     DataFormats/L1TCorrelator
0004 // Class  :     TkPhiCandidate
0005 //
0006 #include "DataFormats/L1TCorrelator/interface/TkPhiCandidate.h"
0007 #include "DataFormats/Math/interface/deltaR.h"
0008 #include <cmath>
0009 
0010 using namespace l1t;
0011 
0012 TkPhiCandidate::TkPhiCandidate() {}
0013 TkPhiCandidate::TkPhiCandidate(const LorentzVector& p4,
0014                                const edm::Ptr<L1TTTrackType>& trkPtr1,
0015                                const edm::Ptr<L1TTTrackType>& trkPtr2)
0016     : L1Candidate(p4) {
0017   trkPtrList_.push_back(trkPtr1);
0018   trkPtrList_.push_back(trkPtr2);
0019 }
0020 // deltaR between track pair
0021 double TkPhiCandidate::dRTrkPair() const {
0022   const edm::Ptr<L1TTTrackType>& itrk = trkPtr(0);
0023   const edm::Ptr<L1TTTrackType>& jtrk = trkPtr(1);
0024 
0025   math::PtEtaPhiMLorentzVector itrkP4(itrk->momentum().perp(), itrk->momentum().eta(), itrk->momentum().phi(), kmass);
0026   math::PtEtaPhiMLorentzVector jtrkP4(jtrk->momentum().perp(), jtrk->momentum().eta(), jtrk->momentum().phi(), kmass);
0027   return reco::deltaR(itrkP4, jtrkP4);
0028 }
0029 
0030 // difference from nominal mass
0031 double TkPhiCandidate::dmass() const { return std::abs(phi_polemass - mass()); }
0032 // position difference between track pair
0033 double TkPhiCandidate::dxyTrkPair() const {
0034   const edm::Ptr<L1TTTrackType>& itrk = trkPtr(0);
0035   const edm::Ptr<L1TTTrackType>& jtrk = trkPtr(1);
0036 
0037   return std::sqrt(std::pow(itrk->POCA().x() - jtrk->POCA().x(), 2) + std::pow(itrk->POCA().y() - jtrk->POCA().y(), 2));
0038 }
0039 double TkPhiCandidate::dzTrkPair() const { return (trkPtr(0)->POCA().z() - trkPtr(1)->POCA().z()); }
0040 double TkPhiCandidate::vx() const { return 0.5 * (trkPtr(0)->POCA().x() + trkPtr(1)->POCA().x()); }
0041 double TkPhiCandidate::vy() const { return 0.5 * (trkPtr(0)->POCA().y() + trkPtr(1)->POCA().y()); }
0042 double TkPhiCandidate::vz() const { return 0.5 * (trkPtr(0)->POCA().z() + trkPtr(1)->POCA().z()); }