test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
DistanceOfVertices2D Class Reference

#include <DistanceOfVertices2D.h>

Inheritance diagram for DistanceOfVertices2D:
DistanceOfVertices

Public Member Functions

virtual Measurement1D distance (const TransientVertex &, const TransientVertex &)
 
 DistanceOfVertices2D ()
 
virtual Measurement1D signedDistance (const TransientVertex &, const TransientVertex &, const CLHEP::Hep3Vector &)
 
virtual ~DistanceOfVertices2D ()
 
- Public Member Functions inherited from DistanceOfVertices
 DistanceOfVertices ()
 
virtual ~DistanceOfVertices ()
 

Additional Inherited Members

- Protected Member Functions inherited from DistanceOfVertices
CLHEP::Hep3Vector deltaV2V1 (const TransientVertex &v1, const TransientVertex &v2)
 
double terms2D (const TransientVertex &v1, const TransientVertex &v2)
 
double terms3D (const TransientVertex &v1, const TransientVertex &v2)
 

Detailed Description

Definition at line 9 of file DistanceOfVertices2D.h.

Constructor & Destructor Documentation

DistanceOfVertices2D::DistanceOfVertices2D ( )
inline

Definition at line 13 of file DistanceOfVertices2D.h.

13 {}
virtual DistanceOfVertices2D::~DistanceOfVertices2D ( )
inlinevirtual

Definition at line 14 of file DistanceOfVertices2D.h.

14 {}

Member Function Documentation

Measurement1D DistanceOfVertices2D::distance ( const TransientVertex v1,
const TransientVertex v2 
)
virtual

Implements DistanceOfVertices.

Definition at line 4 of file DistanceOfVertices2D.cc.

References gather_cfg::cout, DistanceOfVertices::deltaV2V1(), mathSSE::sqrt(), and DistanceOfVertices::terms2D().

Referenced by Flight2DSvFilter::operator()(), and signedDistance().

4  {
5 
6  double FlightDistance2D = deltaV2V1(v1,v2).perp() ;
7 
8  // for the significances, we need the error on the difference:
9  // => take into account the full correlation matrices of both vertices
10  // (but neglect correl. between them, they are not easily available)
11 
12  double sigmaFlightDistance2D2;
13  if( FlightDistance2D > 0.000001 )
14  sigmaFlightDistance2D2 = ( 1 / ( FlightDistance2D*FlightDistance2D ) ) * terms2D ( v1 , v2 ) ;
15  else
16  sigmaFlightDistance2D2 = 0.0;
17 
18  double sigmaFlightDistance2D ;
19  if ( sigmaFlightDistance2D2 >= 0 ) {
20  sigmaFlightDistance2D = sqrt ( sigmaFlightDistance2D2 ) ;
21  }
22  else {
23  std::cout << "DistanceOfVertices2D::distance : sigmaFlightDistance2D2 <= 0 : " << sigmaFlightDistance2D2 << std::endl ;
24  sigmaFlightDistance2D = 0.0 ;
25  }
26 
27  return Measurement1D ( FlightDistance2D , sigmaFlightDistance2D ) ;
28 }
double terms2D(const TransientVertex &v1, const TransientVertex &v2)
CLHEP::Hep3Vector deltaV2V1(const TransientVertex &v1, const TransientVertex &v2)
T sqrt(T t)
Definition: SSEVec.h:48
tuple cout
Definition: gather_cfg.py:121
Measurement1D DistanceOfVertices2D::signedDistance ( const TransientVertex v1,
const TransientVertex v2,
const CLHEP::Hep3Vector &  direction 
)
virtual

Implements DistanceOfVertices.

Definition at line 31 of file DistanceOfVertices2D.cc.

References DistanceOfVertices::deltaV2V1(), distance(), Measurement1D::error(), and Measurement1D::value().

31  {
32  // give a sign to the distance of Vertices v1 and v2:
33  // + if (v2-v1) is along direction, - if in opposite direction
34 
35  CLHEP::Hep3Vector v1ToV2 = deltaV2V1 ( v1, v2 ) ;
36  int sign2d = -1 ;
37  if ( ( direction.x()*v1ToV2.x() + direction.y()*v1ToV2.y() ) > 0 ) sign2d = 1 ;
38 
39  Measurement1D unsignedFlightDistance = distance ( v1 , v2 ) ;
40 
41  return Measurement1D ( sign2d * unsignedFlightDistance.value() , unsignedFlightDistance.error() ) ;
42 }
CLHEP::Hep3Vector deltaV2V1(const TransientVertex &v1, const TransientVertex &v2)
double error() const
Definition: Measurement1D.h:30
virtual Measurement1D distance(const TransientVertex &, const TransientVertex &)
double value() const
Definition: Measurement1D.h:28