CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
RecoTracktoTP Class Reference

#include <RecoTracktoTP.h>

Public Member Functions

bool allmatched () const
 
math::XYZPoint BeamSpot () const
 
float GetShared () const
 
bool hasPCA () const
 
bool hasRV () const
 
bool hasTPMother () const
 
bool matched () const
 
int numTPMothers () const
 
int numTPSourceTracks () const
 
double r_d0 () const
 
double r_d02 () const
 
double r_dsz () const
 
double r_dxy () const
 
double r_dz () const
 
double r_dz2 () const
 
 RecoTracktoTP ()
 
reco::Track RT () const
 
reco::Vertex RV () const
 
double s_d0 () const
 
double s_dsz () const
 
double s_dxy () const
 
double s_dz () const
 
double s_eta () const
 
double s_lambda () const
 
GlobalVector s_p () const
 
GlobalPoint s_pca () const
 
double s_phi () const
 
double s_qoverp () const
 
double s_theta () const
 
GlobalPoint s_v () const
 
void SetBeamSpot (const math::XYZPoint &bs)
 
void SetRecoTrack (reco::TrackBaseRef track)
 
void SetRecoVertex (reco::VertexRef vertex)
 
void SetShared (const float &m)
 
void SetTrackingParticle (TrackingParticleRef tp)
 
void SetTrackingParticleMomentumPCA (const GlobalVector &p)
 
void SetTrackingParticlePCA (const GlobalPoint &v)
 
TrackingParticle TP () const
 
TrackingParticle TPMother () const
 
TrackingParticle TPMother (unsigned short i) const
 
 ~RecoTracktoTP ()
 

Protected Attributes

math::XYZPoint beamSpot_
 
reco::TrackBaseRef recoTrack
 
reco::VertexRef recoVertex
 
float shared_
 
GlobalVector simMomPCA_
 
GlobalPoint simPCA_
 
TrackingParticleRef trackingParticle_
 

Detailed Description

Definition at line 20 of file RecoTracktoTP.h.

Constructor & Destructor Documentation

◆ RecoTracktoTP()

RecoTracktoTP::RecoTracktoTP ( )

Definition at line 4 of file RecoTracktoTP.cc.

4  {
5  SetBeamSpot(math::XYZPoint(-9999.0, -9999.0, -9999.0));
6  SetTrackingParticlePCA(GlobalPoint(-9999.0, -9999.0, -9999.0));
7  SetTrackingParticleMomentumPCA(GlobalVector(-9999.0, -9999.0, -9999.0));
8 }

References SetBeamSpot(), SetTrackingParticleMomentumPCA(), and SetTrackingParticlePCA().

◆ ~RecoTracktoTP()

RecoTracktoTP::~RecoTracktoTP ( )

Definition at line 10 of file RecoTracktoTP.cc.

10 {}

Member Function Documentation

◆ allmatched()

bool RecoTracktoTP::allmatched ( ) const
inline

Definition at line 42 of file RecoTracktoTP.h.

42 { return matched() && hasRV(); }

References hasRV(), and matched().

◆ BeamSpot()

math::XYZPoint RecoTracktoTP::BeamSpot ( ) const
inline

Definition at line 35 of file RecoTracktoTP.h.

35 { return beamSpot_; }

References beamSpot_.

Referenced by r_dsz(), r_dxy(), r_dz(), and s_v().

◆ GetShared()

float RecoTracktoTP::GetShared ( ) const
inline

Definition at line 79 of file RecoTracktoTP.h.

79 { return shared_; }

References shared_.

◆ hasPCA()

bool RecoTracktoTP::hasPCA ( ) const
inline

Definition at line 41 of file RecoTracktoTP.h.

41 { return s_pca().mag() < 9999.0; }

References PV3DBase< T, PVType, FrameType >::mag(), and s_pca().

◆ hasRV()

bool RecoTracktoTP::hasRV ( ) const
inline

Definition at line 38 of file RecoTracktoTP.h.

38  {
39  return recoVertex.isNonnull() && fabs(recoVertex->position().Mag2()) > 0.0;
40  } // position is ROOT::MATH::Cartesian3D<double>

