#include <ConfigurableTrimmedVertexFinder.h>
Public Member Functions | |
virtual ConfigurableTrimmedVertexFinder * | clone () const |
ConfigurableTrimmedVertexFinder (const VertexFitter< 5 > *vf, const VertexUpdator< 5 > *vu, const VertexTrackCompatibilityEstimator< 5 > *ve) | |
int | maxNbOfVertices () const |
float | ptCut () const |
void | setMaxNbOfVertices (int max) |
void | setParameters (const edm::ParameterSet &) |
void | setPtCut (float cut) |
void | setTrackCompatibilityCut (float cut) |
void | setTrackCompatibilityToSV (float cut) |
void | setVertexFitProbabilityCut (float cut) |
float | trackCompatibilityCut () const |
float | trackCompatibilityToSV () const |
const TrimmedTrackFilter & | trackFilter () const |
float | vertexFitProbabilityCut () const |
std::vector< TransientVertex > | vertices (const std::vector< reco::TransientTrack > &tracks, std::vector< reco::TransientTrack > &unused, const reco::BeamSpot &spot, bool use_spot) const |
virtual std::vector < TransientVertex > | vertices (const std::vector< reco::TransientTrack > &tracks, const reco::BeamSpot &spot) const |
virtual std::vector < TransientVertex > | vertices (const std::vector< reco::TransientTrack > &tracks) const |
virtual | ~ConfigurableTrimmedVertexFinder () |
Protected Member Functions | |
virtual void | analyseClusterFinder (const std::vector< TransientVertex > &vts, const std::vector< reco::TransientTrack > &remain) const |
virtual void | analyseFoundVertices (const std::vector< TransientVertex > &vts) const |
virtual void | analyseInputTracks (const std::vector< reco::TransientTrack > &tracks) const |
virtual void | analyseVertexCandidates (const std::vector< TransientVertex > &vts) const |
virtual void | resetEvent (const std::vector< reco::TransientTrack > &tracks) const |
Private Member Functions | |
std::vector< TransientVertex > | clean (const std::vector< TransientVertex > &candidates) const |
std::vector< TransientVertex > | vertexCandidates (const std::vector< reco::TransientTrack > &tracks, std::vector< reco::TransientTrack > &unused, const reco::BeamSpot &spot, bool use_spot) const |
Private Attributes | |
TrimmedVertexFinder | theClusterFinder |
TrimmedTrackFilter | theFilter |
int | theMaxNbOfVertices |
float | theTrackCompatibilityToPV |
float | theTrackCompatibilityToSV |
float | theVtxFitProbCut |
Algorithm to find a series of distinct vertices among the given set of tracks. The technique is:
1) use `TrimmedTrackFilter` to select tracks above a certain pT;
2) use `TrimmedVertexFinder` to split the set of tracks into a cluster of compatible tracks and a set of remaining tracks;
3) repeat 2) with the remaining set, and repeat as long as (a) a cluster of compatible tracks can be found or (b) the maximum number of clusters asked for is reached;
4) reject vertices with a low fit probability.
This algorithm has 5 parameters that can be set at runtime via the corresponding set() methods, or a ParameterSet:
Definition at line 44 of file ConfigurableTrimmedVertexFinder.h.
ConfigurableTrimmedVertexFinder::ConfigurableTrimmedVertexFinder | ( | const VertexFitter< 5 > * | vf, |
const VertexUpdator< 5 > * | vu, | ||
const VertexTrackCompatibilityEstimator< 5 > * | ve | ||
) |
Definition at line 6 of file ConfigurableTrimmedVertexFinder.cc.
References TrimmedTrackFilter::setPtCut(), and theFilter.
Referenced by clone().
: theClusterFinder(vf, vu, ve), theVtxFitProbCut(0.01), theTrackCompatibilityToPV(0.05), theTrackCompatibilityToSV(0.01), theMaxNbOfVertices(0) { // default pt cut is 1.5 GeV theFilter.setPtCut(1.5); }
virtual ConfigurableTrimmedVertexFinder::~ConfigurableTrimmedVertexFinder | ( | ) | [inline, virtual] |
Definition at line 52 of file ConfigurableTrimmedVertexFinder.h.
{}
virtual void ConfigurableTrimmedVertexFinder::analyseClusterFinder | ( | const std::vector< TransientVertex > & | vts, |
const std::vector< reco::TransientTrack > & | remain | ||
) | const [inline, protected, virtual] |
Definition at line 105 of file ConfigurableTrimmedVertexFinder.h.
Referenced by vertexCandidates().
{}
virtual void ConfigurableTrimmedVertexFinder::analyseFoundVertices | ( | const std::vector< TransientVertex > & | vts | ) | const [inline, protected, virtual] |
virtual void ConfigurableTrimmedVertexFinder::analyseInputTracks | ( | const std::vector< reco::TransientTrack > & | tracks | ) | const [inline, protected, virtual] |
virtual void ConfigurableTrimmedVertexFinder::analyseVertexCandidates | ( | const std::vector< TransientVertex > & | vts | ) | const [inline, protected, virtual] |
std::vector< TransientVertex > ConfigurableTrimmedVertexFinder::clean | ( | const std::vector< TransientVertex > & | candidates | ) | const [private] |
Definition at line 138 of file ConfigurableTrimmedVertexFinder.cc.
References ChiSquaredProbability(), i, runTheMatrix::sel, and theVtxFitProbCut.
Referenced by vertices().
{ std::vector<TransientVertex> sel; for (std::vector<TransientVertex>::const_iterator i = candidates.begin(); i != candidates.end(); i++) { if (ChiSquaredProbability((*i).totalChiSquared(), (*i).degreesOfFreedom()) > theVtxFitProbCut) { sel.push_back(*i); } } return sel; }
virtual ConfigurableTrimmedVertexFinder* ConfigurableTrimmedVertexFinder::clone | ( | void | ) | const [inline, virtual] |
Clone method
Implements VertexReconstructor.
Definition at line 93 of file ConfigurableTrimmedVertexFinder.h.
References ConfigurableTrimmedVertexFinder().
Referenced by KalmanTrimmedVertexFinder::KalmanTrimmedVertexFinder().
{ return new ConfigurableTrimmedVertexFinder(*this); }
int ConfigurableTrimmedVertexFinder::maxNbOfVertices | ( | ) | const [inline] |
Definition at line 75 of file ConfigurableTrimmedVertexFinder.h.
References theMaxNbOfVertices.
Referenced by KalmanTrimmedVertexFinder::maxNbOfVertices().
{ return theMaxNbOfVertices; }
float ConfigurableTrimmedVertexFinder::ptCut | ( | ) | const [inline] |
Access to parameters
Definition at line 68 of file ConfigurableTrimmedVertexFinder.h.
References TrimmedTrackFilter::ptCut(), and theFilter.
Referenced by KalmanTrimmedVertexFinder::ptCut().
virtual void ConfigurableTrimmedVertexFinder::resetEvent | ( | const std::vector< reco::TransientTrack > & | tracks | ) | const [inline, protected, virtual] |
void ConfigurableTrimmedVertexFinder::setMaxNbOfVertices | ( | int | max | ) | [inline] |
Definition at line 89 of file ConfigurableTrimmedVertexFinder.h.
References max(), and theMaxNbOfVertices.
Referenced by KalmanTrimmedVertexFinder::setMaxNbOfVertices().
{ theMaxNbOfVertices = max; }
void ConfigurableTrimmedVertexFinder::setParameters | ( | const edm::ParameterSet & | s | ) |
Set parameters
Definition at line 18 of file ConfigurableTrimmedVertexFinder.cc.
References edm::ParameterSet::getParameter(), TrimmedTrackFilter::setPtCut(), theFilter, theMaxNbOfVertices, theTrackCompatibilityToPV, theTrackCompatibilityToSV, and theVtxFitProbCut.
{ theFilter.setPtCut(s.getParameter<double>("ptCut")); theTrackCompatibilityToPV = s.getParameter<double>("trackCompatibilityToPVcut"); theTrackCompatibilityToSV = s.getParameter<double>("trackCompatibilityToSVcut"); theVtxFitProbCut = s.getParameter<double>("vtxFitProbCut"); theMaxNbOfVertices = s.getParameter<int>("maxNbOfVertices"); }
void ConfigurableTrimmedVertexFinder::setPtCut | ( | float | cut | ) | [inline] |
Definition at line 81 of file ConfigurableTrimmedVertexFinder.h.
References TrimmedTrackFilter::setPtCut(), and theFilter.
Referenced by KalmanTrimmedVertexFinder::setPtCut().
void ConfigurableTrimmedVertexFinder::setTrackCompatibilityCut | ( | float | cut | ) | [inline] |
Definition at line 82 of file ConfigurableTrimmedVertexFinder.h.
References align_tpl::cut, and theTrackCompatibilityToPV.
Referenced by KalmanTrimmedVertexFinder::setTrackCompatibilityCut().
{ theTrackCompatibilityToPV = cut; }
void ConfigurableTrimmedVertexFinder::setTrackCompatibilityToSV | ( | float | cut | ) | [inline] |
Definition at line 85 of file ConfigurableTrimmedVertexFinder.h.
References align_tpl::cut, and theTrackCompatibilityToSV.
Referenced by KalmanTrimmedVertexFinder::setTrackCompatibilityToSV().
{ theTrackCompatibilityToSV = cut; }
void ConfigurableTrimmedVertexFinder::setVertexFitProbabilityCut | ( | float | cut | ) | [inline] |
Definition at line 88 of file ConfigurableTrimmedVertexFinder.h.
References align_tpl::cut, and theVtxFitProbCut.
Referenced by KalmanTrimmedVertexFinder::setVertexFitProbabilityCut().
{ theVtxFitProbCut = cut; }
float ConfigurableTrimmedVertexFinder::trackCompatibilityCut | ( | ) | const [inline] |
Definition at line 72 of file ConfigurableTrimmedVertexFinder.h.
References theTrackCompatibilityToPV.
Referenced by KalmanTrimmedVertexFinder::trackCompatibilityCut().
{ return theTrackCompatibilityToPV; }
float ConfigurableTrimmedVertexFinder::trackCompatibilityToSV | ( | ) | const [inline] |
Definition at line 73 of file ConfigurableTrimmedVertexFinder.h.
References theTrackCompatibilityToSV.
Referenced by KalmanTrimmedVertexFinder::trackCompatibilityToSV().
{ return theTrackCompatibilityToSV; }
const TrimmedTrackFilter& ConfigurableTrimmedVertexFinder::trackFilter | ( | ) | const [inline] |
Definition at line 69 of file ConfigurableTrimmedVertexFinder.h.
References theFilter.
{ return theFilter; }
std::vector< TransientVertex > ConfigurableTrimmedVertexFinder::vertexCandidates | ( | const std::vector< reco::TransientTrack > & | tracks, |
std::vector< reco::TransientTrack > & | unused, | ||
const reco::BeamSpot & | spot, | ||
bool | use_spot | ||
) | const [private] |
Definition at line 76 of file ConfigurableTrimmedVertexFinder.cc.
References analyseClusterFinder(), TrimmedVertexFinder::setTrackCompatibilityCut(), theClusterFinder, theMaxNbOfVertices, theTrackCompatibilityToPV, theTrackCompatibilityToSV, testEve_cfg::tracks, and TrimmedVertexFinder::vertices().
Referenced by vertices().
{ std::vector<TransientVertex> cand; std::vector<TransientTrack> remain = tracks; while (true) { float tkCompCut = (cand.size() == 0 ? theTrackCompatibilityToPV : theTrackCompatibilityToSV); // std::cout << "PVR:compat cut " << tkCompCut << std::endl; theClusterFinder.setTrackCompatibilityCut(tkCompCut); // std::cout << "PVCF:compat cut after setting " // << theClusterFinder.trackCompatibilityCut() << std::endl; std::vector<TransientVertex> newVertices; if ( cand.size() == 0 && use_spot ) { newVertices = theClusterFinder.vertices(remain, spot ); } else { newVertices = theClusterFinder.vertices(remain); } if (newVertices.empty()) break; analyseClusterFinder(newVertices, remain); for (std::vector<TransientVertex>::const_iterator iv = newVertices.begin(); iv != newVertices.end(); iv++) { if ( iv->originalTracks().size() > 1 ) { cand.push_back(*iv); } else { // candidate has too few tracks - get them back into the vector for ( std::vector< TransientTrack >::const_iterator trk = iv->originalTracks().begin(); trk != iv->originalTracks().end(); ++trk ) { unused.push_back ( *trk ); } } } // when max number of vertices reached, stop if (theMaxNbOfVertices != 0) { if (cand.size() >= (unsigned int) theMaxNbOfVertices) break; } } for (std::vector<TransientTrack>::const_iterator it = remain.begin(); it != remain.end(); it++) { unused.push_back(*it); } return cand; }
float ConfigurableTrimmedVertexFinder::vertexFitProbabilityCut | ( | ) | const [inline] |
Definition at line 74 of file ConfigurableTrimmedVertexFinder.h.
References theVtxFitProbCut.
Referenced by KalmanTrimmedVertexFinder::vertexFitProbabilityCut().
{ return theVtxFitProbCut; }
std::vector< TransientVertex > ConfigurableTrimmedVertexFinder::vertices | ( | const std::vector< reco::TransientTrack > & | ) | const [virtual] |
Reconstruct vertices
Implements VertexReconstructor.
Definition at line 28 of file ConfigurableTrimmedVertexFinder.cc.
Referenced by vertices(), and KalmanTrimmedVertexFinder::vertices().
{ std::vector<TransientTrack> remaining; return vertices(tracks, remaining, reco::BeamSpot(), false ); }
std::vector< TransientVertex > ConfigurableTrimmedVertexFinder::vertices | ( | const std::vector< reco::TransientTrack > & | tracks, |
std::vector< reco::TransientTrack > & | unused, | ||
const reco::BeamSpot & | spot, | ||
bool | use_spot | ||
) | const |
Definition at line 44 of file ConfigurableTrimmedVertexFinder.cc.
References cond::ecalcond::all, analyseFoundVertices(), analyseInputTracks(), analyseVertexCandidates(), clean(), filtered(), resetEvent(), runTheMatrix::sel, theFilter, and vertexCandidates().
{ resetEvent(tracks); analyseInputTracks(tracks); std::vector<TransientTrack> filtered; for (std::vector<TransientTrack>::const_iterator it = tracks.begin(); it != tracks.end(); it++) { if (theFilter(*it)) { filtered.push_back(*it); } else { unused.push_back(*it); } } std::vector<TransientVertex> all = vertexCandidates(filtered, unused, spot, use_spot ); analyseVertexCandidates(all); std::vector<TransientVertex> sel = clean(all); analyseFoundVertices(sel); return sel; }
std::vector< TransientVertex > ConfigurableTrimmedVertexFinder::vertices | ( | const std::vector< reco::TransientTrack > & | t, |
const reco::BeamSpot & | |||
) | const [virtual] |
Reconstruct vertices, exploiting the beamspot constraint for the primary vertex
Reimplemented from VertexReconstructor.
Definition at line 37 of file ConfigurableTrimmedVertexFinder.cc.
References vertices().
TrimmedVertexFinder ConfigurableTrimmedVertexFinder::theClusterFinder [mutable, private] |
Definition at line 133 of file ConfigurableTrimmedVertexFinder.h.
Referenced by vertexCandidates().
Definition at line 138 of file ConfigurableTrimmedVertexFinder.h.
Referenced by ConfigurableTrimmedVertexFinder(), ptCut(), setParameters(), setPtCut(), trackFilter(), and vertices().
int ConfigurableTrimmedVertexFinder::theMaxNbOfVertices [private] |
Definition at line 137 of file ConfigurableTrimmedVertexFinder.h.
Referenced by maxNbOfVertices(), setMaxNbOfVertices(), setParameters(), and vertexCandidates().
float ConfigurableTrimmedVertexFinder::theTrackCompatibilityToPV [private] |
Definition at line 135 of file ConfigurableTrimmedVertexFinder.h.
Referenced by setParameters(), setTrackCompatibilityCut(), trackCompatibilityCut(), and vertexCandidates().
float ConfigurableTrimmedVertexFinder::theTrackCompatibilityToSV [private] |
Definition at line 136 of file ConfigurableTrimmedVertexFinder.h.
Referenced by setParameters(), setTrackCompatibilityToSV(), trackCompatibilityToSV(), and vertexCandidates().
float ConfigurableTrimmedVertexFinder::theVtxFitProbCut [private] |
Definition at line 134 of file ConfigurableTrimmedVertexFinder.h.
Referenced by clean(), setParameters(), setVertexFitProbabilityCut(), and vertexFitProbabilityCut().