1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
#include "DataFormats/TauReco/interface/PFTauTransverseImpactParameter.h"
#include "TMatrixT.h"
#include "TMatrixTSym.h"
#include "TVectorT.h"
using namespace reco;
PFTauTransverseImpactParameter::PFTauTransverseImpactParameter(const Point& pca,
double thedxy,
double thedxy_error,
const Point& pca3d,
double theip3d,
double theip3d_error,
const VertexRef& PV)
: pca_(pca),
dxy_(thedxy),
dxy_error_(thedxy_error),
pca3d_(pca3d),
ip3d_(theip3d),
ip3d_error_(theip3d_error),
PV_(PV),
hasSV_(false),
FlightLengthSig_(0.) {}
PFTauTransverseImpactParameter::PFTauTransverseImpactParameter(const Point& pca,
double thedxy,
double thedxy_error,
const Point& pca3d,
double theip3d,
double theip3d_error,
const VertexRef& PV,
const Point& theFlightLength,
double theFlightLengthSig,
const VertexRef& SV)
: pca_(pca),
dxy_(thedxy),
dxy_error_(thedxy_error),
pca3d_(pca3d),
ip3d_(theip3d),
ip3d_error_(theip3d_error),
PV_(PV),
hasSV_(true),
FlightLength_(theFlightLength),
FlightLengthSig_(theFlightLengthSig),
SV_(SV) {}
PFTauTransverseImpactParameter* PFTauTransverseImpactParameter::clone() const {
return new PFTauTransverseImpactParameter(*this);
}
PFTauTransverseImpactParameter::Point PFTauTransverseImpactParameter::primaryVertexPos() const {
if (PV_.isNonnull())
return PV_->position();
else
return PFTauTransverseImpactParameter::Point(0., 0., 0.);
}
PFTauTransverseImpactParameter::CovMatrix PFTauTransverseImpactParameter::primaryVertexCov() const {
CovMatrix cov;
for (int i = 0; i < dimension; ++i) {
for (int j = 0; j < dimension; ++j) {
cov(i, j) = PV_->covariance(i, j);
}
}
return cov;
}
const PFTauTransverseImpactParameter::Vector& PFTauTransverseImpactParameter::flightLength() const {
return FlightLength_;
}
double PFTauTransverseImpactParameter::flightLengthSig() const {
if (hasSV_) {
//std::cout << "<PFTauTransverseImpactParameter::flightLengthSig>:" << std::endl;
//VertexDistance3D vtxdist;
//std::cout << "oldValue = " << vtxdist.distance(*PV_, *SV_).significance() << std::endl; // transforms using the jacobian then computes distance/uncertainty
//std::cout << "newValue = " << FlightLengthSig_ << std::endl;
return FlightLengthSig_;
}
return -9.9;
}
PFTauTransverseImpactParameter::Point PFTauTransverseImpactParameter::secondaryVertexPos() const {
if (hasSV_)
return SV_->position();
else
return PFTauTransverseImpactParameter::Point(0., 0., 0.);
}
PFTauTransverseImpactParameter::CovMatrix PFTauTransverseImpactParameter::secondaryVertexCov() const {
CovMatrix cov;
if (!hasSV_)
return cov;
for (int i = 0; i < dimension; ++i) {
for (int j = 0; j < dimension; ++j) {
cov(i, j) = SV_->covariance(i, j);
}
}
return cov;
}
PFTauTransverseImpactParameter::CovMatrix PFTauTransverseImpactParameter::flightLengthCov() const {
CovMatrix cov;
const CovMatrix& sv = secondaryVertexCov();
const CovMatrix& pv = primaryVertexCov();
for (int i = 0; i < dimension; ++i) {
for (int j = 0; j < dimension; ++j) {
cov(i, j) = sv(i, j) + pv(i, j);
}
}
return cov;
}
|