CMS 3D CMS Logo

DistanceOfVertices2D Class Reference

#include <RecoVertex/TertiaryTracksVertexFinder/interface/DistanceOfVertices2D.h>

Inheritance diagram for DistanceOfVertices2D:

DistanceOfVertices

List of all members.

Public Member Functions

virtual Measurement1D distance (const TransientVertex &, const TransientVertex &)
 DistanceOfVertices2D ()
virtual Measurement1D signedDistance (const TransientVertex &, const TransientVertex &, const Hep3Vector &)
virtual ~DistanceOfVertices2D ()


Detailed Description

Definition at line 9 of file DistanceOfVertices2D.h.


Constructor & Destructor Documentation

DistanceOfVertices2D::DistanceOfVertices2D (  )  [inline]

Definition at line 13 of file DistanceOfVertices2D.h.

00013 {}

virtual DistanceOfVertices2D::~DistanceOfVertices2D (  )  [inline, virtual]

Definition at line 14 of file DistanceOfVertices2D.h.

00014 {}


Member Function Documentation

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

Implements DistanceOfVertices.

Definition at line 4 of file DistanceOfVertices2D.cc.

References GenMuonPlsPt100GeV_cfg::cout, DistanceOfVertices::deltaV2V1(), lat::endl(), funct::sqrt(), and DistanceOfVertices::terms2D().

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

00004                                                                                                        {
00005   
00006   double FlightDistance2D = deltaV2V1(v1,v2).perp() ; 
00007   
00008   // for the significances, we need the error on the difference:
00009   // => take into account the full correlation matrices of both vertices
00010   //    (but neglect correl. between them, they are not easily available)
00011   
00012   double sigmaFlightDistance2D2;
00013   if(  FlightDistance2D > 0.000001 )
00014     sigmaFlightDistance2D2 = ( 1 / ( FlightDistance2D*FlightDistance2D ) ) * terms2D ( v1 , v2 ) ; 
00015   else
00016     sigmaFlightDistance2D2 = 0.0;
00017   
00018   double sigmaFlightDistance2D ;
00019   if ( sigmaFlightDistance2D2 >= 0 ) {
00020     sigmaFlightDistance2D = sqrt ( sigmaFlightDistance2D2 ) ;
00021   }
00022   else {
00023     std::cout << "DistanceOfVertices2D::distance : sigmaFlightDistance2D2 <= 0 : " << sigmaFlightDistance2D2 << std::endl ;
00024     sigmaFlightDistance2D = 0.0 ;
00025   }
00026 
00027   return Measurement1D ( FlightDistance2D , sigmaFlightDistance2D ) ;
00028 }

Measurement1D DistanceOfVertices2D::signedDistance ( const TransientVertex v1,
const TransientVertex v2,
const Hep3Vector &  direction 
) [virtual]

Implements DistanceOfVertices.

Definition at line 31 of file DistanceOfVertices2D.cc.

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

00031                                                                                                                                             {
00032   // give a sign to the distance of Vertices v1 and v2:
00033   // + if (v2-v1) is along direction, - if in opposite direction
00034   
00035   Hep3Vector v1ToV2 = deltaV2V1 ( v1, v2 ) ;
00036   int sign2d = -1 ;
00037   if ( ( direction.x()*v1ToV2.x() + direction.y()*v1ToV2.y() ) > 0 )  sign2d = 1 ;
00038   
00039   Measurement1D unsignedFlightDistance = distance ( v1 , v2 ) ;
00040 
00041   return Measurement1D ( sign2d * unsignedFlightDistance.value() , unsignedFlightDistance.error() ) ; 
00042 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:29 2009 for CMSSW by  doxygen 1.5.4