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 32 of file PFDisplacedVertexFinder.h.

Member Typedef Documentation

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

Definition at line 43 of file PFDisplacedVertexFinder.h.

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

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

Definition at line 42 of file PFDisplacedVertexFinder.h.

Definition at line 46 of file PFDisplacedVertexFinder.h.

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

Definition at line 45 of file PFDisplacedVertexFinder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

PFDisplacedVertexFinder::PFDisplacedVertexFinder ( )

Definition at line 28 of file PFDisplacedVertexFinder.cc.

28  :
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) {}
std::vector< PFDisplacedVertex > PFDisplacedVertexCollection
collection of PFDisplacedVertex objects
bool debug_
If true, debug printouts activated.
reco::PFDisplacedVertexCandidateCollection const * displacedVertexCandidates_
-----— Members -----— ///
std::unique_ptr< reco::PFDisplacedVertexCollection > displacedVertices_
float transvSize_
--—— Parameters --—— ///
PFDisplacedVertexFinder::~PFDisplacedVertexFinder ( )

Definition at line 40 of file PFDisplacedVertexFinder.cc.

40 {}

Member Function Documentation

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

Definition at line 739 of file PFDisplacedVertexFinder.cc.

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

Referenced by displacedVertices(), and selectAndLabelVertices().

739  {
740 
741  vector<Track> vt1 = v1.refittedTracks();
742  vector<Track> vt2 = v2.refittedTracks();
743 
744  unsigned commonTracks = 0;
745 
746  for ( unsigned il1 = 0; il1 < vt1.size(); il1++){
747  unsigned il1_idx = v1.originalTrack(vt1[il1]).key();
748 
749  for ( unsigned il2 = 0; il2 < vt2.size(); il2++)
750  if (il1_idx == v2.originalTrack(vt2[il2]).key()) {commonTracks++; break;}
751 
752  }
753 
754  return commonTracks;
755 
756 }
TrackBaseRef originalTrack(const Track &refTrack) const
Definition: Vertex.cc:108
const std::vector< Track > & refittedTracks() const
Returns the container of refitted tracks.
Definition: Vertex.h:164
unsigned commonTracks(const reco::PFDisplacedVertex &, const reco::PFDisplacedVertex &) const
size_t key() const
Definition: RefToBase.h:250
const std::unique_ptr< reco::PFDisplacedVertexCollection >& PFDisplacedVertexFinder::displacedVertices ( ) const
inline
void PFDisplacedVertexFinder::findDisplacedVertices ( )

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

Definition at line 58 of file PFDisplacedVertexFinder.cc.

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

Referenced by displacedVertices().

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

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 displacedVertices(), and findDisplacedVertices().

143  {
144 
145  const PFDisplacedVertexCandidate::DistMap r2Map = vertexCandidate.r2Map();
146  bool bNeedNewCandidate = false;
147 
148  tempDisplacedVertexSeeds.push_back( PFDisplacedVertexSeed() );
149 
150  IDVS idvc_current;
151 
152  for (PFDisplacedVertexCandidate::DistMap::const_iterator imap = r2Map.begin();
153  imap != r2Map.end(); imap++){
154 
155  unsigned ie1 = (*imap).second.first;
156  unsigned ie2 = (*imap).second.second;
157 
158  if (debug_) cout << "ie1 = " << ie1 << " ie2 = " << ie2 << " radius = " << sqrt((*imap).first) << endl;
159 
160  GlobalPoint dcaPoint = vertexCandidate.dcaPoint(ie1, ie2);
161  if (fabs(dcaPoint.x()) > 1e9) continue;
162 
163  bNeedNewCandidate = true;
164  for (idvc_current = tempDisplacedVertexSeeds.begin(); idvc_current != tempDisplacedVertexSeeds.end(); idvc_current++){
165  if ((*idvc_current).isEmpty()) {
166  bNeedNewCandidate = false;
167  break;
168  }
169  const GlobalPoint vertexPoint = (*idvc_current).seedPoint();
170  std::pair<float,float> diffs = getTransvLongDiff(vertexPoint,dcaPoint);
171  if (diffs.second > longSize_) continue;
172  if (diffs.first > transvSize_) continue;
173  bNeedNewCandidate = false;
174  break;
175  }
176  if (bNeedNewCandidate) {
177  if (debug_) cout << "create new displaced vertex" << endl;
178  tempDisplacedVertexSeeds.push_back( PFDisplacedVertexSeed() );
179  idvc_current = tempDisplacedVertexSeeds.end();
180  idvc_current--;
181  }
182 
183 
184 
185  (*idvc_current).updateSeedPoint(dcaPoint, vertexCandidate.tref(ie1), vertexCandidate.tref(ie2));
186 
187 
188 
189  }
190 
191 
192 }
reco::PFDisplacedVertexSeedCollection::iterator IDVS
-----— Useful Types -----— ///
std::map< float, std::pair< int, int > > DistMap
bool debug_
If true, debug printouts activated.
const TrackBaseRef & tref(unsigned ie) const
const GlobalPoint dcaPoint(unsigned ie1, unsigned ie2) const
T sqrt(T t)
Definition: SSEVec.h:18
DistMap r2Map() const
--—— Provide useful information --—— ///
std::pair< float, float > getTransvLongDiff(const GlobalPoint &, const GlobalPoint &) const
float transvSize_
--—— Parameters --—— ///
T x() const
Definition: PV3DBase.h:62
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 229 of file PFDisplacedVertexFinder.cc.

