CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
ConfigurableTrimmedVertexFinder Class Reference

#include <ConfigurableTrimmedVertexFinder.h>

Inheritance diagram for ConfigurableTrimmedVertexFinder:
VertexReconstructor

Public Member Functions

ConfigurableTrimmedVertexFinderclone () const override
 
 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 TrimmedTrackFiltertrackFilter () const
 
float vertexFitProbabilityCut () const
 
std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &tracks) const override
 
std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &tracks, const reco::BeamSpot &spot) const override
 
std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &tracks, std::vector< reco::TransientTrack > &unused, const reco::BeamSpot &spot, bool use_spot) const
 
 ~ConfigurableTrimmedVertexFinder () override
 
- Public Member Functions inherited from VertexReconstructor
 VertexReconstructor ()
 
virtual std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &primaries, const std::vector< reco::TransientTrack > &tracks, const reco::BeamSpot &spot) const
 
virtual ~VertexReconstructor ()
 

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< TransientVertexclean (const std::vector< TransientVertex > &candidates) const
 
std::vector< TransientVertexvertexCandidates (const std::vector< reco::TransientTrack > &tracks, std::vector< reco::TransientTrack > &unused, const reco::BeamSpot &spot, bool use_spot) const
 
virtual std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &) const=0
 
virtual std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &primaries, const std::vector< reco::TransientTrack > &tracks, const reco::BeamSpot &spot) const
 
virtual std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &t, const reco::BeamSpot &) const
 

Private Attributes

TrimmedVertexFinder theClusterFinder
 
TrimmedTrackFilter theFilter
 
int theMaxNbOfVertices
 
float theTrackCompatibilityToPV
 
float theTrackCompatibilityToSV
 
float theVtxFitProbCut
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ConfigurableTrimmedVertexFinder()

ConfigurableTrimmedVertexFinder::ConfigurableTrimmedVertexFinder ( const VertexFitter< 5 > *  vf,
const VertexUpdator< 5 > *  vu,
const VertexTrackCompatibilityEstimator< 5 > *  ve 
)

Definition at line 6 of file ConfigurableTrimmedVertexFinder.cc.

9  : theClusterFinder(vf, vu, ve),
10  theVtxFitProbCut(0.01),
14  // default pt cut is 1.5 GeV
15  theFilter.setPtCut(1.5);
16 }

References TrimmedTrackFilter::setPtCut(), and theFilter.

Referenced by clone().

◆ ~ConfigurableTrimmedVertexFinder()

ConfigurableTrimmedVertexFinder::~ConfigurableTrimmedVertexFinder ( )
inlineoverride

Definition at line 50 of file ConfigurableTrimmedVertexFinder.h.

50 {}

Member Function Documentation

◆ analyseClusterFinder()

virtual void ConfigurableTrimmedVertexFinder::analyseClusterFinder ( const std::vector< TransientVertex > &  vts,
const std::vector< reco::TransientTrack > &  remain 
) const
inlineprotectedvirtual

Definition at line 90 of file ConfigurableTrimmedVertexFinder.h.

91  {}

Referenced by vertexCandidates().

◆ analyseFoundVertices()

virtual void ConfigurableTrimmedVertexFinder::analyseFoundVertices ( const std::vector< TransientVertex > &  vts) const
inlineprotectedvirtual

Definition at line 95 of file ConfigurableTrimmedVertexFinder.h.

95 {}

Referenced by vertices().

◆ analyseInputTracks()

virtual void ConfigurableTrimmedVertexFinder::analyseInputTracks ( const std::vector< reco::TransientTrack > &  tracks) const
inlineprotectedvirtual

Definition at line 88 of file ConfigurableTrimmedVertexFinder.h.

88 {}

Referenced by vertices().

◆ analyseVertexCandidates()

virtual void ConfigurableTrimmedVertexFinder::analyseVertexCandidates ( const std::vector< TransientVertex > &  vts) const
inlineprotectedvirtual

