CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (unsigned short i) const
 
TrackingParticle TPMother () 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 21 of file RecoTracktoTP.h.

Constructor & Destructor Documentation

RecoTracktoTP::RecoTracktoTP ( )

Definition at line 5 of file RecoTracktoTP.cc.

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

6 {
7  SetBeamSpot(math::XYZPoint(-9999.0, -9999.0, -9999.0));
8  SetTrackingParticlePCA(GlobalPoint(-9999.0, -9999.0, -9999.0));
9  SetTrackingParticleMomentumPCA(GlobalVector(-9999.0, -9999.0, -9999.0));
10 }
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition: RecoTracktoTP.h:56
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition: RecoTracktoTP.h:57
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void SetBeamSpot(const math::XYZPoint &bs)
Definition: RecoTracktoTP.h:31
Global3DVector GlobalVector
Definition: GlobalVector.h:10
RecoTracktoTP::~RecoTracktoTP ( )

Definition at line 13 of file RecoTracktoTP.cc.

14 {
15 }

Member Function Documentation

bool RecoTracktoTP::allmatched ( ) const
inline

Definition at line 43 of file RecoTracktoTP.h.

References hasRV(), and matched().

43 {return matched() && hasRV();}
bool hasRV() const
Definition: RecoTracktoTP.h:41
bool matched() const
Definition: RecoTracktoTP.h:40
math::XYZPoint RecoTracktoTP::BeamSpot ( ) const
inline

Definition at line 38 of file RecoTracktoTP.h.

References beamSpot_.

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

38 {return beamSpot_;}
math::XYZPoint beamSpot_
Definition: RecoTracktoTP.h:91
float RecoTracktoTP::GetShared ( ) const
inline

Definition at line 73 of file RecoTracktoTP.h.

References shared_.

73 {return shared_;}
bool RecoTracktoTP::hasPCA ( ) const
inline

Definition at line 42 of file RecoTracktoTP.h.

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

42 {return s_pca().mag()<9999.0;}
T mag() const
Definition: PV3DBase.h:67
GlobalPoint s_pca() const
Definition: RecoTracktoTP.h:60
bool RecoTracktoTP::hasRV ( ) const
inline

Definition at line 41 of file RecoTracktoTP.h.

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

Referenced by allmatched().

41 {return recoVertex.isNonnull() && fabs(recoVertex->position().Mag2())>0.0;} // position is ROOT::MATH::Cartesian3D<double>
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
reco::VertexRef recoVertex
Definition: RecoTracktoTP.h:85
bool RecoTracktoTP::hasTPMother ( ) const
inline

Definition at line 80 of file RecoTracktoTP.h.

References numTPMothers().

80 {return numTPMothers()>0;}
int numTPMothers() const
bool RecoTracktoTP::matched ( ) const
inline

Definition at line 40 of file RecoTracktoTP.h.

References edm::RefToBase< T >::isNonnull(), edm::Ref< C, T, F >::isNonnull(), recoTrack, and trackingParticle_.

Referenced by allmatched().

bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:337
reco::TrackBaseRef recoTrack
Definition: RecoTracktoTP.h:84
TrackingParticleRef trackingParticle_
Definition: RecoTracktoTP.h:87
int RecoTracktoTP::numTPMothers ( ) const

Definition at line 55 of file RecoTracktoTP.cc.

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

Referenced by hasTPMother(), and TPMother().

56 {
57  int count = 0;
58  for(TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
59  si != TP().parentVertex()->sourceTracks_end(); ++si)
60  {
61  for(TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
62  di != TP().parentVertex()->daughterTracks_end(); ++di)
63  {
64  if(si != di) count++;
65  break;
66  }
67  if(count>0) break;
68  }
69  return count;
70 }
TrackingParticle TP() const
Definition: RecoTracktoTP.h:36
const TrackingVertexRef & parentVertex() const
int RecoTracktoTP::numTPSourceTracks ( ) const
inline

Definition at line 78 of file RecoTracktoTP.h.

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