References reco::PFDisplacedVertex::addElement(), patPFMETCorrections_cff::algo, PFCheckHitPattern::analyze(), reco::PFDisplacedVertex::calcKinematics(), vertices_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(), listBenchmarks::pattern, reco::Vertex::position(), 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_, TransientVertex::totalChiSquared(), HiIsolationCommonParameters_cff::track, reco::TransientTrack::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 displacedVertices(), and findDisplacedVertices().

229  {
230 
231 
232  if (debug_) cout << "== Start vertexing procedure ==" << endl;
233 
234 
235  // ---- Prepare transient track list ----
236 
237  auto const& tracksToFit = displacedVertexSeed.elements();
238  const GlobalPoint& seedPoint = displacedVertexSeed.seedPoint();
239 
240  vector<TransientTrack> transTracks;
241  vector<TransientTrack> transTracksRaw;
242  vector<TrackBaseRef> transTracksRef;
243 
244  transTracks.reserve(tracksToFit.size());
245  transTracksRaw.reserve(tracksToFit.size());
246  transTracksRef.reserve(tracksToFit.size());
247 
248 
249 
250  TransientVertex theVertexAdaptiveRaw;
251  TransientVertex theRecoVertex;
252 
253 
254  // ---- 1) Clean for potentially poor seeds ------- //
255  // --------------------------------------------- //
256 
257  if (tracksToFit.size() < 2) {
258  if (debug_) cout << "Only one to Fit Track" << endl;
259  return true;
260  }
261 
262  double rho = sqrt(seedPoint.x()*seedPoint.x()+seedPoint.y()*seedPoint.y());
263  double z = seedPoint.z();
264 
265  if (rho > tobCut_ || fabs(z) > tecCut_) {
266  if (debug_) cout << "Seed Point out of the tracker rho = " << rho << " z = "<< z << " nTracks = " << tracksToFit.size() << endl;
267  return true;
268  }
269 
270  if (debug_) displacedVertexSeed.Dump();
271 
272  int nStep45 = 0;
273  int nNotIterative = 0;
274 
275  // Fill vectors of TransientTracks and TrackRefs after applying preselection cuts.
276  for(auto const& ie : tracksToFit){
277  TransientTrack tmpTk( *(ie.get()), magField_, globTkGeomHandle_);
278  transTracksRaw.emplace_back( tmpTk );
279  bool nonIt = PFTrackAlgoTools::nonIterative((ie)->algo());
280  bool step45 = PFTrackAlgoTools::step45((ie)->algo());
281  bool highQ = PFTrackAlgoTools::highQuality((ie)->algo());
282  if (step45)
283  nStep45++;
284  else if (nonIt)
285  nNotIterative++;
286  else if (!highQ) {
287  nNotIterative++;
288  nStep45++;
289  }
290 
291  }
292 
293  if (rho > 25 && nStep45 + nNotIterative < 1){
294  if (debug_) cout << "Seed point at rho > 25 cm but no step 4-5 tracks" << endl;
295  return true;
296  }
297 
298  // ----------------------------------------------- //
299  // ---- PRESELECT GOOD TRACKS FOR FINAL VERTEX --- //
300  // ----------------------------------------------- //
301 
302 
303 
304  // 1)If only two track are found do not prefit
305 
306 
307  if ( transTracksRaw.size() == 2 ){
308 
309  if (debug_) cout << "No raw fit done" << endl;
311  if (debug_)
312  cout << "Due to probably high pile-up conditions 2 track vertices switched off" << endl;
313  return true;
314 
315  }
316  GlobalError globalError;
317 
318  theVertexAdaptiveRaw = TransientVertex(seedPoint, globalError, transTracksRaw, 1.);
319 
320 
321 
322  } else {//branch with transTracksRaw.size of at least 3
323 
324 
325 
326  if (debug_) cout << "Raw fit done." << endl;
327 
333 
334  if (transTracksRaw.size() == 3){
335 
336  theVertexAdaptiveRaw = theAdaptiveFitterRaw.vertex(transTracksRaw, seedPoint);
337 
338  }
339  else if ( transTracksRaw.size() < 1000){
342 
343  if (debug_) cout << "First test with KFT" << endl;
344 
345  KalmanVertexFitter theKalmanFitter(true);
346  theVertexAdaptiveRaw = theKalmanFitter.vertex(transTracksRaw, seedPoint);
347 
348  if( !theVertexAdaptiveRaw.isValid() || theVertexAdaptiveRaw.totalChiSquared() < 0. ) {
349  if(debug_) cout << "Prefit failed : valid? " << theVertexAdaptiveRaw.isValid()
350  << " totalChi2 = " << theVertexAdaptiveRaw.totalChiSquared() << endl;
351  return true;
352  }
353 
354  if (debug_) cout << "We use KFT instead of seed point to set up a point for AVF "
355  << " x = " << theVertexAdaptiveRaw.position().x()
356  << " y = " << theVertexAdaptiveRaw.position().y()
357  << " z = " << theVertexAdaptiveRaw.position().z()
358  << endl;
359 
360  // To save time: reject the Displaced vertex if it is too close to the beam pipe.
361  // Frequently it is very big vertices, with some dosens of tracks
362 
363  Vertex vtx = theVertexAdaptiveRaw;
364  rho = vtx.position().rho();
365 
366  // cout << "primary vertex cut = " << primaryVertexCut_ << endl;
367 
368  if (rho < primaryVertexCut_ || rho > 100) {
369  if (debug_) cout << "KFT Vertex geometrically rejected with tracks #rho = " << rho << endl;
370  return true;
371  }
372 
373  // cout << "primary vertex cut = " << primaryVertexCut_ << " rho = " << rho << endl;
374 
375  theVertexAdaptiveRaw = theAdaptiveFitterRaw.vertex(transTracksRaw, theVertexAdaptiveRaw.position());
376 
377 
378  } else {
379  edm::LogWarning("TooManyPFDVCandidates")<<"gave up vertex reco for "<< transTracksRaw.size() <<" tracks";
380  }
381 
382  if( !theVertexAdaptiveRaw.isValid() || theVertexAdaptiveRaw.totalChiSquared() < 0. ) {
383  if(debug_) cout << "Fit failed : valid? " << theVertexAdaptiveRaw.isValid()
384  << " totalChi2 = " << theVertexAdaptiveRaw.totalChiSquared() << endl;
385  return true;
386  }
387 
388  // To save time: reject the Displaced vertex if it is too close to the beam pipe.
389  // Frequently it is very big vertices, with some dosens of tracks
390 
391  Vertex vtx = theVertexAdaptiveRaw;
392  rho = vtx.position().rho();
393 
394  if (rho < primaryVertexCut_) {
395  if (debug_) cout << "Vertex " << " geometrically rejected with " << transTracksRaw.size() << " tracks #rho = " << rho << endl;
396  return true;
397  }
398 
399 
400  }
401 
402 
403 
404  // ---- Remove tracks with small weight or
405  // big first (last) hit_to_vertex distance
406  // and then refit ---- //
407 
408 
409 
410  for (unsigned i = 0; i < transTracksRaw.size(); i++) {
411 
412  if (debug_) cout << "Raw Weight track " << i << " = " << theVertexAdaptiveRaw.trackWeight(transTracksRaw[i]) << endl;
413 
414  if (theVertexAdaptiveRaw.trackWeight(transTracksRaw[i]) > minAdaptWeight_){
415 
416  PFTrackHitFullInfo pattern = hitPattern_.analyze(tkerTopo_, tkerGeom_, tracksToFit[i], theVertexAdaptiveRaw);
417 
418  PFDisplacedVertex::VertexTrackType vertexTrackType = getVertexTrackType(pattern);
419 
420  if (vertexTrackType != PFDisplacedVertex::T_NOT_FROM_VERTEX){
421 
422  bool bGoodTrack = helper_.isTrackSelected(transTracksRaw[i].track(), vertexTrackType);
423 
424  if (bGoodTrack){
425  transTracks.push_back(transTracksRaw[i]);
426  transTracksRef.push_back(tracksToFit[i]);
427  } else {
428  if (debug_)
429  cout << "Track rejected nChi2 = " << transTracksRaw[i].track().normalizedChi2()
430  << " pt = " << transTracksRaw[i].track().pt()
431  << " dxy (wrt (0,0,0)) = " << transTracksRaw[i].track().dxy()
432  << " nHits = " << transTracksRaw[i].track().numberOfValidHits()
433  << " nOuterHits = " << transTracksRaw[i].track().hitPattern().numberOfLostHits(HitPattern::MISSING_OUTER_HITS) << endl;
434  }
435  } else {
436 
437  if (debug_){
438  cout << "Remove track because too far away from the vertex:" << endl;
439  }
440 
441  }
442 
443  }
444 
445  }
446 
447 
448 
449  if (debug_) cout << "All Tracks " << transTracksRaw.size()
450  << " with good weight " << transTracks.size() << endl;
451 
452 
453  // ---- Refit ---- //
454  FitterType vtxFitter = F_NOTDEFINED;
455 
456  if (transTracks.size() < 2) return true;
457  else if (transTracks.size() == 2){
458 
460  if (debug_)
461  cout << "Due to probably high pile-up conditions 2 track vertices switched off" << endl;
462  return true;
463  }
464  vtxFitter = F_KALMAN;
465  }
466  else if (transTracks.size() > 2 && transTracksRaw.size() > transTracks.size())
467  vtxFitter = F_ADAPTIVE;
468  else if (transTracks.size() > 2 && transTracksRaw.size() == transTracks.size())
469  vtxFitter = F_DONOTREFIT;
470  else return true;
471 
472  if (debug_) cout << "Vertex Fitter " << vtxFitter << endl;
473 
474  if(vtxFitter == F_KALMAN){
475 
476  KalmanVertexFitter theKalmanFitter(true);
477  theRecoVertex = theKalmanFitter.vertex(transTracks, seedPoint);
478 
479  } else if(vtxFitter == F_ADAPTIVE){
480 
481  AdaptiveVertexFitter theAdaptiveFitter(
487 
488  theRecoVertex = theAdaptiveFitter.vertex(transTracks, seedPoint);
489 
490  } else if (vtxFitter == F_DONOTREFIT) {
491  theRecoVertex = theVertexAdaptiveRaw;
492  } else {
493  return true;
494  }
495 
496 
497  // ---- Check if the fitted vertex is valid ---- //
498 
499  if( !theRecoVertex.isValid() || theRecoVertex.totalChiSquared() < 0. ) {
500  if (debug_) cout << "Refit failed : valid? " << theRecoVertex.isValid()
501  << " totalChi2 = " << theRecoVertex.totalChiSquared() << endl;
502  return true;
503  }
504 
505  // ---- Create vertex ---- //
506 
507  Vertex theRecoVtx = theRecoVertex;
508 
509  double chi2 = theRecoVtx.chi2();
510  double ndf = theRecoVtx.ndof();
511 
512 
513  if (chi2 > TMath::ChisquareQuantile(0.95, ndf)) {
514  if (debug_)
515  cout << "Rejected because of chi2 = " << chi2 << " ndf = " << ndf << " confid. level: " << TMath::ChisquareQuantile(0.95, ndf) << endl;
516  return true;
517  }
518 
519 
520 
521  // ---- Create and fill vector of refitted TransientTracks ---- //
522 
523  // -----------------------------------------------//
524  // ---- Prepare and Fill the Displaced Vertex ----//
525  // -----------------------------------------------//
526 
527 
528  displacedVertex = theRecoVtx;
529  displacedVertex.removeTracks();
530 
531  for(unsigned i = 0; i < transTracks.size();i++) {
532 
533  PFTrackHitFullInfo pattern = hitPattern_.analyze(tkerTopo_, tkerGeom_, transTracksRef[i], theRecoVertex);
534 
535  PFDisplacedVertex::VertexTrackType vertexTrackType = getVertexTrackType(pattern);
536 
537  Track refittedTrack;
538  float weight = theRecoVertex.trackWeight(transTracks[i]);
539 
540 
541  if (weight < minAdaptWeight_) continue;
542 
543  try{
544  refittedTrack = theRecoVertex.refittedTrack(transTracks[i]).track();
545  }catch( cms::Exception& exception ){
546  continue;
547  }
548 
549  if (debug_){
550  cout << "Vertex Track Type = " << vertexTrackType << endl;
551 
552  cout << "nHitBeforeVertex = " << pattern.first.first
553  << " nHitAfterVertex = " << pattern.second.first
554  << " nMissHitBeforeVertex = " << pattern.first.second
555  << " nMissHitAfterVertex = " << pattern.second.second
556  << " Weight = " << weight << endl;
557  }
558 
559  displacedVertex.addElement(transTracksRef[i],
560  refittedTrack,
561  pattern, vertexTrackType, weight);
562 
563  }
564 
565  displacedVertex.setPrimaryDirection(helper_.primaryVertex());
566  displacedVertex.calcKinematics();
567 
568 
569 
570  if (debug_) cout << "== End vertexing procedure ==" << endl;
571 
572  return false;
573 
574 }
void setPrimaryDirection(const math::XYZPoint &pvtx)
edm::ESHandle< GlobalTrackingGeometry > globTkGeomHandle_
Tracker geometry for discerning hit positions.
const TrackerTopology * tkerTopo_
doc?
float totalChiSquared() const
T y() const
Definition: PV3DBase.h:63
Definition: weight.py:1
bool debug_
If true, debug printouts activated.
const Point & position() const
position
Definition: Vertex.h:109
std::pair< PFTrackHitInfo, PFTrackHitInfo > PFTrackHitFullInfo
reco::TransientTrack refittedTrack(const reco::TransientTrack &track) const
void Dump(std::ostream &out=std::cout) const
cout function
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.
bool isTrackSelected(const reco::Track &trk, const reco::PFDisplacedVertex::VertexTrackType vertexTrackType) const
Select tracks tool.
PFTrackHitFullInfo analyze(const TrackerTopology *tkerTopo, const TrackerGeometry *tkerGeom, const reco::TrackBaseRef track, const TransientVertex &vert)
T sqrt(T t)
Definition: SSEVec.h:18
GlobalPoint position() const
T z() const
Definition: PV3DBase.h:64
bool nonIterative(const reco::TrackBase::TrackAlgorithm &)
bool step45(const reco::TrackBase::TrackAlgorithm &)
bool highQuality(const reco::TrackBase::TrackAlgorithm &)
const MagneticField * magField_
to be able to extrapolate tracks f
double chi2() const
chi-squares
Definition: Vertex.h:98
float trackWeight(const reco::TransientTrack &track) const
double ndof() const
Definition: Vertex.h:105
const GlobalPoint & seedPoint() const
const Track & track() const
double sigmacut_
Adaptive Vertex Fitter parameters.
math::XYZPoint primaryVertex() const
Set Vertex direction using the primary vertex.
const TrackerGeometry * tkerGeom_
void removeTracks()
Definition: Vertex.cc:101
const std::vector< TrackBaseRef > & elements() const
T x() const
Definition: PV3DBase.h:62
bool isValid() const
reco::PFDisplacedVertex::VertexTrackType getVertexTrackType(PFTrackHitFullInfo &) const
PFDisplacedVertexHelper helper_
std::pair< float, float > PFDisplacedVertexFinder::getTransvLongDiff ( const GlobalPoint Ref,
const GlobalPoint ToProject 
) const
private

