CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
7 PFTauTransverseImpactParameter::PFTauTransverseImpactParameter(const Point& pca, double thedxy, double thedxy_error, const VertexRef& PV)
8  : pca_(pca),
9  dxy_(thedxy),
10  dxy_error_(thedxy_error),
11  PV_(PV),
12  hasSV_(false),
13  FlightLengthSig_(0.)
14 {}
15 
16 PFTauTransverseImpactParameter::PFTauTransverseImpactParameter(const Point& pca, double thedxy, double thedxy_error, const VertexRef& PV,
17  const Point& theFlightLength, double theFlightLengthSig, const VertexRef& SV)
18  : pca_(pca),
19  dxy_(thedxy),
20  dxy_error_(thedxy_error),
21  PV_(PV),
22  hasSV_(true),
23  FlightLength_(theFlightLength),
24  FlightLengthSig_(theFlightLengthSig),
25  SV_(SV)
26 {}
27 
29 {
30  return new PFTauTransverseImpactParameter(*this);
31 }
32 
34 {
35  if ( PV_.isNonnull() ) return PV_->position();
36  else return PFTauTransverseImpactParameter::Point(0.,0.,0.);
37 }
38 
40 {
41  CovMatrix cov;
42  for ( int i = 0; i < dimension; ++i ) {
43  for ( int j = 0; j < dimension; ++j ) {
44  cov(i,j) = PV_->covariance(i,j);
45  }
46  }
47  return cov;
48 }
49 
51 {
52  return FlightLength_;
53 }
54 
56  if ( hasSV_ ) {
57  //std::cout << "<PFTauTransverseImpactParameter::flightLengthSig>:" << std::endl;
58  //VertexDistance3D vtxdist;
59  //std::cout << "oldValue = " << vtxdist.distance(*PV_, *SV_).significance() << std::endl; // transforms using the jacobian then computes distance/uncertainty
60  //std::cout << "newValue = " << FlightLengthSig_ << std::endl;
61  return FlightLengthSig_;
62  }
63  return -9.9;
64 }
65 
67  if ( hasSV_ ) return SV_->position();
68  else return PFTauTransverseImpactParameter::Point(0.,0.,0.);
69 }
70 
72  CovMatrix cov;
73  if ( !hasSV_ ) return cov;
74  for ( int i = 0; i < dimension; ++i ) {
75  for ( int j = 0; j < dimension; ++j ) {
76  cov(i,j) = SV_->covariance(i,j);
77  }
78  }
79  return cov;
80 }
81 
83  CovMatrix cov;
84  const CovMatrix& sv = secondaryVertexCov();
85  const CovMatrix& pv = primaryVertexCov();
86  for ( int i = 0; i < dimension; ++i ) {
87  for ( int j = 0; j < dimension; ++j ) {
88  cov(i,j) = sv(i,j) + pv(i,j);
89  }
90  }
91  return cov;
92 }
int i
Definition: DBlmapReader.cc:9
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
PFTauTransverseImpactParameter * clone() const
int j
Definition: DBlmapReader.cc:9
volatile std::atomic< bool > shutdown_flag false