CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
PFDisplacedVertexFinder Class Reference

#include <PFDisplacedVertexFinder.h>

Public Types

enum  FitterType { F_NOTDEFINED, F_DONOTREFIT, F_KALMAN, F_ADAPTIVE }
 Fitter Type. More...
 
typedef reco::PFDisplacedVertexCollection::iterator IDV
 
typedef reco::PFDisplacedVertexSeedCollection::iterator IDVS
 -----— Useful Types -----— /// More...
 
typedef std::pair< PFTrackHitInfo, PFTrackHitInfoPFTrackHitFullInfo
 
typedef std::pair< unsigned int, unsigned int > PFTrackHitInfo
 

Public Member Functions

const std::unique_ptr< reco::PFDisplacedVertexCollection > & displacedVertices () const
 
void findDisplacedVertices ()
 -----— Main function which find vertices -----— /// More...
 
 PFDisplacedVertexFinder ()
 
void setAVFParameters (const edm::ParameterSet &ps)
 
void setDebug (bool debug)
 Sets debug printout flag. More...
 
void setEdmParameters (const MagneticField *magField, edm::ESHandle< GlobalTrackingGeometry > globTkGeomHandle, const TrackerTopology *tkerTopo, const TrackerGeometry *tkerGeom)
 Sets parameters for track extrapolation and hits study. More...
 
void setInput (const edm::Handle< reco::PFDisplacedVertexCandidateCollection > &)
 Set input collections of tracks. More...
 
void setParameters (double transvSize, double longSize, double primaryVertexCut, double tobCut, double tecCut, double minAdaptWeight, bool switchOff2TrackVertex)
 -----— Set different algo parameters -----— /// More...
 
