test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
21
class
RecoTracktoTP
22
{
23
public
:
24
25
RecoTracktoTP
();
26
~RecoTracktoTP
();
27
28
void
SetTrackingParticle
(
TrackingParticleRef
tp) {
trackingParticle_
= tp;}
29
void
SetRecoTrack
(
reco::TrackBaseRef
track) {
recoTrack
= track;}
30
void
SetRecoVertex
(
reco::VertexRef
vertex) {
recoVertex
= vertex;}
31
void
SetBeamSpot
(
const
math::XYZPoint
& bs) {
beamSpot_
= bs;}
32
void
SetShared
(
const
float
&
m
) {
shared_
=
m
;}
33
34
// Interogation Functions
35
reco::Track
RT
()
const
{
return
recoTrack
.
isNonnull
() ? *
recoTrack
:
reco::Track
();}
36
TrackingParticle
TP
()
const
{
return
trackingParticle_
.
isNonnull
() ? *
trackingParticle_
:
TrackingParticle
();}
37
reco::Vertex
RV
()
const
{
return
recoVertex
.
isNonnull
() ? *
recoVertex
:
reco::Vertex
();}
38
math::XYZPoint
BeamSpot
()
const
{
return
beamSpot_
;}
39
40
bool
matched
()
const
{
return
trackingParticle_
.
isNonnull
() &&
recoTrack
.
isNonnull
();}
41
bool
hasRV
()
const
{
return
recoVertex
.
isNonnull
() && fabs(
recoVertex
->position().Mag2())>0.0;}
// position is ROOT::MATH::Cartesian3D<double>
42
bool
hasPCA
()
const
{
return
s_pca
().
mag
()<9999.0;}
43
bool
allmatched
()
const
{
return
matched
() &&
hasRV
();}
44
45
// These members for reco d0 and dz are the TIP and LIP w.r.t the reconstructed BeamSpot (as opposed to (0,0,0) ).
46
double
r_dxy
()
const
{
return
RT
().
dxy
(
BeamSpot
() );}
47
double
r_dsz
()
const
{
return
RT
().
dsz
(
BeamSpot
() );}
48
double
r_d0
()
const
{
return
-1.0 *
r_dxy
();}
49
double
r_dz
()
const
{
return
RT
().
dz
(
BeamSpot
() );}
50
51
// These members for reco d0 and dz are the TIP and LIP w.r.t the reconstructed vertex (as opposed to (0,0,0) ).
52
double
r_d02
()
const
{
return
-1.0 *
RT
().
dxy
(
RV
().
position
() );}
53
double
r_dz2
()
const
{
return
RT
().
dz
(
RV
().
position
() );}
54
55
// These members for sim d0 and dz are not included in the TrackingParticle class and must be included seperately.
56
void
SetTrackingParticleMomentumPCA
(
const
GlobalVector
&
p
) {
simMomPCA_
=
p
;}
57
void
SetTrackingParticlePCA
(
const
GlobalPoint
&
v
) {
simPCA_
=
v
;}
58
59
GlobalVector
s_p
()
const
{
return
simMomPCA_
;}
60
GlobalPoint
s_pca
()
const
{
return
simPCA_
;}
61
GlobalPoint
s_v
()
const
{
return
GlobalPoint
(
s_pca
().
x
()-
BeamSpot
().
x
(),
s_pca
().
y
()-
BeamSpot
().
y
(),
s_pca
().
z
()-
BeamSpot
().
z
() );}
62
63
double
s_qoverp
()
const
{
return
TP
().
charge
() /
s_p
().
mag
();}
64
double
s_theta
()
const
{
return
s_p
().
theta
();}
65
double
s_lambda
()
const
{
return
M_PI
/2-
s_p
().
theta
();}
66
double
s_phi
()
const
{
return
s_p
().
phi
();}
67
double
s_eta
()
const
{
return
-1.0*
log
(
tan
(0.5*
s_p
().
theta
()) );}
68
69
double
s_dxy
()
const
{
return
( -
s_v
().
x
() *
s_p
().
y
() +
s_v
().
y
() *
s_p
().
x
() ) /
s_p
().
perp
();}
70
double
s_dsz
()
const
{
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
();}
71
double
s_d0
()
const
{
return
-1.0*
s_dxy
();}
72
double
s_dz
()
const
{
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
();}
73
float
GetShared
()
const
{
return
shared_
;}
74
75
// Short cut methods to get TP truth info
76
TrackingParticle
TPMother
(
unsigned
short
i
)
const
;
77
TrackingParticle
TPMother
()
const
{
return
numTPMothers
()==1 ?
TPMother
(0) :
TrackingParticle
();}
78
int
numTPSourceTracks
()
const
{
return
TP
().
parentVertex
()->nSourceTracks();}
79
int
numTPMothers
()
const
;
80
bool
hasTPMother
()
const
{
return
numTPMothers
()>0;}
81
82
protected
:
83
84
reco::TrackBaseRef
recoTrack
;
85
reco::VertexRef
recoVertex
;
86
87
TrackingParticleRef
trackingParticle_
;
88
89
GlobalVector
simMomPCA_
;
// Momentum at point of closest approach to the beamspot of the trackingParticle.
90
GlobalPoint
simPCA_
;
// Point of closest approach to the BeamSpot of the TrackingParticle.
91
math::XYZPoint
beamSpot_
;
// I use type XYZPoint to faciliate the use of the recoTrack memeber dxy(XYZPoint).
92
float
shared_
;
// Number of shared hits with TP
93
94
};
95
96
97
#endif // TRACKINFO_RECOTRACKTOTP_H
98
i
int i
Definition:
DBlmapReader.cc:9
RecoTracktoTP::SetTrackingParticle
void SetTrackingParticle(TrackingParticleRef tp)
Definition:
RecoTracktoTP.h:28
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition:
Ref.h:252
RecoTracktoTP::SetTrackingParticleMomentumPCA
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition:
RecoTracktoTP.h:56
PV3DBase::perp
T perp() const
Definition:
PV3DBase.h:72
RecoTracktoTP::s_qoverp
double s_qoverp() const
Definition:
RecoTracktoTP.h:63
RecoTracktoTP::hasTPMother
bool hasTPMother() const
Definition:
RecoTracktoTP.h:80
edm::Ref< TrackingParticleCollection >
Vector3DBase< float, GlobalTag >
PV3DBase::phi
Geom::Phi< T > phi() const
Definition:
PV3DBase.h:69
RecoTracktoTP::r_d0
double r_d0() const
Definition:
RecoTracktoTP.h:48
RecoTracktoTP::SetShared
void SetShared(const float &m)
Definition:
RecoTracktoTP.h:32
GlobalPoint
Global3DPoint GlobalPoint
Definition:
GlobalPoint.h:10
RecoTracktoTP::SetTrackingParticlePCA
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition:
RecoTracktoTP.h:57
theta
Geom::Theta< T > theta() const
Definition:
Basic3DVectorLD.h:170
PV3DBase::y
T y() const
Definition:
PV3DBase.h:63
TrackingVertexContainer.h
RecoTracktoTP::SetRecoVertex
void SetRecoVertex(reco::VertexRef vertex)
Definition:
RecoTracktoTP.h:30
TrackingVertex.h
edm::RefToBase::isNonnull
bool isNonnull() const
Checks for non-null.
Definition:
RefToBase.h:330
RecoTracktoTP::s_dxy
double s_dxy() const
Definition:
RecoTracktoTP.h:69
TrackFwd.h
RecoTracktoTP::shared_
float shared_
Definition:
RecoTracktoTP.h:92
TrackingParticle.h
VertexFwd.h
findQualityFiles.v
v
Definition:
findQualityFiles.py:177
RecoTracktoTP::s_eta
double s_eta() const
Definition:
RecoTracktoTP.h:67
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:590
RecoTracktoTP::r_dz2
double r_dz2() const
Definition:
RecoTracktoTP.h:53
Point3D.h
edm::RefToBase< reco::Track >
RecoTracktoTP::numTPMothers
int numTPMothers() const
Definition:
RecoTracktoTP.cc:55
RecoTracktoTP::s_p
GlobalVector s_p() const
Definition:
RecoTracktoTP.h:59
PV3DBase::theta
Geom::Theta< T > theta() const
Definition:
PV3DBase.h:75
RecoTracktoTP::hasPCA
bool hasPCA() const
Definition:
RecoTracktoTP.h:42
RecoTracktoTP::~RecoTracktoTP
~RecoTracktoTP()
Definition:
RecoTracktoTP.cc:13
RecoTracktoTP::recoVertex
reco::VertexRef recoVertex
Definition:
RecoTracktoTP.h:85
RecoTracktoTP::s_phi
double s_phi() const
Definition:
RecoTracktoTP.h:66
RecoTracktoTP::s_dsz
double s_dsz() const
Definition:
RecoTracktoTP.h:70
visualization-live-secondInstance_cfg.m
tuple m
Definition:
visualization-live-secondInstance_cfg.py:45
TrackingParticle::charge
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
Definition:
TrackingParticle.h:99
PV3DBase::mag
T mag() const
Definition:
PV3DBase.h:67
RecoTracktoTP::s_dz
double s_dz() const
Definition:
RecoTracktoTP.h:72
reco::Vertex
Definition:
Vertex.h:34
RecoTracktoTP::r_d02
double r_d02() const
Definition:
RecoTracktoTP.h:52
RecoTracktoTP::BeamSpot
math::XYZPoint BeamSpot() const
Definition:
RecoTracktoTP.h:38
RecoTracktoTP::TP
TrackingParticle TP() const
Definition:
RecoTracktoTP.h:36
PV3DBase::z
T z() const
Definition:
PV3DBase.h:64
RecoTracktoTP::RecoTracktoTP
RecoTracktoTP()
Definition:
RecoTracktoTP.cc:5
RecoTracktoTP
Definition:
RecoTracktoTP.h:21
funct::tan
Tan< T >::type tan(const T &t)
Definition:
Tan.h:22
RecoTracktoTP::RV
reco::Vertex RV() const
Definition:
RecoTracktoTP.h:37
RecoTracktoTP::recoTrack
reco::TrackBaseRef recoTrack
Definition:
RecoTracktoTP.h:84
RecoTracktoTP::s_lambda
double s_lambda() const
Definition:
RecoTracktoTP.h:65
RecoTracktoTP::numTPSourceTracks
int numTPSourceTracks() const
Definition:
RecoTracktoTP.h:78
RecoTracktoTP::s_theta
double s_theta() const
Definition:
RecoTracktoTP.h:64
RecoTracktoTP::GetShared
float GetShared() const
Definition:
RecoTracktoTP.h:73
TrackingParticle::parentVertex
const TrackingVertexRef & parentVertex() const
Definition:
TrackingParticle.h:90
M_PI
#define M_PI
Definition:
readTestVector.cc:25
Vertex.h
RecoTracktoTP::hasRV
bool hasRV() const
Definition:
RecoTracktoTP.h:41
GlobalVector.h
RecoTracktoTP::r_dz
double r_dz() const
Definition:
RecoTracktoTP.h:49
RecoTracktoTP::beamSpot_
math::XYZPoint beamSpot_
Definition:
RecoTracktoTP.h:91
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:596
RecoTracktoTP::TPMother
TrackingParticle TPMother() const
Definition:
RecoTracktoTP.h:77
RecoTracktoTP::RT
reco::Track RT() const
Definition:
RecoTracktoTP.h:35
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition:
Point3D.h:12
RecoTracktoTP::s_d0
double s_d0() const
Definition:
RecoTracktoTP.h:71
RecoTracktoTP::SetRecoTrack
void SetRecoTrack(reco::TrackBaseRef track)
Definition:
RecoTracktoTP.h:29
RecoTracktoTP::r_dsz
double r_dsz() const
Definition:
RecoTracktoTP.h:47
reco::Track
Definition:
Track.h:28
RecoTracktoTP::allmatched
bool allmatched() const
Definition:
RecoTracktoTP.h:43
AlCaHLTBitMon_ParallelJobs.p
tuple p
Definition:
AlCaHLTBitMon_ParallelJobs.py:152
Point3DBase< float, GlobalTag >
RecoTracktoTP::s_pca
GlobalPoint s_pca() const
Definition:
RecoTracktoTP.h:60
RecoTracktoTP::s_v
GlobalPoint s_v() const
Definition:
RecoTracktoTP.h:61
RecoTracktoTP::SetBeamSpot
void SetBeamSpot(const math::XYZPoint &bs)
Definition:
RecoTracktoTP.h:31
DDAxes::y
Vector3D.h
position
static int position[264][3]
Definition:
ReadPGInfo.cc:509
BeamSpot.h
DDAxes::z
TrackingParticle
Monte Carlo truth information used for tracking validation.
Definition:
TrackingParticle.h:29
RecoTracktoTP::trackingParticle_
TrackingParticleRef trackingParticle_
Definition:
RecoTracktoTP.h:87
TrackingParticleFwd.h
Track.h
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:578
DDAxes::x
PV3DBase::x
T x() const
Definition:
PV3DBase.h:62
RecoTracktoTP::matched
bool matched() const
Definition:
RecoTracktoTP.h:40
RecoTracktoTP::simMomPCA_
GlobalVector simMomPCA_
Definition:
RecoTracktoTP.h:89
RecoTracktoTP::simPCA_
GlobalPoint simPCA_
Definition:
RecoTracktoTP.h:90
GlobalPoint.h
cmsBatch.log
tuple log
Definition:
cmsBatch.py:341
RecoTracktoTP::r_dxy
double r_dxy() const
Definition:
RecoTracktoTP.h:46
Generated for CMSSW Reference Manual by
1.8.5