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  :     TkBsCandidate
0005 //
0006 
0007 #include "DataFormats/L1TCorrelator/interface/TkPhiCandidate.h"
0008 #include "DataFormats/L1TCorrelator/interface/TkBsCandidate.h"
0009 #include "DataFormats/Math/interface/deltaR.h"
0010 #include <cmath>
0011 
0012 using namespace l1t;
0013 
0014 TkBsCandidate::TkBsCandidate() {}
0015 TkBsCandidate::TkBsCandidate(const LorentzVector& p4, TkPhiCandidate cand1, TkPhiCandidate cand2)
0016     : L1Candidate(p4), phiCandList_{cand1, cand2} {}
0017 
0018 // deltaR between the Phi pair
0019 double TkBsCandidate::dRPhiPair() const {
0020   const LorentzVector& lva = phiCandidate(0).p4();
0021   const LorentzVector& lvb = phiCandidate(1).p4();
0022   return reco::deltaR(lva, lvb);
0023 }
0024 // position difference between track pair
0025 double TkBsCandidate::dxyPhiPair() const {
0026   const TkPhiCandidate& phia = phiCandidate(0);
0027   const TkPhiCandidate& phib = phiCandidate(1);
0028   return std::sqrt(std::pow(phia.vx() - phib.vx(), 2) + std::pow(phia.vy() - phib.vy(), 2));
0029 }
0030 double TkBsCandidate::dzPhiPair() const { return (phiCandidate(0).vz() - phiCandidate(1).vz()); }