CMS 3D CMS Logo

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), numWarnings_(0) {
28  input_MaxNumAssociations_ = iConfig.getParameter<int>("MaxNumberOfAssociations");
29 
30  token_VertexCollection_ = iC.consumes<VertexCollection>(iConfig.getParameter<InputTag>("VertexCollection"));
31 
32  token_BeamSpot_ = iC.consumes<BeamSpot>(iConfig.getParameter<InputTag>("BeamSpot"));
33 
34  input_doReassociation_ = iConfig.getParameter<bool>("doReassociation");
35  cleanedColls_ = iConfig.getParameter<bool>("GetCleanedCollections");
36 
38  iC.consumes<ConversionCollection>(iConfig.getParameter<InputTag>("ConversionsCollection"));
39 
41  iC.consumes<VertexCompositeCandidateCollection>(iConfig.getParameter<InputTag>("V0KshortCollection"));
43  iC.consumes<VertexCompositeCandidateCollection>(iConfig.getParameter<InputTag>("V0LambdaCollection"));
44 
46  iC.consumes<PFDisplacedVertexCollection>(iConfig.getParameter<InputTag>("NIVertexCollection"));
47 
48  input_FinalAssociation_ = iConfig.getUntrackedParameter<int>("FinalAssociation", 0);
49 
50  ignoremissingpfcollection_ = iConfig.getParameter<bool>("ignoreMissingCollection");
51 
52  input_nTrack_ = iConfig.getParameter<double>("nTrackWeight");
53 }
54 
55 /*************************************************************************************/
56 /* get all needed collections at the beginning */
57 /*************************************************************************************/
58 
60  //get the offline beam spot
61  iEvent.getByToken(token_BeamSpot_, beamspotH);
62 
63  //get the conversion collection for the gamma conversions
66 
67  //get the vertex composite candidate collection for the Kshort's
70 
71  //get the vertex composite candidate collection for the Lambda's
74 
75  //get the displaced vertex collection for nuclear interactions
76  //create a new bool, true if no displaced vertex collection is in the event, mostly for AOD
77  missingColls = false;
80  missingColls = true;
81 
83  LogWarning("PF_PU_AssoMapAlgos::GetInputCollections")
84  << "No Extra objects available in input file --> skipping reconstruction of displaced vertices !!" << endl;
85  ++numWarnings_;
86  }
87  }
88  } else {
90  }
91 
92  //get the input vertex collection
94 
96 }
97 
98 /*************************************************************************************/
99 /* create the track-to-vertex and vertex-to-track maps in one go */
100 /*************************************************************************************/
101 std::pair<std::unique_ptr<TrackToVertexAssMap>, std::unique_ptr<VertexToTrackAssMap>>
103  unique_ptr<TrackToVertexAssMap> track2vertex(new TrackToVertexAssMap(vtxcollH, trkcollH));
104  unique_ptr<VertexToTrackAssMap> vertex2track(new VertexToTrackAssMap(trkcollH, vtxcollH));
105 
106  int num_vertices = vtxcollH->size();
107  if (num_vertices < input_MaxNumAssociations_)
108  input_MaxNumAssociations_ = num_vertices;
109  vector<VertexRef> vtxColl_help;
110  if (input_MaxNumAssociations_ == 1)
111  vtxColl_help = CreateVertexVector(vtxcollH);
112 
113  //loop over all tracks of the track collection
114  for (size_t idxTrack = 0; idxTrack < trkcollH->size(); ++idxTrack) {
115  TrackRef trackref = TrackRef(trkcollH, idxTrack);
116 
117  TransientTrack transtrk(trackref, &(*bFieldH));
118  transtrk.setBeamSpot(*beamspotH);
119  transtrk.setES(iSetup);
120 
122  vtxColl_help = CreateVertexVector(vtxcollH);
123 
124  for (int assoc_ite = 0; assoc_ite < input_MaxNumAssociations_; ++assoc_ite) {
125  VertexStepPair assocVtx = FindAssociation(trackref, vtxColl_help, bFieldH, iSetup, beamspotH, assoc_ite);
126  int step = assocVtx.second;
127  double distance = (IPTools::absoluteImpactParameter3D(transtrk, *(assocVtx.first))).second.value();
128 
129  int quality = DefineQuality(assoc_ite, step, distance);
130 
131  //std::cout << "associating track: Pt = " << trackref->pt() << ","
132  // << " eta = " << trackref->eta() << ", phi = " << trackref->phi()
133  // << " to vertex: z = " << associatedVertex.first->position().z() << " with quality q = " << quality << std::endl;
134 
135  // Insert the best vertex and the pair of track and the quality of this association in the map
136  track2vertex->insert(assocVtx.first, make_pair(trackref, quality));
137  vertex2track->insert(trackref, make_pair(assocVtx.first, quality));
138 
139  //cleanup only if multiple iterations are made
141  PF_PU_AssoMapAlgos::EraseVertex(vtxColl_help, assocVtx.first);
142  }
143  }
144 
145  return {std::move(track2vertex), std::move(vertex2track)};
146 }
147 
148 /*************************************************************************************/
149 /* create the track to vertex association map */
150 /*************************************************************************************/
151 
152 std::unique_ptr<TrackToVertexAssMap> PF_PU_AssoMapAlgos::CreateTrackToVertexMap(
153  edm::Handle<reco::TrackCollection> trkcollH, const edm::EventSetup& iSetup) {
154  return createMappings(trkcollH, iSetup).first;
155 }
156 
157 /*************************************************************************************/
158 /* create the vertex to track association map */
159 /*************************************************************************************/
160 
161 std::unique_ptr<VertexToTrackAssMap> PF_PU_AssoMapAlgos::CreateVertexToTrackMap(
162  edm::Handle<reco::TrackCollection> trkcollH, const edm::EventSetup& iSetup) {
163  return createMappings(trkcollH, iSetup).second;
164 }
165 
166 /*****************************************************************************************/
167 /* function to sort the vertices in the AssociationMap by the sum of (pT - pT_Error)**2 */
168 /*****************************************************************************************/
169 
170 unique_ptr<TrackToVertexAssMap> PF_PU_AssoMapAlgos::SortAssociationMap(TrackToVertexAssMap* trackvertexassInput,
172  //create a new TrackVertexAssMap for the Output which will be sorted
173  unique_ptr<TrackToVertexAssMap> trackvertexassOutput(new TrackToVertexAssMap(vtxcollH, trkcollH));
174 
175  //Create and fill a vector of pairs of vertex and the summed (pT-pT_Error)**2 of the tracks associated to the vertex
176  VertexPtsumVector vertexptsumvector;
177 
178  //loop over all vertices in the association map
179  for (TrackToVertexAssMap::const_iterator assomap_ite = trackvertexassInput->begin();
180  assomap_ite != trackvertexassInput->end();
181  assomap_ite++) {
182  const VertexRef assomap_vertexref = assomap_ite->key;
183  const TrackQualityPairVector trckcoll = assomap_ite->val;
184 
185  float ptsum = 0;
186 
187  TrackRef trackref;
188 
189  //get the tracks associated to the vertex and calculate the manipulated pT**2
190  for (unsigned int trckcoll_ite = 0; trckcoll_ite < trckcoll.size(); trckcoll_ite++) {
191  trackref = trckcoll[trckcoll_ite].first;
192  int quality = trckcoll[trckcoll_ite].second;
193 
194  if (quality <= 2)
195  continue;
196 
197  double man_pT = trackref->pt() - trackref->ptError();
198  if (man_pT > 0.)
199  ptsum += man_pT * man_pT;
200  }
201 
202  vertexptsumvector.push_back(make_pair(assomap_vertexref, ptsum));
203  }
204 
205  while (!vertexptsumvector.empty()) {
206  VertexRef vertexref_highestpT;
207  float highestpT = 0.;
208  int highestpT_index = 0;
209 
210  for (unsigned int vtxptsumvec_ite = 0; vtxptsumvec_ite < vertexptsumvector.size(); vtxptsumvec_ite++) {
211  if (vertexptsumvector[vtxptsumvec_ite].second > highestpT) {
212  vertexref_highestpT = vertexptsumvector[vtxptsumvec_ite].first;
213  highestpT = vertexptsumvector[vtxptsumvec_ite].second;
214  highestpT_index = vtxptsumvec_ite;
215  }
216  }
217 
218  //loop over all vertices in the association map
219  for (TrackToVertexAssMap::const_iterator assomap_ite = trackvertexassInput->begin();
220  assomap_ite != trackvertexassInput->end();
221  assomap_ite++) {
222  const VertexRef assomap_vertexref = assomap_ite->key;
223  const TrackQualityPairVector trckcoll = assomap_ite->val;
224 
225  //if the vertex from the association map the vertex with the highest manipulated pT
226  //insert all associated tracks in the output Association Map
227  if (assomap_vertexref == vertexref_highestpT)
228  for (unsigned int trckcoll_ite = 0; trckcoll_ite < trckcoll.size(); trckcoll_ite++)
229  trackvertexassOutput->insert(assomap_vertexref, trckcoll[trckcoll_ite]);
230  }
231 
232  vertexptsumvector.erase(vertexptsumvector.begin() + highestpT_index);
233  }
234 
235  return trackvertexassOutput;
236 }
237 
238 /********************/
239 /* */
240 /* Member Functions */
241 /* */
242 /********************/
243 
244 /*************************************************************************************/
245 /* create helping vertex vector to remove associated vertices */
246 /*************************************************************************************/
247 
249  vector<VertexRef> output;
250  output.reserve(vtxcollH->size());
251  auto const nVtx = vtxcollH->size();
252  for (unsigned int i = 0; i < nVtx; ++i)
253  output.emplace_back(vtxcollH, i);
254 
255  return output;
256 }
257 
258 /****************************************************************************/
259 /* erase one vertex from the vertex vector */
260 /****************************************************************************/
261 
262 void PF_PU_AssoMapAlgos::EraseVertex(std::vector<reco::VertexRef>& vtxcollV, reco::VertexRef toErase) {
263  for (unsigned int index_vtx = 0; index_vtx < vtxcollV.size(); ++index_vtx) {
264  VertexRef vertexref = vtxcollV.at(index_vtx);
265 
266  if (vertexref == toErase) {
267  vtxcollV.erase(vtxcollV.begin() + index_vtx);
268  break;
269  }
270  }
271 }
272 
273 /*************************************************************************************/
274 /* function to find the closest vertex in 3D for a certain track */
275 /*************************************************************************************/
276 
278  const std::vector<reco::VertexRef>& vtxcollV,
279  double tWeight) {
280  double ztrack = trkref->vertex().z();
281 
282  VertexRef foundVertexRef = vtxcollV.at(0);
283 
284  double dzmin = 1e5;
285 
286  //loop over all vertices with a good quality in the vertex collection
287  for (unsigned int index_vtx = 0; index_vtx < vtxcollV.size(); ++index_vtx) {
288  VertexRef vertexref = vtxcollV.at(index_vtx);
289 
290  double nTracks = sqrt(vertexref->tracksSize());
291 
292  double z_distance = fabs(ztrack - vertexref->z());
293 
294  double weightedDistance = z_distance - tWeight * nTracks;
295 
296  if (weightedDistance < dzmin) {
297  dzmin = weightedDistance;
298  foundVertexRef = vertexref;
299  }
300  }
301 
302  return foundVertexRef;
303 }
304 
305 /*************************************************************************************/
306 /* function to find the closest vertex in 3D for a certain track */
307 /*************************************************************************************/
308 
310  const std::vector<reco::VertexRef>& vtxcollV,
311  double tWeight) {
312  VertexRef foundVertexRef = vtxcollV.at(0);
313 
314  double d3min = 1e5;
315 
316  //loop over all vertices with a good quality in the vertex collection
317  for (unsigned int index_vtx = 0; index_vtx < vtxcollV.size(); ++index_vtx) {
318  VertexRef vertexref = vtxcollV.at(index_vtx);
319 
320  double nTracks = sqrt(vertexref->tracksSize());
321 
322  double distance = 1e5;
323  pair<bool, Measurement1D> IpPair = IPTools::absoluteImpactParameter3D(transtrk, *vertexref);
324 
325  if (IpPair.first)
326  distance = IpPair.second.value();
327 
328  double weightedDistance = distance - tWeight * nTracks;
329 
330  if (weightedDistance < d3min) {
331  d3min = weightedDistance;
332  foundVertexRef = vertexref;
333  }
334  }
335 
336  return foundVertexRef;
337 }
338 
339 /****************************************************************************************/
340 /* function to calculate the deltaR between a vector and a vector connecting two points */
341 /****************************************************************************************/
342 
344  const math::XYZVector& vtx_mom,
346  double bs_x = bsH->x0();
347  double bs_y = bsH->y0();
348  double bs_z = bsH->z0();
349 
350  double connVec_x = vtx_pos.x() - bs_x;
351  double connVec_y = vtx_pos.y() - bs_y;
352  double connVec_z = vtx_pos.z() - bs_z;
353 
354  double connVec_r = sqrt(connVec_x * connVec_x + connVec_y * connVec_y + connVec_z * connVec_z);
355  double connVec_theta = acos(connVec_z * 1. / connVec_r);
356 
357  double connVec_eta = -1. * log(tan(connVec_theta * 1. / 2.));
358  double connVec_phi = atan2(connVec_y, connVec_x);
359 
360  return deltaR(vtx_mom.eta(), vtx_mom.phi(), connVec_eta, connVec_phi);
361 }
362 
363 /*************************************************************************************/
364 /* function to filter the conversion collection */
365 /*************************************************************************************/
366 
367 unique_ptr<ConversionCollection> PF_PU_AssoMapAlgos::GetCleanedConversions(
368  edm::Handle<reco::ConversionCollection> convCollH, Handle<BeamSpot> bsH, bool cleanedColl) {
369  unique_ptr<ConversionCollection> cleanedConvColl(new ConversionCollection());
370 
371  for (unsigned int convcoll_idx = 0; convcoll_idx < convCollH->size(); convcoll_idx++) {
372  ConversionRef convref(convCollH, convcoll_idx);
373 
374  if (!cleanedColl) {
375  cleanedConvColl->push_back(*convref);
376  continue;
377  }
378 
379  if ((convref->nTracks() == 2) && (fabs(convref->pairInvariantMass()) <= 0.1)) {
380  cleanedConvColl->push_back(*convref);
381  }
382  }
383 
384  return cleanedConvColl;
385 }
386 
387 /*************************************************************************************/
388 /* function to find out if the track comes from a gamma conversion */
389 /*************************************************************************************/
390 
392  const ConversionCollection& cleanedConvColl,
393  Conversion* gamma) {
394  for (unsigned int convcoll_ite = 0; convcoll_ite < cleanedConvColl.size(); convcoll_ite++) {
395  if (ConversionTools::matchesConversion(trackref, cleanedConvColl.at(convcoll_ite))) {
396  *gamma = cleanedConvColl.at(convcoll_ite);
397  return true;
398  }
399  }
400 
401  return false;
402 }
403 
404 /********************************************************************************/
405 /* function to find the closest vertex for a track from a conversion */
406 /********************************************************************************/
407 
409  const reco::Conversion& gamma,
411  const EventSetup& iSetup,
413  const std::vector<reco::VertexRef>& vtxcollV,
414  double tWeight) {
415  math::XYZPoint conv_pos = gamma.conversionVertex().position();
416 
417  math::XYZVector conv_mom(
418  gamma.refittedPair4Momentum().x(), gamma.refittedPair4Momentum().y(), gamma.refittedPair4Momentum().z());
419 
420  Track photon(trackref->chi2(), trackref->ndof(), conv_pos, conv_mom, 0, trackref->covariance());
421 
422  TransientTrack transpho(photon, &(*bfH));
423  transpho.setBeamSpot(*bsH);
424  transpho.setES(iSetup);
425 
426  return FindClosest3D(transpho, vtxcollV, tWeight);
427 }
428 
429 /*************************************************************************************/
430 /* function to filter the Kshort collection */
431 /*************************************************************************************/
432 
433 unique_ptr<VertexCompositeCandidateCollection> PF_PU_AssoMapAlgos::GetCleanedKshort(
434  Handle<VertexCompositeCandidateCollection> KshortsH, Handle<BeamSpot> bsH, bool cleanedColl) {
435  unique_ptr<VertexCompositeCandidateCollection> cleanedKaonColl(new VertexCompositeCandidateCollection());
436 
437  for (unsigned int kscoll_idx = 0; kscoll_idx < KshortsH->size(); kscoll_idx++) {
438  VertexCompositeCandidateRef ksref(KshortsH, kscoll_idx);
439 
440  if (!cleanedColl) {
441  cleanedKaonColl->push_back(*ksref);
442  continue;
443  }
444 
445  VertexDistance3D distanceComputer;
446 
447  GlobalPoint dec_pos = RecoVertex::convertPos(ksref->vertex());
448 
449  GlobalError decayVertexError = GlobalError(ksref->vertexCovariance(0, 0),
450  ksref->vertexCovariance(0, 1),
451  ksref->vertexCovariance(1, 1),
452  ksref->vertexCovariance(0, 2),
453  ksref->vertexCovariance(1, 2),
454  ksref->vertexCovariance(2, 2));
455 
456  math::XYZVector dec_mom(ksref->momentum().x(), ksref->momentum().y(), ksref->momentum().z());
457 
458  GlobalPoint bsPosition = RecoVertex::convertPos(bsH->position());
460 
461  double kaon_significance =
462  (distanceComputer.distance(VertexState(bsPosition, bsError), VertexState(dec_pos, decayVertexError)))
463  .significance();
464 
465  if ((ksref->vertex().rho() >= 3.) && (ksref->vertexNormalizedChi2() <= 3.) &&
466  (fabs(ksref->mass() - kMass) <= 0.01) && (kaon_significance > 15.) &&
467  (PF_PU_AssoMapAlgos::dR(ksref->vertex(), dec_mom, bsH) <= 0.3)) {
468  cleanedKaonColl->push_back(*ksref);
469  }
470  }
471 
472  return cleanedKaonColl;
473 }
474 
475 /*************************************************************************************/
476 /* function to filter the Lambda collection */
477 /*************************************************************************************/
478 
479 unique_ptr<VertexCompositeCandidateCollection> PF_PU_AssoMapAlgos::GetCleanedLambda(
480  Handle<VertexCompositeCandidateCollection> LambdasH, Handle<BeamSpot> bsH, bool cleanedColl) {
481  unique_ptr<VertexCompositeCandidateCollection> cleanedLambdaColl(new VertexCompositeCandidateCollection());
482 
483  for (unsigned int lambdacoll_idx = 0; lambdacoll_idx < LambdasH->size(); lambdacoll_idx++) {
484  VertexCompositeCandidateRef lambdaref(LambdasH, lambdacoll_idx);
485 
486  if (!cleanedColl) {
487  cleanedLambdaColl->push_back(*lambdaref);
488  continue;
489  }
490 
491  VertexDistance3D distanceComputer;
492 
493  GlobalPoint dec_pos = RecoVertex::convertPos(lambdaref->vertex());
494 
495  GlobalError decayVertexError = GlobalError(lambdaref->vertexCovariance(0, 0),
496  lambdaref->vertexCovariance(0, 1),
497  lambdaref->vertexCovariance(1, 1),
498  lambdaref->vertexCovariance(0, 2),
499  lambdaref->vertexCovariance(1, 2),
500  lambdaref->vertexCovariance(2, 2));
501 
502  math::XYZVector dec_mom(lambdaref->momentum().x(), lambdaref->momentum().y(), lambdaref->momentum().z());
503 
504  GlobalPoint bsPosition = RecoVertex::convertPos(bsH->position());
506 
507  double lambda_significance =
508  (distanceComputer.distance(VertexState(bsPosition, bsError), VertexState(dec_pos, decayVertexError)))
509  .significance();
510 
511  if ((lambdaref->vertex().rho() >= 3.) && (lambdaref->vertexNormalizedChi2() <= 3.) &&
512  (fabs(lambdaref->mass() - lamMass) <= 0.005) && (lambda_significance > 15.) &&
513  (PF_PU_AssoMapAlgos::dR(lambdaref->vertex(), dec_mom, bsH) <= 0.3)) {
514  cleanedLambdaColl->push_back(*lambdaref);
515  }
516  }
517 
518  return cleanedLambdaColl;
519 }
520 
521 /*************************************************************************************/
522 /* function to find out if the track comes from a V0 decay */
523 /*************************************************************************************/
524 
526  const VertexCompositeCandidateCollection& cleanedKshort,
527  const VertexCompositeCandidateCollection& cleanedLambda,
529  //the part for the reassociation of particles from Kshort decays
530  for (VertexCompositeCandidateCollection::const_iterator iKS = cleanedKshort.begin(); iKS != cleanedKshort.end();
531  iKS++) {
532  const RecoChargedCandidate* dauCand1 = dynamic_cast<const RecoChargedCandidate*>(iKS->daughter(0));
533  TrackRef dauTk1 = dauCand1->track();
534  const RecoChargedCandidate* dauCand2 = dynamic_cast<const RecoChargedCandidate*>(iKS->daughter(1));
535  TrackRef dauTk2 = dauCand2->track();
536 
537  if ((trackref == dauTk1) || (trackref == dauTk2)) {
538  *V0 = *iKS;
539  return true;
540  }
541  }
542 
543  //the part for the reassociation of particles from Lambda decays
544  for (VertexCompositeCandidateCollection::const_iterator iLambda = cleanedLambda.begin();
545  iLambda != cleanedLambda.end();
546  iLambda++) {
547  const RecoChargedCandidate* dauCand1 = dynamic_cast<const RecoChargedCandidate*>(iLambda->daughter(0));
548  TrackRef dauTk1 = dauCand1->track();
549  const RecoChargedCandidate* dauCand2 = dynamic_cast<const RecoChargedCandidate*>(iLambda->daughter(1));
550  TrackRef dauTk2 = dauCand2->track();
551 
552  if ((trackref == dauTk1) || (trackref == dauTk2)) {
553  *V0 = *iLambda;
554  return true;
555  }
556  }
557 
558  return false;
559 }
560 
561 /*************************************************************************************/
562 /* function to find the closest vertex in z for a track from a V0 */
563 /*************************************************************************************/
564 
566  const VertexCompositeCandidate& V0_vtx,
567  ESHandle<MagneticField> bFieldH,
568  const EventSetup& iSetup,
569  Handle<BeamSpot> bsH,
570  const std::vector<reco::VertexRef>& vtxcollV,
571  double tWeight) {
572  const math::XYZPoint& dec_pos = V0_vtx.vertex();
573 
574  math::XYZVector dec_mom(V0_vtx.momentum().x(), V0_vtx.momentum().y(), V0_vtx.momentum().z());
575 
576  Track V0(trackref->chi2(), trackref->ndof(), dec_pos, dec_mom, 0, trackref->covariance());
577 
578  TransientTrack transV0(V0, &(*bFieldH));
579  transV0.setBeamSpot(*bsH);
580  transV0.setES(iSetup);
581 
582  return FindClosest3D(transV0, vtxcollV, tWeight);
583 }
584 
585 /*************************************************************************************/
586 /* function to filter the nuclear interaction collection */
587 /*************************************************************************************/
588 
589 unique_ptr<PFDisplacedVertexCollection> PF_PU_AssoMapAlgos::GetCleanedNI(Handle<PFDisplacedVertexCollection> NuclIntH,
590  Handle<BeamSpot> bsH,
591  bool cleanedColl) {
592  unique_ptr<PFDisplacedVertexCollection> cleanedNIColl(new PFDisplacedVertexCollection());
593 
594  for (PFDisplacedVertexCollection::const_iterator niref = NuclIntH->begin(); niref != NuclIntH->end(); niref++) {
595  if ((niref->isFake()) || !(niref->isNucl()))
596  continue;
597 
598  if (!cleanedColl) {
599  cleanedNIColl->push_back(*niref);
600  continue;
601  }
602 
603  VertexDistance3D distanceComputer;
604 
605  GlobalPoint ni_pos = RecoVertex::convertPos(niref->position());
606  GlobalError interactionVertexError = RecoVertex::convertError(niref->error());
607 
608  math::XYZVector ni_mom(niref->primaryMomentum().x(), niref->primaryMomentum().y(), niref->primaryMomentum().z());
609 
610  GlobalPoint bsPosition = RecoVertex::convertPos(bsH->position());
612 
613  double nuclint_significance =
614  (distanceComputer.distance(VertexState(bsPosition, bsError), VertexState(ni_pos, interactionVertexError)))
615  .significance();
616 
617  if ((niref->position().rho() >= 3.) && (nuclint_significance > 15.) &&
618  (PF_PU_AssoMapAlgos::dR(niref->position(), ni_mom, bsH) <= 0.3)) {
619  cleanedNIColl->push_back(*niref);
620  }
621  }
622 
623  return cleanedNIColl;
624 }
625 
626 /*************************************************************************************/
627 /* function to find out if the track comes from a nuclear interaction */
628 /*************************************************************************************/
629 
631  const PFDisplacedVertexCollection& cleanedNI,
632  PFDisplacedVertex* displVtx) {
633  //the part for the reassociation of particles from nuclear interactions
634  for (PFDisplacedVertexCollection::const_iterator iDisplV = cleanedNI.begin(); iDisplV != cleanedNI.end(); iDisplV++) {
635  if (iDisplV->trackWeight(trackref) > 1.e-5) {
636  *displVtx = *iDisplV;
637  return true;
638  }
639  }
640 
641  return false;
642 }
643 
644 /*************************************************************************************/
645 /* function to find the closest vertex in z for a track from a nuclear interaction */
646 /*************************************************************************************/
647 
649  const PFDisplacedVertex& displVtx,
650  ESHandle<MagneticField> bFieldH,
651  const EventSetup& iSetup,
652  Handle<BeamSpot> bsH,
653  const std::vector<reco::VertexRef>& vtxcollV,
654  double tWeight) {
656 
657  if ((displVtx.isTherePrimaryTracks()) || (displVtx.isThereMergedTracks())) {
658  for (TrackCollection::const_iterator trkcoll_ite = refittedTracks.begin(); trkcoll_ite != refittedTracks.end();
659  trkcoll_ite++) {
660  const TrackBaseRef retrackbaseref = displVtx.originalTrack(*trkcoll_ite);
661 
662  if (displVtx.isIncomingTrack(retrackbaseref)) {
663  VertexRef VOAssociation = TrackWeightAssociation(retrackbaseref, vtxcollV);
664 
665  if (VOAssociation->trackWeight(retrackbaseref) >= 1.e-5) {
666  return VOAssociation;
667  }
668 
669  TransientTrack transIncom(*retrackbaseref, &(*bFieldH));
670  transIncom.setBeamSpot(*bsH);
671  transIncom.setES(iSetup);
672 
673  return FindClosest3D(transIncom, vtxcollV, tWeight);
674  }
675  }
676  }
677 
678  const math::XYZPoint& ni_pos = displVtx.position();
679 
680  math::XYZVector ni_mom(
681  displVtx.primaryMomentum().x(), displVtx.primaryMomentum().y(), displVtx.primaryMomentum().z());
682 
683  Track incom(trackref->chi2(), trackref->ndof(), ni_pos, ni_mom, 0, trackref->covariance());
684 
685  TransientTrack transIncom(incom, &(*bFieldH));
686  transIncom.setBeamSpot(*bsH);
687  transIncom.setES(iSetup);
688 
689  return FindClosest3D(transIncom, vtxcollV, tWeight);
690 }
691 
692 /*************************************************************************************/
693 /* function to find the vertex with the highest TrackWeight for a certain track */
694 /*************************************************************************************/
695 template <typename TREF>
697  const std::vector<reco::VertexRef>& vtxcollV) {
698  VertexRef bestvertexref = vtxcollV.at(0);
699  float bestweight = 0.;
700 
701  //loop over all vertices in the vertex collection
702  for (auto const& vertexref : vtxcollV) {
703  //get the most probable vertex for the track
704  float weight = vertexref->trackWeight(trackRef);
705  if (weight > bestweight) {
706  bestweight = weight;
707  bestvertexref = vertexref;
708  }
709  }
710 
711  return bestvertexref;
712 }
713 
714 /*************************************************************************************/
715 /* find an association for a certain track */
716 /*************************************************************************************/
717 
719  const std::vector<reco::VertexRef>& vtxColl,
721  const edm::EventSetup& iSetup,
723  int assocNum) {
724  VertexRef foundVertex;
725 
726  //if it is not the first try of an association jump to the final association
727  //to avoid multiple (secondary) associations and/or unphysical (primary and secondary) associations
728  if (assocNum > 0)
729  goto finalStep;
730 
731  // Step 1: First round of association:
732  // Find the vertex with the highest track-to-vertex association weight
733  foundVertex = TrackWeightAssociation(trackref, vtxColl);
734 
735  if (foundVertex->trackWeight(trackref) >= 1.e-5) {
736  return make_pair(foundVertex, 0.);
737  }
738 
739  // Step 2: Reassociation
740  // Second round of association:
741  // In case no vertex with track-to-vertex association weight > 1.e-5 is found,
742  // check the track originates from a neutral hadron decay, photon conversion or nuclear interaction
743 
745  // Test if the track comes from a photon conversion:
746  // If so, try to find the vertex of the mother particle
748  if (ComesFromConversion(trackref, *cleanedConvCollP, &gamma)) {
749  foundVertex = FindConversionVertex(trackref, gamma, bfH, iSetup, bsH, vtxColl, input_nTrack_);
750  return make_pair(foundVertex, 1.);
751  }
752 
753  // Test if the track comes from a Kshort or Lambda decay:
754  // If so, reassociate the track to the vertex of the V0
756  if (ComesFromV0Decay(trackref, *cleanedKshortCollP, *cleanedLambdaCollP, &V0)) {
757  foundVertex = FindV0Vertex(trackref, V0, bfH, iSetup, bsH, vtxColl, input_nTrack_);
758  return make_pair(foundVertex, 1.);
759  }
760 
761  if (!missingColls) {
762  // Test if the track comes from a nuclear interaction:
763  // If so, reassociate the track to the vertex of the incoming particle
764  PFDisplacedVertex displVtx;
765  if (ComesFromNI(trackref, *cleanedNICollP, &displVtx)) {
766  foundVertex = FindNIVertex(trackref, displVtx, bfH, iSetup, bsH, vtxColl, input_nTrack_);
767  return make_pair(foundVertex, 1.);
768  }
769  }
770  }
771 
772  // Step 3: Final association
773  // If no vertex is found with track-to-vertex association weight > 1.e-5
774  // and no reassociation was done do the final association
775  // look for the closest vertex in 3D or in z/longitudinal distance
776  // or associate the track always to the first vertex (default)
777 
778 finalStep:
779 
780  switch (input_FinalAssociation_) {
781  case 1: {
782  // closest in z
783  foundVertex = FindClosestZ(trackref, vtxColl, input_nTrack_);
784  break;
785  }
786 
787  case 2: {
788  // closest in 3D
789  TransientTrack transtrk(trackref, &(*bfH));
790  transtrk.setBeamSpot(*bsH);
791  transtrk.setES(iSetup);
792 
793  foundVertex = FindClosest3D(transtrk, vtxColl, input_nTrack_);
794  break;
795  }
796 
797  default: {
798  // allways first vertex
799  foundVertex = vtxColl.at(0);
800  break;
801  }
802  }
803 
804  return make_pair(foundVertex, 2.);
805 }
806 
807 /*************************************************************************************/
808 /* get the quality for a certain association */
809 /*************************************************************************************/
810 
811 int PF_PU_AssoMapAlgos::DefineQuality(int assoc_ite, int step, double distance) {
812  int quality = 0;
813 
814  switch (step) {
815  case 0: {
816  //TrackWeight association
817  if (distance <= tw_90) {
818  quality = 5;
819  } else {
820  if (distance <= tw_70) {
821  quality = 4;
822  } else {
823  if (distance <= tw_50) {
824  quality = 3;
825  } else {
826  quality = 2;
827  }
828  }
829  }
830  break;
831  }
832 
833  case 1: {
834  //Secondary association
835  if (distance <= sec_70) {
836  quality = 4;
837  } else {
838  if (distance <= sec_50) {
839  quality = 3;
840  } else {
841  quality = 2;
842  }
843  }
844  break;
845  }
846 
847  case 2: {
848  //Final association
849  if (assoc_ite == 1) {
850  quality = 1;
851  } else {
852  if (assoc_ite >= 2) {
853  quality = 0;
854  } else {
855  if (distance <= fin_70) {
856  quality = 4;
857  } else {
858  if (distance <= fin_50) {
859  quality = 3;
860  } else {
861  quality = 2;
862  }
863  }
864  }
865  }
866  break;
867  }
868 
869  default: {
870  quality = -1;
871  break;
872  }
873  }
874 
875  return quality;
876 }
PF_PU_AssoMapAlgos::maxNumWarnings_
int maxNumWarnings_
Definition: PF_PU_AssoMapAlgos.h:237
PF_PU_AssoMapAlgos::CreateVertexVector
std::vector< reco::VertexRef > CreateVertexVector(edm::Handle< reco::VertexCollection >)
Definition: PF_PU_AssoMapAlgos.cc:248
PF_PU_AssoMapAlgos::displVertexCollH
edm::Handle< reco::PFDisplacedVertexCollection > displVertexCollH
Definition: PF_PU_AssoMapAlgos.h:227
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
reco::Conversion
Definition: Conversion.h:23
reco::Vertex::originalTrack
TrackBaseRef originalTrack(const Track &refTrack) const
Definition: Vertex.cc:96
nTracks
const unsigned int nTracks(const reco::Vertex &sv)
Definition: TemplatedVertexArbitrator.h:44
reco::RecoChargedCandidate::track
reco::TrackRef track() const override
reference to a track
Definition: RecoChargedCandidate.cc:9
reco::LeafCandidate::momentum
Vector momentum() const final
spatial momentum vector
Definition: LeafCandidate.h:118
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
PF_PU_AssoMapAlgos::numWarnings_
int numWarnings_
Definition: PF_PU_AssoMapAlgos.h:238
PF_PU_AssoMapAlgos::CreateVertexToTrackMap
std::unique_ptr< VertexToTrackAssMap > CreateVertexToTrackMap(edm::Handle< reco::TrackCollection >, const edm::EventSetup &)
Definition: PF_PU_AssoMapAlgos.cc:161
sec_50
const double sec_50
Definition: PF_PU_AssoMapAlgos.h:63
reco::BeamSpot::covariance3D
Covariance3DMatrix covariance3D() const
return only 3D position covariance matrix
Definition: BeamSpot.h:112
ConversionTools.h
step
step
Definition: StallMonitor.cc:94
reco::PFDisplacedVertex::primaryMomentum
const math::XYZTLorentzVector primaryMomentum(std::string massHypo="PI", bool useRefitted=true, double mass=0.0) const
Momentum of primary or merged track calculated with a mass hypothesis.
Definition: PFDisplacedVertex.h:166
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
reco::BeamSpot::z0
double z0() const
z coordinate
Definition: BeamSpot.h:65
edm
HLT enums.
Definition: AlignableModifier.h:19
mps_merge.weight
weight
Definition: mps_merge.py:88
IPTools::absoluteImpactParameter3D
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:38
PF_PU_AssoMapAlgos::GetInputCollections
virtual void GetInputCollections(edm::Event &, const edm::EventSetup &)
Definition: PF_PU_AssoMapAlgos.cc:59
L1TkPrimaryVertex_cfi.nVtx
nVtx
Definition: L1TkPrimaryVertex_cfi.py:19
VertexToTrackAssMap
edm::AssociationMap< edm::OneToManyWithQuality< reco::TrackCollection, reco::VertexCollection, int > > VertexToTrackAssMap
Definition: PF_PU_AssoMapAlgos.h:71
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
VertexDistance3D::distance
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
Definition: VertexDistance3D.cc:17
PF_PU_AssoMapAlgos::GetCleanedConversions
static std::unique_ptr< reco::ConversionCollection > GetCleanedConversions(edm::Handle< reco::ConversionCollection >, edm::Handle< reco::BeamSpot >, bool)
Definition: PF_PU_AssoMapAlgos.cc:367
Measurement1D.h
PF_PU_AssoMapAlgos::createMappings
std::pair< std::unique_ptr< TrackToVertexAssMap >, std::unique_ptr< VertexToTrackAssMap > > createMappings(edm::Handle< reco::TrackCollection > trkcollH, const edm::EventSetup &iSetup)
Definition: PF_PU_AssoMapAlgos.cc:102
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
CustomPhysics_cfi.gamma
gamma
Definition: CustomPhysics_cfi.py:17
reco::PFDisplacedVertex::isIncomingTrack
const bool isIncomingTrack(const reco::TrackBaseRef &originalTrack) const
Is primary or merged track.
Definition: PFDisplacedVertex.h:128
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
PF_PU_AssoMapAlgos::token_VertexCollection_
edm::EDGetTokenT< reco::VertexCollection > token_VertexCollection_
Definition: PF_PU_AssoMapAlgos.h:203
PF_PU_AssoMapAlgos::FindConversionVertex
static reco::VertexRef FindConversionVertex(const reco::TrackRef, const reco::Conversion &, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, const std::vector< reco::VertexRef > &, double)
Definition: PF_PU_AssoMapAlgos.cc:408
TrackQualityPairVector
std::vector< TrackQualityPair > TrackQualityPairVector
Definition: PF_PU_AssoMapAlgos.h:74
reco::Vertex::position
const Point & position() const
position
Definition: Vertex.h:114
ConvertToFromReco.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
PF_PU_AssoMapAlgos::dR
static double dR(const math::XYZPoint &, const math::XYZVector &, edm::Handle< reco::BeamSpot >)
Definition: PF_PU_AssoMapAlgos.cc:343
VertexDistance3D.h
reco::VertexCompositeCandidate
Definition: VertexCompositeCandidate.h:16
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
PF_PU_AssoMapAlgos::vtxcollH
edm::Handle< reco::VertexCollection > vtxcollH
Definition: PF_PU_AssoMapAlgos.h:204
edm::Handle< reco::TrackCollection >
reco::PFDisplacedVertexCollection
std::vector< PFDisplacedVertex > PFDisplacedVertexCollection
collection of PFDisplacedVertex objects
Definition: PFDisplacedVertexFwd.h:10
VertexPtsumVector
std::vector< VertexPtsumPair > VertexPtsumVector
Definition: PF_PU_AssoMapAlgos.h:81
PF_PU_AssoMapAlgos::convCollH
edm::Handle< reco::ConversionCollection > convCollH
Definition: PF_PU_AssoMapAlgos.h:215
edm::Ref< TrackCollection >
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
PF_PU_AssoMapAlgos::FindNIVertex
static reco::VertexRef FindNIVertex(const reco::TrackRef, const reco::PFDisplacedVertex &, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, const std::vector< reco::VertexRef > &, double)
Definition: PF_PU_AssoMapAlgos.cc:648
deltaR.h
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
GlobalError
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition: GlobalError.h:13
edm::AssociationMap::end
const_iterator end() const
last iterator over the map (read only)
Definition: AssociationMap.h:171
fin_50
const double fin_50
Definition: PF_PU_AssoMapAlgos.h:66
PF_PU_AssoMapAlgos::input_nTrack_
double input_nTrack_
Definition: PF_PU_AssoMapAlgos.h:235
PF_PU_AssoMapAlgos::ConversionsCollectionToken_
edm::EDGetTokenT< reco::ConversionCollection > ConversionsCollectionToken_
Definition: PF_PU_AssoMapAlgos.h:214
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
reco::TransientTrack::setBeamSpot
void setBeamSpot(const reco::BeamSpot &beamSpot)
Definition: TransientTrack.h:82
PF_PU_AssoMapAlgos::EraseVertex
void EraseVertex(std::vector< reco::VertexRef > &, reco::VertexRef)
Definition: PF_PU_AssoMapAlgos.cc:262
PF_PU_AssoMapAlgos::vertCompCandCollKshortH
edm::Handle< reco::VertexCompositeCandidateCollection > vertCompCandCollKshortH
Definition: PF_PU_AssoMapAlgos.h:219
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::BeamSpot
Definition: BeamSpot.h:21
reco::Track
Definition: Track.h:27
edm::ESHandle< MagneticField >
PF_PU_AssoMapAlgos::FindClosestZ
static reco::VertexRef FindClosestZ(const reco::TrackRef, const std::vector< reco::VertexRef > &, double tWeight=0.)
Definition: PF_PU_AssoMapAlgos.cc:277
reco::PFDisplacedVertex::isTherePrimaryTracks
const bool isTherePrimaryTracks() const
-----— Provide useful information -----— ///
Definition: PFDisplacedVertex.h:93
PF_PU_AssoMapAlgos::KshortCollectionToken_
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > KshortCollectionToken_
Definition: PF_PU_AssoMapAlgos.h:218
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
VertexState.h
VertexDistance3D
Definition: VertexDistance3D.h:13
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
Point3DBase< float, GlobalTag >
PF_PU_AssoMapAlgos::ComesFromConversion
static bool ComesFromConversion(const reco::TrackRef, const reco::ConversionCollection &, reco::Conversion *)
Definition: PF_PU_AssoMapAlgos.cc:391
sec_70
const double sec_70
Definition: PF_PU_AssoMapAlgos.h:62
reco::Vertex::refittedTracks
const std::vector< Track > & refittedTracks() const
Returns the container of refitted tracks.
Definition: Vertex.h:183
PF_PU_AssoMapAlgos::cleanedConvCollP
std::unique_ptr< reco::ConversionCollection > cleanedConvCollP
Definition: PF_PU_AssoMapAlgos.h:216
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
PF_PU_AssoMapAlgos::cleanedKshortCollP
std::unique_ptr< reco::VertexCompositeCandidateCollection > cleanedKshortCollP
Definition: PF_PU_AssoMapAlgos.h:220
edm::LogWarning
Definition: MessageLogger.h:141
PF_PU_AssoMapAlgos::GetCleanedNI
static std::unique_ptr< reco::PFDisplacedVertexCollection > GetCleanedNI(edm::Handle< reco::PFDisplacedVertexCollection >, edm::Handle< reco::BeamSpot >, bool)
Definition: PF_PU_AssoMapAlgos.cc:589
PF_PU_AssoMapAlgos::input_FinalAssociation_
int input_FinalAssociation_
Definition: PF_PU_AssoMapAlgos.h:230
PF_PU_AssoMapAlgos::token_BeamSpot_
edm::EDGetTokenT< reco::BeamSpot > token_BeamSpot_
Definition: PF_PU_AssoMapAlgos.h:206
edm::ParameterSet
Definition: ParameterSet.h:36
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::PFDisplacedVertex
Block of elements.
Definition: PFDisplacedVertex.h:23
RecoVertex::convertError
reco::Vertex::Error convertError(const GlobalError &ge)
Definition: ConvertError.h:8
ConversionTools::matchesConversion
static bool matchesConversion(const reco::GsfElectron &ele, const reco::Conversion &conv, bool allowCkfMatch=true, bool allowAmbiguousGsfMatch=false)
Definition: ConversionTools.cc:54
edm::AssociationMap
Definition: AssociationMap.h:48
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
PF_PU_AssoMapAlgos::bFieldH
edm::ESHandle< MagneticField > bFieldH
Definition: PF_PU_AssoMapAlgos.h:209
PF_PU_AssoMapAlgos::FindAssociation
VertexStepPair FindAssociation(const reco::TrackRef &, const std::vector< reco::VertexRef > &, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, int)
Definition: PF_PU_AssoMapAlgos.cc:718
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
PF_PU_AssoMapAlgos::GetCleanedKshort
static std::unique_ptr< reco::VertexCompositeCandidateCollection > GetCleanedKshort(edm::Handle< reco::VertexCompositeCandidateCollection >, edm::Handle< reco::BeamSpot >, bool)
Definition: PF_PU_AssoMapAlgos.cc:433
PF_PU_AssoMapAlgos::DefineQuality
int DefineQuality(int, int, double)
Definition: PF_PU_AssoMapAlgos.cc:811
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::PFDisplacedVertex::isThereMergedTracks
const bool isThereMergedTracks() const
If a merged track was identified.
Definition: PFDisplacedVertex.h:96
PF_PU_AssoMapAlgos::beamspotH
edm::Handle< reco::BeamSpot > beamspotH
Definition: PF_PU_AssoMapAlgos.h:207
GlobalErrorBase< double, ErrorMatrixTag >
reco::RecoChargedCandidate
Definition: RecoChargedCandidate.h:15
edm::EventSetup
Definition: EventSetup.h:57
PF_PU_AssoMapAlgos::LambdaCollectionToken_
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > LambdaCollectionToken_
Definition: PF_PU_AssoMapAlgos.h:222
PF_PU_AssoMapAlgos::cleanedLambdaCollP
std::unique_ptr< reco::VertexCompositeCandidateCollection > cleanedLambdaCollP
Definition: PF_PU_AssoMapAlgos.h:224
PF_PU_AssoMapAlgos::GetCleanedLambda
static std::unique_ptr< reco::VertexCompositeCandidateCollection > GetCleanedLambda(edm::Handle< reco::VertexCompositeCandidateCollection >, edm::Handle< reco::BeamSpot >, bool)
Definition: PF_PU_AssoMapAlgos.cc:479
get
#define get
PF_PU_AssoMapAlgos::SortAssociationMap
std::unique_ptr< TrackToVertexAssMap > SortAssociationMap(TrackToVertexAssMap *, edm::Handle< reco::TrackCollection >)
Definition: PF_PU_AssoMapAlgos.cc:170
reco::LeafCandidate::vertex
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: LeafCandidate.h:165
reco::VertexCompositeCandidateCollection
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
Definition: VertexCompositeCandidateFwd.h:19
tkAlTrackRefitSequence_cff.refittedTracks
refittedTracks
Definition: tkAlTrackRefitSequence_cff.py:6
reco::TransientTrack::setES
void setES(const edm::EventSetup &es)
Definition: TransientTrack.h:78
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::BeamSpot::x0
double x0() const
x coordinate
Definition: BeamSpot.h:61
PF_PU_AssoMapAlgos::NIVertexCollectionToken_
edm::EDGetTokenT< reco::PFDisplacedVertexCollection > NIVertexCollectionToken_
Definition: PF_PU_AssoMapAlgos.h:226
TrackToVertexAssMap
edm::AssociationMap< edm::OneToManyWithQuality< reco::VertexCollection, reco::TrackCollection, int > > TrackToVertexAssMap
Definition: PF_PU_AssoMapAlgos.h:69
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
IPTools.h
PF_PU_AssoMapAlgos::ignoremissingpfcollection_
bool ignoremissingpfcollection_
Definition: PF_PU_AssoMapAlgos.h:232
reco::TransientTrack
Definition: TransientTrack.h:19
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
RecoChargedCandidate.h
VertexState
Definition: VertexState.h:13
PF_PU_AssoMapAlgos::CreateTrackToVertexMap
std::unique_ptr< TrackToVertexAssMap > CreateTrackToVertexMap(edm::Handle< reco::TrackCollection >, const edm::EventSetup &)
Definition: PF_PU_AssoMapAlgos.cc:152
PF_PU_AssoMapAlgos::ComesFromNI
static bool ComesFromNI(const reco::TrackRef, const reco::PFDisplacedVertexCollection &, reco::PFDisplacedVertex *)
Definition: PF_PU_AssoMapAlgos.cc:630
PF_PU_AssoMapAlgos.h
lamMass
const double lamMass
Definition: PF_PU_AssoMapAlgos.h:54
edm::AssociationMap::begin
const_iterator begin() const
first iterator over the map (read only)
Definition: AssociationMap.h:169
fin_70
const double fin_70
Definition: PF_PU_AssoMapAlgos.h:65
edm::RefToBase< reco::Track >
PF_PU_AssoMapAlgos::cleanedNICollP
std::unique_ptr< reco::PFDisplacedVertexCollection > cleanedNICollP
Definition: PF_PU_AssoMapAlgos.h:228
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
PF_PU_AssoMapAlgos::vertCompCandCollLambdaH
edm::Handle< reco::VertexCompositeCandidateCollection > vertCompCandCollLambdaH
Definition: PF_PU_AssoMapAlgos.h:223
RecoVertex::convertPos
reco::Vertex::Point convertPos(const GlobalPoint &p)
Definition: ConvertToFromReco.h:7
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
PF_PU_AssoMapAlgos::FindV0Vertex
static reco::VertexRef FindV0Vertex(const reco::TrackRef, const reco::VertexCompositeCandidate &, edm::ESHandle< MagneticField >, const edm::EventSetup &, edm::Handle< reco::BeamSpot >, const std::vector< reco::VertexRef > &, double)
Definition: PF_PU_AssoMapAlgos.cc:565
PF_PU_AssoMapAlgos::FindClosest3D
static reco::VertexRef FindClosest3D(reco::TransientTrack, const std::vector< reco::VertexRef > &, double tWeight=0.)
Definition: PF_PU_AssoMapAlgos.cc:309
tw_70
const double tw_70
Definition: PF_PU_AssoMapAlgos.h:59
PF_PU_AssoMapAlgos::PF_PU_AssoMapAlgos
PF_PU_AssoMapAlgos(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
Definition: PF_PU_AssoMapAlgos.h:86
reco::BeamSpot::y0
double y0() const
y coordinate
Definition: BeamSpot.h:63
PF_PU_AssoMapAlgos::ComesFromV0Decay
static bool ComesFromV0Decay(const reco::TrackRef, const reco::VertexCompositeCandidateCollection &, const reco::VertexCompositeCandidateCollection &, reco::VertexCompositeCandidate *)
Definition: PF_PU_AssoMapAlgos.cc:525
PF_PU_AssoMapAlgos::TrackWeightAssociation
static reco::VertexRef TrackWeightAssociation(const TREF &, const std::vector< reco::VertexRef > &)
VertexStepPair
std::pair< reco::VertexRef, int > VertexStepPair
Definition: PF_PU_AssoMapAlgos.h:76
PF_PU_AssoMapAlgos::input_MaxNumAssociations_
int input_MaxNumAssociations_
Definition: PF_PU_AssoMapAlgos.h:201
edm::Event
Definition: Event.h:73
PF_PU_AssoMapAlgos::input_doReassociation_
bool input_doReassociation_
Definition: PF_PU_AssoMapAlgos.h:211
edm::AssociationMap::const_iterator
const iterator
Definition: AssociationMap.h:76
PF_PU_AssoMapAlgos::missingColls
bool missingColls
Definition: PF_PU_AssoMapAlgos.h:233
tw_50
const double tw_50
Definition: PF_PU_AssoMapAlgos.h:60
tw_90
const double tw_90
Definition: PF_PU_AssoMapAlgos.h:58
kMass
const double kMass
Definition: PF_PU_AssoMapAlgos.h:53
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
weight
Definition: weight.py:1
met_cff.significance
significance
Definition: met_cff.py:19
PF_PU_AssoMapAlgos::cleanedColls_
bool cleanedColls_
Definition: PF_PU_AssoMapAlgos.h:212