CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::PFDisplacedVertexCandidateCollection::iterator 
IDVC
 
typedef
reco::PFDisplacedVertexSeedCollection::iterator 
IDVS
 
typedef std::set
< reco::TrackBaseRef >
::iterator 
IEset
 -----— Useful Types -----— /// More...
 
typedef std::pair
< PFTrackHitInfo,
PFTrackHitInfo
PFTrackHitFullInfo
 
typedef std::pair< unsigned
int, unsigned int > 
PFTrackHitInfo
 

Public Member Functions

const std::auto_ptr
< reco::PFDisplacedVertexCollection > & 
displacedVertices () const
 
void findDisplacedVertices ()
 -----— Main function which find vertices -----— /// More...
 
 PFDisplacedVertexFinder ()
 
void setAVFParameters (edm::ParameterSet ps)
 
void setDebug (bool debug)
 Sets debug printout flag. More...
 
void setEdmParameters (const MagneticField *magField, edm::ESHandle< GlobalTrackingGeometry > globTkGeomHandle, edm::ESHandle< TrackerGeometry > tkerGeomHandle)
 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)
 --—— Set different algo parameters --—— /// More...
 
void setPrimaryVertex (edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
 
void setTracksSelector (edm::ParameterSet ps)
 
void setVertexIdentifier (edm::ParameterSet ps)
 
std::auto_ptr
< reco::PFDisplacedVertexCollection
transferDisplacedVertices ()
 
 ~PFDisplacedVertexFinder ()
 

Private Member Functions

unsigned commonTracks (const reco::PFDisplacedVertex &, const reco::PFDisplacedVertex &) const
 
void findSeedsFromCandidate (reco::PFDisplacedVertexCandidate &, reco::PFDisplacedVertexSeedCollection &)
 --—— Different steps of the finder algorithm --—— /// More...
 
bool fitVertexFromSeed (reco::PFDisplacedVertexSeed &, reco::PFDisplacedVertex &)
 Fit one by one the vertex points with associated tracks to get displaced vertices. More...
 
double getLongDiff (const GlobalPoint &, const GlobalPoint &) const
 
double getLongProj (const GlobalPoint &, const GlobalVector &) const
 
double getTransvDiff (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...
 
std::auto_ptr
< reco::PFDisplacedVertexCandidateCollection
displacedVertexCandidates_
 -----— Members -----— /// More...
 
std::auto_ptr
< reco::PFDisplacedVertexCollection
displacedVertices_
 
edm::ESHandle
< GlobalTrackingGeometry
globTkGeomHandle_
 Tracker geometry for discerning hit positions. More...
 
PFDisplacedVertexHelper helper_
 
PFCheckHitPattern hitPattern_
 
double longSize_
 
const MagneticFieldmagField_
 to be able to extrapolate tracks f More...
 
double minAdaptWeight_
 
double primaryVertexCut_
 
double ratio_
 
double sigmacut_
 Adaptive Vertex Fitter parameters. More...
 
double t_ini_
 
double tecCut_
 
edm::ESHandle< TrackerGeometrytkerGeomHandle_
 doc? More...
 
double tobCut_
 
double 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 45 of file PFDisplacedVertexFinder.h.

typedef reco::PFDisplacedVertexCandidateCollection::iterator PFDisplacedVertexFinder::IDVC

Definition at line 43 of file PFDisplacedVertexFinder.h.

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

Definition at line 44 of file PFDisplacedVertexFinder.h.

typedef std::set< reco::TrackBaseRef >::iterator PFDisplacedVertexFinder::IEset

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

Definition at line 42 of file PFDisplacedVertexFinder.h.

Definition at line 48 of file PFDisplacedVertexFinder.h.

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

Definition at line 47 of file PFDisplacedVertexFinder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

PFDisplacedVertexFinder::PFDisplacedVertexFinder ( )

Definition at line 27 of file PFDisplacedVertexFinder.cc.

27  :
30  transvSize_(0.0),
31  longSize_(0.0),
32  primaryVertexCut_(0.0),
33  tobCut_(0.0),
34  tecCut_(0.0),
35  minAdaptWeight_(2.0),
36  debug_(false) {}
std::vector< PFDisplacedVertex > PFDisplacedVertexCollection
collection of PFDisplacedVertex objects
std::vector< PFDisplacedVertexCandidate > PFDisplacedVertexCandidateCollection
collection of PFDisplacedVertexCandidate objects
std::auto_ptr< reco::PFDisplacedVertexCollection > displacedVertices_
bool debug_
If true, debug printouts activated.
std::auto_ptr< reco::PFDisplacedVertexCandidateCollection > displacedVertexCandidates_
-----— Members -----— ///
double transvSize_
--—— Parameters --—— ///
PFDisplacedVertexFinder::~PFDisplacedVertexFinder ( )

Definition at line 39 of file PFDisplacedVertexFinder.cc.

39 {}

Member Function Documentation

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

Definition at line 741 of file PFDisplacedVertexFinder.cc.

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

Referenced by selectAndLabelVertices().

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

Definition at line 111 of file PFDisplacedVertexFinder.h.

References displacedVertices_.

Referenced by operator<<().

111 {return displacedVertices_;}
std::auto_ptr< reco::PFDisplacedVertexCollection > displacedVertices_
void PFDisplacedVertexFinder::findDisplacedVertices ( )

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

Definition at line 65 of file PFDisplacedVertexFinder.cc.

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

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

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

Referenced by findDisplacedVertices().

147  {
148 
149  const PFDisplacedVertexCandidate::DistMap r2Map = vertexCandidate.r2Map();
150  bool bNeedNewCandidate = false;
151 
152  tempDisplacedVertexSeeds.push_back( PFDisplacedVertexSeed() );
153 
154  IDVS idvc_current;
155 
156  for (PFDisplacedVertexCandidate::DistMap::const_iterator imap = r2Map.begin();
157  imap != r2Map.end(); imap++){
158 
159  unsigned ie1 = (*imap).second.first;
160  unsigned ie2 = (*imap).second.second;
161 
162  if (debug_) cout << "ie1 = " << ie1 << " ie2 = " << ie2 << " radius = " << sqrt((*imap).first) << endl;
163 
164  GlobalPoint dcaPoint = vertexCandidate.dcaPoint(ie1, ie2);
165  if (fabs(dcaPoint.x()) > 1e9) continue;
166 
167  bNeedNewCandidate = true;
168  for (idvc_current = tempDisplacedVertexSeeds.begin(); idvc_current != tempDisplacedVertexSeeds.end(); idvc_current++){
169  if ((*idvc_current).isEmpty()) {
170  bNeedNewCandidate = false;
171  break;
172  }
173  const GlobalPoint vertexPoint = (*idvc_current).seedPoint();
174  double Delta_Long = getLongDiff(vertexPoint, dcaPoint);
175  double Delta_Transv = getTransvDiff(vertexPoint, dcaPoint);
176  if (Delta_Long > longSize_) continue;
177  if (Delta_Transv > transvSize_) continue;
178  bNeedNewCandidate = false;
179  break;
180  }
181  if (bNeedNewCandidate) {
182  if (debug_) cout << "create new displaced vertex" << endl;
183  tempDisplacedVertexSeeds.push_back( PFDisplacedVertexSeed() );
184  idvc_current = tempDisplacedVertexSeeds.end();
185  idvc_current--;
186  bNeedNewCandidate = false;
187  }
188 
189 
190 
191  (*idvc_current).updateSeedPoint(dcaPoint, vertexCandidate.tref(ie1), vertexCandidate.tref(ie2));
192 
193 
194 
195  }
196 
197 
198 }
double getTransvDiff(const GlobalPoint &, const GlobalPoint &) const
reco::PFDisplacedVertexSeedCollection::iterator IDVS
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:28
DistMap r2Map() const
--—— Provide useful information --—— ///
double transvSize_
--—— Parameters --—— ///
tuple cout
Definition: gather_cfg.py:41
double getLongDiff(const GlobalPoint &, const GlobalPoint &) const
T x() const
Definition: PV3DBase.h:56
bool PFDisplacedVertexFinder::fitVertexFromSeed ( 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 234 of file PFDisplacedVertexFinder.cc.

References reco::PFDisplacedVertex::addElement(), PFCheckHitPattern::analyze(), reco::PFDisplacedVertex::calcKinematics(), reco::Vertex::chi2(), ExpressReco_HICollisions_FallBack::chi2, gather_cfg::cout, debug_, reco::PFDisplacedVertexSeed::Dump(), reco::PFDisplacedVertexSeed::elements(), cmsCodeRules.cppFunctionSkipper::exception, F_ADAPTIVE, F_DONOTREFIT, F_KALMAN, F_NOTDEFINED, getVertexTrackType(), globTkGeomHandle_, helper_, hitPattern_, i, PFDisplacedVertexHelper::isTrackSelected(), TransientVertex::isValid(), magField_, minAdaptWeight_, reco::Vertex::ndof(), 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(), t_ini_, tecCut_, tkerGeomHandle_, tobCut_, TransientVertex::totalChiSquared(), reco::TransientTrack::track(), ExpressReco_HICollisions_FallBack::track, TransientVertex::trackWeight(), KalmanVertexFitter::vertex(), AdaptiveVertexFitter::vertex(), CommonMethods::weight(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by findDisplacedVertices().

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

Definition at line 688 of file PFDisplacedVertexFinder.cc.

References Basic3DVector< T >::dot(), Basic3DVector< T >::mag(), and Basic3DVector< T >::mag2().

Referenced by findSeedsFromCandidate(), and isCloseTo().

688  {
689 
690  Basic3DVector<double>vRef(Ref);
691  Basic3DVector<double>vToProject(ToProject);
692  return fabs((vRef.dot(vToProject)-vRef.mag2())/vRef.mag());
693 
694 }
double PFDisplacedVertexFinder::getLongProj ( const GlobalPoint Ref,
const GlobalVector ToProject 
) const
private

Definition at line 697 of file PFDisplacedVertexFinder.cc.

References Basic3DVector< T >::dot(), and Basic3DVector< T >::mag().

697  {
698 
699  Basic3DVector<double>vRef(Ref);
700  Basic3DVector<double>vToProject(ToProject);
701  return (vRef.dot(vToProject))/vRef.mag();
702 
703 
704 }
double PFDisplacedVertexFinder::getTransvDiff ( const GlobalPoint Ref,
const GlobalPoint ToProject 
) const
private

Definition at line 708 of file PFDisplacedVertexFinder.cc.

References Basic3DVector< T >::cross(), and Basic3DVector< T >::mag().

Referenced by findSeedsFromCandidate(), and isCloseTo().

708  {
709 
710  Basic3DVector<double>vRef(Ref);
711  Basic3DVector<double>vToProject(ToProject);
712  return fabs(vRef.cross(vToProject).mag()/vRef.mag());
713 
714 }
reco::PFDisplacedVertex::VertexTrackType PFDisplacedVertexFinder::getVertexTrackType ( PFTrackHitFullInfo pairTrackHitInfo) const
private

Definition at line 718 of file PFDisplacedVertexFinder.cc.

Referenced by fitVertexFromSeed().

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

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

Definition at line 671 of file PFDisplacedVertexFinder.cc.

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

Referenced by mergeSeeds().

671  {
672 
673  bool isCloseTo = false;
674 
675  const GlobalPoint vP1 = dv1.seedPoint();
676  const GlobalPoint vP2 = dv2.seedPoint();
677 
678  double Delta_Long = getLongDiff(vP1, vP2);
679  double Delta_Transv = getTransvDiff(vP1, vP2);
680  if (Delta_Long < longSize_ && Delta_Transv < transvSize_) isCloseTo = true;
681 
682  return isCloseTo;
683 
684 }
double getTransvDiff(const GlobalPoint &, const GlobalPoint &) const
const GlobalPoint & seedPoint() const
double transvSize_
--—— Parameters --—— ///
double getLongDiff(const GlobalPoint &, const GlobalPoint &) const
bool isCloseTo(const reco::PFDisplacedVertexSeed &, const reco::PFDisplacedVertexSeed &) const
-----— Tools -----— ///
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 204 of file PFDisplacedVertexFinder.cc.

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

Referenced by findDisplacedVertices().

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

Definition at line 658 of file PFDisplacedVertexFinder.cc.

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

Referenced by selectAndLabelVertices().

658  {
659 
661  dv.setVertexType(vertexType);
662 
663  return dv.isFake();
664 
665 }
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 565 of file PFDisplacedVertexFinder.cc.

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

Referenced by findDisplacedVertices().

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

Definition at line 98 of file PFDisplacedVertexFinder.h.

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

98  {
99  sigmacut_ = ps.getParameter<double>("sigmacut");
100  t_ini_ = ps.getParameter<double>("Tini");
101  ratio_ = ps.getParameter<double>("ratio");
102  }
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 74 of file PFDisplacedVertexFinder.h.

References debug, and debug_.

74 {debug_ = debug;}
bool debug_
If true, debug printouts activated.
#define debug
Definition: MEtoEDMFormat.h:34
void PFDisplacedVertexFinder::setEdmParameters ( const MagneticField magField,
edm::ESHandle< GlobalTrackingGeometry globTkGeomHandle,
edm::ESHandle< TrackerGeometry tkerGeomHandle 
)
inline

Sets parameters for track extrapolation and hits study.

Definition at line 77 of file PFDisplacedVertexFinder.h.

References globTkGeomHandle_, magField_, and tkerGeomHandle_.

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

Set input collections of tracks.

Definition at line 42 of file PFDisplacedVertexFinder.cc.

References displacedVertexCandidates_, i, and edm::HandleBase::isValid().

43  {
44 
45  if( displacedVertexCandidates_.get() ) {
47  }
48  else
50 
51 
52  if(displacedVertexCandidates.isValid()) {
53  for(unsigned i=0;i<displacedVertexCandidates->size(); i++) {
54  PFDisplacedVertexCandidateRef dvcref( displacedVertexCandidates, i);
55  displacedVertexCandidates_->push_back( (*dvcref));
56  }
57  }
58 
59 }
int i
Definition: DBlmapReader.cc:9
std::vector< PFDisplacedVertexCandidate > PFDisplacedVertexCandidateCollection
collection of PFDisplacedVertexCandidate objects
std::auto_ptr< reco::PFDisplacedVertexCandidateCollection > displacedVertexCandidates_
-----— Members -----— ///
bool isValid() const
Definition: HandleBase.h:76
void PFDisplacedVertexFinder::setParameters ( double  transvSize,
double  longSize,
double  primaryVertexCut,
double  tobCut,
double  tecCut,
double  minAdaptWeight 
)
inline

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

Sets algo parameters for the vertex finder

Definition at line 62 of file PFDisplacedVertexFinder.h.

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

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

Definition at line 93 of file PFDisplacedVertexFinder.h.

References helper_, and PFDisplacedVertexHelper::setPrimaryVertex().

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

Definition at line 85 of file PFDisplacedVertexFinder.h.

References helper_, and PFDisplacedVertexHelper::setTracksSelector().

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

Definition at line 89 of file PFDisplacedVertexFinder.h.

References helper_, and PFDisplacedVertexHelper::setVertexIdentifier().

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

Definition at line 109 of file PFDisplacedVertexFinder.h.

References displacedVertices_.

109 {return displacedVertices_;}
std::auto_ptr< reco::PFDisplacedVertexCollection > displacedVertices_

Friends And Related Function Documentation

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

Definition at line 760 of file PFDisplacedVertexFinder.cc.

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

Member Data Documentation

bool PFDisplacedVertexFinder::debug_
private

If true, debug printouts activated.

Definition at line 177 of file PFDisplacedVertexFinder.h.

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

std::auto_ptr< reco::PFDisplacedVertexCandidateCollection > PFDisplacedVertexFinder::displacedVertexCandidates_
private

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

Definition at line 155 of file PFDisplacedVertexFinder.h.

Referenced by findDisplacedVertices(), and setInput().

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

Tracker geometry for discerning hit positions.

Definition at line 180 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

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

Definition at line 189 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed().

double PFDisplacedVertexFinder::longSize_
private

Definition at line 163 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 186 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

double PFDisplacedVertexFinder::minAdaptWeight_
private

Definition at line 167 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setParameters().

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

Definition at line 173 of file PFDisplacedVertexFinder.h.

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

double PFDisplacedVertexFinder::sigmacut_
private

Adaptive Vertex Fitter parameters.

Definition at line 171 of file PFDisplacedVertexFinder.h.

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

double PFDisplacedVertexFinder::t_ini_
private

Definition at line 172 of file PFDisplacedVertexFinder.h.

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

double PFDisplacedVertexFinder::tecCut_
private
edm::ESHandle<TrackerGeometry> PFDisplacedVertexFinder::tkerGeomHandle_
private

doc?

Definition at line 183 of file PFDisplacedVertexFinder.h.

Referenced by fitVertexFromSeed(), and setEdmParameters().

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

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

Algo parameters for the vertex finder

Definition at line 162 of file PFDisplacedVertexFinder.h.

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