void setPrimaryVertex (edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
 
void setTracksSelector (const edm::ParameterSet &ps)
 
void setVertexIdentifier (const edm::ParameterSet &ps)
 
std::unique_ptr< reco::PFDisplacedVertexCollectiontransferDisplacedVertices ()
 
 ~PFDisplacedVertexFinder ()
 

Private Member Functions

unsigned commonTracks (const reco::PFDisplacedVertex &, const reco::PFDisplacedVertex &) const
 
void findSeedsFromCandidate (const reco::PFDisplacedVertexCandidate &, reco::PFDisplacedVertexSeedCollection &)
 -----— Different steps of the finder algorithm -----— /// More...
 
bool fitVertexFromSeed (const reco::PFDisplacedVertexSeed &, reco::PFDisplacedVertex &)
 Fit one by one the vertex points with associated tracks to get displaced vertices. More...
 
std::pair< float, float > getTransvLongDiff (const GlobalPoint &, const GlobalPoint &) const
 
reco::PFDisplacedVertex::VertexTrackType getVertexTrackType (PFTrackHitFullInfo &) const
 
bool isCloseTo (const reco::PFDisplacedVertexSeed &, const reco::PFDisplacedVertexSeed &) const
 -----— Tools -----— /// More...
 
void mergeSeeds (reco::PFDisplacedVertexSeedCollection &, std::vector< bool > &bLocked)
 Sometimes two vertex candidates can be quite close and coming from the same vertex. More...
 
bool rejectAndLabelVertex (reco::PFDisplacedVertex &dv)
 
void selectAndLabelVertices (reco::PFDisplacedVertexCollection &, std::vector< bool > &)
 Remove potentially fakes displaced vertices. More...
 

Private Attributes

bool debug_
 If true, debug printouts activated. More...
 
reco::PFDisplacedVertexCandidateCollection const * displacedVertexCandidates_
 -----— Members -----— /// More...
 
std::unique_ptr< reco::PFDisplacedVertexCollectiondisplacedVertices_
 
edm::ESHandle< GlobalTrackingGeometryglobTkGeomHandle_
 Tracker geometry for discerning hit positions. More...
 
PFDisplacedVertexHelper helper_
 
PFCheckHitPattern hitPattern_
 
float longSize_
 
const MagneticFieldmagField_
 to be able to extrapolate tracks f More...
 
double minAdaptWeight_
 
double primaryVertexCut_
 
double ratio_
 
double sigmacut_
 Adaptive Vertex Fitter parameters. More...
 
bool switchOff2TrackVertex_
 
double t_ini_
 
double tecCut_
 
const TrackerGeometrytkerGeom_
 
const TrackerTopologytkerTopo_
 doc? More...
 
double tobCut_
 
float transvSize_
 -----— Parameters -----— /// More...
 

Friends

std::ostream & operator<< (std::ostream &, const PFDisplacedVertexFinder &)
 

Detailed Description

Definition at line 31 of file PFDisplacedVertexFinder.h.

Member Typedef Documentation

◆ IDV

typedef reco::PFDisplacedVertexCollection::iterator PFDisplacedVertexFinder::IDV

Definition at line 40 of file PFDisplacedVertexFinder.h.

◆ IDVS

typedef reco::PFDisplacedVertexSeedCollection::iterator PFDisplacedVertexFinder::IDVS

-----— Useful Types -----— ///

Definition at line 39 of file PFDisplacedVertexFinder.h.

◆ PFTrackHitFullInfo

Definition at line 43 of file PFDisplacedVertexFinder.h.

◆ PFTrackHitInfo

typedef std::pair<unsigned int, unsigned int> PFDisplacedVertexFinder::PFTrackHitInfo

Definition at line 42 of file PFDisplacedVertexFinder.h.

Member Enumeration Documentation

◆ FitterType

Fitter Type.

Enumerator
F_NOTDEFINED 
F_DONOTREFIT 
F_KALMAN 
F_ADAPTIVE 

Definition at line 46 of file PFDisplacedVertexFinder.h.

Constructor & Destructor Documentation

◆ PFDisplacedVertexFinder()

PFDisplacedVertexFinder::PFDisplacedVertexFinder ( )

Definition at line 28 of file PFDisplacedVertexFinder.cc.

29  : displacedVertexCandidates_(nullptr),
31  transvSize_(0.0),
32  longSize_(0.0),
33  primaryVertexCut_(0.0),
34  tobCut_(0.0),
35  tecCut_(0.0),
36  minAdaptWeight_(2.0),
37  debug_(false) {}

◆ ~PFDisplacedVertexFinder()

PFDisplacedVertexFinder::~PFDisplacedVertexFinder ( )

Definition at line 39 of file PFDisplacedVertexFinder.cc.

39 {}

Member Function Documentation

◆ commonTracks()

unsigned PFDisplacedVertexFinder::commonTracks ( const reco::PFDisplacedVertex v1,
const reco::PFDisplacedVertex v2 
) const
private

Definition at line 659 of file PFDisplacedVertexFinder.cc.

659  {
660  vector<Track> vt1 = v1.refittedTracks();
661  vector<Track> vt2 = v2.refittedTracks();
662 
663  unsigned commonTracks = 0;
664 
665  for (unsigned il1 = 0; il1 < vt1.size(); il1++) {
666  unsigned il1_idx = v1.originalTrack(vt1[il1]).key();
667 
668  for (unsigned il2 = 0; il2 < vt2.size(); il2++)
669  if (il1_idx == v2.originalTrack(vt2[il2]).key()) {
670  commonTracks++;
671  break;
672  }
673  }
674 
675  return commonTracks;
676 }

References edm::RefToBase< T >::key(), reco::Vertex::originalTrack(), and reco::Vertex::refittedTracks().

Referenced by selectAndLabelVertices().

◆ displacedVertices()

const std::unique_ptr<reco::PFDisplacedVertexCollection>& PFDisplacedVertexFinder::displacedVertices ( ) const
inline

Definition at line 104 of file PFDisplacedVertexFinder.h.

104  {
106  }

References displacedVertices_, and eostools::move().

◆ findDisplacedVertices()

void PFDisplacedVertexFinder::findDisplacedVertices ( )

-----— Main function which find vertices -----— ///

Definition at line 52 of file PFDisplacedVertexFinder.cc.

52  {
53  if (debug_)
54  cout << "========= Start Find Displaced Vertices =========" << endl;
55 
56  // The vertexCandidates have not been passed to the event
57  // So they need to be cleared is they are not empty
58  if (displacedVertices_.get())
59  displacedVertices_->clear();
60  else
62 
63  if (displacedVertexCandidates_ == nullptr) {
64  edm::LogInfo("EmptyVertexInput")
65  << "displacedVertexCandidates are not set or the setInput was called with invalid vertex";
66  return;
67  }
68 
69  // Prepare the collections
70  PFDisplacedVertexSeedCollection tempDisplacedVertexSeeds;
71  tempDisplacedVertexSeeds.reserve(4 * displacedVertexCandidates_->size());
72  PFDisplacedVertexCollection tempDisplacedVertices;
73  tempDisplacedVertices.reserve(4 * displacedVertexCandidates_->size());
74 
75  if (debug_)
76  cout << "1) Parsing displacedVertexCandidates into displacedVertexSeeds" << endl;
77 
78  // 1) Parsing displacedVertexCandidates into displacedVertexSeeds which would
79  // be later used for vertex fitting
80 
81  int i = -1;
82 
83  for (auto const& idvc : *displacedVertexCandidates_) {
84  i++;
85  if (debug_) {
86  cout << "Analyse Vertex Candidate " << i << endl;
87  }
88 
89  findSeedsFromCandidate(idvc, tempDisplacedVertexSeeds);
90  }
91 
92  if (debug_)
93  cout << "2) Merging Vertex Seeds" << endl;
94 
95  // 2) Some displacedVertexSeeds coming from different displacedVertexCandidates
96  // may be closed enough to be merged together. bLocked is an array which keeps the
97  // information about the seeds which are desabled.
98  vector<bool> bLockedSeeds;
99  bLockedSeeds.resize(tempDisplacedVertexSeeds.size());
100  mergeSeeds(tempDisplacedVertexSeeds, bLockedSeeds);
101 
102  if (debug_)
103  cout << "3) Fitting Vertices From Seeds" << endl;
104 
105  // 3) Fit displacedVertices from displacedVertexSeeds
106  for (unsigned idv = 0; idv < tempDisplacedVertexSeeds.size(); idv++) {
107  if (!tempDisplacedVertexSeeds[idv].isEmpty() && !bLockedSeeds[idv]) {
108  PFDisplacedVertex displacedVertex;
109  bLockedSeeds[idv] = fitVertexFromSeed(tempDisplacedVertexSeeds[idv], displacedVertex);
110  if (!bLockedSeeds[idv])
111  tempDisplacedVertices.emplace_back(displacedVertex);
112  }
113  }
114 
115  if (debug_)
116  cout << "4) Rejecting Bad Vertices and label them" << endl;
117 
118  // 4) Reject displaced vertices which may be considered as fakes
119  vector<bool> bLocked;
120  bLocked.resize(tempDisplacedVertices.size());
121  selectAndLabelVertices(tempDisplacedVertices, bLocked);
122 
123  if (debug_)
124  cout << "5) Fill the Displaced Vertices" << endl;
125 
126  // 5) Fill the displacedVertex_ which would be transfered to the producer
127  displacedVertices_->reserve(tempDisplacedVertices.size());
128 
129  for (unsigned idv = 0; idv < tempDisplacedVertices.size(); idv++)
130  if (!bLocked[idv])
131  displacedVertices_->push_back(tempDisplacedVertices[idv]);
132 
133  if (debug_)
134  cout << "========= End Find Displaced Vertices =========" << endl;
135 }

References gather_cfg::cout, debug_, displacedVertexCandidates_, displacedVertices_, findSeedsFromCandidate(), fitVertexFromSeed(), mps_fire::i, mergeSeeds(), and selectAndLabelVertices().

◆ findSeedsFromCandidate()

void PFDisplacedVertexFinder::findSeedsFromCandidate ( const reco::PFDisplacedVertexCandidate vertexCandidate,
reco::PFDisplacedVertexSeedCollection tempDisplacedVertexSeeds 
)
private

-----— Different steps of the finder algorithm -----— ///

Analyse a vertex candidate and select potential vertex point(s)

Definition at line 139 of file PFDisplacedVertexFinder.cc.

140  {
141  const PFDisplacedVertexCandidate::DistMap r2Map = vertexCandidate.r2Map();
142  bool bNeedNewCandidate = false;
143 
144  tempDisplacedVertexSeeds.push_back(PFDisplacedVertexSeed());
145 
146  IDVS idvc_current;
147 
148  for (PFDisplacedVertexCandidate::DistMap::const_iterator imap = r2Map.begin(); imap != r2Map.end(); imap++) {
149  unsigned ie1 = (*imap).second.first;
150  unsigned ie2 = (*imap).second.second;
151 
152  if (debug_)
153  cout << "ie1 = " << ie1 << " ie2 = " << ie2 << " radius = " << sqrt((*imap).first) << endl;
154 
155  GlobalPoint dcaPoint = vertexCandidate.dcaPoint(ie1, ie2);
156  if (fabs(dcaPoint.x()) > 1e9)
157  continue;
158 
159  bNeedNewCandidate = true;
160  for (idvc_current = tempDisplacedVertexSeeds.begin(); idvc_current != tempDisplacedVertexSeeds.end();
161  idvc_current++) {
162  if ((*idvc_current).isEmpty()) {
163  bNeedNewCandidate = false;
164  break;
165  }
166  const GlobalPoint vertexPoint = (*idvc_current).seedPoint();
167  std::pair<float, float> diffs = getTransvLongDiff(vertexPoint, dcaPoint);
168  if (diffs.second > longSize_)
169  continue;
170  if (diffs.first > transvSize_)
171  continue;
172  bNeedNewCandidate = false;
173  break;
174  }
175  if (bNeedNewCandidate) {
176  if (debug_)
177  cout << "create new displaced vertex" << endl;
178  tempDisplacedVertexSeeds.push_back(PFDisplacedVertexSeed());
179  idvc_current = tempDisplacedVertexSeeds.end();
180  idvc_current--;
181  }
182 
183  (*idvc_current).updateSeedPoint(dcaPoint, vertexCandidate.tref(ie1), vertexCandidate.tref(ie2));
184  }
185 }

References gather_cfg::cout, reco::PFDisplacedVertexCandidate::dcaPoint(), debug_, getTransvLongDiff(), longSize_, reco::PFDisplacedVertexCandidate::r2Map(), mathSSE::sqrt(), transvSize_, reco::PFDisplacedVertexCandidate::tref(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by findDisplacedVertices().

◆ fitVertexFromSeed()

bool PFDisplacedVertexFinder::fitVertexFromSeed ( const reco::PFDisplacedVertexSeed displacedVertexSeed,
reco::PFDisplacedVertex displacedVertex 
)
private

Fit one by one the vertex points with associated tracks to get displaced vertices.

This prefit procedure allow to reduce the Warning rate from Adaptive Vertex fitter It reject also many fake tracks

Definition at line 207 of file PFDisplacedVertexFinder.cc.

208  {
209  if (debug_)
210  cout << "== Start vertexing procedure ==" << endl;
211 
212  // ---- Prepare transient track list ----
213 
214  auto const& tracksToFit = displacedVertexSeed.elements();
215  const GlobalPoint& seedPoint = displacedVertexSeed.seedPoint();
216 
217  vector<TransientTrack> transTracks;
218  vector<TransientTrack> transTracksRaw;
219  vector<TrackBaseRef> transTracksRef;
220 
221  transTracks.reserve(tracksToFit.size());
222  transTracksRaw.reserve(tracksToFit.size());
223  transTracksRef.reserve(tracksToFit.size());
224 
225  TransientVertex theVertexAdaptiveRaw;
226  TransientVertex theRecoVertex;
227 
228  // ---- 1) Clean for potentially poor seeds ------- //
229  // --------------------------------------------- //
230 
231  if (tracksToFit.size() < 2) {
232  if (debug_)
233  cout << "Only one to Fit Track" << endl;
234  return true;
235  }
236 
237  double rho = sqrt(seedPoint.x() * seedPoint.x() + seedPoint.y() * seedPoint.y());
238  double z = seedPoint.z();
239 
240  if (rho > tobCut_ || fabs(z) > tecCut_) {
241  if (debug_)
242  cout << "Seed Point out of the tracker rho = " << rho << " z = " << z << " nTracks = " << tracksToFit.size()
243  << endl;
244  return true;
245  }
246 
247  if (debug_)
248  displacedVertexSeed.Dump();
249 
250  int nStep45 = 0;
251  int nNotIterative = 0;
252 
253  // Fill vectors of TransientTracks and TrackRefs after applying preselection cuts.
254  for (auto const& ie : tracksToFit) {
255  TransientTrack tmpTk(*(ie.get()), magField_, globTkGeomHandle_);
256  transTracksRaw.emplace_back(tmpTk);
257  bool nonIt = PFTrackAlgoTools::nonIterative((ie)->algo());
258  bool step45 = PFTrackAlgoTools::step45((ie)->algo());
259  bool highQ = PFTrackAlgoTools::highQuality((ie)->algo());
260  if (step45)
261  nStep45++;
262  else if (nonIt)
263  nNotIterative++;
264  else if (!highQ) {
265  nNotIterative++;
266  nStep45++;
267  }
268  }
269 
270  if (rho > 25 && nStep45 + nNotIterative < 1) {
271  if (debug_)
272  cout << "Seed point at rho > 25 cm but no step 4-5 tracks" << endl;
273  return true;
274  }
275 
276  // ----------------------------------------------- //
277  // ---- PRESELECT GOOD TRACKS FOR FINAL VERTEX --- //
278  // ----------------------------------------------- //
279 
280  // 1)If only two track are found do not prefit
281 
282  if (transTracksRaw.size() == 2) {
283  if (debug_)
284  cout << "No raw fit done" << endl;
286  if (debug_)
287  cout << "Due to probably high pile-up conditions 2 track vertices switched off" << endl;
288  return true;
289  }
290  GlobalError globalError;
291 
292  theVertexAdaptiveRaw = TransientVertex(seedPoint, globalError, transTracksRaw, 1.);
293 
294  } else { //branch with transTracksRaw.size of at least 3
295 
296  if (debug_)
297  cout << "Raw fit done." << endl;
298 
304 
305  if (transTracksRaw.size() == 3) {
306  theVertexAdaptiveRaw = theAdaptiveFitterRaw.vertex(transTracksRaw, seedPoint);
307 
308  } else if (transTracksRaw.size() < 1000) {
311 
312  if (debug_)
313  cout << "First test with KFT" << endl;
314 
315  KalmanVertexFitter theKalmanFitter(true);
316  theVertexAdaptiveRaw = theKalmanFitter.vertex(transTracksRaw, seedPoint);
317 
318  if (!theVertexAdaptiveRaw.isValid() || theVertexAdaptiveRaw.totalChiSquared() < 0.) {
319  if (debug_)
320  cout << "Prefit failed : valid? " << theVertexAdaptiveRaw.isValid()
321  << " totalChi2 = " << theVertexAdaptiveRaw.totalChiSquared() << endl;
322  return true;
323  }
324 
325  if (debug_)
326  cout << "We use KFT instead of seed point to set up a point for AVF "
327  << " x = " << theVertexAdaptiveRaw.position().x() << " y = " << theVertexAdaptiveRaw.position().y()
328  << " z = " << theVertexAdaptiveRaw.position().z() << endl;
329 
330  // To save time: reject the Displaced vertex if it is too close to the beam pipe.
331  // Frequently it is very big vertices, with some dosens of tracks
332 
333  Vertex vtx = theVertexAdaptiveRaw;
334  rho = vtx.position().rho();
335 
336  // cout << "primary vertex cut = " << primaryVertexCut_ << endl;
337 
338  if (rho < primaryVertexCut_ || rho > 100) {
339  if (debug_)
340  cout << "KFT Vertex geometrically rejected with tracks #rho = " << rho << endl;
341  return true;
342  }
343 
344  // cout << "primary vertex cut = " << primaryVertexCut_ << " rho = " << rho << endl;
345 
346  theVertexAdaptiveRaw = theAdaptiveFitterRaw.vertex(transTracksRaw, theVertexAdaptiveRaw.position());
347 
348  } else {
349  edm::LogWarning("TooManyPFDVCandidates") << "gave up vertex reco for " << transTracksRaw.size() << " tracks";
350  }
351 
352  if (!theVertexAdaptiveRaw.isValid() || theVertexAdaptiveRaw.totalChiSquared() < 0.) {
353  if (debug_)
354  cout << "Fit failed : valid? " << theVertexAdaptiveRaw.isValid()
355  << " totalChi2 = " << theVertexAdaptiveRaw.totalChiSquared() << endl;
356  return true;
357  }
358 
359  // To save time: reject the Displaced vertex if it is too close to the beam pipe.
360  // Frequently it is very big vertices, with some dosens of tracks
361 
362  Vertex vtx = theVertexAdaptiveRaw;
363  rho = vtx.position().rho();
364 
365  if (rho < primaryVertexCut_) {
366  if (debug_)
367  cout << "Vertex "
368  << " geometrically rejected with " << transTracksRaw.size() << " tracks #rho = " << rho << endl;
369  return true;
370  }
371  }
372 
373  // ---- Remove tracks with small weight or
374  // big first (last) hit_to_vertex distance
375  // and then refit ---- //
376 
377  for (unsigned i = 0; i < transTracksRaw.size(); i++) {
378  if (debug_)
379  cout << "Raw Weight track " << i << " = " << theVertexAdaptiveRaw.trackWeight(transTracksRaw[i]) << endl;
380 
381  if (theVertexAdaptiveRaw.trackWeight(transTracksRaw[i]) > minAdaptWeight_) {
382  PFTrackHitFullInfo pattern = hitPattern_.analyze(tkerTopo_, tkerGeom_, tracksToFit[i], theVertexAdaptiveRaw);
383 
385 
386  if (vertexTrackType != PFDisplacedVertex::T_NOT_FROM_VERTEX) {
387  bool bGoodTrack = helper_.isTrackSelected(transTracksRaw[i].track(), vertexTrackType);
388 
389  if (bGoodTrack) {
390  transTracks.push_back(transTracksRaw[i]);
391  transTracksRef.push_back(tracksToFit[i]);
392  } else {
393  if (debug_)
394  cout << "Track rejected nChi2 = " << transTracksRaw[i].track().normalizedChi2()
395  << " pt = " << transTracksRaw[i].track().pt()
396  << " dxy (wrt (0,0,0)) = " << transTracksRaw[i].track().dxy()
397  << " nHits = " << transTracksRaw[i].track().numberOfValidHits() << " nOuterHits = "
398  << transTracksRaw[i].track().hitPattern().numberOfLostHits(HitPattern::MISSING_OUTER_HITS) << endl;
399  }
400  } else {
401  if (debug_) {
402  cout << "Remove track because too far away from the vertex:" << endl;
403  }
404  }
405  }
406  }
407 
408  if (debug_)
409  cout << "All Tracks " << transTracksRaw.size() << " with good weight " << transTracks.size() << endl;
410 
411  // ---- Refit ---- //
412  FitterType vtxFitter = F_NOTDEFINED;
413 
414  if (transTracks.size() < 2)
415  return true;
416  else if (transTracks.size() == 2) {
418  if (debug_)
419  cout << "Due to probably high pile-up conditions 2 track vertices switched off" << endl;
420  return true;
421  }
422  vtxFitter = F_KALMAN;
423  } else if (transTracks.size() > 2 && transTracksRaw.size() > transTracks.size())
424  vtxFitter = F_ADAPTIVE;
425  else if (transTracks.size() > 2 && transTracksRaw.size() == transTracks.size())
426  vtxFitter = F_DONOTREFIT;
427  else
428  return true;
429 
430  if (debug_)
431  cout << "Vertex Fitter " << vtxFitter << endl;
432 
433  if (vtxFitter == F_KALMAN) {
434  KalmanVertexFitter theKalmanFitter(true);
435  theRecoVertex = theKalmanFitter.vertex(transTracks, seedPoint);
436 
437  } else if (vtxFitter == F_ADAPTIVE) {
443 
444  theRecoVertex = theAdaptiveFitter.vertex(transTracks, seedPoint);
445 
446  } else if (vtxFitter == F_DONOTREFIT) {
447  theRecoVertex = theVertexAdaptiveRaw;
448  } else {
449  return true;
450  }
451 
452  // ---- Check if the fitted vertex is valid ---- //
453 
454  if (!theRecoVertex.isValid() || theRecoVertex.totalChiSquared() < 0.) {
455  if (debug_)
456  cout << "Refit failed : valid? " << theRecoVertex.isValid() << " totalChi2 = " << theRecoVertex.totalChiSquared()
457  << endl;
458  return true;
459  }
460 
461  // ---- Create vertex ---- //
462 
463  Vertex theRecoVtx = theRecoVertex;
464 
465  double chi2 = theRecoVtx.chi2();
466  double ndf = theRecoVtx.ndof();
467 
468  if (chi2 > TMath::ChisquareQuantile(0.95, ndf)) {
469  if (debug_)
470  cout << "Rejected because of chi2 = " << chi2 << " ndf = " << ndf
471  << " confid. level: " << TMath::ChisquareQuantile(0.95, ndf) << endl;
472  return true;
473  }
474 
475  // ---- Create and fill vector of refitted TransientTracks ---- //
476 
477  // -----------------------------------------------//
478  // ---- Prepare and Fill the Displaced Vertex ----//
479  // -----------------------------------------------//
480 
481  displacedVertex = theRecoVtx;
482  displacedVertex.removeTracks();
483 
484  for (unsigned i = 0; i < transTracks.size(); i++) {
485  PFTrackHitFullInfo pattern = hitPattern_.analyze(tkerTopo_, tkerGeom_, transTracksRef[i], theRecoVertex);
486 
488 
489  Track refittedTrack;
490  float weight = theRecoVertex.trackWeight(transTracks[i]);
491 
492  if (weight < minAdaptWeight_)
493  continue;
494 
495  try {
496  refittedTrack = theRecoVertex.refittedTrack(transTracks[i]).track();
497  } catch (cms::Exception& exception) {
498  continue;
499  }
500 
501  if (debug_) {
502  cout << "Vertex Track Type = " << vertexTrackType << endl;
503 
504  cout << "nHitBeforeVertex = " << pattern.first.first << " nHitAfterVertex = " << pattern.second.first
505  << " nMissHitBeforeVertex = " << pattern.first.second << " nMissHitAfterVertex = " << pattern.second.second
506  << " Weight = " << weight << endl;
507  }
508 
509  displacedVertex.addElement(transTracksRef[i], refittedTrack, pattern, vertexTrackType, weight);
510  }
511 
512  displacedVertex.setPrimaryDirection(helper_.primaryVertex());
513  displacedVertex.calcKinematics();
514 
515  if (debug_)
516  cout << "== End vertexing procedure ==" << endl;
517 
518  return false;
519 }

