CMS 3D CMS Logo

ConversionProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ConversionProducer
4 // Class: ConversionProducer
5 //
13 //
14 // Original Authors: Hongliang Liu
15 // Created: Thu Mar 13 17:40:48 CDT 2008
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 #include <map>
22 
28 
33 
36 
38 
41 
43 
46 
53 
54 //Kinematic constraint vertex fitter
64 
66  : theVertexFinder_(nullptr)
67 
68 {
69  algoName_ = iConfig.getParameter<std::string>("AlgorithmName");
70 
71  src_ = consumes<edm::View<reco::ConversionTrack> >(iConfig.getParameter<edm::InputTag>("src"));
72 
73  maxNumOfTrackInPU_ = iConfig.getParameter<int>("maxNumOfTrackInPU");
74  maxTrackRho_ = iConfig.getParameter<double>("maxTrackRho");
75  maxTrackZ_ = iConfig.getParameter<double>("maxTrackZ");
76 
77  allowTrackBC_ = iConfig.getParameter<bool>("AllowTrackBC");
78  allowD0_ = iConfig.getParameter<bool>("AllowD0");
79  allowDeltaPhi_ = iConfig.getParameter<bool>("AllowDeltaPhi");
80  allowDeltaCot_ = iConfig.getParameter<bool>("AllowDeltaCot");
81  allowMinApproach_ = iConfig.getParameter<bool>("AllowMinApproach");
82  allowOppCharge_ = iConfig.getParameter<bool>("AllowOppCharge");
83 
84  allowVertex_ = iConfig.getParameter<bool>("AllowVertex");
85 
86  bypassPreselGsf_ = iConfig.getParameter<bool>("bypassPreselGsf");
87  bypassPreselEcal_ = iConfig.getParameter<bool>("bypassPreselEcal");
88  bypassPreselEcalEcal_ = iConfig.getParameter<bool>("bypassPreselEcalEcal");
89 
90  deltaEta_ = iConfig.getParameter<double>("deltaEta");
91 
92  halfWayEta_ = iConfig.getParameter<double>("HalfwayEta"); //open angle to search track matches with BC
93 
94  d0Cut_ = iConfig.getParameter<double>("d0");
95 
96  usePvtx_ = iConfig.getParameter<bool>("UsePvtx"); //if use primary vertices
97 
98  vertexProducer_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("primaryVertexProducer"));
99 
100  transientTrackBuilder_ = esConsumes(edm::ESInputTag("", "TransientTrackBuilder"));
101  trackerGeometry_ = esConsumes();
102  magneticField_ = esConsumes();
103 
104  //Track-cluster matching eta and phi cuts
105  dEtaTkBC_ = iConfig.getParameter<double>("dEtaTrackBC"); //TODO research on cut endcap/barrel
106  dPhiTkBC_ = iConfig.getParameter<double>("dPhiTrackBC");
107 
109  consumes<edm::View<reco::CaloCluster> >(iConfig.getParameter<edm::InputTag>("bcBarrelCollection"));
111  consumes<edm::View<reco::CaloCluster> >(iConfig.getParameter<edm::InputTag>("bcEndcapCollection"));
112 
113  scBarrelProducer_ = consumes<edm::View<reco::CaloCluster> >(iConfig.getParameter<edm::InputTag>("scBarrelProducer"));
114  scEndcapProducer_ = consumes<edm::View<reco::CaloCluster> >(iConfig.getParameter<edm::InputTag>("scEndcapProducer"));
115 
116  energyBC_ = iConfig.getParameter<double>("EnergyBC"); //BC energy threshold
117  energyTotalBC_ = iConfig.getParameter<double>("EnergyTotalBC"); //BC energy threshold
118  minSCEt_ = iConfig.getParameter<double>("minSCEt"); //super cluster energy threshold
119  dEtacutForSCmatching_ = iConfig.getParameter<double>(
120  "dEtacutForSCmatching"); // dEta between conversion momentum direction and SC position
121  dPhicutForSCmatching_ = iConfig.getParameter<double>(
122  "dPhicutForSCmatching"); // dPhi between conversion momentum direction and SC position
123 
124  //Track cuts on left right track: at least one leg reaches ECAL
125  //Left track: must exist, must reach Ecal and match BC, so loose cut on Chi2 and tight on hits
126  //Right track: not necessary to exist (if allowSingleLeg_), not necessary to reach ECAL or match BC, so tight cut on Chi2 and loose on hits
127  maxChi2Left_ = iConfig.getParameter<double>("MaxChi2Left");
128  maxChi2Right_ = iConfig.getParameter<double>("MaxChi2Right");
129  minHitsLeft_ = iConfig.getParameter<int>("MinHitsLeft");
130  minHitsRight_ = iConfig.getParameter<int>("MinHitsRight");
131 
132  //Track Open angle cut on delta cot(theta) and delta phi
133  deltaCotTheta_ = iConfig.getParameter<double>("DeltaCotTheta");
134  deltaPhi_ = iConfig.getParameter<double>("DeltaPhi");
135  minApproachLow_ = iConfig.getParameter<double>("MinApproachLow");
136  minApproachHigh_ = iConfig.getParameter<double>("MinApproachHigh");
137 
138  // if allow single track collection, by default False
139  allowSingleLeg_ = iConfig.getParameter<bool>("AllowSingleLeg");
140  rightBC_ = iConfig.getParameter<bool>("AllowRightBC");
141 
142  //track inner position dz cut, need RECO
143  dzCut_ = iConfig.getParameter<double>("dz");
144  //track analytical cross cut
145  r_cut = iConfig.getParameter<double>("rCut");
146  vtxChi2_ = iConfig.getParameter<double>("vtxChi2");
147 
149 
150  thettbuilder_ = nullptr;
151 
152  //output
153  ConvertedPhotonCollection_ = iConfig.getParameter<std::string>("convertedPhotonCollection");
154 
155  produces<reco::ConversionCollection>(ConvertedPhotonCollection_);
156 }
157 
159  // do anything here that needs to be done at desctruction time
160  // (e.g. close files, deallocate resources etc.)
161  delete theVertexFinder_;
162 }
163 
164 // ------------ method called to produce the data ------------
166  using namespace edm;
167 
168  reco::ConversionCollection outputConvPhotonCollection;
169  auto outputConvPhotonCollection_p = std::make_unique<reco::ConversionCollection>();
170 
171  //std::cout << " ConversionProducer::produce " << std::endl;
172  //Read multiple track input collections
173 
174  edm::Handle<edm::View<reco::ConversionTrack> > trackCollectionHandle;
175  iEvent.getByToken(src_, trackCollectionHandle);
176 
177  //build map of ConversionTracks ordered in eta
178  std::multimap<float, edm::Ptr<reco::ConversionTrack> > convTrackMap;
179  for (auto const& t : trackCollectionHandle->ptrs())
180  convTrackMap.emplace(t->track()->eta(), t);
181 
184  if (usePvtx_) {
185  iEvent.getByToken(vertexProducer_, vertexHandle);
186  if (!vertexHandle.isValid()) {
187  edm::LogError("ConversionProducer") << "Error! Can't get the product primary Vertex Collection "
188  << "\n";
189  usePvtx_ = false;
190  }
191  if (usePvtx_)
192  vertexCollection = *(vertexHandle.product());
193  }
194 
196  thettbuilder_ = hTransientTrackBuilder.product();
197 
198  reco::Vertex the_pvtx;
199  //because the priamry vertex is sorted by quality, the first one is the best
200  if (!vertexCollection.empty())
201  the_pvtx = *(vertexCollection.begin());
202 
203  if (trackCollectionHandle->size() > maxNumOfTrackInPU_) {
204  iEvent.put(std::move(outputConvPhotonCollection_p), ConvertedPhotonCollection_);
205  return;
206  }
207 
208  // build Super and Basic cluster geometry map to search in eta bounds for clusters
209  std::multimap<double, reco::CaloClusterPtr> basicClusterPtrs;
210  std::multimap<double, reco::CaloClusterPtr> superClusterPtrs;
211 
212  buildSuperAndBasicClusterGeoMap(iEvent, basicClusterPtrs, superClusterPtrs);
213 
215  iSetup,
216  convTrackMap,
217  superClusterPtrs,
218  basicClusterPtrs,
219  the_pvtx,
220  outputConvPhotonCollection); //allow empty basicClusterPtrs
221 
222  outputConvPhotonCollection_p->assign(outputConvPhotonCollection.begin(), outputConvPhotonCollection.end());
223  iEvent.put(std::move(outputConvPhotonCollection_p), ConvertedPhotonCollection_);
224 }
225 
227  std::multimap<double, reco::CaloClusterPtr>& basicClusterPtrs,
228  std::multimap<double, reco::CaloClusterPtr>& superClusterPtrs) {
229  // Get the Super Cluster collection in the Barrel
231  iEvent.getByToken(scBarrelProducer_, scBarrelHandle);
232  if (!scBarrelHandle.isValid()) {
233  edm::LogError("ConvertedPhotonProducer") << "Error! Can't get the barrel superclusters!";
234  }
235 
236  // Get the Super Cluster collection in the Endcap
238  iEvent.getByToken(scEndcapProducer_, scEndcapHandle);
239  if (!scEndcapHandle.isValid()) {
240  edm::LogError("ConvertedPhotonProducer") << "Error! Can't get the endcap superclusters!";
241  }
242 
244  edm::Handle<edm::View<reco::CaloCluster> > bcEndcapHandle; //TODO check cluster type if BasicCluster or PFCluster
245 
246  iEvent.getByToken(bcBarrelCollection_, bcBarrelHandle);
247  if (!bcBarrelHandle.isValid()) {
248  edm::LogError("ConvertedPhotonProducer") << "Error! Can't get the barrel basic clusters!";
249  }
250 
251  iEvent.getByToken(bcEndcapCollection_, bcEndcapHandle);
252  if (!bcEndcapHandle.isValid()) {
253  edm::LogError("ConvertedPhotonProducer") << "Error! Can't get the endcap basic clusters!";
254  }
255 
256  if (bcBarrelHandle.isValid()) {
257  for (auto const& handle : {bcBarrelHandle, bcEndcapHandle}) {
258  for (auto const& bc : handle->ptrs()) {
259  if (bc->energy() > energyBC_)
260  basicClusterPtrs.emplace(bc->position().eta(), bc);
261  }
262  }
263  }
264 
265  if (scBarrelHandle.isValid()) {
266  for (auto const& handle : {scBarrelHandle, scEndcapHandle}) {
267  for (auto const& sc : handle->ptrs()) {
268  if (sc->energy() > minSCEt_)
269  superClusterPtrs.emplace(sc->position().eta(), sc);
270  }
271  }
272  }
273 }
274 
276  const edm::EventSetup& iSetup,
277  const std::multimap<float, edm::Ptr<reco::ConversionTrack> >& allTracks,
278  const std::multimap<double, reco::CaloClusterPtr>& superClusterPtrs,
279  const std::multimap<double, reco::CaloClusterPtr>& basicClusterPtrs,
280  const reco::Vertex& the_pvtx,
281  reco::ConversionCollection& outputConvPhotonCollection) {
282  edm::ESHandle<TrackerGeometry> trackerGeomHandle = iSetup.getHandle(trackerGeometry_);
283  edm::ESHandle<MagneticField> magFieldHandle = iSetup.getHandle(magneticField_);
284 
285  const TrackerGeometry* trackerGeom = trackerGeomHandle.product();
286  const MagneticField* magField = magFieldHandle.product();
287 
288  // std::vector<math::XYZPointF> trackImpactPosition;
289  // trackImpactPosition.reserve(allTracks.size());//track impact position at ECAL
290  // std::vector<bool> trackValidECAL;//Does this track reach ECAL basic cluster (reach ECAL && match with BC)
291  // trackValidECAL.assign(allTracks.size(), false);
292  //
293  // std::vector<reco::CaloClusterPtr> trackMatchedBC;
294  // reco::CaloClusterPtr empty_bc;
295  // trackMatchedBC.assign(allTracks.size(), empty_bc);//TODO find a better way to avoid copy constructor
296  //
297  // std::vector<int> bcHandleId;//the associated BC handle id, -1 invalid, 0 barrel 1 endcap
298  // bcHandleId.assign(allTracks.size(), -1);
299 
300  // not used std::multimap<double, int> trackInnerEta;//Track innermost state Eta map to TrackRef index, to be used in track pair sorting
301 
302  std::map<edm::Ptr<reco::ConversionTrack>, math::XYZPointF> trackImpactPosition;
303  std::map<edm::Ptr<reco::ConversionTrack>, reco::CaloClusterPtr> trackMatchedBC;
304 
305  ConversionHitChecker hitChecker;
306 
307  //2 propagate all tracks into ECAL, record its eta and phi
308 
309  for (std::multimap<float, edm::Ptr<reco::ConversionTrack> >::const_iterator tk_ref = allTracks.begin();
310  tk_ref != allTracks.end();
311  ++tk_ref) {
312  const reco::Track* tk = tk_ref->second->trackRef().get();
313 
314  //check impact position then match with BC
315  math::XYZPointF ew;
316  if (getTrackImpactPosition(tk, trackerGeom, magField, ew)) {
317  trackImpactPosition[tk_ref->second] = ew;
318 
319  reco::CaloClusterPtr closest_bc; //the closest matching BC to track
320 
321  if (getMatchedBC(basicClusterPtrs, ew, closest_bc)) {
322  trackMatchedBC[tk_ref->second] = closest_bc;
323  }
324  }
325  }
326 
327  //3. pair up tracks:
328  //TODO it is k-Closest pair of point problem
329  //std::cout << " allTracks.size() " << allTracks.size() << std::endl;
330  for (std::multimap<float, edm::Ptr<reco::ConversionTrack> >::const_iterator ll = allTracks.begin();
331  ll != allTracks.end();
332  ++ll) {
333  bool track1HighPurity = true;
334  //std::cout << " Loop on allTracks " << std::endl;
335  const edm::RefToBase<reco::Track>& left = ll->second->trackRef();
336 
337  //TODO: This is a workaround, should be fixed with a proper function in the TTBuilder
338  //(Note that the TrackRef and GsfTrackRef versions of the constructor are needed
339  // to properly get refit tracks in the output vertex)
340  reco::TransientTrack ttk_l;
341  if (dynamic_cast<const reco::GsfTrack*>(left.get())) {
342  ttk_l = thettbuilder_->build(left.castTo<reco::GsfTrackRef>());
343  } else {
344  ttk_l = thettbuilder_->build(left.castTo<reco::TrackRef>());
345  }
346 
348  // if ((allowTrackBC_ && !trackValidECAL[ll-allTracks.begin()]) )//this Left leg should have valid BC
349  // continue;
350 
351  if (the_pvtx.isValid()) {
352  if (!(trackD0Cut(left, the_pvtx)))
353  track1HighPurity = false;
354  } else {
355  if (!(trackD0Cut(left)))
356  track1HighPurity = false;
357  }
358 
359  std::vector<int> right_candidates; //store all right legs passed the cut (theta/approach and ref pair)
360  std::vector<double> right_candidate_theta, right_candidate_approach;
361  std::vector<std::pair<bool, reco::Vertex> > vertex_candidates;
362 
363  //inner loop only over tracks between eta and eta + deltaEta of the first track
364  float etasearch = ll->first + deltaEta_;
365  std::multimap<float, edm::Ptr<reco::ConversionTrack> >::const_iterator rr = ll;
366  ++rr;
367  for (; rr != allTracks.lower_bound(etasearch); ++rr) {
368  bool track2HighPurity = true;
369  bool highPurityPair = true;
370 
371  const edm::RefToBase<reco::Track>& right = rr->second->trackRef();
372 
373  //TODO: This is a workaround, should be fixed with a proper function in the TTBuilder
374  reco::TransientTrack ttk_r;
375  if (dynamic_cast<const reco::GsfTrack*>(right.get())) {
376  ttk_r = thettbuilder_->build(right.castTo<reco::GsfTrackRef>());
377  } else {
378  ttk_r = thettbuilder_->build(right.castTo<reco::TrackRef>());
379  }
380  //std::cout << " This track is " << right->algoName() << std::endl;
381 
382  //all vertexing preselection should go here
383 
384  //check for opposite charge
385  if (allowOppCharge_ && (left->charge() * right->charge() > 0))
386  continue; //same sign, reject pair
387 
389  //if ( (allowTrackBC_ && !trackValidECAL[rr-allTracks.begin()] && rightBC_) )// if right track matches ECAL
390  // continue;
391 
392  double approachDist = -999.;
393  //apply preselection to track pair, overriding preselection for gsf+X or ecalseeded+X pairs if so configured
394  bool preselected = preselectTrackPair(ttk_l, ttk_r, approachDist);
395  preselected = preselected || (bypassPreselGsf_ &&
396  (left->algo() == reco::TrackBase::gsf || right->algo() == reco::TrackBase::gsf));
397  preselected = preselected || (bypassPreselEcal_ && (left->algo() == reco::TrackBase::outInEcalSeededConv ||
401  preselected = preselected || (bypassPreselEcalEcal_ &&
406 
407  if (!preselected) {
408  continue;
409  }
410 
411  //do the actual vertex fit
412  reco::Vertex theConversionVertex; //by default it is invalid
413  bool goodVertex = checkVertex(ttk_l, ttk_r, magField, theConversionVertex);
414 
415  //bail as early as possible in case the fit didn't return a good vertex
416  if (!goodVertex) {
417  continue;
418  }
419 
420  //track pair pass the quality cut
421  if (!((trackQualityFilter(left, true) && trackQualityFilter(right, false)) ||
422  (trackQualityFilter(left, false) && trackQualityFilter(right, true)))) {
423  highPurityPair = false;
424  }
425 
426  if (the_pvtx.isValid()) {
427  if (!(trackD0Cut(right, the_pvtx)))
428  track2HighPurity = false;
429  } else {
430  if (!(trackD0Cut(right)))
431  track2HighPurity = false;
432  }
433 
434  //if all cuts passed, go ahead to make conversion candidates
435  std::vector<edm::RefToBase<reco::Track> > trackPairRef;
436  trackPairRef.push_back(left); //left track
437  trackPairRef.push_back(right); //right track
438 
439  std::vector<math::XYZVectorF> trackPin;
440  std::vector<math::XYZVectorF> trackPout;
441  std::vector<math::XYZPointF> trackInnPos;
442  std::vector<uint8_t> nHitsBeforeVtx;
443  std::vector<Measurement1DFloat> dlClosestHitToVtx;
444 
445  if (left->extra().isNonnull() && right->extra().isNonnull()) { //only available on TrackExtra
446  trackInnPos.push_back(toFConverterP(left->innerPosition()));
447  trackInnPos.push_back(toFConverterP(right->innerPosition()));
448  trackPin.push_back(toFConverterV(left->innerMomentum()));
449  trackPin.push_back(toFConverterV(right->innerMomentum()));
450  trackPout.push_back(toFConverterV(left->outerMomentum()));
451  trackPout.push_back(toFConverterV(right->outerMomentum()));
452  auto leftWrongHits = hitChecker.nHitsBeforeVtx(*left->extra(), theConversionVertex);
453  auto rightWrongHits = hitChecker.nHitsBeforeVtx(*right->extra(), theConversionVertex);
454  nHitsBeforeVtx.push_back(leftWrongHits.first);
455  nHitsBeforeVtx.push_back(rightWrongHits.first);
456  dlClosestHitToVtx.push_back(leftWrongHits.second);
457  dlClosestHitToVtx.push_back(rightWrongHits.second);
458  }
459 
460  uint8_t nSharedHits = hitChecker.nSharedHits(*left.get(), *right.get());
461 
462  //if using kinematic fit, check with chi2 post cut
463  if (theConversionVertex.isValid()) {
464  const float chi2Prob = ChiSquaredProbability(theConversionVertex.chi2(), theConversionVertex.ndof());
465  if (chi2Prob < vtxChi2_)
466  highPurityPair = false;
467  }
468 
469  //std::cout << " highPurityPair after vertex cut " << highPurityPair << std::endl;
470  std::vector<math::XYZPointF> trkPositionAtEcal;
471  std::vector<reco::CaloClusterPtr> matchingBC;
472 
473  if (allowTrackBC_) { //TODO find out the BC ptrs if not doing matching, otherwise, leave it empty
474  //const int lbc_handle = bcHandleId[ll-allTracks.begin()],
475  // rbc_handle = bcHandleId[rr-allTracks.begin()];
476 
477  std::map<edm::Ptr<reco::ConversionTrack>, math::XYZPointF>::const_iterator trackImpactPositionLeft =
478  trackImpactPosition.find(ll->second);
479  std::map<edm::Ptr<reco::ConversionTrack>, math::XYZPointF>::const_iterator trackImpactPositionRight =
480  trackImpactPosition.find(rr->second);
481  std::map<edm::Ptr<reco::ConversionTrack>, reco::CaloClusterPtr>::const_iterator trackMatchedBCLeft =
482  trackMatchedBC.find(ll->second);
483  std::map<edm::Ptr<reco::ConversionTrack>, reco::CaloClusterPtr>::const_iterator trackMatchedBCRight =
484  trackMatchedBC.find(rr->second);
485 
486  if (trackImpactPositionLeft != trackImpactPosition.end()) {
487  trkPositionAtEcal.push_back(trackImpactPositionLeft->second); //left track
488  } else {
489  trkPositionAtEcal.push_back(math::XYZPointF()); //left track
490  }
491  if (trackImpactPositionRight != trackImpactPosition.end()) { //second track ECAL position may be invalid
492  trkPositionAtEcal.push_back(trackImpactPositionRight->second);
493  }
494 
495  double total_e_bc = 0.;
496  if (trackMatchedBCLeft != trackMatchedBC.end()) {
497  matchingBC.push_back(trackMatchedBCLeft->second); //left track
498  total_e_bc += trackMatchedBCLeft->second->energy();
499  } else {
500  matchingBC.push_back(reco::CaloClusterPtr()); //left track
501  }
502  if (trackMatchedBCRight != trackMatchedBC.end()) { //second track ECAL position may be invalid
503  matchingBC.push_back(trackMatchedBCRight->second);
504  total_e_bc += trackMatchedBCRight->second->energy();
505  }
506 
507  if (total_e_bc < energyTotalBC_) {
508  highPurityPair = false;
509  }
510  }
511  //signature cuts, then check if vertex, then post-selection cuts
512  highPurityPair = highPurityPair && track1HighPurity && track2HighPurity && goodVertex &&
513  checkPhi(left, right, trackerGeom, magField, theConversionVertex);
514 
516  /*
517  for ( std::vector<edm::RefToBase<reco::Track> >::iterator iTk=trackPairRef.begin(); iTk!=trackPairRef.end(); iTk++) {
518  math::XYZPointF impPos;
519  if ( getTrackImpactPosition(*iTk, trackerGeom, magField, impPos) ) {
520 
521  }
522 
523  }
524  */
525 
526  const float minAppDist = approachDist;
528  float dummy = 0;
530  reco::Conversion newCandidate(scPtrVec,
531  trackPairRef,
532  trkPositionAtEcal,
533  theConversionVertex,
534  matchingBC,
535  minAppDist,
536  trackInnPos,
537  trackPin,
538  trackPout,
539  nHitsBeforeVtx,
540  dlClosestHitToVtx,
541  nSharedHits,
542  dummy,
543  algo);
544  // Fill in scPtrVec with the macthing SC
545  if (matchingSC(superClusterPtrs, newCandidate, scPtrVec))
546  newCandidate.setMatchingSuperCluster(scPtrVec);
547 
548  newCandidate.setQuality(reco::Conversion::highPurity, highPurityPair);
549  bool generalTracksOnly = ll->second->isTrackerOnly() && rr->second->isTrackerOnly() &&
550  !dynamic_cast<const reco::GsfTrack*>(ll->second->trackRef().get()) &&
551  !dynamic_cast<const reco::GsfTrack*>(rr->second->trackRef().get());
552  bool gsfTracksOpenOnly = ll->second->isGsfTrackOpen() && rr->second->isGsfTrackOpen();
553  bool arbitratedEcalSeeded = ll->second->isArbitratedEcalSeeded() && rr->second->isArbitratedEcalSeeded();
554  bool arbitratedMerged = ll->second->isArbitratedMerged() && rr->second->isArbitratedMerged();
555  bool arbitratedMergedEcalGeneral =
556  ll->second->isArbitratedMergedEcalGeneral() && rr->second->isArbitratedMergedEcalGeneral();
557 
559  newCandidate.setQuality(reco::Conversion::gsfTracksOpenOnly, gsfTracksOpenOnly);
562  newCandidate.setQuality(reco::Conversion::arbitratedMergedEcalGeneral, arbitratedMergedEcalGeneral);
563 
564  outputConvPhotonCollection.push_back(newCandidate);
565  }
566  }
567 }
568 
569 //
570 // member functions
571 //
572 
574  bool pass = true;
575  if (isLeft) {
576  pass = (ref->normalizedChi2() < maxChi2Left_ && ref->found() >= minHitsLeft_);
577  } else {
578  pass = (ref->normalizedChi2() < maxChi2Right_ && ref->found() >= minHitsRight_);
579  }
580 
581  return pass;
582 }
583 
585  //NOTE if not allow d0 cut, always true
586  return ((!allowD0_) || !(ref->d0() * ref->charge() / ref->d0Error() < d0Cut_));
587 }
588 
590  //
591  return ((!allowD0_) || !(-ref->dxy(the_pvtx.position()) * ref->charge() / ref->dxyError() < d0Cut_));
592 }
593 
595  const TrackerGeometry* trackerGeom,
596  const MagneticField* magField,
597  math::XYZPointF& ew) {
598  PropagatorWithMaterial propag(alongMomentum, 0.000511, magField);
599 
601  129.f, GlobalPoint(0., 0., 0.), TkRotation<float>(), new SimpleCylinderBounds(129, 129, -320.5, 320.5)));
602  const float epsilon = 0.001;
603  Surface::RotationType rot; // unit rotation matrix
604  const float barrelRadius = 129.f;
605  const float barrelHalfLength = 270.9f;
606  const float endcapRadius = 171.1f;
607  const float endcapZ = 320.5f;
609  barrelRadius,
610  Surface::PositionType(0, 0, 0),
611  rot,
613  ReferenceCountingPointer<BoundDisk> theNegativeEtaEndcap_(new BoundDisk(
615  ReferenceCountingPointer<BoundDisk> thePositiveEtaEndcap_(new BoundDisk(
617 
618  //const TrajectoryStateOnSurface myTSOS = trajectoryStateTransform::innerStateOnSurface(*(*ref), *trackerGeom, magField);
619  const TrajectoryStateOnSurface myTSOS =
620  trajectoryStateTransform::outerStateOnSurface(*tk_ref, *trackerGeom, magField);
621  TrajectoryStateOnSurface stateAtECAL;
622  stateAtECAL = propag.propagate(myTSOS, *theBarrel_);
623  if (!stateAtECAL.isValid() || (stateAtECAL.isValid() && fabs(stateAtECAL.globalPosition().eta()) > 1.479f)) {
624  //endcap propagator
625  if (myTSOS.globalPosition().z() > 0.) {
626  stateAtECAL = propag.propagate(myTSOS, *thePositiveEtaEndcap_);
627  } else {
628  stateAtECAL = propag.propagate(myTSOS, *theNegativeEtaEndcap_);
629  }
630  }
631  if (stateAtECAL.isValid()) {
632  ew = stateAtECAL.globalPosition();
633  return true;
634  } else
635  return false;
636 }
637 
638 bool ConversionProducer::matchingSC(const std::multimap<double, reco::CaloClusterPtr>& scMap,
639  reco::Conversion& aConv,
640  // reco::CaloClusterPtr& mSC){
642  // double dRMin=999.;
643  double detaMin = 999.;
644  double dphiMin = 999.;
646  for (std::multimap<double, reco::CaloClusterPtr>::const_iterator scItr = scMap.begin(); scItr != scMap.end();
647  scItr++) {
648  const reco::CaloClusterPtr& sc = scItr->second;
649  const double delta_phi = reco::deltaPhi(aConv.refittedPairMomentum().phi(), sc->phi());
650  double sceta = sc->eta();
651  double conveta = etaTransformation(aConv.refittedPairMomentum().eta(), aConv.zOfPrimaryVertexFromTracks());
652  const double delta_eta = fabs(conveta - sceta);
653  if (fabs(delta_eta) < fabs(detaMin) && fabs(delta_phi) < fabs(dphiMin)) {
654  detaMin = fabs(delta_eta);
655  dphiMin = fabs(delta_phi);
656  match = sc;
657  }
658  }
659 
660  if (fabs(detaMin) < dEtacutForSCmatching_ && fabs(dphiMin) < dPhicutForSCmatching_) {
661  mSC.push_back(match);
662  return true;
663  } else
664  return false;
665 }
666 
667 bool ConversionProducer::getMatchedBC(const std::multimap<double, reco::CaloClusterPtr>& bcMap,
668  const math::XYZPointF& trackImpactPosition,
669  reco::CaloClusterPtr& closestBC) {
670  const double track_eta = trackImpactPosition.eta();
671  const double track_phi = trackImpactPosition.phi();
672 
673  double min_eta = 999., min_phi = 999.;
674  reco::CaloClusterPtr closest_bc;
675  for (std::multimap<double, reco::CaloClusterPtr>::const_iterator bc = bcMap.lower_bound(track_eta - halfWayEta_);
676  bc != bcMap.upper_bound(track_eta + halfWayEta_);
677  ++bc) { //use eta map to select possible BC collection then loop in
678  const reco::CaloClusterPtr& ebc = bc->second;
679  const double delta_eta = track_eta - (ebc->position().eta());
680  const double delta_phi = reco::deltaPhi(track_phi, (ebc->position().phi()));
681  if (fabs(delta_eta) < dEtaTkBC_ && fabs(delta_phi) < dPhiTkBC_) {
682  if (fabs(min_eta) > fabs(delta_eta) && fabs(min_phi) > fabs(delta_phi)) { //take the closest to track BC
683  min_eta = delta_eta;
684  min_phi = delta_phi;
685  closest_bc = bc->second;
686  //TODO check if min_eta>delta_eta but min_phi<delta_phi
687  }
688  }
689  }
690 
691  if (min_eta < 999.) {
692  closestBC = closest_bc;
693  return true;
694  } else
695  return false;
696 }
697 
698 //check track open angle of phi at vertex
700  const edm::RefToBase<reco::Track>& tk_r,
701  const TrackerGeometry* trackerGeom,
702  const MagneticField* magField,
703  const reco::Vertex& vtx) {
704  if (!allowDeltaPhi_)
705  return true;
706  //if track has innermost momentum, check with innermost phi
707  //if track also has valid vertex, propagate to vertex then calculate phi there
708  //if track has no innermost momentum, just return true, because track->phi() makes no sense
709  if (tk_l->extra().isNonnull() && tk_r->extra().isNonnull()) {
710  double iphi1 = tk_l->innerMomentum().phi(), iphi2 = tk_r->innerMomentum().phi();
711  if (vtx.isValid()) {
712  PropagatorWithMaterial propag(anyDirection, 0.000511, magField);
713 
714  double recoPhoR = vtx.position().Rho();
717  recoPhoR,
718  Surface::PositionType(0, 0, 0),
719  rot,
721  recoPhoR - 0.001, recoPhoR + 0.001, -fabs(vtx.position().z()), fabs(vtx.position().z()))));
723  Surface::PositionType(0, 0, vtx.position().z()), rot, new SimpleDiskBounds(0, recoPhoR, -0.001, 0.001)));
724 
725  const TrajectoryStateOnSurface myTSOS1 =
726  trajectoryStateTransform::innerStateOnSurface(*tk_l, *trackerGeom, magField);
727  const TrajectoryStateOnSurface myTSOS2 =
728  trajectoryStateTransform::innerStateOnSurface(*tk_r, *trackerGeom, magField);
729  TrajectoryStateOnSurface stateAtVtx1, stateAtVtx2;
730  stateAtVtx1 = propag.propagate(myTSOS1, *theBarrel_);
731  if (!stateAtVtx1.isValid()) {
732  stateAtVtx1 = propag.propagate(myTSOS1, *theDisk_);
733  }
734  if (stateAtVtx1.isValid()) {
735  iphi1 = stateAtVtx1.globalDirection().phi();
736  }
737  stateAtVtx2 = propag.propagate(myTSOS2, *theBarrel_);
738  if (!stateAtVtx2.isValid()) {
739  stateAtVtx2 = propag.propagate(myTSOS2, *theDisk_);
740  }
741  if (stateAtVtx2.isValid()) {
742  iphi2 = stateAtVtx2.globalDirection().phi();
743  }
744  }
745  const double dPhi = reco::deltaPhi(iphi1, iphi2);
746  return (fabs(dPhi) < deltaPhi_);
747  } else {
748  return true;
749  }
750 }
751 
753  const reco::TransientTrack& ttk_r,
754  double& appDist) {
755  double dCotTheta = 1. / tan(ttk_l.track().innerMomentum().theta()) - 1. / tan(ttk_r.track().innerMomentum().theta());
756  if (allowDeltaCot_ && (std::abs(dCotTheta) > deltaCotTheta_)) {
757  return false;
758  }
759 
760  //non-conversion hypothesis, reject prompt track pairs
761  ClosestApproachInRPhi closest;
763  if (!closest.status()) {
764  return false;
765  }
766 
767  if (closest.crossingPoint().perp() < r_cut) {
768  return false;
769  }
770 
771  //compute tangent point btw tracks (conversion hypothesis)
772  TangentApproachInRPhi tangent;
774  if (!tangent.status()) {
775  return false;
776  }
777 
778  GlobalPoint tangentPoint = tangent.crossingPoint();
779  double rho = tangentPoint.perp();
780 
781  //reject candidates well outside of tracker bounds
782  if (rho > maxTrackRho_) {
783  return false;
784  }
785 
786  if (std::abs(tangentPoint.z()) > maxTrackZ_) {
787  return false;
788  }
789 
790  std::pair<GlobalTrajectoryParameters, GlobalTrajectoryParameters> trajs = tangent.trajectoryParameters();
791 
792  //very large separation in z, no hope
793  if (std::abs(trajs.first.position().z() - trajs.second.position().z()) > dzCut_) {
794  return false;
795  }
796 
797  float minApproach = tangent.perpdist();
798  appDist = minApproach;
799 
800  if (allowMinApproach_ && (minApproach < minApproachLow_ || minApproach > minApproachHigh_)) {
801  return false;
802  }
803 
804  return true;
805 }
806 
809  const reco::CaloClusterPtr& bc_l = ll.second; //can be null, so check isNonnull()
810  const reco::CaloClusterPtr& bc_r = rr.second;
811 
812  //The cuts should be ordered by considering if takes time and if cuts off many fakes
813  if (allowTrackBC_) {
814  //check energy of BC
815  double total_e_bc = 0;
816  if (bc_l.isNonnull())
817  total_e_bc += bc_l->energy();
818  if (rightBC_)
819  if (bc_r.isNonnull())
820  total_e_bc += bc_r->energy();
821 
822  if (total_e_bc < energyTotalBC_)
823  return false;
824  }
825 
826  return true;
827 }
828 
829 //because reco::vertex uses track ref, so have to keep them
831  const reco::TransientTrack& ttk_r,
832  const MagneticField* magField,
833  reco::Vertex& the_vertex) {
834  bool found = false;
835 
836  std::vector<reco::TransientTrack> pair;
837  pair.push_back(ttk_l);
838  pair.push_back(ttk_r);
839 
840  found = theVertexFinder_->run(pair, the_vertex);
841 
842  return found;
843 }
844 
845 double ConversionProducer::etaTransformation(float EtaParticle, float Zvertex) {
846  //---Definitions
847  const float PI = 3.1415927;
848 
849  //---Definitions for ECAL
850  const float R_ECAL = 136.5;
851  const float Z_Endcap = 328.0;
852  const float etaBarrelEndcap = 1.479;
853 
854  //---ETA correction
855 
856  float Theta = 0.0;
857  float ZEcal = R_ECAL * sinh(EtaParticle) + Zvertex;
858 
859  if (ZEcal != 0.0)
860  Theta = atan(R_ECAL / ZEcal);
861  if (Theta < 0.0)
862  Theta = Theta + PI;
863  double ETA = -log(tan(0.5 * Theta));
864 
865  if (fabs(ETA) > etaBarrelEndcap) {
866  float Zend = Z_Endcap;
867  if (EtaParticle < 0.0)
868  Zend = -Zend;
869  float Zlen = Zend - Zvertex;
870  float RR = Zlen / sinh(EtaParticle);
871  Theta = atan(RR / Zend);
872  if (Theta < 0.0)
873  Theta = Theta + PI;
874  ETA = -log(tan(0.5 * Theta));
875  }
876  //---Return the result
877  return ETA;
878  //---end
879 }
reco::Track::outerMomentum
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:65
TrajectoryStateOnSurface::globalDirection
GlobalVector globalDirection() const
Definition: TrajectoryStateOnSurface.h:67
PI
Definition: PayloadInspector.h:20
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
reco::Conversion::setQuality
void setQuality(ConversionQuality q, bool b)
Definition: Conversion.h:239
ConversionProducer::deltaCotTheta_
double deltaCotTheta_
Definition: ConversionProducer.h:125
TkRotation< float >
reco::Vertex::isValid
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:72
ConversionProducer::halfWayEta_
double halfWayEta_
Definition: ConversionProducer.h:109
reco::Conversion
Definition: Conversion.h:23
TrajectoryStateOnSurface.h
ConversionProducer::bypassPreselEcal_
bool bypassPreselEcal_
Definition: ConversionProducer.h:99
ConversionProducer::energyBC_
double energyBC_
Definition: ConversionProducer.h:116
HLT_FULL_cff.min_eta
min_eta
Definition: HLT_FULL_cff.py:47206
anyDirection
Definition: PropagationDirection.h:4
edm::ESInputTag
Definition: ESInputTag.h:87
reco::Conversion::generalTracksOnly
Definition: Conversion.h:28
ConversionProducer::d0Cut_
double d0Cut_
Definition: ConversionProducer.h:118
ConversionProducer::getMatchedBC
bool getMatchedBC(const std::multimap< double, reco::CaloClusterPtr > &bcMap, const math::XYZPointF &trackImpactPosition, reco::CaloClusterPtr &closestBC)
Definition: ConversionProducer.cc:667
BoundCylinder
Cylinder BoundCylinder
Definition: BoundCylinder.h:17
ConversionProducer::transientTrackBuilder_
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackBuilder_
Definition: ConversionProducer.h:93
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ConversionProducer::dzCut_
double dzCut_
Definition: ConversionProducer.h:119
MultiTrackKinematicConstraint.h
ConversionProducer::minHitsLeft_
double minHitsLeft_
Definition: ConversionProducer.h:123
ConversionProducer::allowD0_
bool allowD0_
Definition: ConversionProducer.h:97
ClosestApproachInRPhi::status
bool status() const override
Definition: ClosestApproachInRPhi.h:37
reco::TrackBase::inOutEcalSeededConv
Definition: TrackBase.h:106
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PropagatorWithMaterial::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
ConversionProducer::trackQualityFilter
bool trackQualityFilter(const edm::RefToBase< reco::Track > &ref, bool isLeft)
Definition: ConversionProducer.cc:573
PI
#define PI
Definition: QcdUeDQM.h:37
ConversionProducer::allowOppCharge_
bool allowOppCharge_
Definition: ConversionProducer.h:97
patZpeak.handle
handle
Definition: patZpeak.py:23
reco::Conversion::gsfTracksOpenOnly
Definition: Conversion.h:32
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
deltaPhi.h
ColinearityKinematicConstraint.h
ChiSquaredProbability
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:13
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
TangentApproachInRPhi::status
bool status() const override
Definition: TangentApproachInRPhi.h:26
ConversionProducer::buildCollection
void buildCollection(edm::Event &iEvent, const edm::EventSetup &iSetup, const std::multimap< float, edm::Ptr< reco::ConversionTrack > > &allTracks, const std::multimap< double, reco::CaloClusterPtr > &superClusterPtrs, const std::multimap< double, reco::CaloClusterPtr > &basicClusterPtrs, const reco::Vertex &the_pvtx, reco::ConversionCollection &outputConvPhotonCollection)
Definition: ConversionProducer.cc:275
ConversionProducer.h
edm
HLT enums.
Definition: AlignableModifier.h:19
ConversionProducer::checkTrackPair
bool checkTrackPair(const std::pair< edm::RefToBase< reco::Track >, reco::CaloClusterPtr > &ll, const std::pair< edm::RefToBase< reco::Track >, reco::CaloClusterPtr > &rr)
Definition: ConversionProducer.cc:807
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
ConversionProducer::allowSingleLeg_
bool allowSingleLeg_
Definition: ConversionProducer.h:131
ConversionProducer::bypassPreselEcalEcal_
bool bypassPreselEcalEcal_
Definition: ConversionProducer.h:99
muonTagProbeFilters_cff.allTracks
allTracks
Definition: muonTagProbeFilters_cff.py:22
ConversionVertexFinder.h
ChiSquaredProbability.h
ConversionProducer::buildSuperAndBasicClusterGeoMap
void buildSuperAndBasicClusterGeoMap(const edm::Event &, std::multimap< double, reco::CaloClusterPtr > &basicClusterPtrs, std::multimap< double, reco::CaloClusterPtr > &superClusterPtrs)
Definition: ConversionProducer.cc:226
ConversionProducer::minHitsRight_
double minHitsRight_
Definition: ConversionProducer.h:123
reco::Conversion::zOfPrimaryVertexFromTracks
double zOfPrimaryVertexFromTracks(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.h:136
ConversionProducer::matchingSC
bool matchingSC(const std::multimap< double, reco::CaloClusterPtr > &scMap, reco::Conversion &conv, reco::CaloClusterPtrVector &mSC)
Definition: ConversionProducer.cc:638
reco::Vertex::position
const Point & position() const
position
Definition: Vertex.h:114
reco::Track::found
unsigned short found() const
Number of valid hits on track.
Definition: Track.h:142
ConversionProducer::maxChi2Left_
double maxChi2Left_
Definition: ConversionProducer.h:122
ConversionProducer::trackD0Cut
bool trackD0Cut(const edm::RefToBase< reco::Track > &ref)
Definition: ConversionProducer.cc:584
reco::TrackBase::gsf
Definition: TrackBase.h:120
TangentApproachInRPhi::perpdist
float perpdist() const
Definition: TangentApproachInRPhi.cc:58
ConversionProducer::thettbuilder_
const TransientTrackBuilder * thettbuilder_
Definition: ConversionProducer.h:105
ReferenceCountingPointer< Surface >
ConversionProducer::deltaEta_
double deltaEta_
Definition: ConversionProducer.h:107
TransientTrack.h
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13765
ConversionProducer::dEtaTkBC_
double dEtaTkBC_
Definition: ConversionProducer.h:120
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle
Definition: AssociativeIterator.h:50
ConversionProducer::maxTrackZ_
double maxTrackZ_
Definition: ConversionProducer.h:111
KinematicParticleVertexFitter.h
reco::Track::extra
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
reco::TrackBase::dxyError
double dxyError() const
error on dxy
Definition: TrackBase.h:769
ConversionProducer::minApproachLow_
double minApproachLow_
Definition: ConversionProducer.h:125
ConversionProducer::preselectTrackPair
bool preselectTrackPair(const reco::TransientTrack &ttk_l, const reco::TransientTrack &ttk_r, double &appDist)
Definition: ConversionProducer.cc:752
TwoTrackMinimumDistance.h
geometryDiff.epsilon
int epsilon
Definition: geometryDiff.py:26
edm::Ref< GsfTrackCollection >
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
ConversionVertexFinder
Definition: ConversionVertexFinder.h:29
trajectoryStateTransform::outerStateOnSurface
TrajectoryStateOnSurface outerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:118
barrelHalfLength
constexpr float barrelHalfLength
Definition: ConversionTrackEcalImpactPoint.cc:16
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
SimpleCylinderBounds
Definition: SimpleCylinderBounds.h:19
ConversionHitChecker::nSharedHits
uint8_t nSharedHits(const reco::Track &trk1, const reco::Track &trk2) const
Definition: ConversionHitChecker.cc:71
SimpleDiskBounds
Definition: SimpleDiskBounds.h:11
cmsdt::algo
algo
Definition: constants.h:164
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
reco::Conversion::refittedPairMomentum
math::XYZVectorF refittedPairMomentum() const
Conversion tracks momentum from the tracks refitted with vertex constraint.
Definition: Conversion.cc:206
ConversionProducer::usePvtx_
bool usePvtx_
Definition: ConversionProducer.h:101
reco::Conversion::arbitratedMerged
Definition: Conversion.h:30
PropagatorWithMaterial
Definition: PropagatorWithMaterial.h:25
TrackingRecHit.h
reco::Track::innerMomentum
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
ConversionProducer::allowDeltaPhi_
bool allowDeltaPhi_
Definition: ConversionProducer.h:97
ConversionTrack.h
ClosestApproachInRPhi.h
PTrajectoryStateOnDet.h
ConversionProducer::energyTotalBC_
double energyTotalBC_
Definition: ConversionProducer.h:117
ClosestApproachInRPhi::calculate
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
Definition: ClosestApproachInRPhi.cc:8
reco::Conversion::arbitratedEcalSeeded
Definition: Conversion.h:29
reco::TrackBase::outInEcalSeededConv
Definition: TrackBase.h:105
edm::PtrVector< CaloCluster >
ConversionProducer::toFConverterV
math::XYZVectorF toFConverterV(const math::XYZVector &val)
Definition: ConversionProducer.h:188
ConversionProducer::allowTrackBC_
bool allowTrackBC_
Definition: ConversionProducer.h:97
ConversionProducer::checkPhi
bool checkPhi(const edm::RefToBase< reco::Track > &tk_l, const edm::RefToBase< reco::Track > &tk_r, const TrackerGeometry *trackerGeom, const MagneticField *magField, const reco::Vertex &the_vertex)
Definition: ConversionProducer.cc:699
reco::Track
Definition: Track.h:27
edm::ESHandle< TransientTrackBuilder >
ClosestApproachInRPhi
Definition: ClosestApproachInRPhi.h:26
ConversionProducer::toFConverterP
math::XYZPointF toFConverterP(const math::XYZPoint &val)
Definition: ConversionProducer.h:186
reco::Conversion::setMatchingSuperCluster
void setMatchingSuperCluster(const reco::CaloClusterPtrVector &sc)
Definition: Conversion.h:165
ConversionProducer::deltaPhi_
double deltaPhi_
Definition: ConversionProducer.h:125
TangentApproachInRPhi::crossingPoint
GlobalPoint crossingPoint() const override
Definition: TangentApproachInRPhi.cc:42
ConversionProducer::r_cut
double r_cut
Definition: ConversionProducer.h:128
reco::TrackBase::charge
int charge() const
track electric charge
Definition: TrackBase.h:596
ConversionProducer::dEtacutForSCmatching_
double dEtacutForSCmatching_
Definition: ConversionProducer.h:114
ConversionProducer::vtxChi2_
double vtxChi2_
Definition: ConversionProducer.h:129
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ConversionProducer::ConversionProducer
ConversionProducer(const edm::ParameterSet &)
Definition: ConversionProducer.cc:65
Point3DBase< float, GlobalTag >
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
TangentApproachInRPhi.h
tkConvValidator_cfi.generalTracksOnly
generalTracksOnly
Definition: tkConvValidator_cfi.py:50
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TangentApproachInRPhi::trajectoryParameters
std::pair< GlobalTrajectoryParameters, GlobalTrajectoryParameters > trajectoryParameters() const
Definition: TangentApproachInRPhi.cc:116
Vertex.h
EcalSubdetector.h
ConversionProducer::theVertexFinder_
ConversionVertexFinder * theVertexFinder_
Definition: ConversionProducer.h:103
edm::PtrVector::push_back
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
ConversionProducer::scEndcapProducer_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scEndcapProducer_
Definition: ConversionProducer.h:88
CaloSubdetectorGeometry.h
endcapRadius
constexpr float endcapRadius
Definition: ConversionTrackEcalImpactPoint.cc:17
ConversionVertexFinder::run
TransientVertex run(const std::vector< reco::TransientTrack > &pair)
Definition: ConversionVertexFinder.cc:135
edm::ParameterSet
Definition: ParameterSet.h:47
ConversionProducer::bcBarrelCollection_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
Definition: ConversionProducer.h:89
PropagatorWithMaterial.h
ConversionProducer::vertexProducer_
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
Definition: ConversionProducer.h:102
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
ConversionProducer::allowMinApproach_
bool allowMinApproach_
Definition: ConversionProducer.h:97
ConversionProducer::getTrackImpactPosition
bool getTrackImpactPosition(const reco::Track *tk_ref, const TrackerGeometry *trackerGeom, const MagneticField *magField, math::XYZPointF &ew)
Definition: ConversionProducer.cc:594
ConversionProducer::bypassPreselGsf_
bool bypassPreselGsf_
Definition: ConversionProducer.h:99
ConversionProducer::maxNumOfTrackInPU_
unsigned int maxNumOfTrackInPU_
Definition: ConversionProducer.h:110
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
ConversionProducer::rightBC_
bool rightBC_
Definition: ConversionProducer.h:132
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
ConversionProducer::minSCEt_
double minSCEt_
Definition: ConversionProducer.h:113
ConversionProducer::src_
edm::EDGetTokenT< edm::View< reco::ConversionTrack > > src_
Definition: ConversionProducer.h:85
reco::Conversion::highPurity
Definition: Conversion.h:33
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
reco::Track::innerPosition
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
TrackTransientTrack.h
ConversionProducer::~ConversionProducer
~ConversionProducer() override
Definition: ConversionProducer.cc:158
iEvent
int iEvent
Definition: GenABIO.cc:224
ConversionProducer::checkVertex
bool checkVertex(const reco::TransientTrack &ttk_l, const reco::TransientTrack &ttk_r, const MagneticField *magField, reco::Vertex &the_vertex)
Definition: ConversionProducer.cc:830
ClosestApproachInRPhi::crossingPoint
GlobalPoint crossingPoint() const override
Definition: ClosestApproachInRPhi.cc:46
GsfTrack.h
reco::TrackBase::d0
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:611
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
ConversionProducer::minApproachHigh_
double minApproachHigh_
Definition: ConversionProducer.h:125
edm::EventSetup
Definition: EventSetup.h:57
edm::RefToBase::castTo
REF castTo() const
Definition: RefToBase.h:257
AnalyticalPropagator.h
reco::TrackBase::normalizedChi2
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:593
tkConvValidator_cfi.arbitratedMerged
arbitratedMerged
Definition: tkConvValidator_cfi.py:51
ConversionProducer::dPhiTkBC_
double dPhiTkBC_
Definition: ConversionProducer.h:120
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
ConversionProducer::dPhicutForSCmatching_
double dPhicutForSCmatching_
Definition: ConversionProducer.h:115
ConversionProducer::allowDeltaCot_
bool allowDeltaCot_
Definition: ConversionProducer.h:97
reco::Conversion::ConversionAlgorithm
ConversionAlgorithm
Definition: Conversion.h:25
reco::Vertex::chi2
double chi2() const
chi-squares
Definition: Vertex.h:103
TangentApproachInRPhi::calculate
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
Definition: TangentApproachInRPhi.cc:7
ConversionProducer::trackerGeometry_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometry_
Definition: ConversionProducer.h:94
TangentApproachInRPhi
Definition: TangentApproachInRPhi.h:15
edm::Ptr
Definition: AssociationVector.h:31
ConversionProducer::maxTrackRho_
double maxTrackRho_
Definition: ConversionProducer.h:112
reco::TrackBase::algo
TrackAlgorithm algo() const
Definition: TrackBase.h:547
ConversionProducer::allowVertex_
bool allowVertex_
Definition: ConversionProducer.h:97
ConversionProducer::algoName_
std::string algoName_
Definition: ConversionProducer.h:80
endcapZ
constexpr float endcapZ
Definition: ConversionTrackEcalImpactPoint.cc:18
Trajectory.h
reco::Conversion::algoByName
static ConversionAlgorithm algoByName(const std::string &name)
Definition: Conversion.cc:139
ConversionProducer::bcEndcapCollection_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
Definition: ConversionProducer.h:90
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::TrackBase::d0Error
double d0Error() const
error on d0
Definition: TrackBase.h:772
ConversionProducer::ConvertedPhotonCollection_
std::string ConvertedPhotonCollection_
Definition: ConversionProducer.h:91
KinematicConstrainedVertexFitter.h
GsfTrackFwd.h
reco::TransientTrack
Definition: TransientTrack.h:19
reco::TransientTrack::track
const Track & track() const
Definition: TransientTrack.h:117
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
ConversionProducer::maxChi2Right_
double maxChi2Right_
Definition: ConversionProducer.h:122
ConversionProducer::magneticField_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticField_
Definition: ConversionProducer.h:95
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
ETA
#define ETA
Definition: GenericBenchmark.cc:28
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
ConversionProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: ConversionProducer.cc:165
reco::Conversion::arbitratedMergedEcalGeneral
Definition: Conversion.h:31
MassKinematicConstraint.h
ConversionHitChecker::nHitsBeforeVtx
std::pair< uint8_t, Measurement1DFloat > nHitsBeforeVtx(const reco::TrackExtra &track, const reco::Vertex &vtx, float sigmaTolerance=3.0) const
Definition: ConversionHitChecker.cc:8
KinematicParticleFactoryFromTransientTrack.h
edm::Ptr::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase< reco::Track >
TrajectoryStateTransform.h
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
TrackSplittingMonitor_cfi.dphiMin
dphiMin
Definition: TrackSplittingMonitor_cfi.py:33
HLT_FULL_cff.delta_phi
delta_phi
Definition: HLT_FULL_cff.py:11735
TransientTrackBuilder::build
reco::TransientTrack build(const reco::Track *p) const
Definition: TransientTrackBuilder.cc:20
tkConvValidator_cfi.arbitratedEcalSeeded
arbitratedEcalSeeded
Definition: tkConvValidator_cfi.py:52
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dummy
Definition: DummySelector.h:38
trajectoryStateTransform::innerStateOnSurface
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:110
barrelRadius
constexpr float barrelRadius
Definition: ConversionTrackEcalImpactPoint.cc:15
ConversionProducer::etaTransformation
double etaTransformation(float EtaParticle, float Zvertex)
Definition: ConversionProducer.cc:845
ZEcal
static constexpr float ZEcal
Definition: L1TkEmParticleProducer.cc:40
ConversionHitChecker.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
KinematicParticleFitter.h
math::XYZPointF
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
edm::Event
Definition: Event.h:73
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
MagneticField
Definition: MagneticField.h:19
reco::TrackBase::dxy
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608
reco::Vertex::ndof
double ndof() const
Definition: Vertex.h:110
BoundDisk
Disk BoundDisk
Definition: BoundDisk.h:54
ParticleMass.h
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
ConversionProducer::scBarrelProducer_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scBarrelProducer_
Definition: ConversionProducer.h:87
HLT_FULL_cff.delta_eta
delta_eta
Definition: HLT_FULL_cff.py:11734
edm::InputTag
Definition: InputTag.h:15
alongMomentum
Definition: PropagationDirection.h:4
Z_Endcap
static constexpr float Z_Endcap
Definition: ECALPositionCalculator.cc:11
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
reco::Vertex
Definition: Vertex.h:35
R_ECAL
static constexpr float R_ECAL
Definition: ECALPositionCalculator.cc:10
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
TwoTrackMassKinematicConstraint.h
ConversionHitChecker
Definition: ConversionHitChecker.h:31
reco::TransientTrack::innermostMeasurementState
TrajectoryStateOnSurface innermostMeasurementState() const
Definition: TransientTrack.h:88
TrackerGeometry
Definition: TrackerGeometry.h:14
etaBarrelEndcap
static constexpr float etaBarrelEndcap
Definition: ECALPositionCalculator.cc:12