78 {return TP().parentVertex()->nSourceTracks();}
TrackingParticle TP() const
Definition: RecoTracktoTP.h:36
const TrackingVertexRef & parentVertex() const
double RecoTracktoTP::r_d0 ( ) const
inline

Definition at line 48 of file RecoTracktoTP.h.

References r_dxy().

48 {return -1.0 * r_dxy();}
double r_dxy() const
Definition: RecoTracktoTP.h:46
double RecoTracktoTP::r_d02 ( ) const
inline

Definition at line 52 of file RecoTracktoTP.h.

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

52 {return -1.0 * RT().dxy( RV().position() );}
reco::Vertex RV() const
Definition: RecoTracktoTP.h:37
reco::Track RT() const
Definition: RecoTracktoTP.h:35
static int position[264][3]
Definition: ReadPGInfo.cc:509
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:586
double RecoTracktoTP::r_dsz ( ) const
inline

Definition at line 47 of file RecoTracktoTP.h.

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

47 {return RT().dsz( BeamSpot() );}
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:598
math::XYZPoint BeamSpot() const
Definition: RecoTracktoTP.h:38
reco::Track RT() const
Definition: RecoTracktoTP.h:35
double RecoTracktoTP::r_dxy ( ) const
inline

Definition at line 46 of file RecoTracktoTP.h.

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

Referenced by r_d0().

46 {return RT().dxy( BeamSpot() );}
math::XYZPoint BeamSpot() const
Definition: RecoTracktoTP.h:38
reco::Track RT() const
Definition: RecoTracktoTP.h:35
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:586
double RecoTracktoTP::r_dz ( ) const
inline

Definition at line 49 of file RecoTracktoTP.h.

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

49 {return RT().dz( BeamSpot() );}
math::XYZPoint BeamSpot() const
Definition: RecoTracktoTP.h:38
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:604
reco::Track RT() const
Definition: RecoTracktoTP.h:35
double RecoTracktoTP::r_dz2 ( ) const
inline

Definition at line 53 of file RecoTracktoTP.h.

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

53 {return RT().dz( RV().position() );}
reco::Vertex RV() const
Definition: RecoTracktoTP.h:37
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:604
reco::Track RT() const
Definition: RecoTracktoTP.h:35
static int position[264][3]
Definition: ReadPGInfo.cc:509
reco::Track RecoTracktoTP::RT ( ) const
inline

Definition at line 35 of file RecoTracktoTP.h.

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

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

35 {return recoTrack.isNonnull() ? *recoTrack : reco::Track();}
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:337
reco::TrackBaseRef recoTrack
Definition: RecoTracktoTP.h:84
reco::Vertex RecoTracktoTP::RV ( ) const
inline

Definition at line 37 of file RecoTracktoTP.h.

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

Referenced by r_d02(), and r_dz2().

37 {return recoVertex.isNonnull() ? *recoVertex : reco::Vertex();}
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
reco::VertexRef recoVertex
Definition: RecoTracktoTP.h:85
double RecoTracktoTP::s_d0 ( ) const
inline

Definition at line 71 of file RecoTracktoTP.h.

References s_dxy().

71 {return -1.0*s_dxy();}
double s_dxy() const
Definition: RecoTracktoTP.h:69
double RecoTracktoTP::s_dsz ( ) const
inline

Definition at line 70 of file RecoTracktoTP.h.

References PV3DBase< T, PVType, FrameType >::mag(), 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().

70 {return s_v().z()*s_p().perp()/ s_p().mag() - ((s_v().x()*s_p().x() + s_v().y()*s_p().y()) / s_p().perp()) * s_p().z()/s_p().mag();}
T perp() const
Definition: PV3DBase.h:72
T y() const
Definition: PV3DBase.h:63
GlobalVector s_p() const
Definition: RecoTracktoTP.h:59
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
GlobalPoint s_v() const
Definition: RecoTracktoTP.h:61
T x() const
Definition: PV3DBase.h:62
double RecoTracktoTP::s_dxy ( ) const
inline

Definition at line 69 of file RecoTracktoTP.h.

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

Referenced by s_d0().

