CMS 3D CMS Logo

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()); }
l1t::TkPhiCandidate::dRTrkPair
double dRTrkPair() const
Definition: TkPhiCandidate.cc:21
l1t::TkPhiCandidate::dzTrkPair
double dzTrkPair() const
Definition: TkPhiCandidate.cc:39
TTTrack::momentum
GlobalVector momentum() const
Track momentum.
Definition: TTTrack.h:281
l1t::TkPhiCandidate::trkPtrList_
std::vector< edm::Ptr< L1TTTrackType > > trkPtrList_
Definition: TkPhiCandidate.h:53
l1t::TkPhiCandidate::vz
double vz() const override
z coordinate of vertex position
Definition: TkPhiCandidate.cc:42
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
l1t::TkPhiCandidate::phi_polemass
static constexpr double phi_polemass
Definition: TkPhiCandidate.h:21
l1t::TkPhiCandidate::TkPhiCandidate
TkPhiCandidate()
Definition: TkPhiCandidate.cc:12
l1t::TkPhiCandidate::kmass
static constexpr double kmass
Definition: TkPhiCandidate.h:20
l1t::TkPhiCandidate::dmass
double dmass() const
Definition: TkPhiCandidate.cc:31
TTTrack::POCA
GlobalPoint POCA() const
POCA.
Definition: TTTrack.h:316
l1t::L1Candidate
Definition: L1Candidate.h:15
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
l1t::TkPhiCandidate::vx
double vx() const override
x coordinate of vertex position
Definition: TkPhiCandidate.cc:40
reco::LeafCandidate::mass
double mass() const final
mass
Definition: LeafCandidate.h:131
deltaR.h
l1t
delete x;
Definition: CaloConfig.h:22
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
p4
double p4[4]
Definition: TauolaWrapper.h:92
l1t::TkPhiCandidate::vy
double vy() const override
y coordinate of vertex position
Definition: TkPhiCandidate.cc:41
edm::Ptr
Definition: AssociationVector.h:31
l1t::TkPhiCandidate::trkPtr
const edm::Ptr< L1TTTrackType > & trkPtr(size_t i) const
Definition: TkPhiCandidate.h:34
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
l1t::TkPhiCandidate::dxyTrkPair
double dxyTrkPair() const
Definition: TkPhiCandidate.cc:33
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
TkPhiCandidate.h