CMS 3D CMS Logo

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