References edm::Ref< C, T, F >::isNonnull(), and recoVertex.

Referenced by allmatched().

◆ hasTPMother()

bool RecoTracktoTP::hasTPMother ( ) const
inline

Definition at line 86 of file RecoTracktoTP.h.

86 { return numTPMothers() > 0; }

References numTPMothers().

◆ matched()

bool RecoTracktoTP::matched ( ) const
inline

◆ numTPMothers()

int RecoTracktoTP::numTPMothers ( ) const

Definition at line 41 of file RecoTracktoTP.cc.

41  {
42  int count = 0;
43  for (TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
44  si != TP().parentVertex()->sourceTracks_end();
45  ++si) {
46  for (TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
47  di != TP().parentVertex()->daughterTracks_end();
48  ++di) {
49  if (si != di)
50  count++;
51  break;
52  }
53  if (count > 0)
54  break;
55  }
56  return count;
57 }

References KineDebug3::count(), TrackingParticle::parentVertex(), and TP().

Referenced by hasTPMother(), and TPMother().

◆ numTPSourceTracks()

int RecoTracktoTP::numTPSourceTracks ( ) const
inline

Definition at line 84 of file RecoTracktoTP.h.

84 { return TP().parentVertex()->nSourceTracks(); }

References TrackingParticle::parentVertex(), and TP().

◆ r_d0()

double RecoTracktoTP::r_d0 ( ) const
inline

Definition at line 47 of file RecoTracktoTP.h.

47 { return -1.0 * r_dxy(); }

References r_dxy().

◆ r_d02()

double RecoTracktoTP::r_d02 ( ) const
inline

Definition at line 51 of file RecoTracktoTP.h.

51 { return -1.0 * RT().dxy(RV().position()); }

References reco::TrackBase::dxy(), position, RT(), and RV().

◆ r_dsz()

double RecoTracktoTP::r_dsz ( ) const
inline

Definition at line 46 of file RecoTracktoTP.h.

46 { return RT().dsz(BeamSpot()); }

References BeamSpot(), reco::TrackBase::dsz(), and RT().

◆ r_dxy()

double RecoTracktoTP::r_dxy ( ) const
inline

Definition at line 45 of file RecoTracktoTP.h.

45 { return RT().dxy(BeamSpot()); }

References BeamSpot(), reco::TrackBase::dxy(), and RT().

Referenced by r_d0().

◆ r_dz()

double RecoTracktoTP::r_dz ( ) const
inline

Definition at line 48 of file RecoTracktoTP.h.

48 { return RT().dz(BeamSpot()); }

References BeamSpot(), reco::TrackBase::dz(), and RT().

◆ r_dz2()

double RecoTracktoTP::r_dz2 ( ) const
inline

Definition at line 52 of file RecoTracktoTP.h.

52 { return RT().dz(RV().position()); }

References reco::TrackBase::dz(), position, RT(), and RV().

◆ RT()

reco::Track RecoTracktoTP::RT ( ) const
inline

Definition at line 32 of file RecoTracktoTP.h.

32 { return recoTrack.isNonnull() ? *recoTrack : reco::Track(); }

References edm::RefToBase< T >::isNonnull(), and recoTrack.

Referenced by r_d02(), r_dsz(), r_dxy(), r_dz(), and r_dz2().

◆ RV()

reco::Vertex RecoTracktoTP::RV ( ) const
inline

Definition at line 34 of file RecoTracktoTP.h.

34 { return recoVertex.isNonnull() ? *recoVertex : reco::Vertex(); }

References edm::Ref< C, T, F >::isNonnull(), recoVertex, and HltBtagValidation_cff::Vertex.

Referenced by r_d02(), and r_dz2().

◆ s_d0()

double RecoTracktoTP::s_d0 ( ) const
inline

Definition at line 75 of file RecoTracktoTP.h.

75 { return -1.0 * s_dxy(); }

References s_dxy().

◆ s_dsz()

double RecoTracktoTP::s_dsz ( ) const
inline

◆ s_dxy()