References reco::PFDisplacedVertex::addElement(), PFCheckHitPattern::analyze(), reco::PFDisplacedVertex::calcKinematics(), hltPixelTracks_cff::chi2, reco::Vertex::chi2(), gather_cfg::cout, debug_, reco::PFDisplacedVertexSeed::Dump(), reco::PFDisplacedVertexSeed::elements(), cppFunctionSkipper::exception, F_ADAPTIVE, F_DONOTREFIT, F_KALMAN, F_NOTDEFINED, getVertexTrackType(), globTkGeomHandle_, helper_, PFTrackAlgoTools::highQuality(), hitPattern_, mps_fire::i, PFDisplacedVertexHelper::isTrackSelected(), TransientVertex::isValid(), magField_, minAdaptWeight_, reco::Vertex::ndof(), PFTrackAlgoTools::nonIterative(), topSingleLeptonDQM_PU_cfi::pattern, TransientVertex::position(), PFDisplacedVertexHelper::primaryVertex(), primaryVertexCut_, ratio_, TransientVertex::refittedTrack(), reco::Vertex::removeTracks(), rho, reco::PFDisplacedVertexSeed::seedPoint(), reco::PFDisplacedVertex::setPrimaryDirection(), sigmacut_, mathSSE::sqrt(), PFTrackAlgoTools::step45(), switchOff2TrackVertex_, t_ini_, tecCut_, tkerGeom_, tkerTopo_, tobCut_, reco::TransientTrack::track(), HLT_2018_cff::track, TransientVertex::trackWeight(), KalmanVertexFitter::vertex(), AdaptiveVertexFitter::vertex(), badGlobalMuonTaggersAOD_cff::vtx, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by findDisplacedVertices().

