CMS 3D CMS Logo

MultiHitGeneratorFromChi2.cc
Go to the documentation of this file.
3 
8 
13 
15 
22 
29 
31 
33 
36 
37 #include <algorithm>
38 #include <iostream>
39 #include <vector>
40 #include <cmath>
41 #include <map>
42 #include <limits>
43 
44 using namespace std;
45 
47 
48 namespace {
49  struct LayerRZPredictions {
51  };
52 } // namespace
53 
56  useFixedPreFiltering(cfg.getParameter<bool>("useFixedPreFiltering")),
58  cfg.getParameter<double>("extraHitRZtolerance")), //extra window in ThirdHitRZPrediction range
59  extraHitRPhitolerance(cfg.getParameter<double>(
60  "extraHitRPhitolerance")), //extra window in ThirdHitPredictionFromCircle range (divide by R to get phi)
62  cfg.getParameter<double>("extraZKDBox")), //extra windown in Z when building the KDTree box (used in barrel)
64  cfg.getParameter<double>("extraRKDBox")), //extra windown in R when building the KDTree box (used in endcap)
65  extraPhiKDBox(cfg.getParameter<double>("extraPhiKDBox")), //extra windown in Phi when building the KDTree box
66  fnSigmaRZ(cfg.getParameter<double>(
67  "fnSigmaRZ")), //this multiplies the max hit error on the layer when building the KDTree box
68  chi2VsPtCut(cfg.getParameter<bool>("chi2VsPtCut")),
69  maxChi2(cfg.getParameter<double>("maxChi2")),
70  refitHits(cfg.getParameter<bool>("refitHits")),
71  filterName_(cfg.getParameter<std::string>("ClusterShapeHitFilterName")),
72  builderName_(cfg.existsAs<std::string>("TTRHBuilder") ? cfg.getParameter<std::string>("TTRHBuilder")
73  : std::string("WithTrackAngle")),
74  useSimpleMF_(false),
75  mfName_("") {
77  dphi = cfg.getParameter<double>("phiPreFiltering");
78  if (chi2VsPtCut) {
79  pt_interv = cfg.getParameter<std::vector<double> >("pt_interv");
80  chi2_cuts = cfg.getParameter<std::vector<double> >("chi2_cuts");
81  }
82 #ifdef EDM_ML_DEBUG
83  detIdsToDebug = cfg.getParameter<std::vector<int> >("detIdsToDebug");
84  //if (detIdsToDebug.size()<3) //fixme
85 #else
86  detIdsToDebug.push_back(0);
87  detIdsToDebug.push_back(0);
88  detIdsToDebug.push_back(0);
89 #endif
90  // 2014/02/11 mia:
91  // we should get rid of the boolean parameter useSimpleMF,
92  // and use only a string magneticField [instead of SimpleMagneticField]
93  // or better an edm::ESInputTag (at the moment HLT does not handle ESInputTag)
94  if (cfg.exists("SimpleMagneticField")) {
95  useSimpleMF_ = true;
96  mfName_ = cfg.getParameter<std::string>("SimpleMagneticField");
97  }
98  filter = nullptr;
99  bfield = nullptr;
100  nomField = -1.;
101 }
102 
104 
107 
108  // fixed phi filtering
109  desc.add<bool>("useFixedPreFiltering", false);
110  desc.add<double>("phiPreFiltering", 0.3);
111 
112  // box properties
113  desc.add<double>("extraHitRPhitolerance", 0);
114  desc.add<double>("extraHitRZtolerance", 0);
115  desc.add<double>("extraZKDBox", 0.2);
116  desc.add<double>("extraRKDBox", 0.2);
117  desc.add<double>("extraPhiKDBox", 0.005);
118  desc.add<double>("fnSigmaRZ", 2.0);
119 
120  // refit&filter hits
121  desc.add<bool>("refitHits", true);
122  desc.add<std::string>("ClusterShapeHitFilterName", "ClusterShapeHitFilter");
123  desc.add<std::string>("TTRHBuilder", "WithTrackAngle");
124 
125  // chi2 cuts
126  desc.add<double>("maxChi2", 5.0);
127  desc.add<bool>("chi2VsPtCut", true);
128  desc.add<std::vector<double> >("pt_interv", std::vector<double>{{0.4, 0.7, 1.0, 2.0}});
129  desc.add<std::vector<double> >("chi2_cuts", std::vector<double>{{3.0, 4.0, 5.0, 5.0}});
130 
131  // debugging
132  desc.add<std::vector<int> >("detIdsToDebug", std::vector<int>{{0, 0, 0}});
133 }
134 
137  if (useSimpleMF_)
138  es.get<IdealMagneticFieldRecord>().get(mfName_, bfield_h);
139  else
140  es.get<IdealMagneticFieldRecord>().get(bfield_h);
141  bfield = bfield_h.product();
143  ufield.set(nomField); // more than enough (never actually used)
144 
145  if (refitHits) {
147  es.get<CkfComponentsRecord>().get(filterName_, filterHandle_);
148  filter = filterHandle_.product();
149 
151  es.get<TransientRecHitRecord>().get(builderName_, builderH);
152  builder = (TkTransientTrackingRecHitBuilder const*)(builderH.product());
153  cloner = (*builder).cloner();
154  }
155 }
156 
157 namespace {
158  inline bool intersect(Range& range, const Range& second) {
159  if (range.first > second.max() || range.second < second.min())
160  return false;
161  if (range.first < second.min())
162  range.first = second.min();
163  if (range.second > second.max())
164  range.second = second.max();
165  return range.first < range.second;
166  }
167 } // namespace
168 
171  const edm::Event& ev,
172  const edm::EventSetup& es,
174  std::vector<SeedingLayerSetsHits::SeedingLayer> thirdLayers) {
175  LogDebug("MultiHitGeneratorFromChi2") << "pair: " << thePairGenerator->innerLayer(pairLayers).name() << "+"
176  << thePairGenerator->outerLayer(pairLayers).name()
177  << " 3rd lay size: " << thirdLayers.size();
178 
179  auto const& doublets = thePairGenerator->doublets(region, ev, es, pairLayers);
180  LogTrace("MultiHitGeneratorFromChi2") << "";
181  if (doublets.empty()) {
182  // LogDebug("MultiHitGeneratorFromChi2") << "empy pairs";
183  return;
184  }
185 
187  hitSets(region, result, ev, es, doublets, thirdLayers, *theLayerCache, cache);
188 }
189 
192  const edm::Event& ev,
193  const edm::EventSetup& es,
194  const HitDoublets& doublets,
195  const std::vector<SeedingLayerSetsHits::SeedingLayer>& thirdLayers,
196  LayerCacheType& layerCache,
197  cacheHits& refittedHitStorage) {
198  int size = thirdLayers.size();
199  const RecHitsSortedInPhi* thirdHitMap[size];
200  vector<const DetLayer*> thirdLayerDetLayer(size, nullptr);
201  for (int il = 0; il < size; ++il) {
202  thirdHitMap[il] = &layerCache(thirdLayers[il], region, es);
203 
204  thirdLayerDetLayer[il] = thirdLayers[il].detLayer();
205  }
206  hitSets(region, result, es, doublets, thirdHitMap, thirdLayerDetLayer, size, refittedHitStorage);
207 }
208 
211  const edm::EventSetup& es,
212  const HitDoublets& doublets,
213  const RecHitsSortedInPhi** thirdHitMap,
214  const std::vector<const DetLayer*>& thirdLayerDetLayer,
215  const int nThirdLayers) {
216  hitSets(region, result, es, doublets, thirdHitMap, thirdLayerDetLayer, nThirdLayers, cache);
217 }
218 
221  const edm::EventSetup& es,
222  const HitDoublets& doublets,
223  const RecHitsSortedInPhi** thirdHitMap,
224  const std::vector<const DetLayer*>& thirdLayerDetLayer,
225  const int nThirdLayers,
226  cacheHits& refittedHitStorage) {
227 #ifdef EDM_ML_DEBUG
228  unsigned int debug_Id0 = detIdsToDebug[0];
229  unsigned int debug_Id1 = detIdsToDebug[1];
230  unsigned int debug_Id2 = detIdsToDebug[2];
231 #endif
232 
233  std::array<bool, 3> bl;
234  bl[0] = doublets.innerLayer().isBarrel;
235  bl[1] = doublets.outerLayer().isBarrel;
236 
237  //gc: these are all the layers compatible with the layer pairs (as defined in the config file)
238 
239  //gc: initialize a KDTree per each 3rd layer
240  std::vector<KDTreeNodeInfo<RecHitsSortedInPhi::HitIter, 2> > layerTree; // re-used throughout
241  std::vector<RecHitsSortedInPhi::HitIter> foundNodes; // re-used thoughout
242  foundNodes.reserve(100);
244  declareDynArray(LayerRZPredictions, nThirdLayers, mapPred);
245  float rzError[nThirdLayers]; //save maximum errors
246 
247  const float maxDelphi = region.ptMin() < 0.3f ? float(M_PI) / 4.f : float(M_PI) / 8.f; // FIXME move to config??
248  const float maxphi = M_PI + maxDelphi, minphi = -maxphi; // increase to cater for any range
249  const float safePhi = M_PI - maxDelphi; // sideband
250 
251  //gc: loop over each layer
252  for (int il = 0; il < nThirdLayers; il++) {
253  LogTrace("MultiHitGeneratorFromChi2")
254  << "considering third layer: with hits: " << thirdHitMap[il]->all().second - thirdHitMap[il]->all().first;
255  const DetLayer* layer = thirdLayerDetLayer[il];
256  LayerRZPredictions& predRZ = mapPred[il];
257  predRZ.line.initLayer(layer);
258  predRZ.line.initTolerance(extraHitRZtolerance);
259 
260  //gc: now we take all hits in the layer and fill the KDTree
261  auto const& layer3 = *thirdHitMap[il]; // Get iterators
262  layerTree.clear();
263  float minz = 999999.0f, maxz = -minz; // Initialise to extreme values in case no hits
264  float maxErr = 0.0f;
265  if (!layer3.empty()) {
266  minz = layer3.v[0];
267  maxz = minz; //In case there's only one hit on the layer
268  for (auto i = 0U; i < layer3.size(); ++i) {
269  auto hi = layer3.theHits.begin() + i;
270  auto angle = layer3.phi(i);
271  auto myz = layer3.v[i];
272 #ifdef EDM_ML_DEBUG
273  IfLogTrace(hi->hit()->rawId() == debug_Id2, "MultiHitGeneratorFromChi2")
274  << "filling KDTree with hit in id=" << debug_Id2 << " with pos: " << hi->hit()->globalPosition()
275  << " phi=" << hi->hit()->globalPosition().phi() << " z=" << hi->hit()->globalPosition().z()
276  << " r=" << hi->hit()->globalPosition().perp();
277 #endif
278  //use (phi,r) for endcaps rather than (phi,z)
279  if (myz < minz) {
280  minz = myz;
281  } else {
282  if (myz > maxz) {
283  maxz = myz;
284  }
285  }
286  auto myerr = layer3.dv[i];
287  if (myerr > maxErr) {
288  maxErr = myerr;
289  }
290  layerTree.push_back(KDTreeNodeInfo<RecHitsSortedInPhi::HitIter, 2>(hi, angle, myz)); // save it
291  // populate side-bands
292  if (angle > safePhi)
293  layerTree.push_back(
295  else if (angle < -safePhi)
296  layerTree.push_back(
298  }
299  }
300  KDTreeBox phiZ(minphi, maxphi, minz - 0.01f, maxz + 0.01f); // declare our bounds
301  //add fudge factors in case only one hit and also for floating-point inaccuracy
302  hitTree[il].build(layerTree, phiZ); // make KDtree
303  rzError[il] = maxErr; //save error
304  }
305  //gc: now we have initialized the KDTrees and we are out of the layer loop
306 
307  //gc: this sets the minPt of the triplet
308  auto curv = PixelRecoUtilities::curvature(1. / region.ptMin(), es);
309 
310  LogTrace("MultiHitGeneratorFromChi2") << "doublet size=" << doublets.size() << std::endl;
311 
312  //fixme add pixels
313  auto filterHit = [&](TrackingRecHit const* hit, GlobalVector const& dir) -> bool {
314  auto hh = reinterpret_cast<BaseTrackerRecHit const*>(hit);
315  if ( //hh->geographicalId().subdetId() > 2
316  hh->geographicalId().subdetId() == SiStripDetId::TIB || hh->geographicalId().subdetId() == SiStripDetId::TID
317  //|| hh->geographicalId().subdetId()==SiStripDetId::TOB
318  //|| hh->geographicalId().subdetId()==SiStripDetId::TEC
319  ) {
320  // carefull " for matched and projected local of tsos != local for individual clusters...
321  if (hh->isMatched()) {
322  const SiStripMatchedRecHit2D* matchedHit = reinterpret_cast<const SiStripMatchedRecHit2D*>(hh);
323  if (filter->isCompatible(DetId(matchedHit->monoId()), matchedHit->monoCluster(), dir) == 0 ||
324  filter->isCompatible(DetId(matchedHit->stereoId()), matchedHit->stereoCluster(), dir) == 0)
325  return false;
326  } else if (hh->isProjected()) {
327  const ProjectedSiStripRecHit2D* precHit = reinterpret_cast<const ProjectedSiStripRecHit2D*>(hh);
328  if (filter->isCompatible(precHit->originalHit(), dir) == 0)
329  return false; //FIXME??
330  } else if (hh->isSingle()) {
331  const SiStripRecHit2D* recHit = reinterpret_cast<const SiStripRecHit2D*>(hh);
332  if (filter->isCompatible(*recHit, dir) == 0)
333  return false;
334  }
335  }
336  return true;
337  };
338 
339  //gc: now we loop over all pairs
340  for (std::size_t ip = 0; ip != doublets.size(); ip++) {
341  int foundTripletsFromPair = 0;
342  bool usePair = false;
343  cacheHitPointer bestH2;
345 
348 
349  HitOwnPtr hit0(*oriHit0);
350  HitOwnPtr hit1(*oriHit1);
353 
354 #ifdef EDM_ML_DEBUG
355  bool debugPair = oriHit0->rawId() == debug_Id0 && oriHit1->rawId() == debug_Id1;
356 #endif
357  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << endl
358  << endl
359  << "found new pair with ids " << oriHit0->rawId() << " "
360  << oriHit1->rawId() << " with pos: " << gp0 << " " << gp1;
361 
362  if (refitHits) {
363  TrajectoryStateOnSurface tsos0, tsos1;
364  assert(!hit0.isOwn());
365  assert(!hit1.isOwn());
366 #ifdef EDM_ML_DEBUG
367  refit2Hits(hit0, hit1, tsos0, tsos1, region, nomField, debugPair);
368 #else
369  refit2Hits(hit0, hit1, tsos0, tsos1, region, nomField, false);
370 #endif
371 
372  bool passFilterHit0 = filterHit(hit0->hit(), tsos0.globalMomentum());
373  IfLogTrace(debugPair && !passFilterHit0, "MultiHitGeneratorFromChi2") << "hit0 did not pass cluster shape filter";
374  if (!passFilterHit0)
375  continue;
376  bool passFilterHit1 = filterHit(hit1->hit(), tsos1.globalMomentum());
377  IfLogTrace(debugPair && !passFilterHit1, "MultiHitGeneratorFromChi2") << "hit1 did not pass cluster shape filter";
378  if (!passFilterHit1)
379  continue;
380  // refit hits
381  hit0.reset((SeedingHitSet::RecHitPointer)(cloner(*hit0, tsos0)));
382  hit1.reset((SeedingHitSet::RecHitPointer)(cloner(*hit1, tsos1)));
383 
384 #ifdef EDM_ML_DEBUG
385  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2")
386  << "charge=" << tsos0.charge() << std::endl
387  << "state1 pt=" << tsos0.globalMomentum().perp() << " eta=" << tsos0.globalMomentum().eta()
388  << " phi=" << tsos0.globalMomentum().phi() << std::endl
389  << "state2 pt=" << tsos1.globalMomentum().perp() << " eta=" << tsos1.globalMomentum().eta()
390  << " phi=" << tsos1.globalMomentum().phi() << std::endl
391  << "positions after refitting: " << hit0->globalPosition() << " " << hit1->globalPosition();
392 #endif
393  } else {
394  // not refit clone anyhow
395  hit0.reset((BaseTrackerRecHit*)hit0->clone());
396  hit1.reset((BaseTrackerRecHit*)hit1->clone());
397  }
398 
399  assert(hit0.isOwn());
400  assert(hit1.isOwn());
401 
402  //gc: create the RZ line for the pair
403  SimpleLineRZ line(PixelRecoPointRZ(gp0.perp(), gp0.z()), PixelRecoPointRZ(gp1.perp(), gp1.z()));
404  ThirdHitPredictionFromCircle predictionRPhi(gp0, gp1, extraHitRPhitolerance);
405 
406  auto toPos = std::signbit(gp1.z() - gp0.z());
407 
408  //gc: this is the curvature of the two hits assuming the region
409  Range pairCurvature = predictionRPhi.curvature(region.originRBound());
410  //gc: intersect not only returns a bool but may change pairCurvature to intersection with curv
411  if (!intersect(pairCurvature, Range(-curv, curv))) {
412  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2")
413  << "curvature cut: curv=" << curv << " gc=(" << pairCurvature.first << ", " << pairCurvature.second << ")";
414  continue;
415  }
416 
417  std::array<GlobalPoint, 3> gp;
418  std::array<GlobalError, 3> ge;
419  gp[0] = hit0->globalPosition();
420  ge[0] = hit0->globalPositionError();
421  gp[1] = hit1->globalPosition();
422  ge[1] = hit1->globalPositionError();
423 
424  //gc: loop over all third layers compatible with the pair
425  for (int il = 0; (il < nThirdLayers) & (!usePair); il++) {
426  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2")
427  << "cosider layer:"
428  << " for this pair. Location: " << thirdLayerDetLayer[il]->location();
429 
430  if (hitTree[il].empty()) {
431  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << "empty hitTree";
432  continue; // Don't bother if no hits
433  }
434 
435  cacheHitPointer bestL2;
436  float chi2FromThisLayer = std::numeric_limits<float>::max();
437 
438  const DetLayer* layer = thirdLayerDetLayer[il];
439  // bool barrelLayer = layer->location() == GeomDetEnumerators::barrel;
440  auto const& layer3 = *thirdHitMap[il];
441  bool barrelLayer = layer3.isBarrel;
442  bl[2] = layer3.isBarrel;
443 
444  if ((!barrelLayer) & (toPos != std::signbit(layer->position().z())))
445  continue;
446 
447  LayerRZPredictions& predRZ = mapPred[il];
448  predRZ.line.initPropagator(&line);
449 
450  //gc: this takes the z at R-thick/2 and R+thick/2 according to
451  // the line from the two points and the adds the extra tolerance
452  Range rzRange = predRZ.line();
453 
454  if (rzRange.first >= rzRange.second) {
455  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << "rzRange empty";
456  continue;
457  }
458  //gc: check that rzRange is compatible with detector bounds
459  // note that intersect may change rzRange to intersection with bounds
460  if (!intersect(rzRange, predRZ.line.detSize())) { // theDetSize = Range(-maxZ, maxZ);
461  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << "rzRange and detector do not intersect";
462  continue;
463  }
464  Range radius = barrelLayer ? predRZ.line.detRange() : rzRange;
465 
466  //gc: define the phi range of the hits
467  Range phiRange;
468  if (useFixedPreFiltering) {
469  //gc: in this case it takes as range the phi of the outer
470  // hit +/- the phiPreFiltering value from cfg
471  float phi0 = oriHit0->globalPosition().phi();
472  phiRange = Range(phi0 - dphi, phi0 + dphi);
473  } else {
474  //gc: predictionRPhi uses the cosine rule to find the phi of the 3rd point at radius, assuming the pairCurvature range [-c,+c]
475  if (pairCurvature.first < 0. && pairCurvature.second < 0.) {
476  radius.swap();
477  } else if (pairCurvature.first >= 0. && pairCurvature.second >= 0.) {
478  ;
479  } else {
480  radius.first = radius.second;
481  }
482  auto phi12 = predictionRPhi.phi(pairCurvature.first, radius.first);
483  auto phi22 = predictionRPhi.phi(pairCurvature.second, radius.second);
484  phi12 = normalizedPhi(phi12);
485  phi22 = proxim(phi22, phi12);
486  phiRange = Range(phi12, phi22);
487  phiRange.sort();
488  }
489 
490  float prmin = phiRange.min(), prmax = phiRange.max();
491 
492  if (prmax - prmin > maxDelphi) {
493  auto prm = phiRange.mean();
494  prmin = prm - 0.5f * maxDelphi;
495  prmax = prm + 0.5f * maxDelphi;
496  }
497 
498  //gc: this is the place where hits in the compatible region are put in the foundNodes
500  foundNodes.clear(); // Now recover hits in bounding box...
501 
502  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << "defining kd tree box";
503 
504  if (barrelLayer) {
505  KDTreeBox phiZ(prmin - extraPhiKDBox,
506  prmax + extraPhiKDBox,
507  float(rzRange.min() - fnSigmaRZ * rzError[il] - extraZKDBox),
508  float(rzRange.max() + fnSigmaRZ * rzError[il] + extraZKDBox));
509  hitTree[il].search(phiZ, foundNodes);
510 
511  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2")
512  << "kd tree box bounds, phi: " << prmin - extraPhiKDBox << "," << prmax + extraPhiKDBox
513  << " z: " << rzRange.min() - fnSigmaRZ * rzError[il] - extraZKDBox << ","
514  << rzRange.max() + fnSigmaRZ * rzError[il] + extraZKDBox << " rzRange: " << rzRange.min() << ","
515  << rzRange.max();
516 
517  } else {
518  KDTreeBox phiR(prmin - extraPhiKDBox,
519  prmax + extraPhiKDBox,
520  float(rzRange.min() - fnSigmaRZ * rzError[il] - extraRKDBox),
521  float(rzRange.max() + fnSigmaRZ * rzError[il] + extraRKDBox));
522  hitTree[il].search(phiR, foundNodes);
523 
524  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2")
525  << "kd tree box bounds, phi: " << prmin - extraPhiKDBox << "," << prmax + extraPhiKDBox
526  << " r: " << rzRange.min() - fnSigmaRZ * rzError[il] - extraRKDBox << ","
527  << rzRange.max() + fnSigmaRZ * rzError[il] + extraRKDBox << " rzRange: " << rzRange.min() << ","
528  << rzRange.max();
529  }
530 
531  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << "kd tree box size: " << foundNodes.size();
532 
533  //gc: now we loop over the hits in the box for this layer
534  for (std::vector<RecHitsSortedInPhi::HitIter>::iterator ih = foundNodes.begin();
535  ih != foundNodes.end() && !usePair;
536  ++ih) {
537  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << endl << "triplet candidate";
538 
539  const RecHitsSortedInPhi::HitIter KDdata = *ih;
540 
541  auto oriHit2 = KDdata->hit();
542  auto kk = KDdata - layer3.theHits.begin();
543  cacheHitPointer hit2;
544  auto gp2 = layer3.gp(kk);
545  if (refitHits) { //fixme
546 
547  //fitting all 3 hits takes too much time... do it quickly only for 3rd hit
548  GlobalVector initMomentum(gp2 - gp1);
549  initMomentum /= initMomentum.perp(); //set pT=1
550 
551  //fixme add pixels
552  bool passFilterHit2 = filterHit(oriHit2->hit(), initMomentum);
553  if (!passFilterHit2)
554  continue;
555  TrajectoryStateOnSurface state(GlobalTrajectoryParameters(gp2, initMomentum, 1, &ufield),
556  *oriHit2->surface());
557  hit2.reset((SeedingHitSet::RecHitPointer)(cloner(*oriHit2, state)));
558 
559  } else {
560  // not refit clone anyhow
561  hit2.reset((BaseTrackerRecHit*)oriHit2->clone());
562  }
563 
564  //gc: add the chi2 cut
565  gp[2] = hit2->globalPosition();
566  ge[2] = hit2->globalPositionError();
567  RZLine rzLine(gp, ge, bl);
568  float chi2 = rzLine.chi2();
569 
570 #ifdef EDM_ML_DEBUG
571  bool debugTriplet = debugPair && hit2->rawId() == debug_Id2;
572 #endif
573  IfLogTrace(debugTriplet, "MultiHitGeneratorFromChi2")
574  << endl
575  << "triplet candidate in debug id" << std::endl
576  << "hit in id=" << hit2->rawId() << " (from KDTree) with pos: " << KDdata->hit()->globalPosition()
577  << " refitted: " << hit2->globalPosition() << " chi2: " << chi2;
578  // should fix nan
579  if ((chi2 > maxChi2) | edm::isNotFinite(chi2))
580  continue;
581 
582  if (chi2VsPtCut) {
583  FastCircle theCircle(gp[2], gp[1], gp[0]);
584  float tesla0 = 0.1f * nomField;
585  float rho = theCircle.rho();
586  float cm2GeV = 0.01f * 0.3f * tesla0;
587  float pt = cm2GeV * rho;
588  IfLogTrace(debugTriplet, "MultiHitGeneratorFromChi2") << "triplet pT=" << pt;
589  if (pt < region.ptMin())
590  continue;
591 
592  if (chi2_cuts.size() == 4) {
593  if ((pt > pt_interv[0] && pt <= pt_interv[1] && chi2 > chi2_cuts[0]) ||
594  (pt > pt_interv[1] && pt <= pt_interv[2] && chi2 > chi2_cuts[1]) ||
595  (pt > pt_interv[2] && pt <= pt_interv[3] && chi2 > chi2_cuts[2]) ||
596  (pt > pt_interv[3] && chi2 > chi2_cuts[3]))
597  continue;
598  }
599 
600  // apparently this takes too much time...
601  // if (chi2_cuts.size()>1) {
602  // int ncuts = chi2_cuts.size();
603  // if ( pt<=pt_interv[0] && chi2 > chi2_cuts[0] ) continue;
604  // bool pass = true;
605  // for (int icut=1; icut<ncuts-1; icut++){
606  // if ( pt>pt_interv[icut-1] && pt<=pt_interv[icut] && chi2 > chi2_cuts[icut] ) pass=false;
607  // }
608  // if (!pass) continue;
609  // if ( pt>pt_interv[ncuts-2] && chi2 > chi2_cuts[ncuts-1] ) continue;
610  // if (hit0->rawId()==debug_Id0 && hit1->rawId()==debug_Id1 && hit2->rawId()==debug_Id2) {
611  // LogTrace("MultiHitGeneratorFromChi2") << "triplet passed chi2 vs pt cut" << std::endl;
612  // }
613  // }
614  }
615 
616  if (theMaxElement != 0 && result.size() >= theMaxElement) {
617  result.clear();
618  edm::LogError("TooManyTriplets") << " number of triples exceed maximum. no triplets produced.";
619  return;
620  }
621  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << "triplet made";
622  //result.push_back(SeedingHitSet(hit0, hit1, hit2));
623  /* no refit so keep only hit2
624  assert(tripletFromThisLayer.empty());
625  assert(hit0.isOwn()); assert(hit1.isOwn());assert(hit2.isOwn());
626  tripletFromThisLayer.emplace_back(std::move(hit0));
627  tripletFromThisLayer.emplace_back(std::move(hit1));
628  tripletFromThisLayer.emplace_back(std::move(hit2));
629  assert(hit0.isEmpty()); assert(hit1.isEmpty());assert(hit2.isEmpty());
630  */
631  bestL2 = std::move(hit2);
632  chi2FromThisLayer = chi2;
633  foundTripletsFromPair++;
634  if (foundTripletsFromPair >= 2) {
635  usePair = true;
636  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << "using pair";
637  break;
638  }
639  } //loop over hits in KDTree
640 
641  if (usePair)
642  break;
643  else {
644  //if there is one triplet in more than one layer, try picking the one with best chi2
645  if (chi2FromThisLayer < minChi2) {
646  bestH2 = std::move(bestL2);
647  minChi2 = chi2FromThisLayer;
648  }
649  /*
650  else {
651  if (!bestH2 && foundTripletsFromPair>0)
652  LogTrace("MultiHitGeneratorFromChi2") << "what?? " << minChi2 << ' ' << chi2FromThisLayer;
653  }
654  */
655  }
656 
657  } //loop over layers
658 
659  if (foundTripletsFromPair == 0)
660  continue;
661 
662  //push back only (max) once per pair
663  IfLogTrace(debugPair, "MultiHitGeneratorFromChi2") << "Done seed #" << result.size();
664  if (usePair)
665  result.push_back(SeedingHitSet(oriHit0, oriHit1));
666  else {
667  assert(1 == foundTripletsFromPair);
668  assert(bestH2);
669  result.emplace_back(&*hit0, &*hit1, &*bestH2);
670  assert(hit0.isOwn());
671  assert(hit1.isOwn());
672  refittedHitStorage.emplace_back(const_cast<BaseTrackerRecHit*>(hit0.release()));
673  refittedHitStorage.emplace_back(const_cast<BaseTrackerRecHit*>(hit1.release()));
674  refittedHitStorage.emplace_back(std::move(bestH2));
675  assert(hit0.empty());
676  assert(hit1.empty());
677  assert(!bestH2);
678  }
679  // LogTrace("MultiHitGeneratorFromChi2") << (usePair ? "pair " : "triplet ") << minChi2 <<' ' << refittedHitStorage.size();
680 
681  } //loop over pairs
682  LogTrace("MultiHitGeneratorFromChi2") << "triplet size=" << result.size();
683  // std::cout << "MultiHitGeneratorFromChi2 " << "triplet size=" << result.size() << std::endl;
684 }
685 
687  HitOwnPtr& hit2,
688  TrajectoryStateOnSurface& state1,
689  TrajectoryStateOnSurface& state2,
690  const TrackingRegion& region,
691  float nomField,
692  bool isDebug) {
693  //these need to be sorted in R
694  const GlobalPoint& gp0 = region.origin();
695  GlobalPoint gp1 = hit1->globalPosition();
696  GlobalPoint gp2 = hit2->globalPosition();
697 
698  IfLogTrace(isDebug, "MultiHitGeneratorFromChi2")
699  << "positions before refitting: " << hit1->globalPosition() << " " << hit2->globalPosition();
700 
701  FastCircle theCircle(gp2, gp1, gp0);
702  GlobalPoint cc(theCircle.x0(), theCircle.y0(), 0);
703  float tesla0 = 0.1f * nomField;
704  float rho = theCircle.rho();
705  float cm2GeV = 0.01f * 0.3f * tesla0;
706  float pt = cm2GeV * rho;
707 
708  GlobalVector vec20 = gp2 - gp0;
709  //if (isDebug) { cout << "vec20.eta=" << vec20.eta() << endl; }
710 
711  GlobalVector p0(gp0.y() - cc.y(), -gp0.x() + cc.x(), 0.);
712  p0 = p0 * pt / p0.perp();
713  GlobalVector p1(gp1.y() - cc.y(), -gp1.x() + cc.x(), 0.);
714  p1 = p1 * pt / p1.perp();
715  GlobalVector p2(gp2.y() - cc.y(), -gp2.x() + cc.x(), 0.);
716  p2 = p2 * pt / p2.perp();
717 
718  //check sign according to scalar product
719  if ((p0.x() * (gp1.x() - gp0.x()) + p0.y() * (gp1.y() - gp0.y())) < 0) {
720  p0 *= -1.;
721  p1 *= -1.;
722  p2 *= -1.;
723  }
724 
725  //now set z component
726  auto zv = vec20.z() / vec20.perp();
727  p0 = GlobalVector(p0.x(), p0.y(), p0.perp() * zv);
728  p1 = GlobalVector(p1.x(), p1.y(), p1.perp() * zv);
729  p2 = GlobalVector(p2.x(), p2.y(), p2.perp() * zv);
730 
731  //get charge from vectorial product
732  TrackCharge q = 1;
733  if ((gp1 - cc).x() * p1.y() - (gp1 - cc).y() * p1.x() > 0)
734  q = -q;
735 
736  TrajectoryStateOnSurface(GlobalTrajectoryParameters(gp1, p1, q, &ufield), *hit1->surface()).swap(state1);
737  // hit1.reset((SeedingHitSet::RecHitPointer)(cloner(*hit1,state1)));
738 
739  TrajectoryStateOnSurface(GlobalTrajectoryParameters(gp2, p2, q, &ufield), *hit2->surface()).swap(state2);
740  // hit2.reset((SeedingHitSet::RecHitPointer)(cloner(*hit2,state2)));
741 }
742 
743 /*
744 void MultiHitGeneratorFromChi2::refit3Hits(HitOwnPtr & hit0,
745  HitOwnPtr & hit1,
746  HitOwnPtr & hit2,
747  TrajectoryStateOnSurface& state0,
748  TrajectoryStateOnSurface& state1,
749  TrajectoryStateOnSurface& state2,
750  float nomField, bool isDebug) {
751 
752  //these need to be sorted in R
753  GlobalPoint gp0 = hit0->globalPosition();
754  GlobalPoint gp1 = hit1->globalPosition();
755  GlobalPoint gp2 = hit2->globalPosition();
756 
757  IfLogTrace(isDebug, "MultiHitGeneratorFromChi2") << "positions before refitting: " << hit0->globalPosition() << " " << hit1->globalPosition() << " " << hit2->globalPosition();
758  }
759 
760  FastCircle theCircle(gp2,gp1,gp0);
761  GlobalPoint cc(theCircle.x0(),theCircle.y0(),0);
762  float tesla0 = 0.1*nomField;
763  float rho = theCircle.rho();
764  float cm2GeV = 0.01 * 0.3*tesla0;
765  float pt = cm2GeV * rho;
766 
767  GlobalVector vec20 = gp2-gp0;
768  //IfLogTrace(isDebug, "MultiHitGeneratorFromChi2") << "vec20.eta=" << vec20.eta();
769 
770  GlobalVector p0( gp0.y()-cc.y(), -gp0.x()+cc.x(), 0. );
771  p0 = p0*pt/p0.perp();
772  GlobalVector p1( gp1.y()-cc.y(), -gp1.x()+cc.x(), 0. );
773  p1 = p1*pt/p1.perp();
774  GlobalVector p2( gp2.y()-cc.y(), -gp2.x()+cc.x(), 0. );
775  p2 = p2*pt/p2.perp();
776 
777  //check sign according to scalar product
778  if ( (p0.x()*(gp1.x()-gp0.x())+p0.y()*(gp1.y()-gp0.y()) ) < 0 ) {
779  p0*=-1.;
780  p1*=-1.;
781  p2*=-1.;
782  }
783 
784  //now set z component
785  p0 = GlobalVector(p0.x(),p0.y(),p0.perp()/tan(vec20.theta()));
786  p1 = GlobalVector(p1.x(),p1.y(),p1.perp()/tan(vec20.theta()));
787  p2 = GlobalVector(p2.x(),p2.y(),p2.perp()/tan(vec20.theta()));
788 
789  //get charge from vectorial product
790  TrackCharge q = 1;
791  if ((gp1-cc).x()*p1.y() - (gp1-cc).y()*p1.x() > 0) q =-q;
792 
793  GlobalTrajectoryParameters kine0 = GlobalTrajectoryParameters(gp0, p0, q, &*bfield);
794  state0 = TrajectoryStateOnSurface(kine0,*hit0->surface());
795  hit0 = hit0->clone(state0);
796 
797  GlobalTrajectoryParameters kine1 = GlobalTrajectoryParameters(gp1, p1, q, &*bfield);
798  state1 = TrajectoryStateOnSurface(kine1,*hit1->surface());
799  hit1 = hit1->clone(state1);
800 
801  GlobalTrajectoryParameters kine2 = GlobalTrajectoryParameters(gp2, p2, q, &*bfield);
802  state2 = TrajectoryStateOnSurface(kine2,*hit2->surface());
803  hit2 = hit2->clone(state2);
804 
805  IfLogTrace(isDebug, "MultiHitGeneratorFromChi2") << "charge=" << q << std::endl
806  << "state0 pt=" << state0.globalMomentum().perp() << " eta=" << state0.globalMomentum().eta() << " phi=" << state0.globalMomentum().phi() << std::endl
807  << "state1 pt=" << state1.globalMomentum().perp() << " eta=" << state1.globalMomentum().eta() << " phi=" << state1.globalMomentum().phi() << std::endl
808  << "state2 pt=" << state2.globalMomentum().perp() << " eta=" << state2.globalMomentum().eta() << " phi=" << state2.globalMomentum().phi() << std::endl
809  << "positions after refitting: " << hit0->globalPosition() << " " << hit1->globalPosition() << " " << hit2->globalPosition();
810 }
811 */
Vector3DBase
Definition: Vector3DBase.h:8
KDTreeLinkerAlgo.h
HLT_2018_cff.extraHitRPhitolerance
extraHitRPhitolerance
Definition: HLT_2018_cff.py:8543
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
MultiHitGeneratorFromChi2::mfName_
std::string mfName_
Definition: MultiHitGeneratorFromChi2.h:119
Hit
Definition: SiPixelLorentzAngle.h:57
MultiHitGeneratorFromPairAndLayers::theMaxElement
const unsigned int theMaxElement
Definition: MultiHitGeneratorFromPairAndLayers.h:63
SiStripMatchedRecHit2D::monoId
unsigned int monoId() const
Definition: SiStripMatchedRecHit2D.h:29
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DDAxes::y
electrons_cff.bool
bool
Definition: electrons_cff.py:372
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
PixelSubdetector.h
OrderedMultiHits
Definition: OrderedMultiHits.h:8
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
funct::false
false
Definition: Factorize.h:34
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
TrackerGeometry.h
RecHitsSortedInPhi::all
Range all() const
Definition: RecHitsSortedInPhi.h:84
MultiHitGeneratorFromChi2::extraPhiKDBox
float extraPhiKDBox
Definition: MultiHitGeneratorFromChi2.h:104
FastHelix.h
ESHandle.h
SiStripMatchedRecHit2D::stereoCluster
SiStripCluster const & stereoCluster() const
Definition: SiStripMatchedRecHit2D.h:40
DetLayer
Definition: DetLayer.h:21
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
SeedingHitSet
Definition: SeedingHitSet.h:6
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
HitDoublets::outer
Definition: RecHitsSortedInPhi.h:126
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
MultiHitGeneratorFromPairAndLayers::cacheHitPointer
std::unique_ptr< BaseTrackerRecHit > cacheHitPointer
Definition: MultiHitGeneratorFromPairAndLayers.h:57
MultiHitGeneratorFromChi2.h
TransientRecHitRecord.h
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
SeedingHitSet::ConstRecHitPointer
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:10
MultiHitGeneratorFromChi2::chi2VsPtCut
bool chi2VsPtCut
Definition: MultiHitGeneratorFromChi2.h:110
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
FastCircle::y0
double y0() const
Definition: FastCircle.h:45
data-class-funcs.q
q
Definition: data-class-funcs.py:169
TrajectoryStateOnSurface::charge
TrackCharge charge() const
Definition: TrajectoryStateOnSurface.h:68
ThirdHitPredictionFromCircle.h
ProxyBase11::reset
void reset()
Definition: ProxyBase11.h:49
cms::cuda::assert
assert(be >=bs)
proxim
constexpr T proxim(T b, T a)
Definition: normalizedPhi.h:14
mayown_ptr
Definition: mayown_ptr.h:13
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
SiStripDetId.h
SiStripRecHit2D
Definition: SiStripRecHit2D.h:7
beam_dqm_sourceclient-live_cfg.maxChi2
maxChi2
Definition: beam_dqm_sourceclient-live_cfg.py:136
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
MultiHitGeneratorFromChi2::cloner
TkClonerImpl cloner
Definition: MultiHitGeneratorFromChi2.h:97
GeometricSearchDet::position
virtual const Surface::PositionType & position() const
Returns position of the surface.
Definition: GeometricSearchDet.h:31
PixelRecoUtilities::curvature
T curvature(T InversePt, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:42
MultiHitGeneratorFromChi2::builderName_
std::string builderName_
Definition: MultiHitGeneratorFromChi2.h:116
MultiHitGeneratorFromChi2::detIdsToDebug
std::vector< int > detIdsToDebug
Definition: MultiHitGeneratorFromChi2.h:121
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
ProjectedSiStripRecHit2D
Definition: ProjectedSiStripRecHit2D.h:8
RZLine::chi2
float chi2() const
Definition: RZLine.h:94
MultiHitGeneratorFromChi2::ufield
UniformMagneticField ufield
Definition: MultiHitGeneratorFromChi2.h:107
TkTransientTrackingRecHitBuilder
Definition: TkTransientTrackingRecHitBuilder.h:15
cc
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
DetId
Definition: DetId.h:17
ThirdHitPredictionFromCircle::curvature
Range curvature(double transverseIP) const
Definition: ThirdHitPredictionFromCircle.cc:102
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
HLT_2018_cff.doublets
doublets
Definition: HLT_2018_cff.py:8544
mayown_ptr::release
T const * release()
Definition: mayown_ptr.h:67
MultiHitGeneratorFromChi2::hitTriplets
void hitTriplets(const TrackingRegion &region, OrderedMultiHits &result, const edm::EventSetup &es, const HitDoublets &doublets, const RecHitsSortedInPhi **thirdHitMap, const std::vector< const DetLayer * > &thirdLayerDetLayer, const int nThirdLayers) override
Definition: MultiHitGeneratorFromChi2.cc:209
LayerHitMapCache
Definition: LayerHitMapCache.h:14
FastCircle::rho
double rho() const
Definition: FastCircle.h:47
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
MultiHitGeneratorFromChi2::nomField
float nomField
Definition: MultiHitGeneratorFromChi2.h:108
RecHitsSortedInPhi.h
CkfComponentsRecord
Definition: CkfComponentsRecord.h:22
ThirdHitRZPrediction
Definition: ThirdHitRZPrediction.h:14
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
HLT_2018_cff.extraRKDBox
extraRKDBox
Definition: HLT_2018_cff.py:66305
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
p2
double p2[4]
Definition: TauolaWrapper.h:90
MagneticField::nominalValue
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:49
normalizedPhi
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
KDTreeBox
Definition: KDTreeLinkerAlgo.h:14
declareDynArray
#define declareDynArray(T, n, x)
Definition: DynArray.h:91
ProjectedSiStripRecHit2D::originalHit
SiStripRecHit2D originalHit() const
Definition: ProjectedSiStripRecHit2D.h:56
ClusterShapeHitFilter::isCompatible
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=nullptr) const
Definition: ClusterShapeHitFilter.cc:283
KDTreeLinkerAlgo
Definition: KDTreeLinkerAlgo.h:102
HLT_2018_cff.extraPhiKDBox
extraPhiKDBox
Definition: HLT_2018_cff.py:66298
Geom::twoPi
constexpr double twoPi()
Definition: Pi.h:32
UniformMagneticField::set
void set(GlobalVector value)
Definition: UniformMagneticField.h:20
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
IfLogTrace
#define IfLogTrace(cond, cat)
Definition: MessageLogger.h:699
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
RecHitsSortedInPhi::Hit
BaseTrackerRecHit const * Hit
Definition: RecHitsSortedInPhi.h:19
Point3DBase< float, GlobalTag >
ParameterSetDescription.h
ThirdHitPredictionFromCircle::phi
float phi(float curvature, float radius) const
Definition: ThirdHitPredictionFromCircle.cc:61
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
MultiHitGeneratorFromChi2::useSimpleMF_
bool useSimpleMF_
Definition: MultiHitGeneratorFromChi2.h:118
DDAxes::rho
MultiHitGeneratorFromChi2::pt_interv
std::vector< double > pt_interv
Definition: MultiHitGeneratorFromChi2.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MultiHitGeneratorFromChi2::filterName_
std::string filterName_
Definition: MultiHitGeneratorFromChi2.h:115
HLT_2018_cff.chi2VsPtCut
chi2VsPtCut
Definition: HLT_2018_cff.py:66302
FastCircle::x0
double x0() const
Definition: FastCircle.h:43
mayown_ptr::isOwn
bool isOwn() const
Definition: mayown_ptr.h:28
HLT_2018_cff.refitHits
refitHits
Definition: HLT_2018_cff.py:66301
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
RecHitsSortedInPhi
Definition: RecHitsSortedInPhi.h:17
MultiHitGeneratorFromChi2::dphi
float dphi
Definition: MultiHitGeneratorFromChi2.h:105
TrackerDigiGeometryRecord.h
PixelRecoRange< float >
SiStripMatchedRecHit2D::stereoId
unsigned int stereoId() const
Definition: SiStripMatchedRecHit2D.h:28
HitDoublets
Definition: RecHitsSortedInPhi.h:124
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
mayown_ptr::empty
bool empty() const
Definition: mayown_ptr.h:85
HLT_2018_cff.extraHitRZtolerance
extraHitRZtolerance
Definition: HLT_2018_cff.py:44971
RZLine.h
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
normalizedPhi.h
RecHitsSortedInPhi::isBarrel
bool isBarrel
Definition: RecHitsSortedInPhi.h:98
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
ThirdHitCorrection.h
MultiHitGeneratorFromChi2::maxChi2
double maxChi2
Definition: MultiHitGeneratorFromChi2.h:111
p1
double p1[4]
Definition: TauolaWrapper.h:89
ProjectedSiStripRecHit2D.h
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:57
MultiHitGeneratorFromChi2::extraZKDBox
float extraZKDBox
Definition: MultiHitGeneratorFromChi2.h:102
KDTreeNodeInfo
Definition: KDTreeLinkerAlgo.h:34
FastCircle
Definition: FastCircle.h:33
MultiHitGeneratorFromChi2::extraHitRPhitolerance
float extraHitRPhitolerance
Definition: MultiHitGeneratorFromChi2.h:101
get
#define get
MultiHitGeneratorFromChi2::filter
const ClusterShapeHitFilter * filter
Definition: MultiHitGeneratorFromChi2.h:95
DynArray.h
MultiHitGeneratorFromPairAndLayers
Definition: MultiHitGeneratorFromPairAndLayers.h:24
PixelRecoPointRZ
Definition: PixelRecoPointRZ.h:6
looper.cfg
cfg
Definition: looper.py:297
TrackingRecHit
Definition: TrackingRecHit.h:21
BaseTrackerRecHit.h
SiStripDetId::TID
static constexpr auto TID
Definition: SiStripDetId.h:38
SimpleLineRZ
Definition: PixelRecoLineRZ.h:63
MultiHitGeneratorFromChi2::extraRKDBox
float extraRKDBox
Definition: MultiHitGeneratorFromChi2.h:103
hi
Definition: HiEvtPlaneList.h:38
RZLine
Definition: RZLine.h:12
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
MultiHitGeneratorFromChi2::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &desc)
Definition: MultiHitGeneratorFromChi2.cc:105
ESInputTag.h
mayown_ptr::reset
void reset()
Definition: mayown_ptr.h:72
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
MultiHitGeneratorFromChi2::hitSets
void hitSets(const TrackingRegion &region, OrderedMultiHits &trs, const edm::Event &ev, const edm::EventSetup &es, SeedingLayerSetsHits::SeedingLayerSet pairLayers, std::vector< SeedingLayerSetsHits::SeedingLayer > thirdLayers) override
Definition: MultiHitGeneratorFromChi2.cc:169
MultiHitGeneratorFromChi2::bfield
const MagneticField * bfield
Definition: MultiHitGeneratorFromChi2.h:106
HitPairGeneratorFromLayerPair.h
isFinite.h
Range
PixelRecoRange< float > Range
Definition: MultiHitGeneratorFromChi2.cc:46
SiStripMatchedRecHit2D
Definition: SiStripMatchedRecHit2D.h:8
SiStripMatchedRecHit2D::monoCluster
SiStripCluster const & monoCluster() const
Definition: SiStripMatchedRecHit2D.h:41
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
HitDoublets::inner
Definition: RecHitsSortedInPhi.h:126
MultiHitGeneratorFromChi2::~MultiHitGeneratorFromChi2
~MultiHitGeneratorFromChi2() override
Definition: MultiHitGeneratorFromChi2.cc:103
SeedingLayerSetsHits::SeedingLayerSet
Definition: SeedingLayerSetsHits.h:65
MultiHitGeneratorFromChi2::MultiHitGeneratorFromChi2
MultiHitGeneratorFromChi2(const edm::ParameterSet &cfg)
Definition: MultiHitGeneratorFromChi2.cc:54
MultiHitGeneratorFromPairAndLayers::cacheHits
std::vector< cacheHitPointer > cacheHits
Definition: MultiHitGeneratorFromPairAndLayers.h:58
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
SiStripDetId::TIB
static constexpr auto TIB
Definition: SiStripDetId.h:37
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
fnSigmaRZ
constexpr float fnSigmaRZ
Definition: PixelTripletLargeTipGenerator.cc:45
MultiHitGeneratorFromChi2::builder
TkTransientTrackingRecHitBuilder const * builder
Definition: MultiHitGeneratorFromChi2.h:96
minChi2
Definition: JetCombinatorics.h:265
TrackingRegion
Definition: TrackingRegion.h:38
MultiHitGeneratorFromChi2::chi2_cuts
std::vector< double > chi2_cuts
Definition: MultiHitGeneratorFromChi2.h:113
MultiHitGeneratorFromPairAndLayers::cache
cacheHits cache
Definition: MultiHitGeneratorFromPairAndLayers.h:59
MultiHitGeneratorFromChi2::refitHits
bool refitHits
Definition: MultiHitGeneratorFromChi2.h:114
mps_fire.result
result
Definition: mps_fire.py:303
HLT_2018_cff.useFixedPreFiltering
useFixedPreFiltering
Definition: HLT_2018_cff.py:44970
ThirdHitRZPrediction.h
RecHitsSortedInPhi::HitIter
std::vector< HitWithPhi >::const_iterator HitIter
Definition: RecHitsSortedInPhi.h:38
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
MultiHitGeneratorFromChi2::refit2Hits
void refit2Hits(HitOwnPtr &hit0, HitOwnPtr &hit1, TrajectoryStateOnSurface &tsos0, TrajectoryStateOnSurface &tsos1, const TrackingRegion &region, float nomField, bool isDebug)
Definition: MultiHitGeneratorFromChi2.cc:686
ThirdHitPredictionFromCircle
Definition: ThirdHitPredictionFromCircle.h:10
SiStripMatchedRecHit2D.h
MultiHitGeneratorFromPairAndLayers::theLayerCache
LayerCacheType * theLayerCache
Definition: MultiHitGeneratorFromPairAndLayers.h:62
edm::Event
Definition: Event.h:73
mps_splice.line
line
Definition: mps_splice.py:76
SiStripRecHit2D.h
MultiHitGeneratorFromChi2::useFixedPreFiltering
bool useFixedPreFiltering
Definition: MultiHitGeneratorFromChi2.h:99
MultiHitGeneratorFromPairAndLayers::thePairGenerator
std::unique_ptr< HitPairGeneratorFromLayerPair > thePairGenerator
Definition: MultiHitGeneratorFromPairAndLayers.h:61
MultiHitGeneratorFromChi2::extraHitRZtolerance
float extraHitRZtolerance
Definition: MultiHitGeneratorFromChi2.h:100
StripSubdetector.h
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
MultiHitGeneratorFromPairAndLayers::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &desc)
Definition: MultiHitGeneratorFromPairAndLayers.cc:11
hit
Definition: SiStripHitEffFromCalibTree.cc:88
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
MultiHitGeneratorFromChi2::fnSigmaRZ
double fnSigmaRZ
Definition: MultiHitGeneratorFromChi2.h:109
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MultiHitGeneratorFromChi2::initES
void initES(const edm::EventSetup &es) override
Definition: MultiHitGeneratorFromChi2.cc:135
RecHitsSortedInPhi::v
std::vector< float > v
Definition: RecHitsSortedInPhi.h:107
HLT_2018_cff.extraZKDBox
extraZKDBox
Definition: HLT_2018_cff.py:66307