CMS 3D CMS Logo

RecoTracktoTP.h
Go to the documentation of this file.
1 #ifndef TRACKINFO_RECOTRACKTOTP_H
2 #define TRACKINFO_RECOTRACKTOTP_H
3 
17 #include "TMath.h"
18 //#include <vector>
19 
21 public:
22  RecoTracktoTP();
24 
29  void SetShared(const float &m) { shared_ = m; }
30 
31  // Interogation Functions
32  reco::Track RT() const { return recoTrack.isNonnull() ? *recoTrack : reco::Track(); }
35  math::XYZPoint BeamSpot() const { return beamSpot_; }
36 
37  bool matched() const { return trackingParticle_.isNonnull() && recoTrack.isNonnull(); }
38  bool hasRV() const {
39  return recoVertex.isNonnull() && fabs(recoVertex->position().Mag2()) > 0.0;
40  } // position is ROOT::MATH::Cartesian3D<double>
41  bool hasPCA() const { return s_pca().mag() < 9999.0; }
42  bool allmatched() const { return matched() && hasRV(); }
43 
44  // These members for reco d0 and dz are the TIP and LIP w.r.t the reconstructed BeamSpot (as opposed to (0,0,0) ).
45  double r_dxy() const { return RT().dxy(BeamSpot()); }
46  double r_dsz() const { return RT().dsz(BeamSpot()); }
47  double r_d0() const { return -1.0 * r_dxy(); }
48  double r_dz() const { return RT().dz(BeamSpot()); }
49 
50  // These members for reco d0 and dz are the TIP and LIP w.r.t the reconstructed vertex (as opposed to (0,0,0) ).
51  double r_d02() const { return -1.0 * RT().dxy(RV().position()); }
52  double r_dz2() const { return RT().dz(RV().position()); }
53 
54  // These members for sim d0 and dz are not included in the TrackingParticle class and must be included seperately.
57 
58  GlobalVector s_p() const { return simMomPCA_; }
59  GlobalPoint s_pca() const { return simPCA_; }
60  GlobalPoint s_v() const {
61  return GlobalPoint(s_pca().x() - BeamSpot().x(), s_pca().y() - BeamSpot().y(), s_pca().z() - BeamSpot().z());
62  }
63 
64  double s_qoverp() const { return TP().charge() / s_p().mag(); }
65  double s_theta() const { return s_p().theta(); }
66  double s_lambda() const { return M_PI / 2 - s_p().theta(); }
67  double s_phi() const { return s_p().phi(); }
68  double s_eta() const { return -1.0 * log(tan(0.5 * s_p().theta())); }
69 
70  double s_dxy() const { return (-s_v().x() * s_p().y() + s_v().y() * s_p().x()) / s_p().perp(); }
71  double s_dsz() const {
72  return s_v().z() * s_p().perp() / s_p().mag() -
73  ((s_v().x() * s_p().x() + s_v().y() * s_p().y()) / s_p().perp()) * s_p().z() / s_p().mag();
74  }
75  double s_d0() const { return -1.0 * s_dxy(); }
76  double s_dz() const {
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  }
79  float GetShared() const { return shared_; }
80 
81  // Short cut methods to get TP truth info
82  TrackingParticle TPMother(unsigned short i) const;
83  TrackingParticle TPMother() const { return numTPMothers() == 1 ? TPMother(0) : TrackingParticle(); }
84  int numTPSourceTracks() const { return TP().parentVertex()->nSourceTracks(); }
85  int numTPMothers() const;
86  bool hasTPMother() const { return numTPMothers() > 0; }
87 
88 protected:
91 
93 
94  GlobalVector simMomPCA_; // Momentum at point of closest approach to the beamspot of the trackingParticle.
95  GlobalPoint simPCA_; // Point of closest approach to the BeamSpot of the TrackingParticle.
96  math::XYZPoint beamSpot_; // I use type XYZPoint to faciliate the use of the recoTrack memeber dxy(XYZPoint).
97  float shared_; // Number of shared hits with TP
98 };
99 
100 #endif // TRACKINFO_RECOTRACKTOTP_H
Vector3DBase
Definition: Vector3DBase.h:8
RecoTracktoTP::s_p
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
RecoTracktoTP::r_dxy
double r_dxy() const
Definition: RecoTracktoTP.h:45
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
RecoTracktoTP::hasPCA
bool hasPCA() const
Definition: RecoTracktoTP.h:41
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
RecoTracktoTP::SetRecoTrack
void SetRecoTrack(reco::TrackBaseRef track)
Definition: RecoTracktoTP.h:26
RecoTracktoTP::r_dz2
double r_dz2() const
Definition: RecoTracktoTP.h:52
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:614
TrackingParticle::parentVertex
const TrackingVertexRef & parentVertex() const
Definition: TrackingParticle.h:90
RecoTracktoTP::s_dsz
double s_dsz() const
Definition: RecoTracktoTP.h:71
TrackingVertex.h
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
RecoTracktoTP::r_d0
double r_d0() const
Definition: RecoTracktoTP.h:47
RecoTracktoTP::~RecoTracktoTP
~RecoTracktoTP()
Definition: RecoTracktoTP.cc:10
edm::Ref< TrackingParticleCollection >
RecoTracktoTP::recoVertex
reco::VertexRef recoVertex
Definition: RecoTracktoTP.h:90
RecoTracktoTP::SetShared
void SetShared(const float &m)
Definition: RecoTracktoTP.h:29
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
RecoTracktoTP::s_dz
double s_dz() const
Definition: RecoTracktoTP.h:76
RecoTracktoTP::s_lambda
double s_lambda() const
Definition: RecoTracktoTP.h:66
cms::cuda::bs
bs
Definition: HistoContainer.h:127
RecoTracktoTP::RecoTracktoTP
RecoTracktoTP()
Definition: RecoTracktoTP.cc:4
Track.h
TrackFwd.h
TrackingVertexContainer.h
BeamSpot.h
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:622
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
RecoTracktoTP::allmatched
bool allmatched() const
Definition: RecoTracktoTP.h:42
RecoTracktoTP::simPCA_
GlobalPoint simPCA_
Definition: RecoTracktoTP.h:95
Vertex.h
RecoTracktoTP::trackingParticle_
TrackingParticleRef trackingParticle_
Definition: RecoTracktoTP.h:92
RecoTracktoTP::SetTrackingParticle
void SetTrackingParticle(TrackingParticleRef tp)
Definition: RecoTracktoTP.h:25
RecoTracktoTP::r_d02
double r_d02() const
Definition: RecoTracktoTP.h:51
RecoTracktoTP::hasTPMother
bool hasTPMother() const
Definition: RecoTracktoTP.h:86
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
RecoTracktoTP::s_qoverp
double s_qoverp() const
Definition: RecoTracktoTP.h:64
RecoTracktoTP
Definition: RecoTracktoTP.h:20
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
RecoTracktoTP::GetShared
float GetShared() const
Definition: RecoTracktoTP.h:79
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
RecoTracktoTP::s_d0
double s_d0() const
Definition: RecoTracktoTP.h:75
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
RecoTracktoTP::s_pca
GlobalPoint s_pca() const
Definition: RecoTracktoTP.h:59
RecoTracktoTP::numTPSourceTracks
int numTPSourceTracks() const
Definition: RecoTracktoTP.h:84
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
RecoTracktoTP::s_phi
double s_phi() const
Definition: RecoTracktoTP.h:67
VertexFwd.h
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
TrackingParticle.h
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
RecoTracktoTP::r_dsz
double r_dsz() const
Definition: RecoTracktoTP.h:46
RecoTracktoTP::shared_
float shared_
Definition: RecoTracktoTP.h:97
RecoTracktoTP::TPMother
TrackingParticle TPMother() const
Definition: RecoTracktoTP.h:83
TrackingParticleFwd.h
edm::RefToBase::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:301
RecoTracktoTP::s_theta
double s_theta() const
Definition: RecoTracktoTP.h:65
Point3D.h
RecoTracktoTP::r_dz
double r_dz() const
Definition: RecoTracktoTP.h:48
GlobalVector.h
edm::RefToBase< reco::Track >
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
RecoTracktoTP::numTPMothers
int numTPMothers() const
Definition: RecoTracktoTP.cc:41
RecoTracktoTP::SetRecoVertex
void SetRecoVertex(reco::VertexRef vertex)
Definition: RecoTracktoTP.h:27
Vector3D.h
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:608
GlobalPoint.h
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
reco::Vertex
Definition: Vertex.h:35
RecoTracktoTP::TP
TrackingParticle TP() const
Definition: RecoTracktoTP.h:33
RecoTracktoTP::s_eta
double s_eta() const
Definition: RecoTracktoTP.h:68