◆ getTransvLongDiff()

std::pair< float, float > PFDisplacedVertexFinder::getTransvLongDiff ( const GlobalPoint Ref,
const GlobalPoint ToProject 
) const
private

Definition at line 628 of file PFDisplacedVertexFinder.cc.

629  {
630  const auto& vRef = Ref.basicVector();
631  const auto& vToProject = ToProject.basicVector();
632  float vRefMag2 = vRef.mag2();
633  float oneOverMag = 1.0f / sqrt(vRefMag2);
634 
635  return std::make_pair(fabs(vRef.cross(vToProject).mag() * oneOverMag),
636  fabs((vRef.dot(vToProject) - vRefMag2) * oneOverMag));
637 }

References PV3DBase< T, PVType, FrameType >::basicVector(), Basic3DVector< T >::mag2(), and mathSSE::sqrt().

Referenced by findSeedsFromCandidate(), and isCloseTo().

◆ getVertexTrackType()

reco::PFDisplacedVertex::VertexTrackType PFDisplacedVertexFinder::getVertexTrackType ( PFTrackHitFullInfo pairTrackHitInfo) const
private

Definition at line 639 of file PFDisplacedVertexFinder.cc.

640  {
641  unsigned int nHitBeforeVertex = pairTrackHitInfo.first.first;
642  unsigned int nHitAfterVertex = pairTrackHitInfo.second.first;
643 
644  unsigned int nMissHitBeforeVertex = pairTrackHitInfo.first.second;
645  unsigned int nMissHitAfterVertex = pairTrackHitInfo.second.second;
646 
647  // For the moment those definitions are given apriori a more general study would be useful to refine those criteria
648 
649  if (nHitBeforeVertex <= 1 && nHitAfterVertex >= 3 && nMissHitAfterVertex <= 1)
650  return PFDisplacedVertex::T_FROM_VERTEX;
651  else if (nHitBeforeVertex >= 3 && nHitAfterVertex <= 1 && nMissHitBeforeVertex <= 1)
652  return PFDisplacedVertex::T_TO_VERTEX;
653  else if ((nHitBeforeVertex >= 2 && nHitAfterVertex >= 3) || (nHitBeforeVertex >= 3 && nHitAfterVertex >= 2))
654  return PFDisplacedVertex::T_MERGED;
655  else
656  return PFDisplacedVertex::T_NOT_FROM_VERTEX;
657 }

