CMS 3D CMS Logo

TransientVertex Class Reference

#include <RecoVertex/VertexPrimitives/interface/TransientVertex.h>

List of all members.

Public Types

typedef std::map
< reco::TransientTrack, float > 
TransientTrackToFloatMap

Public Member Functions

float degreesOfFreedom () const
bool hasPrior () const
bool hasRefittedTracks () const
 Returns true if at for at least one of the original tracks, the refitted track is available.
bool hasTrackWeight () const
 Returns true if the track-weights are available.
bool isValid () const
 Returns true if vertex is valid.
float normalisedChiSquared () const
 operator reco::Vertex () const
reco::TransientTrack originalTrack (const reco::TransientTrack &refTrack) const
 Returns the original track which corresponds to a particular refitted Track Throws an exception if now refitted tracks are stored ot the track is not found in the list.
std::vector< reco::TransientTrackoriginalTracks () const
 Access to the original tracks used to make the vertex.
GlobalPoint position () const
GlobalError positionError () const
GlobalError priorError () const
GlobalPoint priorPosition () const
reco::TransientTrack refittedTrack (const reco::TransientTrack &track) const
 Returns the refitted track which corresponds to a particular original Track Throws an exception if now refitted tracks are stored ot the track is not found in the list.
void refittedTracks (const std::vector< reco::TransientTrack > &refittedTracks)
 Method to set the refitted tracks used to make the vertex.
std::vector< reco::TransientTrackrefittedTracks () const
 Access to the refitted tracks used to make the vertex.
void tkToTkCovariance (const TTtoTTmap covMap)
AlgebraicMatrix33 tkToTkCovariance (const reco::TransientTrack &t1, const reco::TransientTrack &t2) const
 Returns the Track-to-track covariance matrix for two specified tracks.
bool tkToTkCovarianceIsAvailable () const
 Returns true if the Track-to-track covariance matrices have been calculated.
float totalChiSquared () const
 Implements method of abstract Vertex.