69 {return ( - s_v().x() * s_p().y() + s_v().y() * s_p().x() ) / s_p().perp();}
T perp() const
Definition: PV3DBase.h:72
GlobalVector s_p() const
Definition: RecoTracktoTP.h:59
GlobalPoint s_v() const
Definition: RecoTracktoTP.h:61
double RecoTracktoTP::s_dz ( ) const
inline

Definition at line 72 of file RecoTracktoTP.h.

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().

72 {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();}
T perp() const
Definition: PV3DBase.h:72
T y() const
Definition: PV3DBase.h:63
GlobalVector s_p() const
Definition: RecoTracktoTP.h:59
T z() const
Definition: PV3DBase.h:64
GlobalPoint s_v() const
Definition: RecoTracktoTP.h:61
T x() const
Definition: PV3DBase.h:62
double RecoTracktoTP::s_eta ( ) const
inline

Definition at line 67 of file RecoTracktoTP.h.

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

67 {return -1.0*log( tan (0.5*s_p().theta()) );}
Geom::Theta< T > theta() const
GlobalVector s_p() const
Definition: RecoTracktoTP.h:59
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double RecoTracktoTP::s_lambda ( ) const
inline

Definition at line 65 of file RecoTracktoTP.h.

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

65 {return M_PI/2-s_p().theta();}
GlobalVector s_p() const
Definition: RecoTracktoTP.h:59
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
#define M_PI
GlobalVector RecoTracktoTP::s_p ( ) const
inline

Definition at line 59 of file RecoTracktoTP.h.

References simMomPCA_.

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

59 {return simMomPCA_;}
GlobalVector simMomPCA_
Definition: RecoTracktoTP.h:89
GlobalPoint RecoTracktoTP::s_pca ( ) const
inline

Definition at line 60 of file RecoTracktoTP.h.

References simPCA_.

Referenced by hasPCA(), and s_v().

60 {return simPCA_;}
GlobalPoint simPCA_
Definition: RecoTracktoTP.h:90
double RecoTracktoTP::s_phi ( ) const
inline

Definition at line 66 of file RecoTracktoTP.h.

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

66 {return s_p().phi();}
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalVector s_p() const
Definition: RecoTracktoTP.h:59
double RecoTracktoTP::s_qoverp ( ) const
inline

Definition at line 63 of file RecoTracktoTP.h.

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

63 {return TP().charge() / s_p().mag();}
GlobalVector s_p() const
Definition: RecoTracktoTP.h:59
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
T mag() const
Definition: PV3DBase.h:67
TrackingParticle TP() const
Definition: RecoTracktoTP.h:36
double RecoTracktoTP::s_theta ( ) const
inline

Definition at line 64 of file RecoTracktoTP.h.

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

64 {return s_p().theta();}
GlobalVector s_p() const
Definition: RecoTracktoTP.h:59
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
GlobalPoint RecoTracktoTP::s_v ( ) const
inline

Definition at line 61 of file RecoTracktoTP.h.

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

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

61 {return GlobalPoint(s_pca().x()-BeamSpot().x(), s_pca().y()-BeamSpot().y(), s_pca().z()-BeamSpot().z() );}
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
math::XYZPoint BeamSpot() const
Definition: RecoTracktoTP.h:38
GlobalPoint s_pca() const
Definition: RecoTracktoTP.h:60
void RecoTracktoTP::SetBeamSpot ( const math::XYZPoint bs)
inline

Definition at line 31 of file RecoTracktoTP.h.

References beamSpot_.

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

31 {beamSpot_ = bs;}
math::XYZPoint beamSpot_
Definition: RecoTracktoTP.h:91
void RecoTracktoTP::SetRecoTrack ( reco::TrackBaseRef  track)
inline

Definition at line 29 of file RecoTracktoTP.h.

References recoTrack.

Referenced by TrackAlgoCompareUtil::produce().

29 {recoTrack = track;}
reco::TrackBaseRef recoTrack
Definition: RecoTracktoTP.h:84
void RecoTracktoTP::SetRecoVertex ( reco::VertexRef  vertex)
inline