Definition at line 704 of file PFDisplacedVertexFinder.cc.

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

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

704  {
705 
706  const auto & vRef = Ref.basicVector();
707  const auto & vToProject = ToProject.basicVector();
708  float vRefMag2 = vRef.mag2();
709  float oneOverMag = 1.0f/sqrt(vRefMag2);
710 
711  return std::make_pair(fabs(vRef.cross(vToProject).mag()*oneOverMag),fabs((vRef.dot(vToProject)-vRefMag2)*oneOverMag));
712 }
T sqrt(T t)
Definition: SSEVec.h:18
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
reco::PFDisplacedVertex::VertexTrackType PFDisplacedVertexFinder::getVertexTrackType ( PFTrackHitFullInfo pairTrackHitInfo) const
private

Definition at line 716 of file PFDisplacedVertexFinder.cc.

Referenced by displacedVertices(), and fitVertexFromSeed().

716  {
717 
718  unsigned int nHitBeforeVertex = pairTrackHitInfo.first.first;
719  unsigned int nHitAfterVertex = pairTrackHitInfo.second.first;
720 
721  unsigned int nMissHitBeforeVertex = pairTrackHitInfo.first.second;
722  unsigned int nMissHitAfterVertex = pairTrackHitInfo.second.second;
723 
724  // For the moment those definitions are given apriori a more general study would be useful to refine those criteria
725 
726  if (nHitBeforeVertex <= 1 && nHitAfterVertex >= 3 && nMissHitAfterVertex <= 1)
727  return PFDisplacedVertex::T_FROM_VERTEX;
728  else if (nHitBeforeVertex >= 3 && nHitAfterVertex <= 1 && nMissHitBeforeVertex <= 1)
729  return PFDisplacedVertex::T_TO_VERTEX;
730  else if ((nHitBeforeVertex >= 2 && nHitAfterVertex >= 3)
731  ||
732  (nHitBeforeVertex >= 3 && nHitAfterVertex >= 2))
733  return PFDisplacedVertex::T_MERGED;
734  else
735  return PFDisplacedVertex::T_NOT_FROM_VERTEX;
736 }
bool PFDisplacedVertexFinder::isCloseTo ( const reco::PFDisplacedVertexSeed dv1,
const reco::PFDisplacedVertexSeed dv2 
) const
private

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