float trackWeight (const reco::TransientTrack &track) const
 Returns the weight with which a track has been used in the fit.
 TransientVertex (const VertexState &prior, const VertexState &state, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks, the chi-squared and the number of degrees of freedom.
 TransientVertex (const VertexState &prior, const VertexState &state, const std::vector< reco::TransientTrack > &tracks, float chi2)
 Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks and the chi-squared.
 TransientVertex (const VertexState &state, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks, its chi-squared and its number of degrees of freedom.
 TransientVertex (const VertexState &state, const std::vector< reco::TransientTrack > &tracks, float chi2)
 Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks and its chi-squared.
 TransientVertex (const GlobalPoint &priorPos, const GlobalError &priorErr, const GlobalPoint &pos, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks, the chi-squared and the number of degrees of freedom.
 TransientVertex (const GlobalPoint &priorPos, const GlobalError &priorErr, const GlobalPoint &pos, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2)
 Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks and the chi-squared.
 TransientVertex (const GlobalPoint &pos, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks, its chi-squared and its number of degrees of freedom.
 TransientVertex (const GlobalPoint &pos, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2)
 Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks and its chi-squared.
 TransientVertex ()
 Empty constructor, produces invalid vertex.
VertexState vertexState () const
 Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks, its chi-squared and its number of degrees of freedom, and the track weights.
void weightMap (const TransientTrackToFloatMap &theMap)
TransientTrackToFloatMap weightMap () const

Private Attributes

float theChi2
TTtoTTmap theCovMap
bool theCovMapAvailable
float theNDF
std::vector< reco::TransientTracktheOriginalTracks
VertexState thePriorVertexState
std::vector< reco::TransientTracktheRefittedTracks
VertexState theVertexState
TransientTrackToFloatMap theWeightMap
bool theWeightMapIsAvailable
bool vertexValid
bool withPrior
bool withRefittedTracks


Detailed Description

Definition at line 17 of file TransientVertex.h.


Member Typedef Documentation

typedef std::map<reco::TransientTrack, float> TransientVertex::TransientTrackToFloatMap

Definition at line 21 of file TransientVertex.h.


Constructor & Destructor Documentation

TransientVertex::TransientVertex (  ) 

Empty constructor, produces invalid vertex.

Definition at line 10 of file TransientVertex.cc.

00010                                  : theVertexState(), theOriginalTracks(),
00011   theChi2(0), theNDF(0), vertexValid(false), withPrior(false),
00012   theWeightMapIsAvailable(false), theCovMapAvailable(false), 
00013   withRefittedTracks(false)
00014 {}

TransientVertex::TransientVertex ( const GlobalPoint pos,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks and its chi-squared.

The number of degrees of freedom is equal to 2*nb of tracks - 3.

TransientVertex::TransientVertex ( const GlobalPoint pos,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks, its chi-squared and its number of degrees of freedom.

The ndf can be a float.

TransientVertex::TransientVertex ( const GlobalPoint priorPos,
const GlobalError priorErr,
const GlobalPoint pos,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks and the chi-squared.

Since the prior brings information on 3 coordinates, the number of degrees of freedom is equal to 2*nb of tracks.

TransientVertex::TransientVertex ( const GlobalPoint priorPos,
const GlobalError priorErr,
const GlobalPoint pos,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks, the chi-squared and the number of degrees of freedom.

The ndf can be a float.

TransientVertex::TransientVertex ( const VertexState state,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks and its chi-squared.

The number of degrees of freedom is equal to 2*nb of tracks - 3.

TransientVertex::TransientVertex ( const VertexState state,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks, its chi-squared and its number of degrees of freedom.

The ndf can be a float.

TransientVertex::TransientVertex ( const VertexState prior,
const VertexState state,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks and the chi-squared.

Since the prior brings information on 3 coordinates, the number of degrees of freedom is equal to 2*nb of tracks.

TransientVertex::TransientVertex ( const VertexState prior,
const VertexState state,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks, the chi-squared and the number of degrees of freedom.

The ndf can be a float.


Member Function Documentation

float TransientVertex::degreesOfFreedom (  )  const [inline]

Definition at line 128 of file TransientVertex.h.

References theNDF.

Referenced by AdaptiveVertexReconstructor::cleanUp(), VertexFitterResult::fill(), normalisedChiSquared(), and operator reco::Vertex().

00128 { return theNDF; }

bool TransientVertex::hasPrior (  )  const [inline]

Definition at line 117 of file TransientVertex.h.

References withPrior.

Referenced by AdaptiveVertexReconstructor::cleanUp().

00117 { return withPrior; }

bool TransientVertex::hasRefittedTracks (  )  const [inline]

Returns true if at for at least one of the original tracks, the refitted track is available.

Definition at line 149 of file TransientVertex.h.

References withRefittedTracks.

Referenced by AdaptiveVertexReconstructor::cleanUp(), V0Fitter::fitAll(), and cms::HITrackVertexMaker::produceTracks().

00149 { return withRefittedTracks; }

bool TransientVertex::hasTrackWeight (  )  const [inline]

Returns true if the track-weights are available.

Definition at line 180 of file TransientVertex.h.

References theWeightMapIsAvailable.

00180 { return theWeightMapIsAvailable; }

bool TransientVertex::isValid ( void   )  const [inline]

Returns true if vertex is valid.

An invalid RecVertex is created e.g. when vertex fitting fails.

Definition at line 133 of file TransientVertex.h.

References vertexValid.

Referenced by VertexFitterResult::fill(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), PFCandCommonVertexFitter< Fitter >::fit(), CandCommonVertexFitter< Fitter >::fit(), V0Fitter::fitAll(), Flight2DSvFilter::Flight2DSvFilter(), operator reco::Vertex(), cms::HITrackVertexMaker::produceTracks(), and PrimaryVertexProducerAlgorithm::vertices().

00133                        {
00134     return vertexValid;
00135   }

float TransientVertex::normalisedChiSquared (  )  const [inline]

Definition at line 125 of file TransientVertex.h.

References degreesOfFreedom(), and totalChiSquared().

Referenced by HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), and cms::HITrackVertexMaker::produceTracks().

00125                                      {
00126     return totalChiSquared() / degreesOfFreedom();
00127   }

TransientVertex::operator reco::Vertex (  )  const

Definition at line 219 of file TransientVertex.cc.

References RecoVertex::convertError(), degreesOfFreedom(), VertexState::error(), i, isValid(), VertexState::position(), refittedTrack(), theOriginalTracks, theVertexState, totalChiSquared(), reco::TransientTrack::track(), trackWeight(), and withRefittedTracks.

00220 {
00221    //If the vertex is invalid, return an invalid TV !
00222   if (!isValid()) return Vertex();
00223 
00224   Vertex vertex(Vertex::Point(theVertexState.position()),
00225         RecoVertex::convertError(theVertexState.error()), 
00226         totalChiSquared(), degreesOfFreedom(), theOriginalTracks.size() );
00227   for (vector<TransientTrack>::const_iterator i = theOriginalTracks.begin();
00228        i != theOriginalTracks.end(); ++i) {
00229 //     const TrackTransientTrack* ttt = dynamic_cast<const TrackTransientTrack*>((*i).basicTransientTrack());
00230 //     if ((ttt!=0) && (ttt->persistentTrackRef().isNonnull()))
00231 //     {
00232 //       TrackRef tr = ttt->persistentTrackRef();
00233 //       TrackBaseRef tbr(tr);
00234       if (withRefittedTracks) {
00235         
00236         vertex.add((*i).trackBaseRef(), refittedTrack(*i).track(), trackWeight ( *i ) );
00237       } else { 
00238         vertex.add((*i).trackBaseRef(), trackWeight ( *i ) );
00239       }
00240     //}
00241   }
00242   return vertex;
00243 }

TransientTrack TransientVertex::originalTrack ( const reco::TransientTrack refTrack  )  const

Returns the original track which corresponds to a particular refitted Track Throws an exception if now refitted tracks are stored ot the track is not found in the list.

Definition at line 195 of file TransientVertex.cc.

References find(), it, theOriginalTracks, and theRefittedTracks.

00196 {
00197   if (theRefittedTracks.empty())
00198         throw VertexException("No refitted tracks stored in vertex");
00199   std::vector<TransientTrack>::const_iterator it =
00200         find(theRefittedTracks.begin(), theRefittedTracks.end(), refTrack);
00201   if (it==theRefittedTracks.end())
00202         throw VertexException("Refitted track not found in list");
00203   size_t pos = it - theRefittedTracks.begin();
00204   return theOriginalTracks[pos];
00205 }

std::vector<reco::TransientTrack> TransientVertex::originalTracks (  )  const [inline]

Access to the original tracks used to make the vertex.

Returns track container by value.

Definition at line 140 of file TransientVertex.h.

References theOriginalTracks.

Referenced by AdaptiveVertexReconstructor::cleanUp(), element(), VertexFitterResult::fill(), TransientTrackInVertices::isInVertex(), V0SvFilter::operator()(), Flight2DSvFilter::operator()(), PvSvFilter::operator()(), VertexHigherPtSquared::operator()(), VertexMass::operator()(), and cms::HITrackVertexMaker::produceTracks().

00140                                                        {
00141     return theOriginalTracks;
00142   }

GlobalPoint TransientVertex::position ( void   )  const [inline]

Definition at line 113 of file TransientVertex.h.

References VertexState::position(), and theVertexState.

Referenced by KVFTest::analyze(), KineExample::analyze(), DistanceOfVertices::deltaV2V1(), Flight2DSvFilter::DistanceSignificance2DToBeamLine(), Flight2DSvFilter::DistanceToBeamLine(), VertexFitterResult::fill(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), cms::HITrackVertexMaker::produceTracks(), pseudoVertexFit(), and PrimaryVertexProducerAlgorithm::vertices().

00113 { return theVertexState.position(); }

GlobalError TransientVertex::positionError (  )  const [inline]

Definition at line 114 of file TransientVertex.h.

References VertexState::error(), and theVertexState.

Referenced by Flight2DSvFilter::DistanceSignificance2DToBeamLine(), VertexFitterResult::fill(), HLTDisplacedmumuFilter::filter(), HLTmmkFilter::filter(), DistanceOfVertices::terms2D(), and DistanceOfVertices::terms3D().

00114 { return theVertexState.error(); }

GlobalError TransientVertex::priorError (  )  const [inline]

Definition at line 116 of file TransientVertex.h.

References VertexState::error(), and thePriorVertexState.

Referenced by AdaptiveVertexReconstructor::cleanUp().

00116 { return thePriorVertexState.error(); }

GlobalPoint TransientVertex::priorPosition (  )  const [inline]

Definition at line 115 of file TransientVertex.h.

References VertexState::position(), and thePriorVertexState.

Referenced by AdaptiveVertexReconstructor::cleanUp().

00115 { return thePriorVertexState.position(); }

TransientTrack TransientVertex::refittedTrack ( const reco::TransientTrack track  )  const

Returns the refitted track which corresponds to a particular original Track Throws an exception if now refitted tracks are stored ot the track is not found in the list.

Definition at line 207 of file TransientVertex.cc.

References find(), it, theOriginalTracks, and theRefittedTracks.

Referenced by operator reco::Vertex().

00208 {
00209   if (theRefittedTracks.empty())
00210         throw VertexException("No refitted tracks stored in vertex");
00211   std::vector<TransientTrack>::const_iterator it =
00212         find(theOriginalTracks.begin(), theOriginalTracks.end(), track);
00213   if (it==theOriginalTracks.end())
00214         throw VertexException("Track not found in list");
00215   size_t pos = it - theOriginalTracks.begin();
00216   return theRefittedTracks[pos];
00217 }

void TransientVertex::refittedTracks ( const std::vector< reco::TransientTrack > &  refittedTracks  ) 

Method to set the refitted tracks used to make the vertex.

std::vector<reco::TransientTrack> TransientVertex::refittedTracks (  )  const [inline]

Access to the refitted tracks used to make the vertex.

Returns track container by value.

Definition at line 155 of file TransientVertex.h.

References theRefittedTracks.

Referenced by AdaptiveVertexReconstructor::cleanUp(), V0Fitter::fitAll(), CachingVertex< N >::operator TransientVertex(), and cms::HITrackVertexMaker::produceTracks().

00155                                                        {
00156     return theRefittedTracks;
00157   }

void TransientVertex::tkToTkCovariance ( const TTtoTTmap  covMap  ) 

Definition at line 143 of file TransientVertex.cc.

References theCovMap, and theCovMapAvailable.

00144 {
00145   theCovMap = covMap;
00146   theCovMapAvailable = true;
00147 }

AlgebraicMatrix33 TransientVertex::tkToTkCovariance ( const reco::TransientTrack t1,
const reco::TransientTrack t2 
) const

Returns the Track-to-track covariance matrix for two specified tracks.

In case these do not exist, or one of the tracks does not belong to the vertex, an exception is thrown.

Definition at line 164 of file TransientVertex.cc.

References it, theCovMap, and theCovMapAvailable.

Referenced by CachingVertex< N >::operator TransientVertex().

00165 {
00166   if (!theCovMapAvailable) {
00167    throw VertexException("TransientVertex::Track-to-track covariance matrices not available");
00168   }
00169   const TransientTrack* tr1;
00170   const TransientTrack* tr2;
00171   if (t1<t2) {
00172     tr1 = &t1;
00173     tr2 = &t2;
00174   } else {
00175     tr1 = &t2;
00176     tr2 = &t1;
00177   }
00178   TTtoTTmap::const_iterator it = theCovMap.find(*tr1);
00179   if (it !=  theCovMap.end()) {
00180     const TTmap & tm = it->second;
00181     TTmap::const_iterator nit = tm.find(*tr2);
00182     if (nit != tm.end()) {
00183       return( nit->second);
00184     }
00185     else {
00186       throw VertexException("TransientVertex::requested Track-to-track covariance matrix does not exist");
00187     }
00188   }
00189   else {
00190     throw VertexException("TransientVertex::requested Track-to-track covariance matrix does not exist");
00191   }
00192 }

bool TransientVertex::tkToTkCovarianceIsAvailable (  )  const [inline]

Returns true if the Track-to-track covariance matrices have been calculated.

Definition at line 199 of file TransientVertex.h.

References theCovMapAvailable.

00199 { return theCovMapAvailable; }

float TransientVertex::totalChiSquared (  )  const [inline]

Implements method of abstract Vertex.

Returns track pointer container by value

Definition at line 124 of file TransientVertex.h.

References theChi2.

Referenced by AdaptiveVertexReconstructor::cleanUp(), VertexFitterResult::fill(), V0Fitter::fitAll(), normalisedChiSquared(), operator reco::Vertex(), and cms::HITrackVertexMaker::produceTracks().

00124 { return theChi2; }

float TransientVertex::trackWeight ( const reco::TransientTrack track  )  const

Returns the weight with which a track has been used in the fit.

If the track is not present in the list, it is obviously not used, and this method returns a weight of 0. If this information has not been provided at construction, a weight of 1.0 is assumed for all tracks used and present in the originalTracks() std::vector.

Definition at line 149 of file TransientVertex.cc.

References find(), it, theOriginalTracks, theWeightMap, and theWeightMapIsAvailable.

Referenced by AdaptiveVertexReconstructor::cleanUp(), and operator reco::Vertex().

00149                                                                      {
00150   if (!theWeightMapIsAvailable) {
00151     vector<TransientTrack>::const_iterator foundTrack = find(theOriginalTracks.begin(), 
00152                 theOriginalTracks.end(), track);
00153     return ((foundTrack != theOriginalTracks.end()) ? 1. : 0.);
00154   }
00155   TransientTrackToFloatMap::const_iterator it = theWeightMap.find(track);
00156   if (it !=  theWeightMap.end()) {
00157     return(it->second);
00158   }
00159   return 0.;
00160 
00161 }

VertexState TransientVertex::vertexState (  )  const [inline]

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks, its chi-squared and its number of degrees of freedom, and the track weights.

The ndf can be a float. Access methods

Definition at line 112 of file TransientVertex.h.

References theVertexState.

Referenced by AdaptiveVertexReconstructor::cleanUp().

00112 { return theVertexState; }

void TransientVertex::weightMap ( const TransientTrackToFloatMap theMap  ) 

Definition at line 125 of file TransientVertex.cc.

References theWeightMap, and theWeightMapIsAvailable.

00126 {
00127   theWeightMap = theMap;
00128   theWeightMapIsAvailable = true;
00129 //   removeTracks(); // remove trackrefs from reco::Vertex
00130 //   addTracks( theOriginalTracks );
00131 }

TransientTrackToFloatMap TransientVertex::weightMap (  )  const [inline]

Definition at line 192 of file TransientVertex.h.

References theWeightMap.

Referenced by AdaptiveVertexReconstructor::cleanUp(), CachingVertex< N >::operator TransientVertex(), and pseudoVertexFit().

00192 { return theWeightMap; }


Member Data Documentation

float TransientVertex::theChi2 [private]

Definition at line 224 of file TransientVertex.h.

Referenced by totalChiSquared().

TTtoTTmap TransientVertex::theCovMap [private]

Definition at line 229 of file TransientVertex.h.

Referenced by tkToTkCovariance().

bool TransientVertex::theCovMapAvailable [private]

Definition at line 227 of file TransientVertex.h.

Referenced by tkToTkCovariance(), and tkToTkCovarianceIsAvailable().

float TransientVertex::theNDF [private]

Definition at line 225 of file TransientVertex.h.

Referenced by degreesOfFreedom().

std::vector<reco::TransientTrack> TransientVertex::theOriginalTracks [private]

Definition at line 220 of file TransientVertex.h.

Referenced by operator reco::Vertex(), originalTrack(), originalTracks(), refittedTrack(), and trackWeight().

VertexState TransientVertex::thePriorVertexState [mutable, private]

Definition at line 215 of file TransientVertex.h.

Referenced by priorError(), and priorPosition().

std::vector<reco::TransientTrack> TransientVertex::theRefittedTracks [private]

Definition at line 221 of file TransientVertex.h.

Referenced by originalTrack(), refittedTrack(), and refittedTracks().

VertexState TransientVertex::theVertexState [mutable, private]

Definition at line 216 of file TransientVertex.h.

Referenced by operator reco::Vertex(), position(), positionError(), and vertexState().

TransientTrackToFloatMap TransientVertex::theWeightMap [private]

Definition at line 230 of file TransientVertex.h.

Referenced by trackWeight(), and weightMap().

bool TransientVertex::theWeightMapIsAvailable [private]

Definition at line 227 of file TransientVertex.h.

Referenced by hasTrackWeight(), trackWeight(), and weightMap().

bool TransientVertex::vertexValid [private]

Definition at line 226 of file TransientVertex.h.

Referenced by isValid().

bool TransientVertex::withPrior [private]

Definition at line 227 of file TransientVertex.h.

Referenced by hasPrior().

bool TransientVertex::withRefittedTracks [private]

Definition at line 228 of file TransientVertex.h.

Referenced by hasRefittedTracks(), and operator reco::Vertex().


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