Definition at line 30 of file RecoTracktoTP.h.

References recoVertex.

Referenced by TrackAlgoCompareUtil::produce().

30 {recoVertex = vertex;}
reco::VertexRef recoVertex
Definition: RecoTracktoTP.h:85
void RecoTracktoTP::SetShared ( const float &  m)
inline
void RecoTracktoTP::SetTrackingParticle ( TrackingParticleRef  tp)
inline

Definition at line 28 of file RecoTracktoTP.h.

References trackingParticle_.

Referenced by TrackAlgoCompareUtil::produce().

28 {trackingParticle_ = tp;}
TrackingParticleRef trackingParticle_
Definition: RecoTracktoTP.h:87
void RecoTracktoTP::SetTrackingParticleMomentumPCA ( const GlobalVector p)
inline
void RecoTracktoTP::SetTrackingParticlePCA ( const GlobalPoint v)
inline
TrackingParticle RecoTracktoTP::TP ( ) const
inline

Definition at line 36 of file RecoTracktoTP.h.

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

Referenced by numTPMothers(), numTPSourceTracks(), s_qoverp(), and TPMother().

bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
Monte Carlo truth information used for tracking validation.
TrackingParticleRef trackingParticle_
Definition: RecoTracktoTP.h:87
TrackingParticle RecoTracktoTP::TPMother ( unsigned short  i) const

Definition at line 18 of file RecoTracktoTP.cc.

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

19 {
20  std::vector<TrackingParticle> result;
21 
22  if( TP().parentVertex().isNonnull())
23  {
24  if(TP().parentVertex()->nSourceTracks() > 0)
25  {
26  for(TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
27  si != TP().parentVertex()->sourceTracks_end(); ++si)
28  {
29  for(TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
30  di != TP().parentVertex()->daughterTracks_end(); ++di)
31  {
32  if(si != di)
33  {
34  result.push_back(**si);
35  break;
36  }
37  }
38  if(result.size()) break;
39  }
40  }
41  else
42  {
43  return TrackingParticle();
44  }
45  }
46  else
47  {
48  return TrackingParticle();
49  }
50 
51  return i < result.size() ? result[i] : TrackingParticle();
52 }
int i
Definition: DBlmapReader.cc:9
tuple result
Definition: mps_fire.py:84
TrackingParticle TP() const
Definition: RecoTracktoTP.h:36
const TrackingVertexRef & parentVertex() const
Monte Carlo truth information used for tracking validation.
TrackingParticle RecoTracktoTP::TPMother ( ) const
inline

Definition at line 77 of file RecoTracktoTP.h.

References numTPMothers(), and TPMother().

Referenced by TPMother().

77 {return numTPMothers()==1 ? TPMother(0) : TrackingParticle();}
int numTPMothers() const
TrackingParticle TPMother() const
Definition: RecoTracktoTP.h:77
Monte Carlo truth information used for tracking validation.

Member Data Documentation

math::XYZPoint RecoTracktoTP::beamSpot_
protected

Definition at line 91 of file RecoTracktoTP.h.

Referenced by BeamSpot(), and SetBeamSpot().

reco::TrackBaseRef RecoTracktoTP::recoTrack
protected

Definition at line 84 of file RecoTracktoTP.h.

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

reco::VertexRef RecoTracktoTP::recoVertex
protected

Definition at line 85 of file RecoTracktoTP.h.

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

float RecoTracktoTP::shared_
protected

Definition at line 92 of file RecoTracktoTP.h.

Referenced by GetShared(), and SetShared().

GlobalVector RecoTracktoTP::simMomPCA_
protected

Definition at line 89 of file RecoTracktoTP.h.

Referenced by s_p(), and SetTrackingParticleMomentumPCA().

GlobalPoint RecoTracktoTP::simPCA_
protected

Definition at line 90 of file RecoTracktoTP.h.

Referenced by s_pca(), and SetTrackingParticlePCA().

TrackingParticleRef RecoTracktoTP::trackingParticle_
protected

Definition at line 87 of file RecoTracktoTP.h.

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