Definition at line 93 of file ConfigurableTrimmedVertexFinder.h.

93 {}

Referenced by vertices().

◆ clean()

std::vector< TransientVertex > ConfigurableTrimmedVertexFinder::clean ( const std::vector< TransientVertex > &  candidates) const
private

Definition at line 119 of file ConfigurableTrimmedVertexFinder.cc.

120  {
121  std::vector<TransientVertex> sel;
122  for (std::vector<TransientVertex>::const_iterator i = candidates.begin(); i != candidates.end(); i++) {
123  if (ChiSquaredProbability((*i).totalChiSquared(), (*i).degreesOfFreedom()) > theVtxFitProbCut) {
124  sel.push_back(*i);
125  }
126  }
127 
128  return sel;
129 }

References HLT_FULL_cff::candidates, ChiSquaredProbability(), mps_fire::i, EgammaValidation_Wenu_cff::sel, and theVtxFitProbCut.

Referenced by vertices().

◆ clone()

ConfigurableTrimmedVertexFinder* ConfigurableTrimmedVertexFinder::clone ( void  ) const
inlineoverridevirtual

Clone method

Implements VertexReconstructor.

Definition at line 83 of file ConfigurableTrimmedVertexFinder.h.

83 { return new ConfigurableTrimmedVertexFinder(*this); }

References ConfigurableTrimmedVertexFinder().

◆ maxNbOfVertices()

int ConfigurableTrimmedVertexFinder::maxNbOfVertices ( ) const
inline

Definition at line 69 of file ConfigurableTrimmedVertexFinder.h.

69 { return theMaxNbOfVertices; }

References theMaxNbOfVertices.

Referenced by KalmanTrimmedVertexFinder::maxNbOfVertices().

◆ ptCut()

float ConfigurableTrimmedVertexFinder::ptCut ( ) const
inline

Access to parameters

Definition at line 64 of file ConfigurableTrimmedVertexFinder.h.

64 { return theFilter.ptCut(); }

References TrimmedTrackFilter::ptCut(), and theFilter.

Referenced by KalmanTrimmedVertexFinder::ptCut().

◆ resetEvent()

virtual void ConfigurableTrimmedVertexFinder::resetEvent ( const std::vector< reco::TransientTrack > &  tracks) const
inlineprotectedvirtual

Definition at line 86 of file ConfigurableTrimmedVertexFinder.h.

86 {}

Referenced by vertices().

◆ setMaxNbOfVertices()

void ConfigurableTrimmedVertexFinder::setMaxNbOfVertices ( int  max)
inline

◆ setParameters()

void ConfigurableTrimmedVertexFinder::setParameters ( const edm::ParameterSet s)

Set parameters

Definition at line 18 of file ConfigurableTrimmedVertexFinder.cc.

18  {
19  theFilter.setPtCut(s.getParameter<double>("ptCut"));
20  theTrackCompatibilityToPV = s.getParameter<double>("trackCompatibilityToPVcut");
21  theTrackCompatibilityToSV = s.getParameter<double>("trackCompatibilityToSVcut");
22  theVtxFitProbCut = s.getParameter<double>("vtxFitProbCut");
23  theMaxNbOfVertices = s.getParameter<int>("maxNbOfVertices");
24 }

References alignCSCRings::s, TrimmedTrackFilter::setPtCut(), theFilter, theMaxNbOfVertices, theTrackCompatibilityToPV, theTrackCompatibilityToSV, and theVtxFitProbCut.

◆ setPtCut()

void ConfigurableTrimmedVertexFinder::setPtCut ( float  cut)
inline

◆ setTrackCompatibilityCut()

void ConfigurableTrimmedVertexFinder::setTrackCompatibilityCut ( float  cut)
inline

◆ setTrackCompatibilityToSV()