double RecoTracktoTP::s_dxy ( ) const
inline

Definition at line 70 of file RecoTracktoTP.h.

70 { return (-s_v().x() * s_p().y() + s_v().y() * s_p().x()) / s_p().perp(); }

References PV3DBase< T, PVType, FrameType >::perp(), s_p(), s_v(), x, and y.

Referenced by s_d0().

◆ s_dz()

double RecoTracktoTP::s_dz ( ) const
inline

Definition at line 76 of file RecoTracktoTP.h.

76  {
77  return s_v().z() - (s_v().x() * s_p().x() + s_v().y() * s_p().y()) / s_p().perp() * s_p().z() / s_p().perp();
78  }

References PV3DBase< T, PVType, FrameType >::perp(), s_p(), s_v(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ s_eta()

double RecoTracktoTP::s_eta ( ) const
inline

Definition at line 68 of file RecoTracktoTP.h.

68 { return -1.0 * log(tan(0.5 * s_p().theta())); }

References dqm-mbProfile::log, s_p(), funct::tan(), and theta().

◆ s_lambda()

double RecoTracktoTP::s_lambda ( ) const
inline

Definition at line 66 of file RecoTracktoTP.h.

66 { return M_PI / 2 - s_p().theta(); }

References M_PI, s_p(), and PV3DBase< T, PVType, FrameType >::theta().

◆ s_p()

GlobalVector RecoTracktoTP::s_p ( ) const
inline

Definition at line 58 of file RecoTracktoTP.h.

58 { return simMomPCA_; }

References simMomPCA_.

Referenced by s_dsz(), s_dxy(), s_dz(), s_eta(), s_lambda(), s_phi(), s_qoverp(), and s_theta().

◆ s_pca()

GlobalPoint RecoTracktoTP::s_pca ( ) const
inline

Definition at line 59 of file RecoTracktoTP.h.

59 { return simPCA_; }

References simPCA_.

Referenced by hasPCA(), and s_v().

◆ s_phi()

double RecoTracktoTP::s_phi ( ) const
inline

Definition at line 67 of file RecoTracktoTP.h.

67 { return s_p().phi(); }

References PV3DBase< T, PVType, FrameType >::phi(), and s_p().

◆ s_qoverp()

double RecoTracktoTP::s_qoverp ( ) const
inline

Definition at line 64 of file RecoTracktoTP.h.

64 { return TP().charge() / s_p().mag(); }

References TrackingParticle::charge(), PV3DBase< T, PVType, FrameType >::mag(), s_p(), and TP().

◆ s_theta()

double RecoTracktoTP::s_theta ( ) const
inline

Definition at line 65 of file RecoTracktoTP.h.

65 { return s_p().theta(); }

References s_p(), and PV3DBase< T, PVType, FrameType >::theta().

◆ s_v()

GlobalPoint RecoTracktoTP::s_v ( ) const
inline

Definition at line 60 of file RecoTracktoTP.h.

60  {
61  return GlobalPoint(s_pca().x() - BeamSpot().x(), s_pca().y() - BeamSpot().y(), s_pca().z() - BeamSpot().z());
62  }

References BeamSpot(), s_pca(), x, y, and z.

Referenced by s_dsz(), s_dxy(), and s_dz().

◆ SetBeamSpot()

void RecoTracktoTP::SetBeamSpot ( const math::XYZPoint bs)
inline

Definition at line 28 of file RecoTracktoTP.h.

28 { beamSpot_ = bs; }

References beamSpot_, and cms::cuda::bs.

Referenced by TrackAlgoCompareUtil::produce(), and RecoTracktoTP().

◆ SetRecoTrack()

void RecoTracktoTP::SetRecoTrack ( reco::TrackBaseRef  track)
inline

Definition at line 26 of file RecoTracktoTP.h.

26 { recoTrack = track; }

References recoTrack, and HLT_2018_cff::track.

Referenced by TrackAlgoCompareUtil::produce().

◆ SetRecoVertex()

void RecoTracktoTP::SetRecoVertex ( reco::VertexRef  vertex)
inline

Definition at line 27 of file RecoTracktoTP.h.

27 { recoVertex = vertex; }

References recoVertex, and bphysicsOniaDQM_cfi::vertex.

Referenced by TrackAlgoCompareUtil::produce().

◆ SetShared()

void RecoTracktoTP::SetShared ( const float &  m)
inline

Definition at line 29 of file RecoTracktoTP.h.

29 { shared_ = m; }

References visualization-live-secondInstance_cfg::m, and shared_.

Referenced by TrackAlgoCompareUtil::produce().

◆ SetTrackingParticle()

void RecoTracktoTP::SetTrackingParticle ( TrackingParticleRef  tp)
inline

Definition at line 25 of file RecoTracktoTP.h.

25 { trackingParticle_ = tp; }

References cmsswSequenceInfo::tp, and trackingParticle_.

Referenced by TrackAlgoCompareUtil::produce().

◆ SetTrackingParticleMomentumPCA()

void RecoTracktoTP::SetTrackingParticleMomentumPCA ( const GlobalVector p)
inline

◆ SetTrackingParticlePCA()

void RecoTracktoTP::SetTrackingParticlePCA ( const GlobalPoint v)
inline

Definition at line 56 of file RecoTracktoTP.h.

56 { simPCA_ = v; }

References simPCA_, and findQualityFiles::v.

Referenced by RecoTracktoTP(), and TrackAlgoCompareUtil::SetTrackingParticleD0Dz().

◆ TP()

TrackingParticle RecoTracktoTP::TP ( ) const
inline

◆ TPMother() [1/2]

TrackingParticle RecoTracktoTP::TPMother ( ) const
inline

Definition at line 83 of file RecoTracktoTP.h.

83 { return numTPMothers() == 1 ? TPMother(0) : TrackingParticle(); }

References numTPMothers(), TPMother(), and ProducerES_cfi::TrackingParticle.

Referenced by TPMother().

◆ TPMother() [2/2]

TrackingParticle RecoTracktoTP::TPMother ( unsigned short  i) const

Definition at line 12 of file RecoTracktoTP.cc.

12  {
13  std::vector<TrackingParticle> result;
14 
15  if (TP().parentVertex().isNonnull()) {
16  if (TP().parentVertex()->nSourceTracks() > 0) {
17  for (TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
18  si != TP().parentVertex()->sourceTracks_end();
19  ++si) {
20  for (TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
21  di != TP().parentVertex()->daughterTracks_end();
22  ++di) {
23  if (si != di) {
24  result.push_back(**si);
25  break;
26  }
27  }
28  if (!result.empty())
29  break;
30  }
31  } else {
32  return TrackingParticle();
33  }
34  } else {
35  return TrackingParticle();
36  }
37 
38  return i < result.size() ? result[i] : TrackingParticle();
39 }

References mps_fire::i, TrackingParticle::parentVertex(), mps_fire::result, TP(), and ProducerES_cfi::TrackingParticle.

Member Data Documentation

◆ beamSpot_

math::XYZPoint RecoTracktoTP::beamSpot_
protected

Definition at line 96 of file RecoTracktoTP.h.

Referenced by BeamSpot(), and SetBeamSpot().

◆ recoTrack

reco::TrackBaseRef RecoTracktoTP::recoTrack
protected

Definition at line 89 of file RecoTracktoTP.h.

Referenced by matched(), RT(), and SetRecoTrack().

◆ recoVertex

reco::VertexRef RecoTracktoTP::recoVertex
protected

Definition at line 90 of file RecoTracktoTP.h.

Referenced by hasRV(), RV(), and SetRecoVertex().

◆ shared_

float RecoTracktoTP::shared_
protected

Definition at line 97 of file RecoTracktoTP.h.

Referenced by GetShared(), and SetShared().

◆ simMomPCA_

GlobalVector RecoTracktoTP::simMomPCA_
protected

Definition at line 94 of file RecoTracktoTP.h.

Referenced by s_p(), and SetTrackingParticleMomentumPCA().

◆ simPCA_

GlobalPoint RecoTracktoTP::simPCA_
protected

Definition at line 95 of file RecoTracktoTP.h.

Referenced by s_pca(), and SetTrackingParticlePCA().

◆ trackingParticle_

TrackingParticleRef RecoTracktoTP::trackingParticle_
protected

Definition at line 92 of file RecoTracktoTP.h.

Referenced by matched(), SetTrackingParticle(), and TP().

RecoTracktoTP::s_p
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:355
RecoTracktoTP::r_dxy
double r_dxy() const
Definition: RecoTracktoTP.h:45
RecoTracktoTP::s_dxy
double s_dxy() const
Definition: RecoTracktoTP.h:70
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
RecoTracktoTP::hasRV
bool hasRV() const
Definition: RecoTracktoTP.h:38
ProducerES_cfi.TrackingParticle
TrackingParticle
Definition: ProducerES_cfi.py:66
RecoTracktoTP::SetTrackingParticleMomentumPCA
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition: RecoTracktoTP.h:55
reco::TrackBase::dsz
double dsz() const
dsz parameter (THIS IS NOT the SZ impact parameter to (0,0,0) if refPoint is far from (0,...
Definition: TrackBase.h:599
TrackingParticle::parentVertex
const TrackingVertexRef & parentVertex() const
Definition: TrackingParticle.h:90
DDAxes::x
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
findQualityFiles.v
v
Definition: findQualityFiles.py:179
RecoTracktoTP::recoVertex
reco::VertexRef recoVertex
Definition: RecoTracktoTP.h:90
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
TrackingParticle::charge
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
Definition: TrackingParticle.h:98
cms::cuda::bs
bs
Definition: HistoContainer.h:127
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
TrackingParticle
Monte Carlo truth information used for tracking validation.
Definition: TrackingParticle.h:29
DDAxes::z
reco::Track
Definition: Track.h:27
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
reco::TrackBase::dz
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:602
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
RecoTracktoTP::simPCA_
GlobalPoint simPCA_
Definition: RecoTracktoTP.h:95
RecoTracktoTP::trackingParticle_
TrackingParticleRef trackingParticle_
Definition: RecoTracktoTP.h:92
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
RecoTracktoTP::beamSpot_
math::XYZPoint beamSpot_
Definition: RecoTracktoTP.h:96
RecoTracktoTP::matched
bool matched() const
Definition: RecoTracktoTP.h:37
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
RecoTracktoTP::s_pca
GlobalPoint s_pca() const
Definition: RecoTracktoTP.h:59
RecoTracktoTP::SetBeamSpot
void SetBeamSpot(const math::XYZPoint &bs)
Definition: RecoTracktoTP.h:28
RecoTracktoTP::RT
reco::Track RT() const
Definition: RecoTracktoTP.h:32
RecoTracktoTP::SetTrackingParticlePCA
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition: RecoTracktoTP.h:56
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
RecoTracktoTP::shared_
float shared_
Definition: RecoTracktoTP.h:97
RecoTracktoTP::TPMother
TrackingParticle TPMother() const
Definition: RecoTracktoTP.h:83
edm::RefToBase::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:301
edm::RefVectorIterator
Definition: EDProductfwd.h:33
RecoTracktoTP::simMomPCA_
GlobalVector simMomPCA_
Definition: RecoTracktoTP.h:94
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
RecoTracktoTP::recoTrack
reco::TrackBaseRef recoTrack
Definition: RecoTracktoTP.h:89
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
mps_fire.result
result
Definition: mps_fire.py:303
RecoTracktoTP::numTPMothers
int numTPMothers() const
Definition: RecoTracktoTP.cc:41
RecoTracktoTP::BeamSpot
math::XYZPoint BeamSpot() const
Definition: RecoTracktoTP.h:35
reco::TrackBase::dxy
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:593
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
RecoTracktoTP::s_v
GlobalPoint s_v() const
Definition: RecoTracktoTP.h:60
RecoTracktoTP::RV
reco::Vertex RV() const
Definition: RecoTracktoTP.h:34
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
RecoTracktoTP::TP
TrackingParticle TP() const
Definition: RecoTracktoTP.h:33