#include <TransientVertex.h>
Definition at line 17 of file TransientVertex.h.
typedef std::map<reco::TransientTrack, float> TransientVertex::TransientTrackToFloatMap |
Definition at line 21 of file TransientVertex.h.
TransientVertex::TransientVertex | ( | ) |
Empty constructor, produces invalid vertex
Definition at line 9 of file TransientVertex.cc.
: theVertexState(), theOriginalTracks(), theChi2(0), theNDF(0), vertexValid(false), withPrior(false), theWeightMapIsAvailable(false), theCovMapAvailable(false), withRefittedTracks(false) {}
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.
Definition at line 16 of file TransientVertex.cc.
References theNDF, and theOriginalTracks.
: theVertexState(pos, posError), theOriginalTracks(tracks), theChi2(chi2), theNDF(0), vertexValid(true), withPrior(false), theWeightMapIsAvailable(false), theCovMapAvailable(false), withRefittedTracks(false) { theNDF = 2.*theOriginalTracks.size() - 3.; // addTracks(tracks); }
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.
Definition at line 28 of file TransientVertex.cc.
: theVertexState(pos, posError), theOriginalTracks(tracks), theChi2(chi2), theNDF(ndf), vertexValid(true), withPrior(false), theWeightMapIsAvailable(false), theCovMapAvailable(false), withRefittedTracks(false) { // addTracks(tracks); }
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.
Definition at line 39 of file TransientVertex.cc.
References theNDF, and theOriginalTracks.
: thePriorVertexState(priorPos, priorErr), theVertexState(pos, posError), theOriginalTracks(tracks), theChi2(chi2), theNDF(0), vertexValid(true), withPrior(true), theWeightMapIsAvailable(false), theCovMapAvailable(false), withRefittedTracks(false) { theNDF = 2.*theOriginalTracks.size(); // addTracks(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.
Definition at line 52 of file TransientVertex.cc.
: thePriorVertexState(priorPos, priorErr), theVertexState(pos, posError), theOriginalTracks(tracks), theChi2(chi2), theNDF(ndf), vertexValid(true), withPrior(true), theWeightMapIsAvailable(false), theCovMapAvailable(false), withRefittedTracks(false) { // addTracks(tracks); }
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.
Definition at line 64 of file TransientVertex.cc.
References theNDF, and theOriginalTracks.
: theVertexState(state), theOriginalTracks(tracks), theChi2(chi2), theNDF(0), vertexValid(true), withPrior(false), theWeightMapIsAvailable(false), theCovMapAvailable(false), withRefittedTracks(false) { theNDF = 2.*theOriginalTracks.size() - 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.
Definition at line 75 of file TransientVertex.cc.
: theVertexState(state), theOriginalTracks(tracks), theChi2(chi2), theNDF(ndf), vertexValid(true), withPrior(false), theWeightMapIsAvailable(false), theCovMapAvailable(false), withRefittedTracks(false) { // addTracks(tracks); }
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.
Definition at line 86 of file TransientVertex.cc.
References theNDF, and theOriginalTracks.
: thePriorVertexState(prior), theVertexState(state), theOriginalTracks(tracks), theChi2(chi2), theNDF(0), vertexValid(true), withPrior(true), theWeightMapIsAvailable(false), theCovMapAvailable(false), withRefittedTracks(false) { theNDF = 2.*theOriginalTracks.size(); // addTracks(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.
Definition at line 100 of file TransientVertex.cc.
: thePriorVertexState(prior), theVertexState(state), theOriginalTracks(tracks), theChi2(chi2), theNDF(ndf), vertexValid(true), withPrior(true), theWeightMapIsAvailable(false), theCovMapAvailable(false), withRefittedTracks(false) { // addTracks(tracks); }
float TransientVertex::degreesOfFreedom | ( | ) | const [inline] |
Definition at line 128 of file TransientVertex.h.
References theNDF.
Referenced by PrimaryVertexValidation::analyze(), AdaptiveVertexReconstructor::cleanUp(), VertexFitterResult::fill(), normalisedChiSquared(), and PrimaryVertexProducer::produce().
{ return theNDF; }
bool TransientVertex::hasPrior | ( | ) | const [inline] |
Definition at line 117 of file TransientVertex.h.
References withPrior.
Referenced by AdaptiveVertexReconstructor::cleanUp().
{ 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 HPSPFRecoTauAlgorithm::refitThreeProng().
{ 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.
Referenced by PrimaryVertexValidation::analyze().
{ 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 KineExample::analyze(), PrimaryVertexValidation::analyze(), VertexFitterResult::fill(), PFCandCommonVertexFitter< Fitter >::fit(), CandCommonVertexFitter< Fitter >::fit(), V0Fitter::fitAll(), PFDisplacedVertexFinder::fitVertexFromSeed(), Flight2DSvFilter::Flight2DSvFilter(), PrimaryVertexAnalyzer4PU::getSimEvents(), HLTmmkFilter::hltFilter(), HLTmmkkFilter::hltFilter(), InclusiveVertexFinder::produce(), HLTDisplacedmumumuVtxProducer::produce(), HLTDisplacedmumuVtxProducer::produce(), PrimaryVertexProducer::produce(), cms::HITrackVertexMaker::produceTracks(), ConfigurableTertiaryTracksVertexFinder::reconstruct(), HPSPFRecoTauAlgorithm::refitThreeProng(), PFRecoTauDiscriminationByFlightPathSignificance::threeProngFlightPathSig(), CaloRecoTauDiscriminationByFlightPathSignificance::threeProngFlightPathSig(), and TrackVertexArbitration::trackVertexArbitrator().
{ return vertexValid; }
float TransientVertex::normalisedChiSquared | ( | ) | const [inline] |
Definition at line 125 of file TransientVertex.h.
References degreesOfFreedom(), and totalChiSquared().
Referenced by PrimaryVertexValidation::analyze(), HLTmmkFilter::hltFilter(), HLTmmkkFilter::hltFilter(), and cms::HITrackVertexMaker::produceTracks().
{ return totalChiSquared() / degreesOfFreedom(); }
TransientVertex::operator reco::Vertex | ( | ) | const |
Definition at line 206 of file TransientVertex.cc.
References reco::Vertex::add(), and i.
{ //If the vertex is invalid, return an invalid TV ! if (!isValid()) return Vertex(); Vertex vertex(Vertex::Point(theVertexState.position()), // RecoVertex::convertError(theVertexState.error()), theVertexState.error().matrix_new(), totalChiSquared(), degreesOfFreedom(), theOriginalTracks.size() ); for (std::vector<TransientTrack>::const_iterator i = theOriginalTracks.begin(); i != theOriginalTracks.end(); ++i) { // const TrackTransientTrack* ttt = dynamic_cast<const TrackTransientTrack*>((*i).basicTransientTrack()); // if ((ttt!=0) && (ttt->persistentTrackRef().isNonnull())) // { // TrackRef tr = ttt->persistentTrackRef(); // TrackBaseRef tbr(tr); if (withRefittedTracks) { vertex.add((*i).trackBaseRef(), refittedTrack(*i).track(), trackWeight ( *i ) ); } else { vertex.add((*i).trackBaseRef(), trackWeight ( *i ) ); } //} } return vertex; }
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 182 of file TransientVertex.cc.
References spr::find(), pos, theOriginalTracks, and theRefittedTracks.
{ if (theRefittedTracks.empty()) throw VertexException("No refitted tracks stored in vertex"); std::vector<TransientTrack>::const_iterator it = find(theRefittedTracks.begin(), theRefittedTracks.end(), refTrack); if (it==theRefittedTracks.end()) throw VertexException("Refitted track not found in list"); size_t pos = it - theRefittedTracks.begin(); return theOriginalTracks[pos]; }
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(), edm::RefVector< TrackingRecHitCollection >::erase(), VertexFitterResult::fill(), TransientTrackInVertices::isInVertex(), V0SvFilter::operator()(), Flight2DSvFilter::operator()(), PvSvFilter::operator()(), VertexHigherPtSquared::operator()(), VertexMass::operator()(), cms::HITrackVertexMaker::produceTracks(), and TrimmedVertexFitter::vertex().
{ return theOriginalTracks; }
GlobalPoint TransientVertex::position | ( | void | ) | const [inline] |
Definition at line 113 of file TransientVertex.h.
References VertexState::position(), and theVertexState.
Referenced by PFCheckHitPattern::analyze(), KVFTest::analyze(), KineExample::analyze(), PrimaryVertexValidation::analyze(), DistanceOfVertices::deltaV2V1(), Flight2DSvFilter::DistanceSignificance2DToBeamLine(), Flight2DSvFilter::DistanceToBeamLine(), VertexFitterResult::fill(), PFDisplacedVertexFinder::fitVertexFromSeed(), PrimaryVertexAnalyzer4PU::getSimEvents(), HLTmmkFilter::hltFilter(), HLTmmkkFilter::hltFilter(), PrimaryVertexProducer::produce(), cms::HITrackVertexMaker::produceTracks(), reco::GhostTrackVertexFinder::reassignTracks(), HPSPFRecoTauAlgorithm::refitThreeProng(), and TrimmedVertexFitter::vertex().
{ 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(), HLTmmkFilter::hltFilter(), HLTmmkkFilter::hltFilter(), DistanceOfVertices::terms2D(), DistanceOfVertices::terms3D(), and TrimmedVertexFitter::vertex().
{ 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().
{ 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().
{ 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 194 of file TransientVertex.cc.
References spr::find(), pos, theOriginalTracks, and theRefittedTracks.
Referenced by PFDisplacedVertexFinder::fitVertexFromSeed().
{ if (theRefittedTracks.empty()) throw VertexException("No refitted tracks stored in vertex"); std::vector<TransientTrack>::const_iterator it = find(theOriginalTracks.begin(), theOriginalTracks.end(), track); if (it==theOriginalTracks.end()) throw VertexException("Track not found in list"); size_t pos = it - theOriginalTracks.begin(); return theRefittedTracks[pos]; }
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(), HPSPFRecoTauAlgorithm::refitThreeProng(), CandCommonVertexFitterBase::set(), and PFCandCommonVertexFitterBase::set().
{ return theRefittedTracks; }
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 151 of file TransientVertex.cc.
References theCovMap, and theCovMapAvailable.
Referenced by CachingVertex< N >::operator TransientVertex().
{ if (!theCovMapAvailable) { throw VertexException("TransientVertex::Track-to-track covariance matrices not available"); } const TransientTrack* tr1; const TransientTrack* tr2; if (t1<t2) { tr1 = &t1; tr2 = &t2; } else { tr1 = &t2; tr2 = &t1; } TTtoTTmap::const_iterator it = theCovMap.find(*tr1); if (it != theCovMap.end()) { const TTmap & tm = it->second; TTmap::const_iterator nit = tm.find(*tr2); if (nit != tm.end()) { return( nit->second); } else { throw VertexException("TransientVertex::requested Track-to-track covariance matrix does not exist"); } } else { throw VertexException("TransientVertex::requested Track-to-track covariance matrix does not exist"); } }
void TransientVertex::tkToTkCovariance | ( | const TTtoTTmap | covMap | ) |
Definition at line 130 of file TransientVertex.cc.
References theCovMap, and theCovMapAvailable.
{ theCovMap = covMap; theCovMapAvailable = true; }
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.
{ 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 PrimaryVertexValidation::analyze(), AdaptiveVertexReconstructor::cleanUp(), VertexFitterResult::fill(), V0Fitter::fitAll(), PFDisplacedVertexFinder::fitVertexFromSeed(), normalisedChiSquared(), cms::HITrackVertexMaker::produceTracks(), and TrimmedVertexFitter::vertex().
{ 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 136 of file TransientVertex.cc.
References spr::find(), theOriginalTracks, theWeightMap, and theWeightMapIsAvailable.
Referenced by PrimaryVertexValidation::analyze(), AdaptiveVertexReconstructor::cleanUp(), edm::RefVector< TrackingRecHitCollection >::erase(), and PFDisplacedVertexFinder::fitVertexFromSeed().
{ if (!theWeightMapIsAvailable) { std::vector<TransientTrack>::const_iterator foundTrack = find(theOriginalTracks.begin(), theOriginalTracks.end(), track); return ((foundTrack != theOriginalTracks.end()) ? 1. : 0.); } TransientTrackToFloatMap::const_iterator it = theWeightMap.find(track); if (it != theWeightMap.end()) { return(it->second); } return 0.; }
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().
{ return theVertexState; }
void TransientVertex::weightMap | ( | const TransientTrackToFloatMap & | theMap | ) |
Definition at line 112 of file TransientVertex.cc.
References theWeightMap, and theWeightMapIsAvailable.
{ theWeightMap = theMap; theWeightMapIsAvailable = true; // removeTracks(); // remove trackrefs from reco::Vertex // addTracks( theOriginalTracks ); }
TransientTrackToFloatMap TransientVertex::weightMap | ( | ) | const [inline] |
Definition at line 192 of file TransientVertex.h.
References theWeightMap.
Referenced by AdaptiveVertexReconstructor::cleanUp(), and CachingVertex< N >::operator TransientVertex().
{ return theWeightMap; }
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(), and TransientVertex().
std::vector<reco::TransientTrack> TransientVertex::theOriginalTracks [private] |
Definition at line 220 of file TransientVertex.h.
Referenced by originalTrack(), originalTracks(), refittedTrack(), trackWeight(), and TransientVertex().
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 position(), positionError(), and vertexState().
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().