void ConfigurableTrimmedVertexFinder::setTrackCompatibilityToSV ( float  cut)
inline

◆ setVertexFitProbabilityCut()

void ConfigurableTrimmedVertexFinder::setVertexFitProbabilityCut ( float  cut)
inline

◆ trackCompatibilityCut()

float ConfigurableTrimmedVertexFinder::trackCompatibilityCut ( ) const
inline

◆ trackCompatibilityToSV()

float ConfigurableTrimmedVertexFinder::trackCompatibilityToSV ( ) const
inline

◆ trackFilter()

const TrimmedTrackFilter& ConfigurableTrimmedVertexFinder::trackFilter ( ) const
inline

Definition at line 65 of file ConfigurableTrimmedVertexFinder.h.

65 { return theFilter; }

References theFilter.

◆ vertexCandidates()

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 65 of file ConfigurableTrimmedVertexFinder.cc.

68  {
69  std::vector<TransientVertex> cand;
70 
71  std::vector<TransientTrack> remain = tracks;
72 
73  while (true) {
74  float tkCompCut = (cand.empty() ? theTrackCompatibilityToPV : theTrackCompatibilityToSV);
75 
76  // std::cout << "PVR:compat cut " << tkCompCut << std::endl;
78  // std::cout << "PVCF:compat cut after setting "
79  // << theClusterFinder.trackCompatibilityCut() << std::endl;
80 
81  std::vector<TransientVertex> newVertices;
82  if (cand.empty() && use_spot) {
83  newVertices = theClusterFinder.vertices(remain, spot);
84  } else {
85  newVertices = theClusterFinder.vertices(remain);
86  }
87  if (newVertices.empty())
88  break;
89 
90  analyseClusterFinder(newVertices, remain);
91 
92  for (std::vector<TransientVertex>::const_iterator iv = newVertices.begin(); iv != newVertices.end(); iv++) {
93  if (iv->originalTracks().size() > 1) {
94  cand.push_back(*iv);
95  } else {
96  // candidate has too few tracks - get them back into the vector
97  for (std::vector<TransientTrack>::const_iterator trk = iv->originalTracks().begin();
98  trk != iv->originalTracks().end();
99  ++trk) {
100  unused.push_back(*trk);
101  }
102  }
103  }
104 
105  // when max number of vertices reached, stop
106  if (theMaxNbOfVertices != 0) {
107  if (cand.size() >= (unsigned int)theMaxNbOfVertices)
108  break;
109  }
110  }
111 
112  for (std::vector<TransientTrack>::const_iterator it = remain.begin(); it != remain.end(); it++) {
113  unused.push_back(*it);
114  }
115 
116  return cand;
117 }

References analyseClusterFinder(), createfilelist::int, TrimmedVertexFinder::setTrackCompatibilityCut(), theClusterFinder, theMaxNbOfVertices, theTrackCompatibilityToPV, theTrackCompatibilityToSV, PDWG_EXOHSCP_cff::tracks, and TrimmedVertexFinder::vertices().

Referenced by vertices().

◆ vertexFitProbabilityCut()

float ConfigurableTrimmedVertexFinder::vertexFitProbabilityCut ( ) const
inline

◆ vertices() [1/6]

virtual std::vector<TransientVertex> VertexReconstructor::vertices
private

Reconstruct vertices

◆ vertices() [2/6]

virtual std::vector<TransientVertex> VertexReconstructor::vertices
inlineprivate

Reconstruct vertices, but exploit the fact that you know that some tracks cannot come from a secondary vertex. \paramname primaries Tracks that cannot come from a secondary vertex (but can, in principle, be non-primaries, also). \paramname tracks These are the tracks that are of unknown origin. These tracks are subjected to pattern recognition. \paramname spot A beamspot constraint is mandatory in this method.

Definition at line 39 of file VertexReconstructor.h.

41  {
42  return vertices(tracks, spot);
43  }

◆ vertices() [3/6]