Definition at line 688 of file PFDisplacedVertexFinder.cc.

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

Referenced by displacedVertices(), and mergeSeeds().

688  {
689 
690  const GlobalPoint& vP1 = dv1.seedPoint();
691  const GlobalPoint& vP2 = dv2.seedPoint();
692 
693  std::pair<float,float> diffs = getTransvLongDiff(vP1,vP2);
694  if (diffs.second > longSize_) return false;
695  if (diffs.first > transvSize_) return false;
696  // if (Delta_Long < longSize_ && Delta_Transv < transvSize_) isCloseTo = true;
697 
698  return true;
699 
700 }
std::pair< float, float > getTransvLongDiff(const GlobalPoint &, const GlobalPoint &) const
const GlobalPoint & seedPoint() const
float transvSize_
--—— Parameters --—— ///
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 198 of file PFDisplacedVertexFinder.cc.

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

Referenced by displacedVertices(), and findDisplacedVertices().

198  {
199 
200  // loop over displaced vertex candidates
201  // and merge them if they are close to each other
202  for(unsigned idv_mother = 0;idv_mother < tempDisplacedVertexSeeds.size(); idv_mother++){
203  if (!bLocked[idv_mother]){
204 
205  for (unsigned idv_daughter = idv_mother+1;idv_daughter < tempDisplacedVertexSeeds.size(); idv_daughter++){
206 
207  if (!bLocked[idv_daughter]){
208  if (isCloseTo(tempDisplacedVertexSeeds[idv_mother], tempDisplacedVertexSeeds[idv_daughter])) {
209 
210  tempDisplacedVertexSeeds[idv_mother].mergeWith(tempDisplacedVertexSeeds[idv_daughter]);
211  bLocked[idv_daughter] = true;
212  if (debug_) cout << "Seeds " << idv_mother << " and " << idv_daughter << " merged" << endl;
213  }
214  }
215  }
216  }
217  }
218 
219 }
bool debug_
If true, debug printouts activated.
bool isCloseTo(const reco::PFDisplacedVertexSeed &, const reco::PFDisplacedVertexSeed &) const
-----— Tools -----— ///
bool PFDisplacedVertexFinder::rejectAndLabelVertex ( reco::PFDisplacedVertex dv)
private

