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"
5 #include "TVectorT.h"
6 using namespace reco;
7 
8 PFTauTransverseImpactParameter::PFTauTransverseImpactParameter(const Point& pca, double thedxy, double thedxy_error, const VertexRef& PV)
9  : pca_(pca),
10  dxy_(thedxy),
11  dxy_error_(thedxy_error),
12  PV_(PV),
13  hasSV_(false),
14  FlightLengthSig_(0.)
15 {}
16 
17 PFTauTransverseImpactParameter::PFTauTransverseImpactParameter(const Point& pca, double thedxy, double thedxy_error, const VertexRef& PV,
18  const Point& theFlightLength, double theFlightLengthSig, const VertexRef& SV)
19  : pca_(pca),
20  dxy_(thedxy),
21  dxy_error_(thedxy_error),
22  PV_(PV),
23  hasSV_(true),
24  FlightLength_(theFlightLength),
25  FlightLengthSig_(theFlightLengthSig),
26  SV_(SV)
27 {}
28 
30 {
31  return new PFTauTransverseImpactParameter(*this);
32 }
33 
35 {
36  if ( PV_.isNonnull() ) return PV_->position();
37  else return PFTauTransverseImpactParameter::Point(0.,0.,0.);
38 }
39 
41 {
42  CovMatrix cov;
43  for ( int i = 0; i < dimension; ++i ) {
44  for ( int j = 0; j < dimension; ++j ) {
45  cov(i,j) = PV_->covariance(i,j);
46  }
47  }
48  return cov;
49 }
50 
52 {
53  return FlightLength_;
54 }
55 
57  if ( hasSV_ ) {
58  //std::cout << "<PFTauTransverseImpactParameter::flightLengthSig>:" << std::endl;
59  //VertexDistance3D vtxdist;
60  //std::cout << "oldValue = " << vtxdist.distance(*PV_, *SV_).significance() << std::endl; // transforms using the jacobian then computes distance/uncertainty
61  //std::cout << "newValue = " << FlightLengthSig_ << std::endl;
62  return FlightLengthSig_;
63  }
64  return -9.9;
65 }
66 
68  if ( hasSV_ ) return SV_->position();
69  else return PFTauTransverseImpactParameter::Point(0.,0.,0.);
70 }
71 
73  CovMatrix cov;
74  if ( !hasSV_ ) return cov;
75  for ( int i = 0; i < dimension; ++i ) {
76  for ( int j = 0; j < dimension; ++j ) {
77  cov(i,j) = SV_->covariance(i,j);
78  }
79  }
80  return cov;
81 }
82 
84  CovMatrix cov;
85  const CovMatrix& sv = secondaryVertexCov();
86  const CovMatrix& pv = primaryVertexCov();
87  for ( int i = 0; i < dimension; ++i ) {
88  for ( int j = 0; j < dimension; ++j ) {
89  cov(i,j) = sv(i,j) + pv(i,j);
90  }
91  }
92  return cov;
93 }
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