virtual std::vector<TransientVertex> VertexReconstructor::vertices
inlineprivate

Reconstruct vertices, exploiting the beamspot constraint for the primary vertex

Definition at line 25 of file VertexReconstructor.h.

26  {
27  return vertices(t);
28  }

◆ vertices() [4/6]

std::vector< TransientVertex > ConfigurableTrimmedVertexFinder::vertices ( const std::vector< reco::TransientTrack > &  ) const
overridevirtual

Reconstruct vertices

Implements VertexReconstructor.

Definition at line 26 of file ConfigurableTrimmedVertexFinder.cc.

26  {
27  std::vector<TransientTrack> remaining;
28 
29  return vertices(tracks, remaining, reco::BeamSpot(), false);
30 }

References PDWG_EXOHSCP_cff::tracks.

Referenced by KalmanTrimmedVertexFinder::vertices(), and vertices().

◆ vertices() [5/6]

std::vector< TransientVertex > ConfigurableTrimmedVertexFinder::vertices ( const std::vector< reco::TransientTrack > &  t,
const reco::BeamSpot  
) const
overridevirtual

Reconstruct vertices, exploiting the beamspot constraint for the primary vertex

Reimplemented from VertexReconstructor.

Definition at line 32 of file ConfigurableTrimmedVertexFinder.cc.

33  {
34  std::vector<TransientTrack> remaining;
35  return vertices(tracks, remaining, spot, true);
36 }

References PDWG_EXOHSCP_cff::tracks, and vertices().

◆ vertices() [6/6]

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 38 of file ConfigurableTrimmedVertexFinder.cc.

41  {
44 
45  std::vector<TransientTrack> filtered;
46  for (std::vector<TransientTrack>::const_iterator it = tracks.begin(); it != tracks.end(); it++) {
47  if (theFilter(*it)) {
48  filtered.push_back(*it);
49  } else {
50  unused.push_back(*it);
51  }
52  }
53 
54  std::vector<TransientVertex> all = vertexCandidates(filtered, unused, spot, use_spot);
55 
57 
58  std::vector<TransientVertex> sel = clean(all);
59 
61 
62  return sel;
63 }

References python.cmstools::all(), analyseFoundVertices(), analyseInputTracks(), analyseVertexCandidates(), clean(), filtered(), resetEvent(), EgammaValidation_Wenu_cff::sel, theFilter, PDWG_EXOHSCP_cff::tracks, and vertexCandidates().

Member Data Documentation

◆ theClusterFinder

TrimmedVertexFinder ConfigurableTrimmedVertexFinder::theClusterFinder
mutableprivate

Definition at line 114 of file ConfigurableTrimmedVertexFinder.h.

Referenced by vertexCandidates().

◆ theFilter

TrimmedTrackFilter ConfigurableTrimmedVertexFinder::theFilter
private

◆ theMaxNbOfVertices

int ConfigurableTrimmedVertexFinder::theMaxNbOfVertices
private

◆ theTrackCompatibilityToPV

float ConfigurableTrimmedVertexFinder::theTrackCompatibilityToPV
private

◆ theTrackCompatibilityToSV

float ConfigurableTrimmedVertexFinder::theTrackCompatibilityToSV
private

◆ theVtxFitProbCut