Definition at line 675 of file PFDisplacedVertexFinder.cc.

References helper_, PFDisplacedVertexHelper::identifyVertex(), reco::PFDisplacedVertex::isFake(), and reco::PFDisplacedVertex::setVertexType().

Referenced by displacedVertices(), and selectAndLabelVertices().

675  {
676 
678  dv.setVertexType(vertexType);
679 
680  return dv.isFake();
681 
682 }
void setVertexType(VertexType vertexType)
Set the type of this vertex.
reco::PFDisplacedVertex::VertexType identifyVertex(const reco::PFDisplacedVertex &v) const
Vertex identification tool.
PFDisplacedVertexHelper helper_
void PFDisplacedVertexFinder::selectAndLabelVertices ( reco::PFDisplacedVertexCollection tempDisplacedVertices,
std::vector< bool > &  bLocked 
)
private

Remove potentially fakes displaced vertices.

Definition at line 582 of file PFDisplacedVertexFinder.cc.

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

Referenced by displacedVertices(), and findDisplacedVertices().

582  {
583 
584  if (debug_) cout << " 4.1) Reject vertices " << endl;
585 
586  for(unsigned idv = 0; idv < tempDisplacedVertices.size(); idv++){
587 
588 
589  // ---- We accept a vertex only if it is not in TOB in the barrel
590  // and not in TEC in the end caps
591  // and not too much before the first pixel layer ---- //
592 
593  const float rho = tempDisplacedVertices[idv].position().rho();
594  const float z = tempDisplacedVertices[idv].position().z();
595 
596  if (rho > tobCut_ || rho < primaryVertexCut_ || fabs(z) > tecCut_) {
597  if (debug_) cout << "Vertex " << idv
598  << " geometrically rejected #rho = " << rho
599  << " z = " << z << endl;
600 
601  bLocked[idv] = true;
602 
603  continue;
604  }
605 
606  unsigned nPrimary = tempDisplacedVertices[idv].nPrimaryTracks();
607  unsigned nMerged = tempDisplacedVertices[idv].nMergedTracks();
608  unsigned nSecondary = tempDisplacedVertices[idv].nSecondaryTracks();
609 
610  if (nPrimary + nMerged > 1) {
611  bLocked[idv] = true;
612  if (debug_) cout << "Vertex " << idv
613  << " rejected because two primary or merged tracks" << endl;
614 
615 
616  }
617 
618  if (nPrimary + nMerged + nSecondary < 2){
619  bLocked[idv] = true;
620  if (debug_) cout << "Vertex " << idv
621  << " rejected because only one track related to the vertex" << endl;
622  }
623 
624 
625  }
626 
627 
628  if (debug_) cout << " 4.2) Check for common vertices" << endl;
629 
630  // ---- Among the remaining vertex we shall remove one
631  // of those which have two common tracks ---- //
632 
633  for(unsigned idv_mother = 0; idv_mother < tempDisplacedVertices.size(); idv_mother++){
634  for(unsigned idv_daughter = idv_mother+1;
635  idv_daughter < tempDisplacedVertices.size(); idv_daughter++){
636 
637  if(!bLocked[idv_daughter] && !bLocked[idv_mother]){
638 
639  const unsigned commonTrks = commonTracks(tempDisplacedVertices[idv_daughter], tempDisplacedVertices[idv_mother]);
640 
641  if (commonTrks > 1) {
642 
643  if (debug_) cout << "Vertices " << idv_daughter << " and " << idv_mother
644  << " has many common tracks" << endl;
645 
646  // We keep the vertex vertex which contains the most of the tracks
647 
648  const int mother_size = tempDisplacedVertices[idv_mother].nTracks();
649  const int daughter_size = tempDisplacedVertices[idv_daughter].nTracks();
650 
651  if (mother_size > daughter_size) bLocked[idv_daughter] = true;
652  else if (mother_size < daughter_size) bLocked[idv_mother] = true;
653  else {
654 
655  // If they have the same size we keep the vertex with the best normalised chi2
656 
657  const float mother_normChi2 = tempDisplacedVertices[idv_mother].normalizedChi2();
658  const float daughter_normChi2 = tempDisplacedVertices[idv_daughter].normalizedChi2();
659  if (mother_normChi2 < daughter_normChi2) bLocked[idv_daughter] = true;
660  else bLocked[idv_mother] = true;
661  }
662 
663  }
664  }
665  }
666  }
667 
668  for(unsigned idv = 0; idv < tempDisplacedVertices.size(); idv++)
669  if ( !bLocked[idv] ) bLocked[idv] = rejectAndLabelVertex(tempDisplacedVertices[idv]);
670 
671 
672 }
bool rejectAndLabelVertex(reco::PFDisplacedVertex &dv)
bool debug_
If true, debug printouts activated.
unsigned commonTracks(const reco::PFDisplacedVertex &, const reco::PFDisplacedVertex &) const
void PFDisplacedVertexFinder::setAVFParameters ( const edm::ParameterSet ps)
inline