Referenced by fitVertexFromSeed().

◆ isCloseTo()

bool PFDisplacedVertexFinder::isCloseTo ( const reco::PFDisplacedVertexSeed dv1,
const reco::PFDisplacedVertexSeed dv2 
) const
private

-----— Tools -----— ///

Definition at line 614 of file PFDisplacedVertexFinder.cc.

614  {
615  const GlobalPoint& vP1 = dv1.seedPoint();
616  const GlobalPoint& vP2 = dv2.seedPoint();
617 
618  std::pair<float, float> diffs = getTransvLongDiff(vP1, vP2);
619  if (diffs.second > longSize_)
620  return false;
621  if (diffs.first > transvSize_)
622  return false;
623  // if (Delta_Long < longSize_ && Delta_Transv < transvSize_) isCloseTo = true;
624 
625  return true;
626 }

References getTransvLongDiff(), longSize_, reco::PFDisplacedVertexSeed::seedPoint(), and transvSize_.

Referenced by mergeSeeds().

◆ mergeSeeds()

void PFDisplacedVertexFinder::mergeSeeds ( reco::PFDisplacedVertexSeedCollection tempDisplacedVertexSeeds,
std::vector< bool > &  bLocked 
)
private

Sometimes two vertex candidates can be quite close and coming from the same vertex.

Definition at line 187 of file PFDisplacedVertexFinder.cc.

188  {
189  // loop over displaced vertex candidates
190  // and merge them if they are close to each other
191  for (unsigned idv_mother = 0; idv_mother < tempDisplacedVertexSeeds.size(); idv_mother++) {
192  if (!bLocked[idv_mother]) {
193  for (unsigned idv_daughter = idv_mother + 1; idv_daughter < tempDisplacedVertexSeeds.size(); idv_daughter++) {
194  if (!bLocked[idv_daughter]) {
195  if (isCloseTo(tempDisplacedVertexSeeds[idv_mother], tempDisplacedVertexSeeds[idv_daughter])) {
196  tempDisplacedVertexSeeds[idv_mother].mergeWith(tempDisplacedVertexSeeds[idv_daughter]);
197  bLocked[idv_daughter] = true;
198  if (debug_)
199  cout << "Seeds " << idv_mother << " and " << idv_daughter << " merged" << endl;
200  }
201  }
202  }
203  }
204  }
205 }

References gather_cfg::cout, debug_, and isCloseTo().

Referenced by findDisplacedVertices().

◆ rejectAndLabelVertex()

bool PFDisplacedVertexFinder::rejectAndLabelVertex ( reco::PFDisplacedVertex dv)
private

◆ selectAndLabelVertices()

void PFDisplacedVertexFinder::selectAndLabelVertices ( reco::PFDisplacedVertexCollection tempDisplacedVertices,
std::vector< bool > &  bLocked 
)
private

Remove potentially fakes displaced vertices.

Definition at line 521 of file PFDisplacedVertexFinder.cc.

522  {
523  if (debug_)
524  cout << " 4.1) Reject vertices " << endl;
525 
526  for (unsigned idv = 0; idv < tempDisplacedVertices.size(); idv++) {
527  // ---- We accept a vertex only if it is not in TOB in the barrel
528  // and not in TEC in the end caps
529  // and not too much before the first pixel layer ---- //
530 
531  const float rho = tempDisplacedVertices[idv].position().rho();
532  const float z = tempDisplacedVertices[idv].position().z();
533 
534  if (rho > tobCut_ || rho < primaryVertexCut_ || fabs(z) > tecCut_) {
535  if (debug_)
536  cout << "Vertex " << idv << " geometrically rejected #rho = " << rho << " z = " << z << endl;
537 
538  bLocked[idv] = true;
539 
540  continue;
541  }
542 
543  unsigned nPrimary = tempDisplacedVertices[idv].nPrimaryTracks();
544  unsigned nMerged = tempDisplacedVertices[idv].nMergedTracks();
545  unsigned nSecondary = tempDisplacedVertices[idv].nSecondaryTracks();
546 
547  if (nPrimary + nMerged > 1) {
548  bLocked[idv] = true;
549  if (debug_)
550  cout << "Vertex " << idv << " rejected because two primary or merged tracks" << endl;
551  }
552 
553  if (nPrimary + nMerged + nSecondary < 2) {
554  bLocked[idv] = true;
555  if (debug_)
556  cout << "Vertex " << idv << " rejected because only one track related to the vertex" << endl;
557  }
558  }
559 
560  if (debug_)
561  cout << " 4.2) Check for common vertices" << endl;
562 
563  // ---- Among the remaining vertex we shall remove one
564  // of those which have two common tracks ---- //
565 
566  for (unsigned idv_mother = 0; idv_mother < tempDisplacedVertices.size(); idv_mother++) {
567  for (unsigned idv_daughter = idv_mother + 1; idv_daughter < tempDisplacedVertices.size(); idv_daughter++) {
568  if (!bLocked[idv_daughter] && !bLocked[idv_mother]) {
569  const unsigned commonTrks =
570  commonTracks(tempDisplacedVertices[idv_daughter], tempDisplacedVertices[idv_mother]);
571 
572  if (commonTrks > 1) {
573  if (debug_)
574  cout << "Vertices " << idv_daughter << " and " << idv_mother << " has many common tracks" << endl;
575 
576  // We keep the vertex vertex which contains the most of the tracks
577 
578  const int mother_size = tempDisplacedVertices[idv_mother].nTracks();
579  const int daughter_size = tempDisplacedVertices[idv_daughter].nTracks();
580 
581  if (mother_size > daughter_size)
582  bLocked[idv_daughter] = true;
583  else if (mother_size < daughter_size)
584  bLocked[idv_mother] = true;
585  else {
586  // If they have the same size we keep the vertex with the best normalised chi2
587 
588  const float mother_normChi2 = tempDisplacedVertices[idv_mother].normalizedChi2();
589  const float daughter_normChi2 = tempDisplacedVertices[idv_daughter].normalizedChi2();
590  if (mother_normChi2 < daughter_normChi2)
591  bLocked[idv_daughter] = true;
592  else
593  bLocked[idv_mother] = true;
594  }
595  }
596  }
597  }
598  }
599 
600  for (unsigned idv = 0; idv < tempDisplacedVertices.size(); idv++)
601  if (!bLocked[idv])
602  bLocked[idv] = rejectAndLabelVertex(tempDisplacedVertices[idv]);
603 }

References commonTracks(), gather_cfg::cout, debug_, primaryVertexCut_, rejectAndLabelVertex(), rho, tecCut_, tobCut_, and z.

Referenced by findDisplacedVertices().

◆ setAVFParameters()

void PFDisplacedVertexFinder::setAVFParameters ( const edm::ParameterSet ps)
inline

Definition at line 90 of file PFDisplacedVertexFinder.h.

