src
AnalysisDataFormats
TrackInfo
interface
RecoTracktoTP.h
Go to the documentation of this file.
1
#ifndef TRACKINFO_RECOTRACKTOTP_H
2
#define TRACKINFO_RECOTRACKTOTP_H
3
4
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
5
#include "
DataFormats/TrackReco/interface/Track.h
"
6
#include "
DataFormats/VertexReco/interface/Vertex.h
"
7
#include "
DataFormats/VertexReco/interface/VertexFwd.h
"
8
#include "
DataFormats/BeamSpot/interface/BeamSpot.h
"
9
#include "
SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h
"
10
#include "
SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h
"
11
#include "
SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h
"
12
#include "
SimDataFormats/TrackingAnalysis/interface/TrackingVertexContainer.h
"
13
#include "
DataFormats/Math/interface/Vector3D.h
"
14
#include "
DataFormats/Math/interface/Point3D.h
"
15
#include "
DataFormats/GeometryVector/interface/GlobalPoint.h
"
16
#include "
DataFormats/GeometryVector/interface/GlobalVector.h
"
17
#include "TMath.h"
18
//#include <vector>
19
20
class
RecoTracktoTP
{
21
public
:
22
RecoTracktoTP
();
23
~RecoTracktoTP
();
24
25
void
SetTrackingParticle
(
TrackingParticleRef
tp
) {
trackingParticle_
=
tp
; }
26
void
SetRecoTrack
(
reco::TrackBaseRef
track
) {
recoTrack
=
track
; }
27
void
SetRecoVertex
(
reco::VertexRef
vertex
) {
recoVertex
=
vertex
; }
28
void
SetBeamSpot
(
const
math::XYZPoint
&
bs
) {
beamSpot_
=
bs
; }
29
void
SetShared
(
const
float
&
m
) {
shared_
=
m
; }
30
31
// Interogation Functions
32
reco::Track
RT
()
const
{
return
recoTrack
.
isNonnull
() ? *
recoTrack
:
reco::Track
(); }
33
TrackingParticle
TP
()
const
{
return
trackingParticle_
.
isNonnull
() ? *
trackingParticle_
:
TrackingParticle
(); }
34
reco::Vertex
RV
()
const
{
return
recoVertex
.
isNonnull
() ? *
recoVertex
:
reco::Vertex
(); }
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.
55
void
SetTrackingParticleMomentumPCA
(
const
GlobalVector
&
p
) {
simMomPCA_
=
p
; }
56
void
SetTrackingParticlePCA
(
const
GlobalPoint
&
v
) {
simPCA_
=
v
; }
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
:
89
reco::TrackBaseRef
recoTrack
;
90
reco::VertexRef
recoVertex
;
91
92
TrackingParticleRef
trackingParticle_
;
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
RecoTracktoTP::hasTPMother
bool hasTPMother() const
Definition:
RecoTracktoTP.h:86
Vertex.h
RecoTracktoTP::SetTrackingParticle
void SetTrackingParticle(TrackingParticleRef tp)
Definition:
RecoTracktoTP.h:25
RecoTracktoTP::TP
TrackingParticle TP() const
Definition:
RecoTracktoTP.h:33
bphysicsOniaDQM_cfi.vertex
vertex
Definition:
bphysicsOniaDQM_cfi.py:7
PV3DBase::perp
T perp() const
Definition:
PV3DBase.h:69
mps_fire.i
i
Definition:
mps_fire.py:429
RecoTracktoTP::SetTrackingParticleMomentumPCA
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition:
RecoTracktoTP.h:55
RecoTracktoTP::s_qoverp
double s_qoverp() const
Definition:
RecoTracktoTP.h:64
ProducerSetup_cfi.TrackingParticle
TrackingParticle
Definition:
ProducerSetup_cfi.py:72
PV3DBase::z
T z() const
Definition:
PV3DBase.h:61
edm::Ref< TrackingParticleCollection >
edm::RefToBase::isNonnull
bool isNonnull() const
Checks for non-null.
Definition:
RefToBase.h:303
Vector3DBase
Definition:
Vector3DBase.h:8
PV3DBase::phi
Geom::Phi< T > phi() const
Definition:
PV3DBase.h:66
RecoTracktoTP::SetShared
void SetShared(const float &m)
Definition:
RecoTracktoTP.h:29
GlobalPoint
Global3DPoint GlobalPoint
Definition:
GlobalPoint.h:10
RecoTracktoTP::SetTrackingParticlePCA
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition:
RecoTracktoTP.h:56
TrackingVertexContainer.h
RecoTracktoTP::SetRecoVertex
void SetRecoVertex(reco::VertexRef vertex)
Definition:
RecoTracktoTP.h:27
RecoTracktoTP::BeamSpot
math::XYZPoint BeamSpot() const
Definition:
RecoTracktoTP.h:35
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition:
Ref.h:238
TrackingVertex.h
HltBtagValidation_cff.Vertex
Vertex
Definition:
HltBtagValidation_cff.py:32
cmsswSequenceInfo.tp
tp
Definition:
cmsswSequenceInfo.py:17
TrackFwd.h
RecoTracktoTP::s_v
GlobalPoint s_v() const
Definition:
RecoTracktoTP.h:60
RecoTracktoTP::shared_
float shared_
Definition:
RecoTracktoTP.h:97
RecoTracktoTP::hasRV
bool hasRV() const
Definition:
RecoTracktoTP.h:38
TrackingParticle.h
VertexFwd.h
findQualityFiles.v
v
Definition:
findQualityFiles.py:179
Point3D.h
RecoTracktoTP::r_dz2
double r_dz2() const
Definition:
RecoTracktoTP.h:52
edm::RefToBase< reco::Track >
RecoTracktoTP::s_pca
GlobalPoint s_pca() const
Definition:
RecoTracktoTP.h:59
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
RecoTracktoTP::~RecoTracktoTP
~RecoTracktoTP()
Definition:
RecoTracktoTP.cc:10
RecoTracktoTP::numTPMothers
int numTPMothers() const
Definition:
RecoTracktoTP.cc:41
RecoTracktoTP::recoVertex
reco::VertexRef recoVertex
Definition:
RecoTracktoTP.h:90
PV3DBase::x
T x() const
Definition:
PV3DBase.h:59
PV3DBase::y
T y() const
Definition:
PV3DBase.h:60
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
RecoTracktoTP::r_d0
double r_d0() const
Definition:
RecoTracktoTP.h:47
reco::Vertex
Definition:
Vertex.h:35
RecoTracktoTP::GetShared
float GetShared() const
Definition:
RecoTracktoTP.h:79
RecoTracktoTP::RV
reco::Vertex RV() const
Definition:
RecoTracktoTP.h:34
RecoTracktoTP::TPMother
TrackingParticle TPMother() const
Definition:
RecoTracktoTP.h:83
RecoTracktoTP::RecoTracktoTP
RecoTracktoTP()
Definition:
RecoTracktoTP.cc:4
RecoTracktoTP
Definition:
RecoTracktoTP.h:20
visualization-live-secondInstance_cfg.m
m
Definition:
visualization-live-secondInstance_cfg.py:80
RecoTracktoTP::matched
bool matched() const
Definition:
RecoTracktoTP.h:37
PV3DBase::mag
T mag() const
Definition:
PV3DBase.h:64
funct::tan
Tan< T >::type tan(const T &t)
Definition:
Tan.h:22
RecoTracktoTP::r_dz
double r_dz() const
Definition:
RecoTracktoTP.h:48
RecoTracktoTP::s_dsz
double s_dsz() const
Definition:
RecoTracktoTP.h:71
RecoTracktoTP::recoTrack
reco::TrackBaseRef recoTrack
Definition:
RecoTracktoTP.h:89
RecoTracktoTP::s_dxy
double s_dxy() const
Definition:
RecoTracktoTP.h:70
RecoTracktoTP::s_phi
double s_phi() const
Definition:
RecoTracktoTP.h:67
RecoTracktoTP::hasPCA
bool hasPCA() const
Definition:
RecoTracktoTP.h:41
GlobalVector.h
M_PI
#define M_PI
Definition:
BXVectorInputProducer.cc:50
RecoTracktoTP::beamSpot_
math::XYZPoint beamSpot_
Definition:
RecoTracktoTP.h:96
RecoTracktoTP::allmatched
bool allmatched() const
Definition:
RecoTracktoTP.h:42
TrackingParticle::parentVertex
const TrackingVertexRef & parentVertex() const
Definition:
TrackingParticle.h:90
RecoTracktoTP::r_d02
double r_d02() const
Definition:
RecoTracktoTP.h:51
RecoTracktoTP::s_eta
double s_eta() const
Definition:
RecoTracktoTP.h:68
RecoTracktoTP::s_theta
double s_theta() const
Definition:
RecoTracktoTP.h:65
RecoTracktoTP::r_dsz
double r_dsz() const
Definition:
RecoTracktoTP.h:46
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition:
Point3D.h:12
RecoTracktoTP::SetRecoTrack
void SetRecoTrack(reco::TrackBaseRef track)
Definition:
RecoTracktoTP.h:26
RecoTracktoTP::s_d0
double s_d0() const
Definition:
RecoTracktoTP.h:75
RecoTracktoTP::r_dxy
double r_dxy() const
Definition:
RecoTracktoTP.h:45
cms::cuda::bs
bs
Definition:
HistoContainer.h:76
reco::Track
Definition:
Track.h:27
RecoTracktoTP::numTPSourceTracks
int numTPSourceTracks() const
Definition:
RecoTracktoTP.h:84
Point3DBase< float, GlobalTag >
RecoTracktoTP::SetBeamSpot
void SetBeamSpot(const math::XYZPoint &bs)
Definition:
RecoTracktoTP.h:28
DDAxes::y
Vector3D.h
position
static int position[264][3]
Definition:
ReadPGInfo.cc:289
BeamSpot.h
DDAxes::z
RecoTracktoTP::s_dz
double s_dz() const
Definition:
RecoTracktoTP.h:76
RecoTracktoTP::s_lambda
double s_lambda() const
Definition:
RecoTracktoTP.h:66
TrackingParticle
Monte Carlo truth information used for tracking validation.
Definition:
TrackingParticle.h:29
Track.h
RecoTracktoTP::trackingParticle_
TrackingParticleRef trackingParticle_
Definition:
RecoTracktoTP.h:92
RecoTracktoTP::s_p
GlobalVector s_p() const
Definition:
RecoTracktoTP.h:58
dqm-mbProfile.log
log
Definition:
dqm-mbProfile.py:17
TrackingParticleFwd.h
DDAxes::x
theta
Geom::Theta< T > theta() const
Definition:
Basic3DVectorLD.h:150
RecoTracktoTP::simMomPCA_
GlobalVector simMomPCA_
Definition:
RecoTracktoTP.h:94
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
RecoTracktoTP::RT
reco::Track RT() const
Definition:
RecoTracktoTP.h:32
PV3DBase::theta
Geom::Theta< T > theta() const
Definition:
PV3DBase.h:72
HLT_2023v12_cff.track
track
Definition:
HLT_2023v12_cff.py:9591
TrackingParticle::charge
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
Definition:
TrackingParticle.h:98
RecoTracktoTP::simPCA_
GlobalPoint simPCA_
Definition:
RecoTracktoTP.h:95
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
Generated for CMSSW Reference Manual by
1.8.14