Definition at line 99 of file PFDisplacedVertexFinder.h.

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

99  {
100  sigmacut_ = ps.getParameter<double>("sigmacut");
101  t_ini_ = ps.getParameter<double>("Tini");
102  ratio_ = ps.getParameter<double>("ratio");
103  }
T getParameter(std::string const &) const
double sigmacut_
Adaptive Vertex Fitter parameters.
void PFDisplacedVertexFinder::setDebug ( bool  debug)
inline

Sets debug printout flag.

Definition at line 73 of file PFDisplacedVertexFinder.h.

References debug, and debug_.

73 {debug_ = debug;}
bool debug_
If true, debug printouts activated.
#define debug
Definition: HDRShower.cc:19
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 76 of file PFDisplacedVertexFinder.h.

References globTkGeomHandle_, magField_, tkerGeom_, and tkerTopo_.

79  {
80  magField_ = magField;
81  globTkGeomHandle_ = globTkGeomHandle;
82  tkerTopo_ = tkerTopo;
83  tkerGeom_ = tkerGeom;
84  }
edm::ESHandle< GlobalTrackingGeometry > globTkGeomHandle_
Tracker geometry for discerning hit positions.
const TrackerTopology * tkerTopo_
doc?
const MagneticField * magField_
to be able to extrapolate tracks f
const TrackerGeometry * tkerGeom_
void PFDisplacedVertexFinder::setInput ( const edm::Handle< reco::PFDisplacedVertexCandidateCollection > &  displacedVertexCandidates)

