CMS 3D CMS Logo

GE0SegAlgoRU.cc
Go to the documentation of this file.
1 
9 #include "GE0SegAlgoRU.h"
10 #include "MuonSegFit.h"
16 
17 #include <algorithm>
18 #include <cmath>
19 #include <iostream>
20 #include <string>
21 
22 #include <Math/Functions.h>
23 #include <Math/SVector.h>
24 #include <Math/SMatrix.h>
25 
26 GE0SegAlgoRU::GE0SegAlgoRU(const edm::ParameterSet& ps) : GEMSegmentAlgorithmBase(ps), myName("GE0SegAlgoRU") {
27  allowWideSegments = ps.getParameter<bool>("allowWideSegments");
28  doCollisions = ps.getParameter<bool>("doCollisions");
29 
30  stdParameters.maxChi2Additional = ps.getParameter<double>("maxChi2Additional");
31  stdParameters.maxChi2Prune = ps.getParameter<double>("maxChi2Prune");
32  stdParameters.maxChi2GoodSeg = ps.getParameter<double>("maxChi2GoodSeg");
33  stdParameters.maxPhiSeeds = ps.getParameter<double>("maxPhiSeeds");
34  stdParameters.maxPhiAdditional = ps.getParameter<double>("maxPhiAdditional");
35  stdParameters.maxETASeeds = ps.getParameter<double>("maxETASeeds");
36  stdParameters.requireCentralBX = ps.getParameter<bool>("requireCentralBX");
37  stdParameters.minNumberOfHits = ps.getParameter<unsigned int>("minNumberOfHits");
38  stdParameters.maxNumberOfHits = ps.getParameter<unsigned int>("maxNumberOfHits");
39  stdParameters.maxNumberOfHitsPerLayer = ps.getParameter<unsigned int>("maxNumberOfHitsPerLayer");
41 
48 
57 
58  LogDebug("GE0SegAlgoRU") << myName << " has algorithm cuts set to: \n"
59  << "--------------------------------------------------------------------\n"
60  << "allowWideSegments = " << allowWideSegments << "\n"
61  << "doCollisions = " << doCollisions << "\n"
62  << "maxChi2Additional = " << stdParameters.maxChi2Additional << "\n"
63  << "maxChi2Prune = " << stdParameters.maxChi2Prune << "\n"
64  << "maxChi2GoodSeg = " << stdParameters.maxChi2GoodSeg << "\n"
65  << "maxPhiSeeds = " << stdParameters.maxPhiSeeds << "\n"
66  << "maxPhiAdditional = " << stdParameters.maxPhiAdditional << "\n"
67  << "maxETASeeds = " << stdParameters.maxETASeeds << "\n"
68  << std::endl;
69 
70  theChamber = nullptr;
71 }
72 
73 std::vector<GEMSegment> GE0SegAlgoRU::run(const GEMEnsemble& ensemble, const std::vector<const GEMRecHit*>& rechits) {
74  HitAndPositionContainer hitAndPositions;
75  auto& superchamber = ensemble.first;
76  for (const auto& rechit : rechits) {
77  const GEMEtaPartition* part = ensemble.second.at(rechit->gemId().rawId());
78  GlobalPoint glb = part->toGlobal(rechit->localPosition());
79  LocalPoint nLoc = superchamber->toLocal(glb);
80  hitAndPositions.emplace_back(&(*rechit), nLoc, glb, hitAndPositions.size());
81  }
82 
83  LogDebug("GE0Segment|GE0") << "found " << hitAndPositions.size() << " rechits in superchamber " << superchamber->id();
84  //sort by layer
85  float z1 = superchamber->chamber(1)->position().z();
86  float zlast = superchamber->chamber(superchamber->nChambers())->position().z();
87  if (z1 < zlast)
88  std::sort(hitAndPositions.begin(), hitAndPositions.end(), [](const HitAndPosition& h1, const HitAndPosition& h2) {
89  return h1.layer < h2.layer;
90  });
91  else
92  std::sort(hitAndPositions.begin(), hitAndPositions.end(), [](const HitAndPosition& h1, const HitAndPosition& h2) {
93  return h1.layer > h2.layer;
94  });
95  return run(ensemble.first, hitAndPositions);
96 }
97 
98 std::vector<GEMSegment> GE0SegAlgoRU::run(const GEMSuperChamber* chamber, const HitAndPositionContainer& rechits) {
99 #ifdef EDM_ML_DEBUG // have lines below only compiled when in debug mode
100  GEMDetId chId(chamber->id());
101  edm::LogVerbatim("GE0SegAlgoRU") << "[GEMSegmentAlgorithm::run] build segments in chamber " << chId
102  << " which contains " << rechits.size() << " rechits";
103  for (const auto& h : rechits) {
104  auto ge0id = h.rh->gemId();
105  auto rhLP = h.lp;
106  edm::LogVerbatim("GE0SegAlgoRU") << "[RecHit :: Loc x = " << std::showpos << std::setw(9) << rhLP.x()
107  << " Glb y = " << std::showpos << std::setw(9) << rhLP.y()
108  << " Time = " << std::showpos << h.rh->BunchX() << " -- " << ge0id.rawId() << " = "
109  << ge0id << " ]" << std::endl;
110  }
111 #endif
112 
114  return std::vector<GEMSegment>();
115  }
116 
118 
119  std::vector<unsigned int> recHits_per_layer(theChamber->nChambers(), 0);
120  for (const auto& rechit : rechits) {
121  recHits_per_layer[rechit.layer - 1]++;
122  }
123 
124  BoolContainer used(rechits.size(), false);
125 
126  // We have at least 2 hits. We intend to try all possible pairs of hits to start
127  // segment building. 'All possible' means each hit lies on different layers in the chamber.
128  // after all same size segs are build we get rid of the overcrossed segments using the chi2 criteria
129  // the hits from the segs that are left are marked as used and are not added to segs in future iterations
130  // the hits from 3p segs are marked as used separately in order to try to assamble them in longer segments
131  // in case there is a second pass
132 
133  // Choose first hit (as close to IP as possible) h1 and second hit
134  // (as far from IP as possible) h2 To do this we iterate over hits
135  // in the chamber by layer - pick two layers. Then we
136  // iterate over hits within each of these layers and pick h1 and h2
137  // these. If they are 'close enough' we build an empty
138  // segment. Then try adding hits to this segment.
139 
140  std::vector<GEMSegment> segments;
141 
142  auto doStd = [&]() {
143  for (unsigned int n_seg_min = 6u; n_seg_min >= stdParameters.minNumberOfHits; --n_seg_min)
144  lookForSegments(stdParameters, n_seg_min, rechits, recHits_per_layer, used, segments);
145  };
146  auto doDisplaced = [&]() {
147  for (unsigned int n_seg_min = 6u; n_seg_min >= displacedParameters.minNumberOfHits; --n_seg_min)
148  lookForSegments(displacedParameters, n_seg_min, rechits, recHits_per_layer, used, segments);
149  };
150  // Not currently used
151  // auto doWide = [&] () {
152  // for(unsigned int n_seg_min = 6u; n_seg_min >= wideParameters.minNumberOfHits; --n_seg_min)
153  // lookForSegments(wideParameters,n_seg_min,rechits,recHits_per_layer, used,segments);
154  // };
155  auto printSegments = [&] {
156 #ifdef EDM_ML_DEBUG // have lines below only compiled when in debug mode
157  for (const auto& seg : segments) {
158  GEMDetId chId(seg.gemDetId());
159  const auto& rechits = seg.specificRecHits();
160  edm::LogVerbatim("GE0SegAlgoRU") << "[GE0SegAlgoRU] segment in chamber " << chId << " which contains "
161  << rechits.size() << " rechits and with specs: \n"
162  << seg;
163  for (const auto& rh : rechits) {
164  auto ge0id = rh.gemId();
165  edm::LogVerbatim("GE0SegAlgoRU") << "[RecHit :: Loc x = " << std::showpos << std::setw(9)
166  << rh.localPosition().x() << " Loc y = " << std::showpos << std::setw(9)
167  << rh.localPosition().y() << " Time = " << std::showpos << rh.BunchX()
168  << " -- " << ge0id.rawId() << " = " << ge0id << " ]";
169  }
170  }
171 #endif
172  };
173 
174  //If we arent doing collisions, do a single iteration
175  if (!doCollisions) {
176  doDisplaced();
177  printSegments();
178  return segments;
179  }
180 
181  //Iteration 1: STD processing
182  doStd();
183 
184  if (false) {
185  //How the CSC algorithm ~does iterations. for now not considering
186  //displaced muons will not worry about it later
187  //Iteration 2a: If we don't allow wide segments simply do displaced
188  // Or if we already found a segment simply skip to displaced
189  if (!allowWideSegments || !segments.empty()) {
190  doDisplaced();
191  return segments;
192  }
193  //doWide();
194  doDisplaced();
195  }
196  printSegments();
197  return segments;
198 }
199 
201  const unsigned int n_seg_min,
203  const std::vector<unsigned int>& recHits_per_layer,
204  BoolContainer& used,
205  std::vector<GEMSegment>& segments) const {
206  auto ib = rechits.begin();
207  auto ie = rechits.end();
208  std::vector<std::pair<float, HitAndPositionPtrContainer> > proto_segments;
209  // the first hit is taken from the back
210  for (auto i1 = ib; i1 != ie; ++i1) {
211  const auto& h1 = *i1;
212 
213  //skip if rh is used and the layer tat has big rh multiplicity(>25RHs)
214  if (used[h1.idx])
215  continue;
216  if (recHits_per_layer[h1.layer - 1] > params.maxNumberOfHitsPerLayer)
217  continue;
218 
219  // the second hit from the front
220  for (auto i2 = ie - 1; i2 != i1; --i2) {
221  const auto& h2 = *i2;
222 
223  //skip if rh is used and the layer tat has big rh multiplicity(>25RHs)
224  if (used[h2.idx])
225  continue;
226  if (recHits_per_layer[h2.layer - 1] > params.maxNumberOfHitsPerLayer)
227  continue;
228 
229  //Stop if the distance between layers is not large enough
230  if ((std::abs(int(h2.layer) - int(h1.layer)) + 1) < int(n_seg_min))
231  break;
232 
233  if (!areHitsCloseInEta(params.maxETASeeds, params.requireBeamConstr, h1.gp, h2.gp))
234  continue;
235  if (!areHitsCloseInGlobalPhi(params.maxPhiSeeds, std::abs(int(h2.layer) - int(h1.layer)), h1.gp, h2.gp))
236  continue;
237 
238  HitAndPositionPtrContainer current_proto_segment;
239  std::unique_ptr<MuonSegFit> current_fit;
240  current_fit = addHit(current_proto_segment, h1);
241  current_fit = addHit(current_proto_segment, h2);
242 
243  tryAddingHitsToSegment(params.maxETASeeds,
244  params.maxPhiAdditional,
245  params.maxChi2Additional,
246  current_fit,
247  current_proto_segment,
248  used,
249  i1,
250  i2);
251 
252  if (current_proto_segment.size() > n_seg_min)
253  pruneBadHits(params.maxChi2Prune, current_proto_segment, current_fit, n_seg_min);
254 
255  LogDebug("GE0SegAlgoRU") << "[GE0SegAlgoRU::lookForSegments] # of hits in segment "
256  << current_proto_segment.size() << " min # " << n_seg_min << " => "
257  << (current_proto_segment.size() >= n_seg_min) << " chi2/ndof "
258  << current_fit->chi2() / current_fit->ndof() << " => "
259  << (current_fit->chi2() / current_fit->ndof() < params.maxChi2GoodSeg) << std::endl;
260 
261  if (current_proto_segment.size() < n_seg_min)
262  continue;
263  const float current_metric = current_fit->chi2() / current_fit->ndof();
264  if (current_metric > params.maxChi2GoodSeg)
265  continue;
266 
267  if (params.requireCentralBX) {
268  int nCentral = 0;
269  int nNonCentral = 0;
270  for (const auto* rh : current_proto_segment) {
271  if (std::abs(rh->rh->BunchX()) < 2)
272  nCentral++;
273  else
274  nNonCentral++;
275  }
276  if (nNonCentral >= nCentral)
277  continue;
278  }
279 
280  proto_segments.emplace_back(current_metric, current_proto_segment);
281  }
282  }
283  addUniqueSegments(proto_segments, segments, used);
284 }
285 
287  std::vector<GEMSegment>& segments,
288  BoolContainer& used) const {
289  std::sort(proto_segments.begin(),
290  proto_segments.end(),
291  [](const std::pair<float, HitAndPositionPtrContainer>& a,
292  const std::pair<float, HitAndPositionPtrContainer>& b) { return a.first < b.first; });
293 
294  //Now add to the collect based on minChi2 marking the hits as used after
295  std::vector<unsigned int> usedHits;
296  for (auto& container : proto_segments) {
297  HitAndPositionPtrContainer currentProtoSegment = container.second;
298 
299  //check to see if we already used thes hits this round
300  bool alreadyFilled = false;
301  for (const auto& h : currentProtoSegment) {
302  for (unsigned int iOH = 0; iOH < usedHits.size(); ++iOH) {
303  if (usedHits[iOH] != h->idx)
304  continue;
305  alreadyFilled = true;
306  break;
307  }
308  }
309  if (alreadyFilled)
310  continue;
311  for (const auto* h : currentProtoSegment) {
312  usedHits.push_back(h->idx);
313  used[h->idx] = true;
314  }
315 
316  std::unique_ptr<MuonSegFit> current_fit = makeFit(currentProtoSegment);
317 
318  // Create an actual GEMSegment - retrieve all info from the fit
319  // calculate the timing fron rec hits associated to the TrackingRecHits used
320  // to fit the segment
321  float averageBX = 0.;
322  for (const auto* h : currentProtoSegment) {
323  averageBX += h->rh->BunchX();
324  }
325  averageBX /= int(currentProtoSegment.size());
326 
327  std::sort(currentProtoSegment.begin(),
328  currentProtoSegment.end(),
329  [](const HitAndPosition* a, const HitAndPosition* b) { return a->layer < b->layer; });
330 
331  std::vector<const GEMRecHit*> bareRHs;
332  bareRHs.reserve(currentProtoSegment.size());
333  for (const auto* rh : currentProtoSegment)
334  bareRHs.push_back(rh->rh);
335  const float dPhi = theChamber->computeDeltaPhi(current_fit->intercept(), current_fit->localdir());
336  GEMSegment temp(bareRHs,
337  current_fit->intercept(),
338  current_fit->localdir(),
339  current_fit->covarianceMatrix(),
340  current_fit->chi2(),
341  averageBX,
342  dPhi);
343  segments.push_back(temp);
344  }
345 }
346 
348  const float maxPhi,
349  const float maxChi2,
350  std::unique_ptr<MuonSegFit>& current_fit,
351  HitAndPositionPtrContainer& proto_segment,
352  const BoolContainer& used,
353  HitAndPositionContainer::const_iterator i1,
354  HitAndPositionContainer::const_iterator i2) const {
355  // Iterate over the layers with hits in the chamber
356  // Skip the layers containing the segment endpoints
357  // Test each hit on the other layers to see if it is near the segment
358  // If it is, see whether there is already a hit on the segment from the same layer
359  // - if so, and there are more than 2 hits on the segment, copy the segment,
360  // replace the old hit with the new hit. If the new segment chi2 is better
361  // then replace the original segment with the new one (by swap)
362  // - if not, copy the segment, add the hit. If the new chi2/dof is still satisfactory
363  // then replace the original segment with the new one (by swap)
364 
365  //Hits are ordered by layer, "i1" is the inner hit and i2 is the outer hit
366  //so possible hits to add must be between these two iterators
367  for (auto iH = i1 + 1; iH != i2; ++iH) {
368  if (iH->layer == i1->layer)
369  continue;
370  if (iH->layer == i2->layer)
371  break;
372  if (used[iH->idx])
373  continue;
374  if (!isHitNearSegment(maxETA, maxPhi, current_fit, proto_segment, *iH))
375  continue;
376  if (hasHitOnLayer(proto_segment, iH->layer))
377  compareProtoSegment(current_fit, proto_segment, *iH);
378  else
379  increaseProtoSegment(maxChi2, current_fit, proto_segment, *iH);
380  }
381 }
382 
384  const bool beamConst,
385  const GlobalPoint& h1,
386  const GlobalPoint& h2) const {
387  float diff = std::abs(h1.eta() - h2.eta());
388  LogDebug("GE0SegAlgoRU") << "[GE0SegAlgoRU::areHitsCloseInEta] gp1 = " << h1 << " in eta part = " << h1.eta()
389  << " and gp2 = " << h2 << " in eta part = " << h2.eta() << " ==> dEta = " << diff
390  << " ==> return " << (diff < 0.1) << std::endl;
391  //temp for floating point comparision...maxEta is the difference between partitions, so x1.5 to take into account non-circle geom.
392  return (diff < std::max(maxETA, 0.01f));
393 }
394 
396  const unsigned int nLayDisp,
397  const GlobalPoint& h1,
398  const GlobalPoint& h2) const {
399  float dphi12 = deltaPhi(h1.barePhi(), h2.barePhi());
400  LogDebug("GE0SegAlgoRU") << "[GE0SegAlgoRU::areHitsCloseInGlobalPhi] gp1 = " << h1 << " and gp2 = " << h2
401  << " ==> dPhi = " << dphi12 << " ==> return " << (std::abs(dphi12) < std::max(maxPHI, 0.02f))
402  << std::endl;
403  return std::abs(dphi12) < std::max(maxPHI, float(float(nLayDisp) * 0.004));
404 }
405 
407  const float maxPHI,
408  const std::unique_ptr<MuonSegFit>& fit,
409  const HitAndPositionPtrContainer& proto_segment,
410  const HitAndPosition& h) const {
411  //Get average eta, based on the two seeds...asssumes that we have not started pruning yet!
412  const float avgETA = (proto_segment[1]->gp.eta() + proto_segment[0]->gp.eta()) / 2.;
413  if (std::abs(h.gp.eta() - avgETA) > std::max(maxETA, 0.01f))
414  return false;
415 
416  //Now check the dPhi based on the segment fit
417  GlobalPoint globIntercept = globalAtZ(fit, h.lp.z());
418  float dPhi = deltaPhi(h.gp.barePhi(), globIntercept.phi());
419  //check to see if it is inbetween the two rolls of the outer and inner hits
420  return (std::abs(dPhi) < std::max(maxPHI, 0.001f));
421 }
422 
423 GlobalPoint GE0SegAlgoRU::globalAtZ(const std::unique_ptr<MuonSegFit>& fit, float z) const {
424  float x = fit->xfit(z);
425  float y = fit->yfit(z);
426  return theChamber->toGlobal(LocalPoint(x, y, z));
427 }
428 
429 std::unique_ptr<MuonSegFit> GE0SegAlgoRU::addHit(HitAndPositionPtrContainer& proto_segment,
430  const HitAndPosition& aHit) const {
431  proto_segment.push_back(&aHit);
432  // make a fit
433  return makeFit(proto_segment);
434 }
435 
436 std::unique_ptr<MuonSegFit> GE0SegAlgoRU::makeFit(const HitAndPositionPtrContainer& proto_segment) const {
437  // for GE0 we take the gemrechit from the proto_segment we transform into Tracking Rechits
438  // the local rest frame is the GEMSuperChamber
440  for (const auto& rh : proto_segment) {
441  GEMRecHit* newRH = rh->rh->clone();
442  newRH->setPosition(rh->lp);
443  MuonSegFit::MuonRecHitPtr trkRecHit(newRH);
444  muonRecHits.push_back(trkRecHit);
445  }
446  auto currentFit = std::make_unique<MuonSegFit>(muonRecHits);
447  currentFit->fit();
448  return currentFit;
449 }
450 
452  HitAndPositionPtrContainer& proto_segment,
453  std::unique_ptr<MuonSegFit>& fit,
454  const unsigned int n_seg_min) const {
455  while (proto_segment.size() > n_seg_min && fit->chi2() / fit->ndof() > maxChi2) {
456  float maxDev = -1;
457  HitAndPositionPtrContainer::iterator worstHit;
458  for (auto it = proto_segment.begin(); it != proto_segment.end(); ++it) {
459  const float dev = getHitSegChi2(fit, *(*it)->rh);
460  if (dev < maxDev)
461  continue;
462  maxDev = dev;
463  worstHit = it;
464  }
465  LogDebug("GE0SegAlgoRU") << "[GE0SegAlgoRU::pruneBadHits] pruning one hit-> layer: " << (*worstHit)->layer
466  << " eta: " << (*worstHit)->gp.eta() << " phi: " << (*worstHit)->gp.phi()
467  << " old chi2/dof: " << fit->chi2() / fit->ndof() << std::endl;
468  proto_segment.erase(worstHit);
469  fit = makeFit(proto_segment);
470  }
471 }
472 
473 float GE0SegAlgoRU::getHitSegChi2(const std::unique_ptr<MuonSegFit>& fit, const GEMRecHit& hit) const {
474  const auto lp = hit.localPosition();
475  const auto le = hit.localPositionError();
476  const float du = fit->xdev(lp.x(), lp.z());
477  const float dv = fit->ydev(lp.y(), lp.z());
478 
479  ROOT::Math::SMatrix<double, 2, 2, ROOT::Math::MatRepSym<double, 2> > IC;
480  IC(0, 0) = le.xx();
481  IC(1, 0) = le.xy();
482  IC(1, 1) = le.yy();
483 
484  // Invert covariance matrix
485  IC.Invert();
486  return du * du * IC(0, 0) + 2. * du * dv * IC(0, 1) + dv * dv * IC(1, 1);
487 }
488 
489 bool GE0SegAlgoRU::hasHitOnLayer(const HitAndPositionPtrContainer& proto_segment, const unsigned int layer) const {
490  for (const auto* h : proto_segment)
491  if (h->layer == layer)
492  return true;
493  return false;
494 }
495 
496 void GE0SegAlgoRU::compareProtoSegment(std::unique_ptr<MuonSegFit>& current_fit,
497  HitAndPositionPtrContainer& current_proto_segment,
498  const HitAndPosition& new_hit) const {
499  const HitAndPosition* old_hit = nullptr;
500  HitAndPositionPtrContainer new_proto_segment = current_proto_segment;
501 
502  for (auto it = new_proto_segment.begin(); it != new_proto_segment.end();) {
503  if ((*it)->layer == new_hit.layer) {
504  old_hit = *it;
505  it = new_proto_segment.erase(it);
506  } else {
507  ++it;
508  }
509  }
510  if (old_hit == nullptr)
511  return;
512  auto new_fit = addHit(new_proto_segment, new_hit);
513 
514  //If on the same strip but different BX choose the closest
515  bool useNew = false;
516  if (old_hit->lp == new_hit.lp) {
517  float avgbx = 0;
518  for (const auto* h : current_proto_segment)
519  if (old_hit != h)
520  avgbx += h->rh->BunchX();
521  avgbx /= float(current_proto_segment.size() - 1);
522  if (std::abs(avgbx - new_hit.rh->BunchX()) < std::abs(avgbx - old_hit->rh->BunchX()))
523  useNew = true;
524  } //otherwise base it on chi2
525  else if (new_fit->chi2() < current_fit->chi2())
526  useNew = true;
527 
528  if (useNew) {
529  current_proto_segment = new_proto_segment;
530  current_fit = std::move(new_fit);
531  }
532 }
533 
535  std::unique_ptr<MuonSegFit>& current_fit,
536  HitAndPositionPtrContainer& current_proto_segment,
537  const HitAndPosition& new_hit) const {
538  HitAndPositionPtrContainer new_proto_segment = current_proto_segment;
539  auto new_fit = addHit(new_proto_segment, new_hit);
540  if (new_fit->chi2() / new_fit->ndof() < maxChi2) {
541  current_proto_segment = new_proto_segment;
542  current_fit = std::move(new_fit);
543  }
544 }
std::shared_ptr< TrackingRecHit > MuonRecHitPtr
Definition: MuonSegFit.h:38
Log< level::Info, true > LogVerbatim
std::vector< bool > BoolContainer
Definition: GE0SegAlgoRU.h:62
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
GE0SegAlgoRU(const edm::ParameterSet &ps)
Constructor.
Definition: GE0SegAlgoRU.cc:26
SegmentParameters wideParameters
Definition: GE0SegAlgoRU.h:147
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
bool isHitNearSegment(const float maxETA, const float maxPHI, const std::unique_ptr< MuonSegFit > &fit, const HitAndPositionPtrContainer &proto_segment, const HitAndPosition &h) const
T eta() const
Definition: PV3DBase.h:73
double glb
Definition: hdecay.h:105
std::vector< const HitAndPosition * > HitAndPositionPtrContainer
Definition: GE0SegAlgoRU.h:59
bool areHitsCloseInEta(const float maxETA, const bool beamConst, const GlobalPoint &h1, const GlobalPoint &h2) const
bool allowWideSegments
Definition: GE0SegAlgoRU.h:143
const std::string myName
Definition: GE0SegAlgoRU.h:141
void pruneBadHits(const float maxChi2, HitAndPositionPtrContainer &proto_segment, std::unique_ptr< MuonSegFit > &fit, const unsigned int n_seg_min) const
std::pair< const GEMSuperChamber *, std::map< uint32_t, const GEMEtaPartition * > > GEMEnsemble
const GEMSuperChamber * theChamber
Definition: GE0SegAlgoRU.h:150
float float float z
T barePhi() const
Definition: PV3DBase.h:65
int nChambers() const
Return numbers of chambers.
float getHitSegChi2(const std::unique_ptr< MuonSegFit > &fit, const GEMRecHit &hit) const
void compareProtoSegment(std::unique_ptr< MuonSegFit > &current_fit, HitAndPositionPtrContainer &current_proto_segment, const HitAndPosition &new_hit) const
void tryAddingHitsToSegment(const float maxETA, const float maxPhi, const float maxChi2, std::unique_ptr< MuonSegFit > &current_fit, HitAndPositionPtrContainer &proto_segment, const BoolContainer &used, HitAndPositionContainer::const_iterator i1, HitAndPositionContainer::const_iterator i2) const
GEMRecHit * clone() const override
Definition: GEMRecHit.cc:58
std::vector< MuonRecHitPtr > MuonRecHitContainer
Definition: MuonSegFit.h:39
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
void addUniqueSegments(SegmentByMetricContainer &proto_segments, std::vector< GEMSegment > &segments, BoolContainer &used) const
std::vector< GEMSegment > run(const GEMSuperChamber *chamber, const HitAndPositionContainer &rechits)
Definition: GE0SegAlgoRU.cc:98
bool hasHitOnLayer(const HitAndPositionPtrContainer &proto_segment, const unsigned int layer) const
int BunchX() const
Definition: GEMRecHit.h:67
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
std::unique_ptr< MuonSegFit > makeFit(const HitAndPositionPtrContainer &proto_segment) const
bool areHitsCloseInGlobalPhi(const float maxPHI, const unsigned int nLayDisp, const GlobalPoint &h1, const GlobalPoint &h2) const
void lookForSegments(const SegmentParameters &params, const unsigned int n_seg_min, const HitAndPositionContainer &rechits, const std::vector< unsigned int > &recHits_per_layer, BoolContainer &used, std::vector< GEMSegment > &segments) const
SegmentParameters displacedParameters
Definition: GE0SegAlgoRU.h:146
part
Definition: HCALResponse.h:20
double b
Definition: hdecay.h:120
std::vector< std::pair< float, HitAndPositionPtrContainer > > SegmentByMetricContainer
Definition: GE0SegAlgoRU.h:63
float computeDeltaPhi(const LocalPoint &position, const LocalVector &direction) const
double a
Definition: hdecay.h:121
std::vector< HitAndPosition > HitAndPositionContainer
Definition: GE0SegAlgoRU.h:58
static int position[264][3]
Definition: ReadPGInfo.cc:289
std::unique_ptr< MuonSegFit > addHit(HitAndPositionPtrContainer &proto_segment, const HitAndPosition &aHit) const
SegmentParameters stdParameters
Definition: GE0SegAlgoRU.h:145
void setPosition(LocalPoint pos)
Set local position.
Definition: GEMRecHit.h:53
GlobalPoint globalAtZ(const std::unique_ptr< MuonSegFit > &fit, float z) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def move(src, dest)
Definition: eostools.py:511
void increaseProtoSegment(const float maxChi2, std::unique_ptr< MuonSegFit > &current_fit, HitAndPositionPtrContainer &current_proto_segment, const HitAndPosition &new_hit) const
ib
Definition: cuy.py:661
#define LogDebug(id)