90  {
91  sigmacut_ = ps.getParameter<double>("sigmacut");
92  t_ini_ = ps.getParameter<double>("Tini");
93  ratio_ = ps.getParameter<double>("ratio");
94  }

References edm::ParameterSet::getParameter(), ratio_, sigmacut_, and t_ini_.

◆ setDebug()

void PFDisplacedVertexFinder::setDebug ( bool  debug)
inline

Sets debug printout flag.

Definition at line 68 of file PFDisplacedVertexFinder.h.

68 { debug_ = debug; }

References debug, and debug_.

◆ setEdmParameters()

void PFDisplacedVertexFinder::setEdmParameters ( const MagneticField magField,
edm::ESHandle< GlobalTrackingGeometry globTkGeomHandle,
const TrackerTopology tkerTopo,
const TrackerGeometry tkerGeom 
)
inline

Sets parameters for track extrapolation and hits study.

Definition at line 71 of file PFDisplacedVertexFinder.h.

74  {
75  magField_ = magField;
76  globTkGeomHandle_ = globTkGeomHandle;
77  tkerTopo_ = tkerTopo;
78  tkerGeom_ = tkerGeom;
79  }

References globTkGeomHandle_, magField_, tkerGeom_, and tkerTopo_.

◆ setInput()

void PFDisplacedVertexFinder::setInput ( const edm::Handle< reco::PFDisplacedVertexCandidateCollection > &  displacedVertexCandidates)

Set input collections of tracks.

Definition at line 41 of file PFDisplacedVertexFinder.cc.

42  {
43  if (displacedVertexCandidates.isValid()) {
44  displacedVertexCandidates_ = displacedVertexCandidates.product();
45  } else {
47  }
48 }

References displacedVertexCandidates_, edm::HandleBase::isValid(), and edm::Handle< T >::product().

◆ setParameters()

void PFDisplacedVertexFinder::setParameters ( double  transvSize,
double  longSize,
double  primaryVertexCut,
double  tobCut,
double  tecCut,
double  minAdaptWeight,
bool  switchOff2TrackVertex 
)
inline

◆ setPrimaryVertex()

void PFDisplacedVertexFinder::setPrimaryVertex ( edm::Handle< reco::VertexCollection mainVertexHandle,
edm::Handle< reco::BeamSpot beamSpotHandle 
)
inline

Definition at line 85 of file PFDisplacedVertexFinder.h.

86  {
87  helper_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
88  }

References helper_, and PFDisplacedVertexHelper::setPrimaryVertex().

◆ setTracksSelector()

void PFDisplacedVertexFinder::setTracksSelector ( const edm::ParameterSet ps)
inline

◆ setVertexIdentifier()

void PFDisplacedVertexFinder::setVertexIdentifier ( const edm::ParameterSet ps)
inline

◆ transferDisplacedVertices()

std::unique_ptr<reco::PFDisplacedVertexCollection> PFDisplacedVertexFinder::transferDisplacedVertices ( )
inline
Returns
unique_ptr to collection of DisplacedVertices

Definition at line 100 of file PFDisplacedVertexFinder.h.

100  {
102  }

References displacedVertices_, and eostools::move().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const PFDisplacedVertexFinder a 
)
friend

Definition at line 678 of file PFDisplacedVertexFinder.cc.

678  {
679  if (!out)
680  return out;
681  out << setprecision(3) << setw(5) << endl;
682  out << "" << endl;
683  out << " ====================================== " << endl;
684  out << " ====== Displaced Vertex Finder ======= " << endl;
685  out << " ====================================== " << endl;
686  out << " " << endl;
687 
688  a.helper_.Dump();
689  out << "" << endl
690  << " Adaptive Vertex Fitter parameters are :" << endl
691  << " sigmacut = " << a.sigmacut_ << " T_ini = " << a.t_ini_ << " ratio = " << a.ratio_ << endl
692  << endl;
693 
694  const std::unique_ptr<reco::PFDisplacedVertexCollection>& displacedVertices_ = std::move(a.displacedVertices());
695 
696  if (!displacedVertices_.get()) {
697  out << "displacedVertex already transfered" << endl;
698  } else {
699  out << "Number of displacedVertices found : " << displacedVertices_->size() << endl << endl;
700 
701  int i = -1;
702 
703  for (PFDisplacedVertexFinder::IDV idv = displacedVertices_->begin(); idv != displacedVertices_->end(); idv++) {
704  i++;
705  out << i << " ";
706  idv->Dump();
707  out << "" << endl;
708  }
709  }
710 
711  return out;
712 }

Member Data Documentation

◆ debug_

bool PFDisplacedVertexFinder::debug_
private

If true, debug printouts activated.

Definition at line 166 of file PFDisplacedVertexFinder.h.

Referenced by findDisplacedVertices(), findSeedsFromCandidate(), fitVertexFromSeed(), mergeSeeds(), selectAndLabelVertices(), and setDebug().

◆ displacedVertexCandidates_

reco::PFDisplacedVertexCandidateCollection const* PFDisplacedVertexFinder::displacedVertexCandidates_
private

-----— Members -----— ///

Definition at line 143 of file PFDisplacedVertexFinder.h.

Referenced by findDisplacedVertices(), and setInput().

◆ displacedVertices_

std::unique_ptr<reco::PFDisplacedVertexCollection> PFDisplacedVertexFinder::displacedVertices_
private

◆ globTkGeomHandle_

edm::ESHandle<GlobalTrackingGeometry> PFDisplacedVertexFinder::globTkGeomHandle_
private

Tracker geometry for discerning hit positions.

Definition at line 169 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

◆ helper_

PFDisplacedVertexHelper PFDisplacedVertexFinder::helper_
private

◆ hitPattern_

PFCheckHitPattern PFDisplacedVertexFinder::hitPattern_
private

Definition at line 178 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed().

◆ longSize_

float PFDisplacedVertexFinder::longSize_
private

Definition at line 151 of file PFDisplacedVertexFinder.h.

Referenced by findSeedsFromCandidate(), isCloseTo(), and setParameters().

◆ magField_

const MagneticField* PFDisplacedVertexFinder::magField_
private

to be able to extrapolate tracks f

Definition at line 176 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

◆ minAdaptWeight_

double PFDisplacedVertexFinder::minAdaptWeight_
private

Definition at line 155 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setParameters().

◆ primaryVertexCut_

double PFDisplacedVertexFinder::primaryVertexCut_
private

◆ ratio_

double PFDisplacedVertexFinder::ratio_
private

Definition at line 163 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setAVFParameters().

◆ sigmacut_

double PFDisplacedVertexFinder::sigmacut_
private

Adaptive Vertex Fitter parameters.

Definition at line 161 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setAVFParameters().

◆ switchOff2TrackVertex_

bool PFDisplacedVertexFinder::switchOff2TrackVertex_
private

Definition at line 157 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setParameters().

◆ t_ini_

double PFDisplacedVertexFinder::t_ini_
private

Definition at line 162 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setAVFParameters().

◆ tecCut_

double PFDisplacedVertexFinder::tecCut_
private

◆ tkerGeom_

const TrackerGeometry* PFDisplacedVertexFinder::tkerGeom_
private

Definition at line 173 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

◆ tkerTopo_

const TrackerTopology* PFDisplacedVertexFinder::tkerTopo_
private

doc?

Definition at line 172 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

◆ tobCut_

double PFDisplacedVertexFinder::tobCut_
private

◆ transvSize_

float PFDisplacedVertexFinder::transvSize_
private

-----— Parameters -----— ///

Algo parameters for the vertex finder

Definition at line 150 of file PFDisplacedVertexFinder.h.

