CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PF_PU_AssoMapAlgos.cc
Go to the documentation of this file.
1 
3 
5 
7 
12 
14 
17 
18 using namespace edm;
19 using namespace std;
20 using namespace reco;
21 
22 /*************************************************************************************/
23 /* dedicated constructor for the algorithms */
24 /*************************************************************************************/
25 
27  : maxNumWarnings_(3),
28  numWarnings_(0)
29 {
30 
31  input_MaxNumAssociations_ = iConfig.getParameter<int>("MaxNumberOfAssociations");
32 
33  input_VertexCollection_= iConfig.getParameter<InputTag>("VertexCollection");
34 
35  input_BeamSpot_= iConfig.getParameter<InputTag>("BeamSpot");
36 
37  input_doReassociation_= iConfig.getParameter<bool>("doReassociation");
38  cleanedColls_ = iConfig.getParameter<bool>("GetCleanedCollections");
39 
40  ConversionsCollection_= iConfig.getParameter<InputTag>("ConversionsCollection");
41 
42  KshortCollection_= iConfig.getParameter<InputTag>("V0KshortCollection");
43  LambdaCollection_= iConfig.getParameter<InputTag>("V0LambdaCollection");
44 
45  NIVertexCollection_= iConfig.getParameter<InputTag>("NIVertexCollection");
46 
47  IFVVertexCollection_ = iConfig.getParameter<InputTag>("IVFVertexCollection");
48  if ( IFVVertexCollection_.label()=="" ) {
49  LogWarning("PF_PU_AssoMapAlgos::PF_PU_AssoMapAlgos") << "No InputTag for IV's given --> skipping reconstruction of inclusive vertices !!" << endl;
50  }
51 
52  input_FinalAssociation_= iConfig.getUntrackedParameter<int>("FinalAssociation", 0);
53 
54  ignoremissingpfcollection_ = iConfig.getParameter<bool>("ignoreMissingCollection");
55 
56  input_nTrack_z_ = iConfig.getParameter<double>("nTrackWeight_z");
57  input_nTrack_3D_ = iConfig.getParameter<double>("nTrackWeight_3D");
58 
59  missingColls = false;
60 
61 }
62 
63 /*************************************************************************************/
64 /* dedicated destructor for the algorithms */
65 /*************************************************************************************/
66 
68 {
69  // do anything here that needs to be done at destruction time
70  // (e.g. close files, deallocate resources etc.)
71 }
72 
73 /*************************************************************************************/
74 /* get all needed collections at the beginning */
75 /*************************************************************************************/
76 
77 void
79 {
80 
81  //get the offline beam spot
83 
84  GlobalPoint bsPosition = RecoVertex::convertPos( beamspotH->position() );
85  GlobalError bsError = RecoVertex::convertError( beamspotH->covariance3D() );
86 
87  BSVertexState = VertexState( bsPosition, bsError );
88 
89  //get the conversion collection for the gamma conversions
92 
93  //get the vertex composite candidate collection for the Kshort's
96 
97  //get the vertex composite candidate collection for the Lambda's
100 
101  //get the displaced vertex collection for nuclear interactions
104  if ( numWarnings_ < maxNumWarnings_ ) {
105  LogWarning("PF_PU_AssoMapAlgos::GetInputCollections") << "No Extra objects available in input file --> skipping reconstruction of displaced vertices !!" << endl;
106  ++numWarnings_;
107  }
108  }
109  } else {
110 
112 
113  }
114 
115  //get the inclusive vertex finder collection
117  if ( ( ignoremissingpfcollection_ ) && !( IFVVertexCollection_.label()=="" ) ){
118  if ( numWarnings_ < maxNumWarnings_ ) {
119  LogWarning("PF_PU_AssoMapAlgos::GetInputCollections") << "No Extra objects available in input file --> skipping reconstruction of ifv vertices !!" << endl;
120  ++numWarnings_;
121  }
122  }
123  } else {
124 
126 
127  }
128 
129  //get the input vertex collection
131 
132  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
133 
134 }
135 
136 /*************************************************************************************/
137 /* create the track to vertex association map */
138 /*************************************************************************************/
139 std::auto_ptr<TrackToVertexAssMap>
141 {
142 
143  auto_ptr<TrackToVertexAssMap> track2vertex(new TrackToVertexAssMap());
144 
145  int num_associations = input_MaxNumAssociations_;
146  int num_vertices = vtxcollH->size();
147  if ( num_vertices < num_associations) num_associations = num_vertices;
148 
149  //loop over all tracks of the track collection
150  for ( size_t idxTrack = 0; idxTrack < trkcollH->size(); ++idxTrack ) {
151 
152  TrackRef trackref = TrackRef(trkcollH, idxTrack);
153 
154  TransientTrack transtrk(trackref, &(*bFieldH) );
155  transtrk.setBeamSpot(*beamspotH);
156  transtrk.setES(iSetup);
157 
158  vector<VertexRef>* vtxColl_help = CreateVertexVector(vtxcollH);
159  StepDistancePairVector distances;
160 
161  int num_assoc = 0;
162 
163  for ( int assoc_ite = 0; assoc_ite < num_associations; ++assoc_ite ) {
164 
165  VertexStepPair assocVtx = FindAssociation(trackref, vtxColl_help, bFieldH, iSetup, beamspotH, assoc_ite);
166  VertexRef associatedVertex = assocVtx.first;
167  int step = assocVtx.second;
168  double distance = ( IPTools::absoluteImpactParameter3D( transtrk, *associatedVertex ) ).second.value();
169 
170  int quality = DefineQuality(distances, step, distance);
171  distances.push_back( make_pair(step, distance) );
172 
173  // edm::LogInfo("Trck2VtxAssociation") << "associating track: Pt = " << trackref->pt() << ","
174  // << " eta = " << trackref->eta() << ", phi = " << trackref->phi()
175  // << " to vertex: z = " << associatedVertex.first->position().z() << " with quality q = " << quality << std::endl;
176 
177 
178  // Insert the best vertex and the pair of track and the quality of this association in the map
179  track2vertex->insert( associatedVertex, make_pair(trackref, quality) );
180 
181  PF_PU_AssoMapAlgos::EraseVertex(vtxColl_help, associatedVertex);
182  num_assoc++;
183 
184  }
185 
186  delete vtxColl_help;
187 
188  }
189 
190  return track2vertex;
191 
192 }
193 
194 /*************************************************************************************/
195 /* create the vertex to track association map */
196 /*************************************************************************************/
197 
198 std::auto_ptr<VertexToTrackAssMap>
200 {
201 
202  auto_ptr<VertexToTrackAssMap> vertex2track(new VertexToTrackAssMap());
203 
204  int num_associations = input_MaxNumAssociations_;
205  int num_vertices = vtxcollH->size();
206  if ( num_vertices < num_associations) num_associations = num_vertices;
207 
208  //loop over all tracks of the track collection
209  for ( size_t idxTrack = 0; idxTrack < trkcollH->size(); ++idxTrack ) {
210 
211  TrackRef trackref = TrackRef(trkcollH, idxTrack);
212 
213  TransientTrack transtrk(trackref, &(*bFieldH) );
214  transtrk.setBeamSpot(*beamspotH);
215  transtrk.setES(iSetup);
216 
217  vector<VertexRef>* vtxColl_help = CreateVertexVector(vtxcollH);
218  StepDistancePairVector distances;
219 
220  for ( int assoc_ite = 0; assoc_ite < num_associations; ++assoc_ite ) {
221 
222  VertexStepPair assocVtx = FindAssociation(trackref, vtxColl_help, bFieldH, iSetup, beamspotH, assoc_ite);
223  VertexRef associatedVertex = assocVtx.first;
224  int step = assocVtx.second;
225  double distance = ( IPTools::absoluteImpactParameter3D( transtrk, *associatedVertex ) ).second.value();
226 
227  int quality = DefineQuality(distances, step, distance);
228  distances.push_back( make_pair(step, distance) );
229 
230  // edm::LogInfo("Vtx2TrckAssociation") << "associating track: Pt = " << trackref->pt() << ","
231  // << " eta = " << trackref->eta() << ", phi = " << trackref->phi()
232  // << " to vertex: z = " << associatedVertex.first->position().z() << " with quality q = " << quality << std::endl;
233 
234  // Insert the best vertex and the pair of track and the quality of this association in the map
235  vertex2track->insert( trackref, make_pair(associatedVertex, quality) );
236 
237  PF_PU_AssoMapAlgos::EraseVertex(vtxColl_help, associatedVertex);
238 
239  }
240 
241  delete vtxColl_help;
242 
243  }
244 
245  return vertex2track;
246 
247 }
248 
249 /*****************************************************************************************/
250 /* function to sort the vertices in the AssociationMap by the sum of (pT - pT_Error)**2 */
251 /*****************************************************************************************/
252 
253 auto_ptr<TrackToVertexAssMap>
255 {
256 
257  //create a new TrackVertexAssMap for the Output which will be sorted
258  auto_ptr<TrackToVertexAssMap> trackvertexassOutput(new TrackToVertexAssMap() );
259 
260  //Create and fill a vector of pairs of vertex and the summed (pT-pT_Error)**2 of the tracks associated to the vertex
261  VertexPtsumVector vertexptsumvector;
262 
263  //loop over all vertices in the association map
264  for(TrackToVertexAssMap::const_iterator assomap_ite=trackvertexassInput->begin(); assomap_ite!=trackvertexassInput->end(); assomap_ite++){
265 
266  const VertexRef assomap_vertexref = assomap_ite->key;
267  const TrackQualityPairVector trckcoll = assomap_ite->val;
268 
269  float ptsum = 0;
270 
271  TrackRef trackref;
272 
273  //get the tracks associated to the vertex and calculate the manipulated pT**2
274  for(unsigned int trckcoll_ite=0; trckcoll_ite<trckcoll.size(); trckcoll_ite++){
275 
276  trackref = trckcoll[trckcoll_ite].first;
277  int quality = trckcoll[trckcoll_ite].second;
278 
279  if ( quality<=2 ) continue;
280 
281  double man_pT = trackref->pt() - trackref->ptError();
282  if(man_pT>0.) ptsum+=man_pT*man_pT;
283 
284  }
285 
286  vertexptsumvector.push_back(make_pair(assomap_vertexref,ptsum));
287 
288  }
289 
290  while (vertexptsumvector.size()!=0){
291 
292  VertexRef vertexref_highestpT;
293  float highestpT = 0.;
294  int highestpT_index = 0;
295 
296  for(unsigned int vtxptsumvec_ite=0; vtxptsumvec_ite<vertexptsumvector.size(); vtxptsumvec_ite++){
297 
298  if(vertexptsumvector[vtxptsumvec_ite].second>highestpT){
299 
300  vertexref_highestpT = vertexptsumvector[vtxptsumvec_ite].first;
301  highestpT = vertexptsumvector[vtxptsumvec_ite].second;
302  highestpT_index = vtxptsumvec_ite;
303 
304  }
305 
306  }
307 
308  //loop over all vertices in the association map
309  for(TrackToVertexAssMap::const_iterator assomap_ite=trackvertexassInput->begin(); assomap_ite!=trackvertexassInput->end(); assomap_ite++){
310 
311  const VertexRef assomap_vertexref = assomap_ite->key;
312  const TrackQualityPairVector trckcoll = assomap_ite->val;
313 
314  //if the vertex from the association map the vertex with the highest manipulated pT
315  //insert all associated tracks in the output Association Map
316  if(assomap_vertexref==vertexref_highestpT)
317  for(unsigned int trckcoll_ite=0; trckcoll_ite<trckcoll.size(); trckcoll_ite++)
318  trackvertexassOutput->insert(assomap_vertexref,trckcoll[trckcoll_ite]);
319 
320  }
321 
322  vertexptsumvector.erase(vertexptsumvector.begin()+highestpT_index);
323 
324  }
325 
326  return trackvertexassOutput;
327 
328 }
329 
330 /********************/
331 /* */
332 /* Member Functions */
333 /* */
334 /********************/
335 
336 /*************************************************************************************/
337 /* create helping vertex vector to remove associated vertices */
338 /*************************************************************************************/
339 
340 std::vector<reco::VertexRef>*
342 {
343 
344  vector<VertexRef>* output = new vector<VertexRef>();
345 
346  for(unsigned int index_vtx=0; index_vtx<vtxcollH->size(); ++index_vtx){
347 
348  VertexRef vertexref(vtxcollH,index_vtx);
349  output->push_back(vertexref);
350 
351  }
352 
353  return output;
354 
355 }
356 
357 /****************************************************************************/
358 /* erase one vertex from the vertex vector */
359 /****************************************************************************/
360 
361 void
362 PF_PU_AssoMapAlgos::EraseVertex(std::vector<reco::VertexRef>* vtxcollV, reco::VertexRef toErase)
363 {
364 
365  for(unsigned int index_vtx=0; index_vtx<vtxcollV->size(); ++index_vtx){
366 
367  VertexRef vertexref = vtxcollV->at(index_vtx);
368 
369  if ( vertexref == toErase ){
370  vtxcollV->erase(vtxcollV->begin()+index_vtx);
371  break;
372  }
373 
374  }
375 
376 }
377 
378 
379 /*************************************************************************************/
380 /* function to find the closest vertex in 3D for a certain track */
381 /*************************************************************************************/
382 
383 VertexRef
384 PF_PU_AssoMapAlgos::FindClosestZ(const reco::TrackRef trkref, std::vector<reco::VertexRef>* vtxcollV, double tWeight)
385 {
386 
387  double ztrack = trkref->vertex().z();
388 
389  VertexRef foundVertexRef = vtxcollV->at(0);
390 
391  double dzmin = 1e5;
392 
393  //loop over all vertices with a good quality in the vertex collection
394  for(unsigned int index_vtx=0; index_vtx<vtxcollV->size(); ++index_vtx){
395 
396  VertexRef vertexref = vtxcollV->at(index_vtx);
397 
398  double nTracks = sqrt( vertexref->tracksSize() );
399 
400  //find and store the closest vertex in z
401  double distance = fabs(ztrack - vertexref->z());
402 
403  double weightedDistance = distance-tWeight*nTracks;
404 
405  if(weightedDistance<dzmin) {
406  dzmin = weightedDistance;
407  foundVertexRef = vertexref;
408  }
409 
410  }
411 
412  return foundVertexRef;
413 
414 }
415 
416 
417 /*************************************************************************************/
418 /* function to find the closest vertex in 3D for a certain track */
419 /*************************************************************************************/
420 
421 VertexRef
422 PF_PU_AssoMapAlgos::FindClosest3D(TransientTrack transtrk, std::vector<reco::VertexRef>* vtxcollV, double tWeight)
423 {
424 
425  VertexRef foundVertexRef = vtxcollV->at(0);
426 
427  double d3min = 1e5;
428 
429  //loop over all vertices with a good quality in the vertex collection
430  for ( unsigned int index_vtx=0; index_vtx<vtxcollV->size(); ++index_vtx ) {
431 
432  VertexRef vertexref = vtxcollV->at( index_vtx );
433 
434  double nTracks = vertexref->tracksSize();
435 
436  double distance = 1e5;
437  pair<bool,Measurement1D> IpPair = IPTools::absoluteImpactParameter3D(transtrk, *vertexref);
438 
439  if ( IpPair.first ) distance = IpPair.second.value();
440 
441  double weightedDistance = distance-tWeight*nTracks;
442 
443  if ( weightedDistance<d3min ) {
444  d3min = weightedDistance;
445  foundVertexRef = vertexref;
446  }
447 
448  }
449 
450  return foundVertexRef;
451 
452 }
453 
454 
455 /*************************************************************************************/
456 /* function to filter the conversion collection */
457 /*************************************************************************************/
458 
459 auto_ptr<ConversionCollection>
461 {
462 
463  auto_ptr<ConversionCollection> cleanedConvColl(new ConversionCollection() );
464 
465  for ( unsigned int convcoll_idx=0; convcoll_idx<convCollH->size(); convcoll_idx++ ){
466 
467  ConversionRef convref(convCollH,convcoll_idx);
468 
469  if ( !cleanedColl ) {
470  cleanedConvColl->push_back(*convref);
471  continue;
472  }
473 
474  if ( convref->quality( Conversion::highPurity ) ){
475 
476  cleanedConvColl->push_back(*convref);
477 
478  }
479 
480  }
481 
482  return cleanedConvColl;
483 
484 }
485 
486 
487 /*************************************************************************************/
488 /* function to find out if the track comes from a gamma conversion */
489 /*************************************************************************************/
490 
491 bool
493 {
494 
495  for(unsigned int convcoll_ite=0; convcoll_ite<cleanedConvColl.size(); convcoll_ite++){
496 
497  if(ConversionTools::matchesConversion(trackref,cleanedConvColl.at(convcoll_ite))){
498 
499  *gamma = cleanedConvColl.at(convcoll_ite);
500  return true;
501 
502  }
503 
504  }
505 
506  return false;
507 
508 }
509 
510 
511 /********************************************************************************/
512 /* function to find the closest vertex for a track from a conversion */
513 /********************************************************************************/
514 
515 VertexRef
516 PF_PU_AssoMapAlgos::FindConversionVertex(const reco::TrackRef trackref, const reco::Conversion& gamma, ESHandle<MagneticField> bfH, const EventSetup& iSetup, edm::Handle<reco::BeamSpot> bsH, std::vector<reco::VertexRef>* vtxcollV, double tWeight)
517 {
518 
519  math::XYZPoint conv_pos = gamma.conversionVertex().position();
520 
521  math::XYZVector conv_mom( gamma.refittedPair4Momentum().x(),
522  gamma.refittedPair4Momentum().y(),
523  gamma.refittedPair4Momentum().z());
524 
525  Track photon( trackref->chi2(), trackref->ndof(), conv_pos, conv_mom, 0, trackref->covariance() );
526 
527  TransientTrack transpho(photon, &(*bfH) );
528  transpho.setBeamSpot( *bsH );
529  transpho.setES( iSetup );
530 
531  return FindClosest3D(transpho, vtxcollV, tWeight);
532 
533 }
534 
535 /*************************************************************************************/
536 /* function to filter the Kshort collection */
537 /*************************************************************************************/
538 
539 auto_ptr<VertexCompositeCandidateCollection>
541 {
542 
543  auto_ptr<VertexCompositeCandidateCollection> cleanedKaonColl(new VertexCompositeCandidateCollection() );
544 
545  for ( unsigned int kscoll_idx=0; kscoll_idx<KshortsH->size(); kscoll_idx++ ) {
546 
547  VertexCompositeCandidateRef ksref(KshortsH,kscoll_idx);
548 
549  if ( !cleanedColl ) {
550  cleanedKaonColl->push_back(*ksref);
551  continue;
552  }
553 
554  GlobalPoint dec_pos = RecoVertex::convertPos(ksref->vertex());
555 
556  GlobalError decayVertexError = GlobalError(ksref->vertexCovariance(0,0), ksref->vertexCovariance(0,1), ksref->vertexCovariance(1,1), ksref->vertexCovariance(0,2), ksref->vertexCovariance(1,2), ksref->vertexCovariance(2,2));
557 
558  double kaon_significance = ( distanceComputerXY.distance( BSVertexState, VertexState( dec_pos, decayVertexError ) ) ).significance();
559 
560  if ( ( ksref->vertexNormalizedChi2()<=7. ) &&
561  ( fabs(ksref->mass() - kMass)<=0.06 ) &&
562  ( kaon_significance>25. ) ) {
563 
564  cleanedKaonColl->push_back(*ksref);
565 
566  }
567 
568  }
569 
570  return cleanedKaonColl;
571 
572 }
573 
574 /*************************************************************************************/
575 /* function to filter the Lambda collection */
576 /*************************************************************************************/
577 
578 auto_ptr<VertexCompositeCandidateCollection>
580 {
581 
582  auto_ptr<VertexCompositeCandidateCollection> cleanedLambdaColl(new VertexCompositeCandidateCollection() );
583 
584  for ( unsigned int lambdacoll_idx=0; lambdacoll_idx<LambdasH->size(); lambdacoll_idx++ ) {
585 
586  VertexCompositeCandidateRef lambdaref(LambdasH,lambdacoll_idx);
587 
588  if ( !cleanedColl ) {
589  cleanedLambdaColl->push_back(*lambdaref);
590  continue;
591  }
592 
593  GlobalPoint dec_pos = RecoVertex::convertPos(lambdaref->vertex());
594 
595  GlobalError decayVertexError = GlobalError(lambdaref->vertexCovariance(0,0), lambdaref->vertexCovariance(0,1), lambdaref->vertexCovariance(1,1), lambdaref->vertexCovariance(0,2), lambdaref->vertexCovariance(1,2), lambdaref->vertexCovariance(2,2));
596 
597  double lambda_significance = ( distanceComputerXY.distance( BSVertexState, VertexState( dec_pos, decayVertexError ) ) ).significance();
598 
599  if ( ( lambdaref->vertexNormalizedChi2()<=7. ) &&
600  ( fabs(lambdaref->mass() - lamMass)<=0.04 ) &&
601  ( lambda_significance>26. ) ){
602 
603  cleanedLambdaColl->push_back(*lambdaref);
604 
605  }
606 
607  }
608 
609  return cleanedLambdaColl;
610 
611 }
612 
613 /*************************************************************************************/
614 /* function to find out if the track comes from a V0 decay */
615 /*************************************************************************************/
616 
617 bool
619 {
620 
621  //the part for the reassociation of particles from V= decays
622  for(VertexCompositeCandidateCollection::const_iterator iV0=cleanedVCCC.begin(); iV0!=cleanedVCCC.end(); iV0++){
623 
624  const RecoChargedCandidate *dauCand1 = dynamic_cast<const RecoChargedCandidate*>(iV0->daughter(0));
625  TrackRef dauTk1 = dauCand1->track();
626  const RecoChargedCandidate *dauCand2 = dynamic_cast<const RecoChargedCandidate*>(iV0->daughter(1));
627  TrackRef dauTk2 = dauCand2->track();
628 
629  if ( (trackref==dauTk1) || (trackref==dauTk2) ) {
630 
631  *V0 = *iV0;
632  return true;
633 
634  }
635 
636  }
637 
638  return false;
639 
640 }
641 
642 
643 /*************************************************************************************/
644 /* function to find the closest vertex in z for a track from a V0 */
645 /*************************************************************************************/
646 
647 VertexRef
648 PF_PU_AssoMapAlgos::FindV0Vertex(const TrackRef trackref, const VertexCompositeCandidate& V0_vtx, ESHandle<MagneticField> bFieldH, const EventSetup& iSetup, Handle<BeamSpot> bsH, std::vector<reco::VertexRef>* vtxcollV, double tWeight)
649 {
650 
651  math::XYZPoint dec_pos = V0_vtx.vertex();
652 
653  math::XYZVector dec_mom( V0_vtx.momentum().x(),
654  V0_vtx.momentum().y(),
655  V0_vtx.momentum().z() );
656 
657  Track V0(trackref->chi2(), trackref->ndof(), dec_pos, dec_mom, 0, trackref->covariance());
658 
659  TransientTrack transV0(V0, &(*bFieldH) );
660  transV0.setBeamSpot( *bsH );
661  transV0.setES( iSetup );
662 
663  return FindClosest3D(transV0, vtxcollV, tWeight);
664 
665 }
666 
667 
668 /*************************************************************************************/
669 /* function to filter the nuclear interaction collection */
670 /*************************************************************************************/
671 
672 auto_ptr<PFDisplacedVertexCollection>
674 {
675 
676  auto_ptr<PFDisplacedVertexCollection> cleanedNIColl(new PFDisplacedVertexCollection() );
677 
678  for ( PFDisplacedVertexCollection::const_iterator niref=NuclIntH->begin(); niref!=NuclIntH->end(); niref++ ) {
679 
680  if ( !cleanedColl ) {
681  cleanedNIColl->push_back(*niref);
682  continue;
683  }
684 
685  GlobalPoint ni_pos = RecoVertex::convertPos( niref->position() );
686  GlobalError interactionVertexError = RecoVertex::convertError( niref->error() );
687 
688  double nuclint_distance = ( distanceComputerXY.distance( BSVertexState, VertexState( ni_pos, interactionVertexError ) ) ).value();
689 
690  if ( ( !niref->isFake() ) &&
691  ( niref->isNucl() ) &&
692  ( niref->normalizedChi2()<=2. ) &&
693  ( niref->tracksSize()>=2 ) &&
694  ( nuclint_distance>3. ) ) {
695 
696  cleanedNIColl->push_back(*niref);
697 
698  }
699 
700  }
701 
702  return cleanedNIColl;
703 
704 }
705 
706 /*************************************************************************************/
707 /* function to find out if the track comes from a nuclear interaction */
708 /*************************************************************************************/
709 
710 bool
712 {
713 
714  //the part for the reassociation of particles from nuclear interactions
715  for ( PFDisplacedVertexCollection::const_iterator iDisplV=cleanedNI.begin(); iDisplV!=cleanedNI.end(); iDisplV++ ) {
716 
717  if ( iDisplV->trackWeight(trackref)>1.e-5 ) {
718 
719  *displVtx = *iDisplV;
720  return true;
721 
722  }
723 
724  }
725 
726  return false;
727 
728 }
729 
730 
731 /*************************************************************************************/
732 /* function to find the closest vertex in z for a track from a nuclear interaction */
733 /*************************************************************************************/
734 
735 VertexRef
736 PF_PU_AssoMapAlgos::FindNIVertex(const TrackRef trackref, const PFDisplacedVertex& displVtx, ESHandle<MagneticField> bFieldH, const EventSetup& iSetup, Handle<BeamSpot> bsH, std::vector<reco::VertexRef>* vtxcollV, double tWeight, TransientTrack transhelp)
737 {
738 
739  TrackCollection refittedTracks = displVtx.refittedTracks();
740 
741  if ( ( displVtx.isTherePrimaryTracks() ) || ( displVtx.isThereMergedTracks() ) ){
742 
743  for ( TrackCollection::const_iterator trkcoll_ite=refittedTracks.begin(); trkcoll_ite!=refittedTracks.end(); trkcoll_ite++ ) {
744 
745  const TrackBaseRef retrackbaseref = displVtx.originalTrack(*trkcoll_ite);
746 
747  if ( displVtx.isIncomingTrack( retrackbaseref ) ) {
748 
749  VertexRef bestvertexref = vtxcollV->at(0);
750  float bestweight = 0.;
751 
752  for ( unsigned int index_vtx=0; index_vtx<vtxcollV->size(); ++index_vtx ) {
753 
754  VertexRef vertexref = vtxcollV->at(index_vtx);
755 
756  //get the most probable vertex for the track
757  float weight = vertexref->trackWeight(retrackbaseref);
758  if(weight>bestweight){
759  bestweight = weight;
760  bestvertexref = vertexref;
761  }
762 
763  }
764 
765  if ( bestweight>1.e-5 ) return bestvertexref;
766 
767  TransientTrack transIncom(*retrackbaseref, &(*bFieldH) );
768  transIncom.setBeamSpot( *bsH );
769  transIncom.setES( iSetup );
770 
771  return FindClosest3D(transIncom, vtxcollV, tWeight);
772 
773  }
774 
775  }
776 
777  }
778 
779  return FindClosest3D(transhelp, vtxcollV, tWeight);
780 
781 }
782 
783 
784 /*************************************************************************************/
785 /* function to filter the inclusive vertex finder collection */
786 /*************************************************************************************/
787 
788 auto_ptr<VertexCollection>
790 {
791 
792  auto_ptr<VertexCollection> cleanedIVFColl(new VertexCollection() );
793 
794  for ( VertexCollection::const_iterator ivfref=ifvH->begin(); ivfref!=ifvH->end(); ivfref++ ) {
795 
796  if ( !cleanedColl ) {
797  cleanedIVFColl->push_back(*ivfref);
798  continue;
799  }
800 
801  GlobalPoint iv_pos = RecoVertex::convertPos( ivfref->position() );
802  GlobalError iv_err = RecoVertex::convertError( ivfref->error() );
803 
804  double ivf_significance = ( distanceComputerXY.distance( BSVertexState, VertexState( iv_pos, iv_err ))).significance();
805 
806  if ( ( ivfref->isValid() ) &&
807  ( !ivfref->isFake() ) &&
808  ( ivfref->chi2()<=10. ) &&
809  ( ivfref->nTracks(0.)>=2 ) &&
810  ( ivf_significance>=5. ) ) {
811 
812  cleanedIVFColl->push_back(*ivfref);
813 
814  }
815 
816  }
817 
818  return cleanedIVFColl;
819 
820 }
821 
822 /*************************************************************************************/
823 /* function to find out if the track comes from a inclusive vertex */
824 /*************************************************************************************/
825 
826 bool
827 PF_PU_AssoMapAlgos::ComesFromIVF(const TrackRef trackref, const VertexCollection& cleanedIVF, Vertex* ivfVtx)
828 {
829 
830  for(VertexCollection::const_iterator iInclV=cleanedIVF.begin(); iInclV!=cleanedIVF.end(); iInclV++){
831 
832  if(iInclV->trackWeight(trackref)>1.e-5){
833 
834  *ivfVtx = *iInclV;
835  return true;
836 
837  }
838 
839  }
840 
841  return false;
842 
843 }
844 
845 /*************************************************************************************/
846 /* function to find the closest vertex in z for a track from an inclusive vertex */
847 /*************************************************************************************/
848 
849 VertexRef
850 PF_PU_AssoMapAlgos::FindIVFVertex(const TrackRef trackref, const Vertex& ivfVtx, ESHandle<MagneticField> bFieldH, const EventSetup& iSetup, Handle<BeamSpot> bsH, std::vector<reco::VertexRef>* vtxcollV, double tWeight)
851 {
852 
853  math::XYZPoint iv_pos = ivfVtx.position();
854 
855  math::XYZVector iv_mom( ivfVtx.p4(0.1, 0.).x(),
856  ivfVtx.p4(0.1, 0.).y(),
857  ivfVtx.p4(0.1, 0.).z() );
858 
859  Track incom(trackref->chi2(), trackref->ndof(), iv_pos, iv_mom, 0, trackref->covariance());
860 
861  TransientTrack transIncom(incom, &(*bFieldH) );
862  transIncom.setBeamSpot( *bsH );
863  transIncom.setES( iSetup );
864 
865  return FindClosest3D(transIncom, vtxcollV, tWeight);
866 
867 }
868 
869 
870 /*************************************************************************************/
871 /* function to find the vertex with the highest TrackWeight for a certain track */
872 /*************************************************************************************/
873 
874 VertexRef
875 PF_PU_AssoMapAlgos::TrackWeightAssociation(const TrackBaseRef& trackbaseRef, std::vector<reco::VertexRef>* vtxcollV)
876 {
877 
878  VertexRef bestvertexref = vtxcollV->at(0);
879  float bestweight = 0.;
880 
881  //loop over all vertices in the vertex collection
882  for(unsigned int index_vtx=0; index_vtx<vtxcollV->size(); ++index_vtx){
883 
884  VertexRef vertexref = vtxcollV->at(index_vtx);
885 
886  //get the most probable vertex for the track
887  float weight = vertexref->trackWeight(trackbaseRef);
888  if(weight>bestweight){
889  bestweight = weight;
890  bestvertexref = vertexref;
891  }
892 
893  }
894 
895  return bestvertexref;
896 
897 }
898 
899 /*************************************************************************************/
900 /* find an association for a certain track */
901 /*************************************************************************************/
902 
904 PF_PU_AssoMapAlgos::FindAssociation(const reco::TrackRef& trackref, std::vector<reco::VertexRef>* vtxColl, edm::ESHandle<MagneticField> bfH, const edm::EventSetup& iSetup, edm::Handle<reco::BeamSpot> bsH, int assocNum)
905 {
906 
907  const TrackBaseRef& trackbaseRef = TrackBaseRef(trackref);
908 
909  TransientTrack transtrk(trackref, &(*bfH) );
910  transtrk.setBeamSpot(*bsH);
911  transtrk.setES(iSetup);
912 
913  VertexRef foundVertex;
914 
915  //if it is not the first try of an association jump to the final association
916  //to avoid multiple (secondary) associations and/or unphysical (primary and secondary) associations
917  if ( assocNum>0 ) goto finalStep;
918 
919  // Step 1: First round of association:
920  // Find the vertex with the highest track-to-vertex association weight
921  foundVertex = TrackWeightAssociation(trackbaseRef, vtxColl);
922 
923  if ( foundVertex->trackWeight(trackbaseRef) >= 1.e-5 ){
924  return make_pair( foundVertex, 0. );
925  }
926 
927  // Step 2: Reassociation
928  // Second round of association:
929  // In case no vertex with track-to-vertex association weight > 1.e-5 is found,
930  // check the track originates from a neutral hadron decay, photon conversion or nuclear interaction
931 
932  if ( input_doReassociation_ ) {
933 
934  // Test if the track comes from a photon conversion:
935  // If so, try to find the vertex of the mother particle
936  Conversion gamma;
938  foundVertex = PF_PU_AssoMapAlgos::FindConversionVertex(trackref, gamma, bfH, iSetup, bsH, vtxColl, input_nTrack_3D_);
939  return make_pair( foundVertex, 1. );
940  }
941 
942  // Test if the track comes from a Kshort or Lambda decay:
943  // If so, reassociate the track to the vertex of the V0
945  if ( ( PF_PU_AssoMapAlgos::ComesFromV0Decay(trackref, *cleanedKshortCollP, &V0) ) ||
947  foundVertex = PF_PU_AssoMapAlgos::FindV0Vertex(trackref, V0, bfH, iSetup, bsH, vtxColl, input_nTrack_3D_);
948  return make_pair( foundVertex, 1. );
949  }
950 
951  if ( displVertexCollH.isValid() ) {
952 
953  // Test if the track comes from a nuclear interaction:
954  // If so, reassociate the track to the vertex of the incoming particle
955  PFDisplacedVertex displVtx;
956  if ( PF_PU_AssoMapAlgos::ComesFromNI(trackref, *cleanedNICollP, &displVtx) ){
957  foundVertex = PF_PU_AssoMapAlgos::FindNIVertex(trackref, displVtx, bfH, iSetup, bsH, vtxColl, input_nTrack_3D_, transtrk);
958  return make_pair( foundVertex, 1. );
959  }
960 
961  }
962 
963  if ( ivfVertexCollH.isValid() ) {
964 
965  // Test if the track comes from a nuclear interaction:
966  // If so, reassociate the track to the vertex of the incoming particle
967  Vertex ivfVtx;
968  if ( ComesFromIVF(trackref, *cleanedIVFCollP, &ivfVtx) ){
969  foundVertex = FindIVFVertex(trackref, ivfVtx, bfH, iSetup, bsH, vtxColl, input_nTrack_3D_);
970  return make_pair( foundVertex, 1. );
971  }
972 
973  }
974 
975  }
976 
977  // Step 3: Final association
978  // If no vertex is found with track-to-vertex association weight > 1.e-5
979  // and no reassociation was done do the final association
980  // look for the closest vertex in 3D or in z/longitudinal distance
981  // or associate the track always to the first vertex (default)
982 
983  finalStep:
984 
985  switch (input_FinalAssociation_) {
986 
987  case 1:{
988 
989  // closest in z
990  foundVertex = FindClosestZ(trackref, vtxColl, input_nTrack_z_);
991  break;
992 
993  }
994 
995  case 2:{
996 
997  // closest in 3D
998  TransientTrack transtrk(trackref, &(*bfH) );
999  transtrk.setBeamSpot(*bsH);
1000  transtrk.setES(iSetup);
1001 
1002  foundVertex = FindClosest3D(transtrk, vtxColl, input_nTrack_3D_);
1003  break;
1004 
1005  }
1006 
1007  default:{
1008 
1009  // allways first vertex
1010  foundVertex = vtxColl->at(0);
1011  break;
1012 
1013  }
1014 
1015  }
1016 
1017  return make_pair( foundVertex, 2. );
1018 
1019 }
1020 
1021 /*************************************************************************************/
1022 /* get the quality for a certain association */
1023 /*************************************************************************************/
1024 
1025 int
1026 PF_PU_AssoMapAlgos::DefineQuality(vector< pair<int, double> > distances, int step, double distance)
1027 {
1028 
1029  int quality = 0;
1030  int assoc_ite = distances.size();
1031 
1032  if ( assoc_ite >= 2 ) return 0;
1033 
1034  switch ( step ) {
1035 
1036  case 0:{
1037 
1038  //TrackWeight association
1039  if ( distance <= tw_1st_90_cum ) {
1040  quality = 6;
1041  } else {
1042  quality = 5;
1043  }
1044  break;
1045 
1046  }
1047 
1048  case 1:{
1049 
1050  //Secondary association
1051  if ( distance <= sc_1st_70_cum ) {
1052  quality = 5;
1053  } else {
1054  quality = 4;
1055  }
1056  break;
1057 
1058  }
1059 
1060  case 2:{
1061 
1062  //Final association
1063  if ( input_FinalAssociation_ == 0 ) {
1064 
1065  // always first vertex
1066  if ( assoc_ite == 0 ) {
1067 
1068  if ( distance <= f1_1st_70_cum ) {
1069  quality = 5;
1070  } else {
1071  if ( distance <= f1_1st_50_cum ) {
1072  quality = 4;
1073  } else {
1074  quality = 3;
1075  }
1076  }
1077 
1078  } else {
1079 
1080  int firstStep = distances.at(0).first;
1081  int firstDistance = distances.at(0).second;
1082 
1083  switch ( firstStep ) {
1084 
1085  case 0:{
1086 
1087  if ( ( firstDistance <= tw_1st_50 ) &&
1088  ( distance <= tw_2nd_f1_cum ) ) {
1089  quality = 2;
1090  } else {
1091  quality = 1;
1092  }
1093  break;
1094 
1095  }
1096 
1097  case 1:{
1098 
1099  if ( ( ( firstDistance <= sc_1st_50 ) && ( distance <= sc_2nd_f1_0_cum ) ) ||
1100  ( ( firstDistance > sc_1st_50 ) && ( distance <= sc_2nd_f1_1_cum ) ) ) {
1101  quality = 2;
1102  } else {
1103  quality = 1;
1104  }
1105  break;
1106 
1107  }
1108 
1109  case 2:{
1110  quality = 1;
1111  }
1112 
1113  default:{
1114  quality = 1;
1115  }
1116 
1117  }
1118 
1119  }
1120 
1121  } else {
1122 
1123  if ( input_FinalAssociation_ == 1 ) {
1124 
1125  // closest in z
1126  if ( assoc_ite == 0 ) {
1127 
1128  if ( distance <= fz_1st_70_cum ) {
1129  quality = 5;
1130  } else {
1131  if ( distance <= fz_1st_50_cum ) {
1132  quality = 4;
1133  } else {
1134  quality = 3;
1135  }
1136  }
1137 
1138  } else {
1139 
1140  int firstStep = distances.at(0).first;
1141  int firstDistance = distances.at(0).second;
1142 
1143  switch ( firstStep ) {
1144 
1145  case 0:{
1146 
1147  if ( ( firstDistance <= tw_1st_50 ) &&
1148  ( distance <= tw_2nd_fz_cum ) ) {
1149  quality = 2;
1150  } else {
1151  quality = 1;
1152  }
1153  break;
1154 
1155  }
1156 
1157  case 1:{
1158 
1159  if ( ( ( firstDistance <= sc_1st_50 ) && ( distance <= sc_2nd_fz_0_cum ) ) ||
1160  ( ( firstDistance > sc_1st_50 ) && ( distance <= sc_2nd_fz_1_cum ) ) ) {
1161  quality = 2;
1162  } else {
1163  quality = 1;
1164  }
1165  break;
1166 
1167  }
1168 
1169  case 2:{
1170 
1171  if ( ( firstDistance <= fz_1st_50 ) &&
1172  ( distance <= fz_2nd_fz_cum ) ) {
1173  quality = 2;
1174  } else {
1175  quality = 1;
1176  }
1177  break;
1178 
1179  }
1180 
1181  default:{
1182  quality = 1;
1183  }
1184 
1185  }
1186 
1187  }
1188 
1189  } else {
1190 
1191  // closest in 3D
1192  if ( assoc_ite == 0 ) {
1193 
1194  if ( distance <= f3_1st_70_cum ) {
1195  quality = 5;
1196  } else {
1197  if ( distance <= f3_1st_50_cum ) {
1198  quality = 4;
1199  } else {
1200  quality = 3;
1201  }
1202  }
1203 
1204  } else {
1205 
1206  int firstStep = distances.at(0).first;
1207  int firstDistance = distances.at(0).second;
1208 
1209  switch ( firstStep ) {
1210 
1211  case 0:{
1212 
1213  if ( ( firstDistance <= tw_1st_50 ) &&
1214  ( distance <= tw_2nd_f3_cum ) ) {
1215  quality = 2;
1216  } else {
1217  quality = 1;
1218  }
1219  break;
1220 
1221  }
1222 
1223  case 1:{
1224 
1225  if ( ( ( firstDistance <= sc_1st_50 ) && ( distance <= sc_2nd_f3_0_cum ) ) ||
1226  ( ( firstDistance > sc_1st_50 ) && ( distance <= sc_2nd_f3_1_cum ) ) ) {
1227  quality = 2;
1228  } else {
1229  quality = 1;
1230  }
1231  break;
1232 
1233  }
1234 
1235  case 2:{
1236 
1237  if ( ( firstDistance <= fz_1st_50 ) &&
1238  ( distance <= f3_2nd_f3_cum ) ) {
1239  quality = 2;
1240  } else {
1241  quality = 1;
1242  }
1243  break;
1244 
1245  }
1246 
1247  default:{
1248  quality = 1;
1249  }
1250 
1251  }
1252 
1253  }
1254  }
1255  }
1256 
1257  break;
1258  }
1259 
1260  default:{
1261  quality = 0;
1262  break;
1263  }
1264 
1265  }
1266 
1267  return quality;
1268 
1269 }
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:97
VertexStepPair FindAssociation(const reco::TrackRef &, std::vector< reco::VertexRef > *, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, int)
reco::Vertex::Point convertPos(const GlobalPoint &p)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual std::auto_ptr< reco::VertexCompositeCandidateCollection > GetCleanedLambda(edm::Handle< reco::VertexCompositeCandidateCollection >, bool)
edm::InputTag IFVVertexCollection_
std::vector< PFDisplacedVertex > PFDisplacedVertexCollection
collection of PFDisplacedVertex objects
static bool matchesConversion(const reco::GsfElectron &ele, const reco::Conversion &conv, bool allowCkfMatch=true, bool allowAmbiguousGsfMatch=false)
std::vector< TrackQualityPair > TrackQualityPairVector
edm::ESHandle< MagneticField > bFieldH
const double tw_1st_50
const double lamMass
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
edm::InputTag ConversionsCollection_
virtual std::auto_ptr< reco::ConversionCollection > GetCleanedConversions(edm::Handle< reco::ConversionCollection >, bool)
const double fz_1st_70_cum
const double f1_1st_50_cum
const double sc_2nd_f3_0_cum
const bool isTherePrimaryTracks() const
--—— Provide useful information --—— ///
const_iterator end() const
last iterator over the map (read only)
const double sc_2nd_f3_1_cum
void setBeamSpot(const reco::BeamSpot &beamSpot)
const double kMass
TrackBaseRef originalTrack(const Track &refTrack) const
Definition: Vertex.cc:85
static bool ComesFromNI(const reco::TrackRef, const reco::PFDisplacedVertexCollection &, reco::PFDisplacedVertex *)
static reco::VertexRef FindConversionVertex(const reco::TrackRef, const reco::Conversion &, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, std::vector< reco::VertexRef > *, double)
virtual const Point & vertex() const
vertex position (overwritten by PF...)
edm::InputTag KshortCollection_
void EraseVertex(std::vector< reco::VertexRef > *, reco::VertexRef)
reco::Vertex::Error convertError(const GlobalError &ge)
Definition: ConvertError.h:8
edm::InputTag LambdaCollection_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
static reco::VertexRef FindClosest3D(reco::TransientTrack, std::vector< reco::VertexRef > *, double tWeight=0.)
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:37
VertexDistanceXY distanceComputerXY
const bool isIncomingTrack(const reco::TrackBaseRef &originalTrack) const
Is primary or merged track.
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
const double sc_2nd_f1_1_cum
const double f3_1st_50_cum
edm::InputTag input_VertexCollection_
std::auto_ptr< TrackToVertexAssMap > CreateTrackToVertexMap(edm::Handle< reco::TrackCollection >, const edm::EventSetup &)
tuple firstStep
First step, triplets, r=0.2 cm.
const std::vector< Track > & refittedTracks() const
Returns the container of refitted tracks.
Definition: Vertex.h:135
static reco::VertexRef FindNIVertex(const reco::TrackRef, const reco::PFDisplacedVertex &, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, std::vector< reco::VertexRef > *, double, reco::TransientTrack)
const double fz_1st_50
const double sc_1st_70_cum
const Point & position() const
position
Definition: Vertex.h:92
const double fz_2nd_fz_cum
std::pair< reco::VertexRef, int > VertexStepPair
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
edm::Handle< reco::VertexCollection > ivfVertexCollH
const double sc_1st_50
U second(std::pair< T, U > const &p)
static reco::VertexRef FindV0Vertex(const reco::TrackRef, const reco::VertexCompositeCandidate &, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, std::vector< reco::VertexRef > *, double)
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition: GlobalError.h:11
std::auto_ptr< reco::VertexCollection > cleanedIVFCollP
const double sc_2nd_fz_0_cum
std::vector< VertexPtsumPair > VertexPtsumVector
const double tw_2nd_fz_cum
int iEvent
Definition: GenABIO.cc:243
static reco::VertexRef FindClosestZ(const reco::TrackRef, std::vector< reco::VertexRef > *, double tWeight=0.)
edm::InputTag input_BeamSpot_
edm::InputTag NIVertexCollection_
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:22
const double tw_1st_90_cum
T sqrt(T t)
Definition: SSEVec.h:48
const double sc_2nd_f1_0_cum
const double f1_1st_70_cum
edm::Handle< reco::PFDisplacedVertexCollection > displVertexCollH
virtual void GetInputCollections(edm::Event &, const edm::EventSetup &)
std::auto_ptr< reco::VertexCompositeCandidateCollection > cleanedKshortCollP
static reco::VertexRef FindIVFVertex(const reco::TrackRef, const reco::Vertex &, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, std::vector< reco::VertexRef > *, double)
static reco::VertexRef TrackWeightAssociation(const reco::TrackBaseRef &, std::vector< reco::VertexRef > *)
edm::AssociationMap< edm::OneToManyWithQuality< reco::VertexCollection, reco::TrackCollection, int > > TrackToVertexAssMap
virtual Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const
bool isValid() const
Definition: HandleBase.h:76
std::auto_ptr< reco::VertexCompositeCandidateCollection > cleanedLambdaCollP
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
const double tw_2nd_f3_cum
void setES(const edm::EventSetup &es)
edm::Handle< reco::VertexCollection > vtxcollH
std::auto_ptr< TrackToVertexAssMap > SortAssociationMap(TrackToVertexAssMap *)
std::auto_ptr< reco::PFDisplacedVertexCollection > cleanedNICollP
const double fz_1st_50_cum
math::XYZTLorentzVectorF refittedPair4Momentum() const
Conversion track pair 4-momentum from the tracks refitted with vertex constraint. ...
Definition: Conversion.cc:235
Block of elements.
virtual std::auto_ptr< reco::VertexCompositeCandidateCollection > GetCleanedKshort(edm::Handle< reco::VertexCompositeCandidateCollection >, bool)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
math::XYZTLorentzVectorD p4(float mass=0.13957018, float minWeight=0.5) const
Returns the four momentum of the sum of the tracks, assuming the given mass for the decay products...
Definition: Vertex.cc:112
virtual std::auto_ptr< reco::VertexCollection > GetCleanedIVF(edm::Handle< reco::VertexCollection >, bool)
const T & get() const
Definition: EventSetup.h:55
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
virtual Vector momentum() const GCC11_FINAL
spatial momentum vector
key_type key() const
Accessor for product key.
Definition: Ref.h:266
edm::Handle< reco::VertexCompositeCandidateCollection > vertCompCandCollLambdaH
virtual reco::TrackRef track() const
reference to a track
std::vector< reco::VertexRef > * CreateVertexVector(edm::Handle< reco::VertexCollection >)
std::string const & label() const
Definition: InputTag.h:42
const double tw_2nd_f1_cum
int DefineQuality(StepDistancePairVector, int, double)
static bool ComesFromConversion(const reco::TrackRef, const reco::ConversionCollection &, reco::Conversion *)
virtual std::auto_ptr< reco::PFDisplacedVertexCollection > GetCleanedNI(edm::Handle< reco::PFDisplacedVertexCollection >, bool)
static bool ComesFromV0Decay(const reco::TrackRef, const reco::VertexCompositeCandidateCollection &, reco::VertexCompositeCandidate *)
const double f3_1st_70_cum
edm::Handle< reco::BeamSpot > beamspotH
const_iterator begin() const
first iterator over the map (read only)
const double f3_2nd_f3_cum
static bool ComesFromIVF(const reco::TrackRef, const reco::VertexCollection &, reco::Vertex *)
edm::Handle< reco::ConversionCollection > convCollH
int weight
Definition: histoStyle.py:50
const bool isThereMergedTracks() const
If a merged track was identified.
const double sc_2nd_fz_1_cum
std::auto_ptr< VertexToTrackAssMap > CreateVertexToTrackMap(edm::Handle< reco::TrackCollection >, const edm::EventSetup &)
edm::AssociationMap< edm::OneToManyWithQuality< reco::TrackCollection, reco::VertexCollection, int > > VertexToTrackAssMap
edm::Handle< reco::VertexCompositeCandidateCollection > vertCompCandCollKshortH
PF_PU_AssoMapAlgos(const edm::ParameterSet &)
std::vector< StepDistancePair > StepDistancePairVector
std::auto_ptr< reco::ConversionCollection > cleanedConvCollP