Set input collections of tracks.

Definition at line 43 of file PFDisplacedVertexFinder.cc.

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

Referenced by setAVFParameters().

44  {
45 
46  if (displacedVertexCandidates.isValid()){
47  displacedVertexCandidates_ = displacedVertexCandidates.product();
48  } else {
50  }
51 
52 }
reco::PFDisplacedVertexCandidateCollection const * displacedVertexCandidates_
-----— Members -----— ///
bool isValid() const
Definition: HandleBase.h:74
T const * product() const
Definition: Handle.h:74
void PFDisplacedVertexFinder::setParameters ( double  transvSize,
double  longSize,
double  primaryVertexCut,
double  tobCut,
double  tecCut,
double  minAdaptWeight,
bool  switchOff2TrackVertex 
)
inline

--—— Set different algo parameters --—— ///

Sets algo parameters for the vertex finder

Definition at line 60 of file PFDisplacedVertexFinder.h.

References particleFlowDisplacedVertex_cfi::longSize, longSize_, particleFlowDisplacedVertex_cfi::minAdaptWeight, minAdaptWeight_, particleFlowDisplacedVertex_cfi::primaryVertexCut, primaryVertexCut_, particleFlowDisplacedVertex_cfi::switchOff2TrackVertex, switchOff2TrackVertex_, particleFlowDisplacedVertex_cfi::tecCut, tecCut_, particleFlowDisplacedVertex_cfi::tobCut, tobCut_, particleFlowDisplacedVertex_cfi::transvSize, and transvSize_.

62  {
66  tobCut_ = tobCut;
67  tecCut_ = tecCut;
70  }
float transvSize_
--—— Parameters --—— ///
void PFDisplacedVertexFinder::setPrimaryVertex ( edm::Handle< reco::VertexCollection mainVertexHandle,
edm::Handle< reco::BeamSpot beamSpotHandle 
)
inline

Definition at line 94 of file PFDisplacedVertexFinder.h.

References helper_, and PFDisplacedVertexHelper::setPrimaryVertex().

95  {
96  helper_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
97  }
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
Update the primary vertex information.
PFDisplacedVertexHelper helper_
void PFDisplacedVertexFinder::setTracksSelector ( const edm::ParameterSet ps)
inline

Definition at line 86 of file PFDisplacedVertexFinder.h.

References helper_, and PFDisplacedVertexHelper::setTracksSelector().

86  {
88  }
void setTracksSelector(const edm::ParameterSet &ps)
Set Tracks selector parameters.
PFDisplacedVertexHelper helper_
void PFDisplacedVertexFinder::setVertexIdentifier ( const edm::ParameterSet ps)
inline

Definition at line 90 of file PFDisplacedVertexFinder.h.

