CMS 3D CMS Logo

pat::VertexAssociation Class Reference

Analysis-level structure for vertex-related information. More...

#include <DataFormats/PatCandidates/interface/Vertexing.h>

List of all members.

Public Member Functions

const Measurement1DFloatdr () const
 Distance between the object and the vertex in the transverse plane, and it's error.
const Measurement1DFloatdz () const
 Distance between the object and the vertex along the Z axis, and it's error.
bool hasErrors () const
 True if the errors on dr and dz have been set, false if they're nulls.
bool hasTrack () const
 Returns 'true' if a reference to a track was stored in this VertexAssociation.
bool hasTransverseIP () const
 True if the transverse distance was computed for this VertexAssociation.
bool isAvailable () const
 Return 'true' if the reco::Vertex is available in the file, false if it has been dropped.
bool isNonnull () const
 Return 'true' unless this is a null association (that is, no vertex).
bool isNull () const
 Return 'true' if this is a null association (that is, no vertex).
const reco::Vertexoperator * () const
 Return the vertex (that is, you can do "const reco::Vertex &vtx = *assoc").
const reco::Vertexoperator-> () const
 Allows VertexAssociation to behave like a vertex ref (e.g. to do "assoc->position()").
template<typename T1, typename T2>
void setDistances (const T1 &p1, const T2 &p2, const AlgebraicSymMatrix33 &err)
 Set dz and dr given the two points (object and vertex) and the 3x3 total covariance matrix of the distance The covariance matrix must already include the covariance matrix of the vertex 'p1', 'p2' can be anything that has methods .x(), .y(), .z() (e.g.
void setDistances (const AlgebraicVector3 &dist, const AlgebraicSymMatrix33 &err)
 Set dz and dr given the distance and the 3x3 total covariance matrix of the distance.
void setDr (const Measurement1D &dr)
void setDr (const Measurement1DFloat &dr)
void setDz (const Measurement1D &dz)
void setDz (const Measurement1DFloat &dz)
const reco::Tracktrack () const
 Returns a C++ pointer to the track stored in this vertex (can be a null pointer).
const reco::TrackBaseReftrackRef () const
 Returns a reference to the track stored in this vertex (can be null).
const reco::Vertexvertex () const
 Returns a pointer to the vertex, or a null pointer if there is no vertex (null association).
 VertexAssociation (const reco::VertexRef &vertex, const reco::TrackBaseRef &tk)
 Create a vertex association given a ref to a vertex and a reference to a track object Note: you also have to set the distances, they can be computed by the VertexAssociation itself because it requires access to the magnetic field and other condition data.
 VertexAssociation (const reco::VertexRef &vertex)
 Create a vertex association given a ref to a vertex.
 VertexAssociation ()
 Create a null vertx association.
const reco::VertexRefvertexRef () const
 Returns the reference to the vertex (can be a null reference).

Private Attributes

Measurement1DFloat dr_
Measurement1DFloat dz_
reco::TrackBaseRef track_
reco::VertexRef vertex_


Detailed Description

Analysis-level structure for vertex-related information.

pat::VertexAssociation holds a reference to a vertex and extended information like the distance between the object and the vertex.

For convenience, pat::VertexAssociation behaves like a VertexRef, that is (*assoc) is a reco::Vertex.

The original proposal is at httpss://hypernews.cern.ch/HyperNews/CMS/get/physTools/587.html

Author:
Giovanni Petrucciani
Version:
Id
Vertexing.h,v 1.1 2008/07/22 12:44:19 gpetrucc Exp

Definition at line 27 of file Vertexing.h.


Constructor & Destructor Documentation

pat::VertexAssociation::VertexAssociation (  )  [inline]

Create a null vertx association.

Definition at line 30 of file Vertexing.h.

00030 {}

pat::VertexAssociation::VertexAssociation ( const reco::VertexRef vertex  )  [inline]

Create a vertex association given a ref to a vertex.

Definition at line 32 of file Vertexing.h.

00032 : vertex_(vertex) {}

pat::VertexAssociation::VertexAssociation ( const reco::VertexRef vertex,
const reco::TrackBaseRef tk 
) [inline]

Create a vertex association given a ref to a vertex and a reference to a track object Note: you also have to set the distances, they can be computed by the VertexAssociation itself because it requires access to the magnetic field and other condition data.

Definition at line 36 of file Vertexing.h.

00036 : vertex_(vertex), track_(tk) {}


Member Function Documentation

const Measurement1DFloat& pat::VertexAssociation::dr (  )  const [inline]

Distance between the object and the vertex in the transverse plane, and it's error.

Definition at line 64 of file Vertexing.h.

References dr_.

Referenced by pat::VertexAssociationSelector::operator()().

00064 { return dr_; }

const Measurement1DFloat& pat::VertexAssociation::dz (  )  const [inline]

Distance between the object and the vertex along the Z axis, and it's error.

Note 1: if the BeamSpot was used as Vertex, the error includes the BeamSpot spread!

Definition at line 62 of file Vertexing.h.

References dz_.

Referenced by pat::VertexAssociationSelector::operator()().

00062 { return dz_; }

bool pat::VertexAssociation::hasErrors (  )  const [inline]

True if the errors on dr and dz have been set, false if they're nulls.

Definition at line 68 of file Vertexing.h.

References dr_, dz_, Measurement1DFloat::error(), and hasTransverseIP().

00068 { return (dz_.error() != 0) && ( !hasTransverseIP() || dr_.error() != 0 ); }

bool pat::VertexAssociation::hasTrack (  )  const [inline]

Returns 'true' if a reference to a track was stored in this VertexAssociation.

Definition at line 54 of file Vertexing.h.

References edm::RefToBase< T >::isNull(), and track_.

Referenced by track().

00054 { return !track_.isNull(); }

bool pat::VertexAssociation::hasTransverseIP (  )  const [inline]

True if the transverse distance was computed for this VertexAssociation.

Definition at line 66 of file Vertexing.h.

References dr_, and Measurement1DFloat::value().

Referenced by hasErrors().

00066 { return (dr_.value() != 0); }

bool pat::VertexAssociation::isAvailable (  )  const [inline]

Return 'true' if the reco::Vertex is available in the file, false if it has been dropped.

Definition at line 43 of file Vertexing.h.

References edm::Ref< C, T, F >::isAvailable(), and vertex_.

00043 { return vertex_.isAvailable(); }

bool pat::VertexAssociation::isNonnull (  )  const [inline]

Return 'true' unless this is a null association (that is, no vertex).

Definition at line 41 of file Vertexing.h.

References edm::Ref< C, T, F >::isNonnull(), and vertex_.

00041 { return vertex_.isNonnull(); }

bool pat::VertexAssociation::isNull (  )  const [inline]

Return 'true' if this is a null association (that is, no vertex).

Definition at line 39 of file Vertexing.h.

References edm::Ref< C, T, F >::isNull(), and vertex_.

Referenced by pat::VertexAssociationSelector::operator()().

00039 { return vertex_.isNull(); }

const reco::Vertex& pat::VertexAssociation::operator * ( void   )  const [inline]

Return the vertex (that is, you can do "const reco::Vertex &vtx = *assoc").

Definition at line 45 of file Vertexing.h.

References operator->().

00045 { return * operator->(); }

const reco::Vertex* pat::VertexAssociation::operator-> (  )  const [inline]

Allows VertexAssociation to behave like a vertex ref (e.g. to do "assoc->position()").

Definition at line 47 of file Vertexing.h.

References edm::Ref< C, T, F >::get(), edm::Ref< C, T, F >::isNull(), and vertex_.

Referenced by operator *().

00047 { return vertex_.isNull() ? 0 : vertex_.get(); }

template<typename T1, typename T2>
void pat::VertexAssociation::setDistances ( const T1 &  p1,
const T2 &  p2,
const AlgebraicSymMatrix33 err 
) [inline]

Set dz and dr given the two points (object and vertex) and the 3x3 total covariance matrix of the distance The covariance matrix must already include the covariance matrix of the vertex 'p1', 'p2' can be anything that has methods .x(), .y(), .z() (e.g.

GlobalPoint, Vertex, ...)

Definition at line 80 of file Vertexing.h.

References dist(), and setDistances().

00080                                                                                             {
00081                 AlgebraicVector3 dist(p1.x() - p2.x(), p1.y() - p2.y(), p1.z() - p2.z());
00082                 setDistances(dist, err);
00083             }

void VertexAssociation::setDistances ( const AlgebraicVector3 dist,
const AlgebraicSymMatrix33 err 
)

Set dz and dr given the distance and the 3x3 total covariance matrix of the distance.

Definition at line 5 of file Vertexing.cc.

References funct::abs(), d2, err, setDr(), setDz(), and funct::sqrt().

Referenced by pat::helper::VertexingHelper::associate(), setDistances(), and pat::VertexAssociationSelector::simpleAssociation().

00005                                                                                                    {
00006     setDz( Measurement1DFloat( std::abs(dist[2]) , std::sqrt(err(2,2)) ) );
00007 
00008     AlgebraicVector3 dist2D(dist[0], dist[1], 0);
00009     float d2 = dist2D[0]*dist2D[0] + dist2D[1]*dist2D[1];
00010     setDr( Measurement1DFloat( sqrt(d2), sqrt(ROOT::Math::Similarity(dist2D, err)/d2) ) );
00011 }

void pat::VertexAssociation::setDr ( const Measurement1D dr  )  [inline]

Definition at line 73 of file Vertexing.h.

References dr_, Measurement1D::error(), and Measurement1D::value().

00073 { dr_ = Measurement1DFloat(dr.value(), dr.error()); }

void pat::VertexAssociation::setDr ( const Measurement1DFloat dr  )  [inline]

Definition at line 71 of file Vertexing.h.

References dr_.

Referenced by setDistances().

00071 { dr_ = dr; }

void pat::VertexAssociation::setDz ( const Measurement1D dz  )  [inline]

Definition at line 72 of file Vertexing.h.

References dz_, Measurement1D::error(), and Measurement1D::value().

00072 { dz_ = Measurement1DFloat(dz.value(), dz.error()); }

void pat::VertexAssociation::setDz ( const Measurement1DFloat dz  )  [inline]

Definition at line 70 of file Vertexing.h.

References dz_.

Referenced by setDistances().

00070 { dz_ = dz; }

const reco::Track* pat::VertexAssociation::track ( void   )  const [inline]

Returns a C++ pointer to the track stored in this vertex (can be a null pointer).

Definition at line 58 of file Vertexing.h.

References edm::RefToBase< T >::get(), hasTrack(), and track_.

00058 { return hasTrack() ? track_.get() : 0; }

const reco::TrackBaseRef& pat::VertexAssociation::trackRef (  )  const [inline]

Returns a reference to the track stored in this vertex (can be null).

Definition at line 56 of file Vertexing.h.

References track_.

00056 { return track_; }

const reco::Vertex* pat::VertexAssociation::vertex (  )  const [inline]

Returns a pointer to the vertex, or a null pointer if there is no vertex (null association).

Definition at line 52 of file Vertexing.h.

References edm::Ref< C, T, F >::get(), edm::Ref< C, T, F >::isNull(), and vertex_.

00052 { return vertex_.isNull() ? 0 : vertex_.get(); }

const reco::VertexRef& pat::VertexAssociation::vertexRef (  )  const [inline]

Returns the reference to the vertex (can be a null reference).

Definition at line 50 of file Vertexing.h.

References vertex_.

00050 { return vertex_; }


Member Data Documentation

Measurement1DFloat pat::VertexAssociation::dr_ [private]

Definition at line 91 of file Vertexing.h.

Referenced by dr(), hasErrors(), hasTransverseIP(), and setDr().

Measurement1DFloat pat::VertexAssociation::dz_ [private]

Definition at line 91 of file Vertexing.h.

Referenced by dz(), hasErrors(), and setDz().

reco::TrackBaseRef pat::VertexAssociation::track_ [private]

Definition at line 94 of file Vertexing.h.

Referenced by hasTrack(), track(), and trackRef().

reco::VertexRef pat::VertexAssociation::vertex_ [private]

Definition at line 90 of file Vertexing.h.

Referenced by isAvailable(), isNonnull(), isNull(), operator->(), vertex(), and vertexRef().


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