float ConfigurableTrimmedVertexFinder::theVtxFitProbCut
private
ConfigurableTrimmedVertexFinder::analyseFoundVertices
virtual void analyseFoundVertices(const std::vector< TransientVertex > &vts) const
Definition: ConfigurableTrimmedVertexFinder.h:95
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:428
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
ConfigurableTrimmedVertexFinder::analyseClusterFinder
virtual void analyseClusterFinder(const std::vector< TransientVertex > &vts, const std::vector< reco::TransientTrack > &remain) const
Definition: ConfigurableTrimmedVertexFinder.h:90
ChiSquaredProbability
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:13
TrimmedTrackFilter::setPtCut
void setPtCut(double ptCut)
Definition: TrimmedTrackFilter.h:27
ConfigurableTrimmedVertexFinder::theTrackCompatibilityToPV
float theTrackCompatibilityToPV
Definition: ConfigurableTrimmedVertexFinder.h:116
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
ConfigurableTrimmedVertexFinder::ConfigurableTrimmedVertexFinder
ConfigurableTrimmedVertexFinder(const VertexFitter< 5 > *vf, const VertexUpdator< 5 > *vu, const VertexTrackCompatibilityEstimator< 5 > *ve)
Definition: ConfigurableTrimmedVertexFinder.cc:6
alignCSCRings.s
s
Definition: alignCSCRings.py:92
ConfigurableTrimmedVertexFinder::theVtxFitProbCut
float theVtxFitProbCut
Definition: ConfigurableTrimmedVertexFinder.h:115
reco::BeamSpot
Definition: BeamSpot.h:21
ConfigurableTrimmedVertexFinder::vertexCandidates
std::vector< TransientVertex > vertexCandidates(const std::vector< reco::TransientTrack > &tracks, std::vector< reco::TransientTrack > &unused, const reco::BeamSpot &spot, bool use_spot) const
Definition: ConfigurableTrimmedVertexFinder.cc:65
ConfigurableTrimmedVertexFinder::analyseVertexCandidates
virtual void analyseVertexCandidates(const std::vector< TransientVertex > &vts) const
Definition: ConfigurableTrimmedVertexFinder.h:93
ConfigurableTrimmedVertexFinder::clean
std::vector< TransientVertex > clean(const std::vector< TransientVertex > &candidates) const
Definition: ConfigurableTrimmedVertexFinder.cc:119
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
cand
Definition: decayParser.h:32
createfilelist.int
int
Definition: createfilelist.py:10
filtered
static const TGPicture * filtered(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:100
ConfigurableTrimmedVertexFinder::resetEvent
virtual void resetEvent(const std::vector< reco::TransientTrack > &tracks) const
Definition: ConfigurableTrimmedVertexFinder.h:86
TrimmedVertexFinder::vertices
std::vector< TransientVertex > vertices(std::vector< reco::TransientTrack > &remain) const
Definition: TrimmedVertexFinder.cc:26
ConfigurableTrimmedVertexFinder::theFilter
TrimmedTrackFilter theFilter
Definition: ConfigurableTrimmedVertexFinder.h:119
HLT_FULL_cff.candidates
candidates
Definition: HLT_FULL_cff.py:55051
ConfigurableTrimmedVertexFinder::analyseInputTracks
virtual void analyseInputTracks(const std::vector< reco::TransientTrack > &tracks) const
Definition: ConfigurableTrimmedVertexFinder.h:88
ConfigurableTrimmedVertexFinder::theClusterFinder
TrimmedVertexFinder theClusterFinder
Definition: ConfigurableTrimmedVertexFinder.h:114
TrimmedTrackFilter::ptCut
double ptCut() const
Definition: TrimmedTrackFilter.h:23
EgammaValidation_Wenu_cff.sel
sel
Definition: EgammaValidation_Wenu_cff.py:33
ConfigurableTrimmedVertexFinder::theTrackCompatibilityToSV
float theTrackCompatibilityToSV
Definition: ConfigurableTrimmedVertexFinder.h:117
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
TrimmedVertexFinder::setTrackCompatibilityCut
void setTrackCompatibilityCut(float cut)
Definition: TrimmedVertexFinder.h:61
ConfigurableTrimmedVertexFinder::theMaxNbOfVertices
int theMaxNbOfVertices
Definition: ConfigurableTrimmedVertexFinder.h:118
ConfigurableTrimmedVertexFinder::vertices
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &tracks) const override
Definition: ConfigurableTrimmedVertexFinder.cc:26