References helper_, and PFDisplacedVertexHelper::setVertexIdentifier().

90  {
92  }
void setVertexIdentifier(const edm::ParameterSet &ps)
Set Vertex identifier parameters.
PFDisplacedVertexHelper helper_
std::unique_ptr< reco::PFDisplacedVertexCollection > PFDisplacedVertexFinder::transferDisplacedVertices ( )
inline
Returns
unique_ptr to collection of DisplacedVertices

Definition at line 110 of file PFDisplacedVertexFinder.h.

References displacedVertices_, and eostools::move().

110 {return std::move(displacedVertices_);}
std::unique_ptr< reco::PFDisplacedVertexCollection > displacedVertices_
def move(src, dest)
Definition: eostools.py:511

Friends And Related Function Documentation

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

Definition at line 758 of file PFDisplacedVertexFinder.cc.

Referenced by displacedVertices().

758  {
759 
760  if(! out) return out;
761  out << setprecision(3) << setw(5) << endl;
762  out << "" << endl;
763  out << " ====================================== " << endl;
764  out << " ====== Displaced Vertex Finder ======= " << endl;
765  out << " ====================================== " << endl;
766  out << " " << endl;
767 
768  a.helper_.Dump();
769  out << "" << endl
770  << " Adaptive Vertex Fitter parameters are :"<< endl
771  << " sigmacut = " << a.sigmacut_ << " T_ini = "
772  << a.t_ini_ << " ratio = " << a.ratio_ << endl << endl;
773 
774  const std::unique_ptr< reco::PFDisplacedVertexCollection >& displacedVertices_
776 
777 
778  if(!displacedVertices_.get() ) {
779  out<<"displacedVertex already transfered"<<endl;
780  }
781  else{
782 
783  out<<"Number of displacedVertices found : "<< displacedVertices_->size()<<endl<<endl;
784 
785  int i = -1;
786 
787  for(PFDisplacedVertexFinder::IDV idv = displacedVertices_->begin();
788  idv != displacedVertices_->end(); idv++){
789  i++;
790  out << i << " "; idv->Dump(); out << "" << endl;
791  }
792  }
793 
794  return out;
795 }
void Dump(std::ostream &out=std::cout) const
std::unique_ptr< reco::PFDisplacedVertexCollection > displacedVertices_
double sigmacut_
Adaptive Vertex Fitter parameters.
reco::PFDisplacedVertexCollection::iterator IDV
const std::unique_ptr< reco::PFDisplacedVertexCollection > & displacedVertices() const
def move(src, dest)
Definition: eostools.py:511
PFDisplacedVertexHelper helper_

Member Data Documentation

bool PFDisplacedVertexFinder::debug_
private

If true, debug printouts activated.

Definition at line 178 of file PFDisplacedVertexFinder.h.

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

reco::PFDisplacedVertexCandidateCollection const* PFDisplacedVertexFinder::displacedVertexCandidates_
private

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

Definition at line 154 of file PFDisplacedVertexFinder.h.

Referenced by findDisplacedVertices(), and setInput().

std::unique_ptr< reco::PFDisplacedVertexCollection > PFDisplacedVertexFinder::displacedVertices_
private
edm::ESHandle<GlobalTrackingGeometry> PFDisplacedVertexFinder::globTkGeomHandle_
private

Tracker geometry for discerning hit positions.

Definition at line 181 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

PFDisplacedVertexHelper PFDisplacedVertexFinder::helper_
private
PFCheckHitPattern PFDisplacedVertexFinder::hitPattern_
private

Definition at line 191 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed().

float PFDisplacedVertexFinder::longSize_
private

Definition at line 162 of file PFDisplacedVertexFinder.h.

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

const MagneticField* PFDisplacedVertexFinder::magField_
private

to be able to extrapolate tracks f

Definition at line 188 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

double PFDisplacedVertexFinder::minAdaptWeight_
private

Definition at line 166 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setParameters().

double PFDisplacedVertexFinder::primaryVertexCut_
private
double PFDisplacedVertexFinder::ratio_
private

Definition at line 174 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), operator<<(), and setAVFParameters().

double PFDisplacedVertexFinder::sigmacut_
private

Adaptive Vertex Fitter parameters.

Definition at line 172 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), operator<<(), and setAVFParameters().

bool PFDisplacedVertexFinder::switchOff2TrackVertex_
private

Definition at line 168 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setParameters().

double PFDisplacedVertexFinder::t_ini_
private

Definition at line 173 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), operator<<(), and setAVFParameters().

double PFDisplacedVertexFinder::tecCut_
private
const TrackerGeometry* PFDisplacedVertexFinder::tkerGeom_
private

Definition at line 185 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

const TrackerTopology* PFDisplacedVertexFinder::tkerTopo_
private

doc?

Definition at line 184 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

double PFDisplacedVertexFinder::tobCut_
private
float PFDisplacedVertexFinder::transvSize_
private

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

Algo parameters for the vertex finder

Definition at line 161 of file PFDisplacedVertexFinder.h.

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