Referenced by findSeedsFromCandidate(), isCloseTo(), and setParameters().

AdaptiveVertexFitter
Definition: AdaptiveVertexFitter.h:29
PFDisplacedVertexFinder::globTkGeomHandle_
edm::ESHandle< GlobalTrackingGeometry > globTkGeomHandle_
Tracker geometry for discerning hit positions.
Definition: PFDisplacedVertexFinder.h:169
PFTrackAlgoTools::nonIterative
bool nonIterative(const reco::TrackBase::TrackAlgorithm &)
Definition: PFTrackAlgoTools.cc:210
PFDisplacedVertexFinder::FitterType
FitterType
Fitter Type.
Definition: PFDisplacedVertexFinder.h:46
PFDisplacedVertexFinder::getTransvLongDiff
std::pair< float, float > getTransvLongDiff(const GlobalPoint &, const GlobalPoint &) const
Definition: PFDisplacedVertexFinder.cc:628
PFDisplacedVertexFinder::longSize_
float longSize_
Definition: PFDisplacedVertexFinder.h:151
reco::Vertex::originalTrack
TrackBaseRef originalTrack(const Track &refTrack) const
Definition: Vertex.cc:96
KalmanVertexUpdator< 5 >
mps_fire.i
i
Definition: mps_fire.py:355
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::PFDisplacedVertexSeed::seedPoint
const GlobalPoint & seedPoint() const
Definition: PFDisplacedVertexSeed.h:53
particleFlowDisplacedVertex_cfi.minAdaptWeight
minAdaptWeight
Definition: particleFlowDisplacedVertex_cfi.py:34
edm::RefToBase::key
size_t key() const
Definition: RefToBase.h:219
TransientVertex::isValid
bool isValid() const
Definition: TransientVertex.h:195
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
reco::PFDisplacedVertex::isFake
bool isFake() const
Definition: PFDisplacedVertex.h:204
TransientVertex::refittedTrack
reco::TransientTrack refittedTrack(const reco::TransientTrack &track) const
Definition: TransientVertex.cc:291
PFTrackAlgoTools::step45
bool step45(const reco::TrackBase::TrackAlgorithm &)
Definition: PFTrackAlgoTools.cc:221
PFDisplacedVertexFinder::getVertexTrackType
reco::PFDisplacedVertex::VertexTrackType getVertexTrackType(PFTrackHitFullInfo &) const
Definition: PFDisplacedVertexFinder.cc:639
PFDisplacedVertexFinder::helper_
PFDisplacedVertexHelper helper_
Definition: PFDisplacedVertexFinder.h:180
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
reco::PFDisplacedVertexSeed
Block of elements.
Definition: PFDisplacedVertexSeed.h:25
PFDisplacedVertexFinder::IDVS
reco::PFDisplacedVertexSeedCollection::iterator IDVS
-----— Useful Types -----— ///
Definition: PFDisplacedVertexFinder.h:39
reco::PFDisplacedVertexCandidate::tref
const TrackBaseRef & tref(unsigned ie) const
Definition: PFDisplacedVertexCandidate.h:92
PFDisplacedVertexHelper::setVertexIdentifier
void setVertexIdentifier(const edm::ParameterSet &ps)
Set Vertex identifier parameters.
Definition: PFDisplacedVertexHelper.h:26
particleFlowDisplacedVertex_cfi.transvSize
transvSize
Definition: particleFlowDisplacedVertex_cfi.py:14
particleFlowDisplacedVertex_cfi.tecCut
tecCut
Definition: particleFlowDisplacedVertex_cfi.py:29
TransientVertex::position
GlobalPoint position() const
Definition: TransientVertex.h:169
PFDisplacedVertexHelper::setTracksSelector
void setTracksSelector(const edm::ParameterSet &ps)
Set Tracks selector parameters.
Definition: PFDisplacedVertexHelper.h:23
PFDisplacedVertexHelper::setPrimaryVertex
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
Update the primary vertex information.
Definition: PFDisplacedVertexHelper.cc:23
reco::PFDisplacedVertexCandidate::dcaPoint
const GlobalPoint dcaPoint(unsigned ie1, unsigned ie2) const
Definition: PFDisplacedVertexCandidate.cc:126
PFDisplacedVertexFinder::tkerTopo_
const TrackerTopology * tkerTopo_
doc?
Definition: PFDisplacedVertexFinder.h:172
PFDisplacedVertexFinder::debug_
bool debug_
If true, debug printouts activated.
Definition: PFDisplacedVertexFinder.h:166
PFDisplacedVertexFinder::isCloseTo
bool isCloseTo(const reco::PFDisplacedVertexSeed &, const reco::PFDisplacedVertexSeed &) const
-----— Tools -----— ///
Definition: PFDisplacedVertexFinder.cc:614
PFTrackAlgoTools::highQuality
bool highQuality(const reco::TrackBase::TrackAlgorithm &)
Definition: PFTrackAlgoTools.cc:193
PFDisplacedVertexFinder::fitVertexFromSeed
bool fitVertexFromSeed(const reco::PFDisplacedVertexSeed &, reco::PFDisplacedVertex &)
Fit one by one the vertex points with associated tracks to get displaced vertices.
Definition: PFDisplacedVertexFinder.cc:207
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
PFDisplacedVertexFinder::rejectAndLabelVertex
bool rejectAndLabelVertex(reco::PFDisplacedVertex &dv)
Definition: PFDisplacedVertexFinder.cc:605
PFDisplacedVertexFinder::F_KALMAN
Definition: PFDisplacedVertexFinder.h:46
reco::PFDisplacedVertexSeed::Dump
void Dump(std::ostream &out=std::cout) const
cout function
Definition: PFDisplacedVertexSeed.cc:63
Basic3DVector::mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: extBasic3DVector.h:113
PFDisplacedVertexFinder::displacedVertices_
std::unique_ptr< reco::PFDisplacedVertexCollection > displacedVertices_
Definition: PFDisplacedVertexFinder.h:144
reco::PFDisplacedVertexCollection
std::vector< PFDisplacedVertex > PFDisplacedVertexCollection
collection of PFDisplacedVertex objects
Definition: PFDisplacedVertexFwd.h:10
PFDisplacedVertexFinder::primaryVertexCut_
double primaryVertexCut_
Definition: PFDisplacedVertexFinder.h:152
PFDisplacedVertexFinder::displacedVertexCandidates_
reco::PFDisplacedVertexCandidateCollection const * displacedVertexCandidates_
-----— Members -----— ///
Definition: PFDisplacedVertexFinder.h:143
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
reco::PFDisplacedVertexCandidate::DistMap
std::map< float, std::pair< int, int > > DistMap
Definition: PFDisplacedVertexCandidate.h:49
particleFlowDisplacedVertex_cfi.tobCut
tobCut
Definition: particleFlowDisplacedVertex_cfi.py:25
PFDisplacedVertexFinder::F_ADAPTIVE
Definition: PFDisplacedVertexFinder.h:46
cmsdt::algo
algo
Definition: constants.h:164
PFDisplacedVertexFinder::switchOff2TrackVertex_
bool switchOff2TrackVertex_
Definition: PFDisplacedVertexFinder.h:157
PFDisplacedVertexFinder::F_NOTDEFINED
Definition: PFDisplacedVertexFinder.h:46
debug
#define debug
Definition: HDRShower.cc:19
PFDisplacedVertexFinder::tobCut_
double tobCut_
Definition: PFDisplacedVertexFinder.h:153
PFDisplacedVertexFinder::PFTrackHitFullInfo
std::pair< PFTrackHitInfo, PFTrackHitInfo > PFTrackHitFullInfo
Definition: PFDisplacedVertexFinder.h:43
reco::PFDisplacedVertexSeedCollection
std::vector< PFDisplacedVertexSeed > PFDisplacedVertexSeedCollection
collection of PFDisplacedVertexSeed objects
Definition: PFDisplacedVertexSeedFwd.h:10
PFCheckHitPattern::analyze
PFTrackHitFullInfo analyze(const TrackerTopology *tkerTopo, const TrackerGeometry *tkerGeom, const reco::TrackBaseRef track, const TransientVertex &vert)
Definition: PFCheckHitPattern.cc:77
KalmanVertexTrackCompatibilityEstimator
Definition: KalmanVertexTrackCompatibilityEstimator.h:24
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::PFDisplacedVertexSeed::elements
const std::vector< TrackBaseRef > & elements() const
Definition: PFDisplacedVertexSeed.h:48
PFDisplacedVertexFinder::findSeedsFromCandidate
void findSeedsFromCandidate(const reco::PFDisplacedVertexCandidate &, reco::PFDisplacedVertexSeedCollection &)
-----— Different steps of the finder algorithm -----— ///
Definition: PFDisplacedVertexFinder.cc:139
DDAxes::z
reco::Track
Definition: Track.h:27
PFDisplacedVertexHelper::primaryVertex
math::XYZPoint primaryVertex() const
Set Vertex direction using the primary vertex.
Definition: PFDisplacedVertexHelper.h:39
PFDisplacedVertexFinder::magField_
const MagneticField * magField_
to be able to extrapolate tracks f
Definition: PFDisplacedVertexFinder.h:176
Point3DBase< float, GlobalTag >
reco::PFDisplacedVertexCandidate::r2Map
DistMap r2Map() const
-----— Provide useful information -----— ///
Definition: PFDisplacedVertexCandidate.cc:77
KalmanVertexSmoother
Definition: KalmanVertexSmoother.h:6
reco::Vertex::refittedTracks
const std::vector< Track > & refittedTracks() const
Returns the container of refitted tracks.
Definition: Vertex.h:183
reco::PFDisplacedVertex::setVertexType
void setVertexType(VertexType vertexType)
Set the type of this vertex.
Definition: PFDisplacedVertex.h:77
PFDisplacedVertexFinder::t_ini_
double t_ini_
Definition: PFDisplacedVertexFinder.h:162
DDAxes::rho
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
edm::LogWarning
Definition: MessageLogger.h:141
PFDisplacedVertexFinder::mergeSeeds
void mergeSeeds(reco::PFDisplacedVertexSeedCollection &, std::vector< bool > &bLocked)
Sometimes two vertex candidates can be quite close and coming from the same vertex.
Definition: PFDisplacedVertexFinder.cc:187
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
reco::PFDisplacedVertex
Block of elements.
Definition: PFDisplacedVertex.h:23
a
double a
Definition: hdecay.h:119
PFDisplacedVertexFinder::IDV
reco::PFDisplacedVertexCollection::iterator IDV
Definition: PFDisplacedVertexFinder.h:40
reco::PFDisplacedVertex::addElement
void addElement(const TrackBaseRef &r, const Track &refTrack, const PFTrackHitFullInfo &hitInfo, VertexTrackType trackType=T_NOT_FROM_VERTEX, float w=1.0)
Add a new track to the vertex.
Definition: PFDisplacedVertex.cc:12
PFDisplacedVertexFinder::ratio_
double ratio_
Definition: PFDisplacedVertexFinder.h:163
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GeometricAnnealing
Definition: GeometricAnnealing.h:7
particleFlowDisplacedVertex_cfi.longSize
longSize
Definition: particleFlowDisplacedVertex_cfi.py:17
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
PFDisplacedVertexFinder::commonTracks
unsigned commonTracks(const reco::PFDisplacedVertex &, const reco::PFDisplacedVertex &) const
Definition: PFDisplacedVertexFinder.cc:659
GlobalErrorBase< double, ErrorMatrixTag >
PFDisplacedVertexFinder::selectAndLabelVertices
void selectAndLabelVertices(reco::PFDisplacedVertexCollection &, std::vector< bool > &)
Remove potentially fakes displaced vertices.
Definition: PFDisplacedVertexFinder.cc:521
TransientVertex
Definition: TransientVertex.h:18
PFDisplacedVertexFinder::F_DONOTREFIT
Definition: PFDisplacedVertexFinder.h:46
DefaultLinearizationPointFinder
Definition: DefaultLinearizationPointFinder.h:13
reco::PFDisplacedVertex::VertexTrackType
VertexTrackType
Definition: PFDisplacedVertex.h:36
reco::Vertex::chi2
double chi2() const
chi-squares
Definition: Vertex.h:103
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
PFDisplacedVertexFinder::tkerGeom_
const TrackerGeometry * tkerGeom_
Definition: PFDisplacedVertexFinder.h:173
particleFlowDisplacedVertex_cfi.primaryVertexCut
primaryVertexCut
Definition: particleFlowDisplacedVertex_cfi.py:21
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::PFDisplacedVertex::calcKinematics
void calcKinematics()
Definition: PFDisplacedVertex.h:184
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::TransientTrack
Definition: TransientTrack.h:19
reco::TransientTrack::track
const Track & track() const
Definition: TransientTrack.h:117
reco::PFDisplacedVertex::VertexType
VertexType
Definition: PFDisplacedVertex.h:40
TransientVertex::trackWeight
float trackWeight(const reco::TransientTrack &track) const
Definition: TransientVertex.cc:241
PFDisplacedVertexFinder::transvSize_
float transvSize_
-----— Parameters -----— ///
Definition: PFDisplacedVertexFinder.h:150
reco::JetExtendedAssociation::Ref
edm::Ref< Container > Ref
Definition: JetExtendedAssociation.h:32
PFDisplacedVertexHelper::identifyVertex
reco::PFDisplacedVertex::VertexType identifyVertex(const reco::PFDisplacedVertex &v) const
Vertex identification tool.
Definition: PFDisplacedVertexHelper.cc:72
PFDisplacedVertexFinder::tecCut_
double tecCut_
Definition: PFDisplacedVertexFinder.h:154
PFDisplacedVertexFinder::sigmacut_
double sigmacut_
Adaptive Vertex Fitter parameters.
Definition: PFDisplacedVertexFinder.h:161
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
cms::Exception
Definition: Exception.h:70
reco::PFDisplacedVertex::setPrimaryDirection
void setPrimaryDirection(const math::XYZPoint &pvtx)
Definition: PFDisplacedVertex.cc:54
reco::Vertex::removeTracks
void removeTracks()
Definition: Vertex.cc:90
PFDisplacedVertexFinder::minAdaptWeight_
double minAdaptWeight_
Definition: PFDisplacedVertexFinder.h:155
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
reco::Vertex::ndof
double ndof() const
Definition: Vertex.h:110
PFDisplacedVertexFinder::hitPattern_
PFCheckHitPattern hitPattern_
Definition: PFDisplacedVertexFinder.h:178
particleFlowDisplacedVertex_cfi.switchOff2TrackVertex
switchOff2TrackVertex
Definition: particleFlowDisplacedVertex_cfi.py:38
weight
Definition: weight.py:1
reco::Vertex
Definition: Vertex.h:35
PFDisplacedVertexHelper::isTrackSelected
bool isTrackSelected(const reco::Track &trk, const reco::PFDisplacedVertex::VertexTrackType vertexTrackType) const
Select tracks tool.
Definition: PFDisplacedVertexHelper.cc:38
KalmanVertexFitter
Definition: KalmanVertexFitter.h:22