CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TkPhiCandidate.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DataFormats/L1TCorrelator
4 // Class : TkPhiCandidate
5 //
8 #include <cmath>
9 
10 using namespace l1t;
11 
14  const edm::Ptr<L1TTTrackType>& trkPtr1,
15  const edm::Ptr<L1TTTrackType>& trkPtr2)
16  : L1Candidate(p4) {
17  trkPtrList_.push_back(trkPtr1);
18  trkPtrList_.push_back(trkPtr2);
19 }
20 // deltaR between track pair
21 double TkPhiCandidate::dRTrkPair() const {
22  const edm::Ptr<L1TTTrackType>& itrk = trkPtr(0);
23  const edm::Ptr<L1TTTrackType>& jtrk = trkPtr(1);
24 
25  math::PtEtaPhiMLorentzVector itrkP4(itrk->momentum().perp(), itrk->momentum().eta(), itrk->momentum().phi(), kmass);
26  math::PtEtaPhiMLorentzVector jtrkP4(jtrk->momentum().perp(), jtrk->momentum().eta(), jtrk->momentum().phi(), kmass);
27  return reco::deltaR(itrkP4, jtrkP4);
28 }
29 
30 // difference from nominal mass
31 double TkPhiCandidate::dmass() const { return std::abs(phi_polemass - mass()); }
32 // position difference between track pair
34  const edm::Ptr<L1TTTrackType>& itrk = trkPtr(0);
35  const edm::Ptr<L1TTTrackType>& jtrk = trkPtr(1);
36 
37  return std::sqrt(std::pow(itrk->POCA().x() - jtrk->POCA().x(), 2) + std::pow(itrk->POCA().y() - jtrk->POCA().y(), 2));
38 }
39 double TkPhiCandidate::dzTrkPair() const { return (trkPtr(0)->POCA().z() - trkPtr(1)->POCA().z()); }
40 double TkPhiCandidate::vx() const { return 0.5 * (trkPtr(0)->POCA().x() + trkPtr(1)->POCA().x()); }
41 double TkPhiCandidate::vy() const { return 0.5 * (trkPtr(0)->POCA().y() + trkPtr(1)->POCA().y()); }
42 double TkPhiCandidate::vz() const { return 0.5 * (trkPtr(0)->POCA().z() + trkPtr(1)->POCA().z()); }
T perp() const
Definition: PV3DBase.h:69
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
double dzTrkPair() const
delete x;
Definition: CaloConfig.h:22
GlobalVector momentum() const
Track momentum.
Definition: TTTrack.h:295
double vy() const override
y coordinate of vertex position
double vz() const override
z coordinate of vertex position
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double dRTrkPair() const
std::vector< edm::Ptr< L1TTTrackType > > trkPtrList_
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
static constexpr double phi_polemass
double vx() const override
x coordinate of vertex position
double dxyTrkPair() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
double mass() const final
mass
const edm::Ptr< L1TTTrackType > & trkPtr(size_t i) const
double dmass() const
static constexpr double kmass
GlobalPoint POCA() const
POCA.
Definition: TTTrack.h:335
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29