CMS 3D CMS Logo

HoughGrouping.cc
Go to the documentation of this file.
2 
6 
8 
9 #include <cmath>
10 #include <memory>
11 
12 #include "TMath.h"
13 
14 using namespace std;
15 using namespace edm;
16 using namespace cmsdt;
17 using namespace cms_units::operators;
18 
19 namespace {
20  struct {
21  bool operator()(ProtoCand a, ProtoCand b) const {
22  unsigned short int sumhqa = 0;
23  unsigned short int sumhqb = 0;
24  unsigned short int sumlqa = 0;
25  unsigned short int sumlqb = 0;
26  double sumdista = 0;
27  double sumdistb = 0;
28 
29  for (unsigned short int lay = 0; lay < 8; lay++) {
30  sumhqa += (unsigned short int)a.isThereHitInLayer_[lay];
31  sumhqb += (unsigned short int)b.isThereHitInLayer_[lay];
32  sumlqa += (unsigned short int)a.isThereNeighBourHitInLayer_[lay];
33  sumlqb += (unsigned short int)b.isThereNeighBourHitInLayer_[lay];
34  sumdista += a.xDistToPattern_[lay];
35  sumdistb += b.xDistToPattern_[lay];
36  }
37 
38  if (a.nLayersWithHits_ != b.nLayersWithHits_)
39  return (a.nLayersWithHits_ > b.nLayersWithHits_); // number of layers with hits
40  else if (sumhqa != sumhqb)
41  return (sumhqa > sumhqb); // number of hq hits
42  else if (sumlqa != sumlqb)
43  return (sumlqa > sumlqb); // number of lq hits
44  else if (a.nHitsDiff_ != b.nHitsDiff_)
45  return (a.nHitsDiff_ < b.nHitsDiff_); // abs. diff. between SL1 & SL3 hits
46  else
47  return (sumdista < sumdistb); // abs. dist. to digis
48  }
49  } HoughOrdering;
50 } // namespace
51 // ============================================================================
52 // Constructors and destructor
53 // ============================================================================
55  // Obtention of parameters
56  debug_ = pset.getUntrackedParameter<bool>("debug");
57  if (debug_)
58  LogDebug("HoughGrouping") << "HoughGrouping: constructor";
59 
60  // HOUGH TRANSFORM CONFIGURATION
61  angletan_ = pset.getUntrackedParameter<double>("angletan");
62  anglebinwidth_ = pset.getUntrackedParameter<double>("anglebinwidth");
63  posbinwidth_ = pset.getUntrackedParameter<double>("posbinwidth");
64 
65  // MAXIMA SEARCH CONFIGURATION
66  maxdeltaAngDeg_ = pset.getUntrackedParameter<double>("maxdeltaAngDeg");
67  maxdeltaPos_ = pset.getUntrackedParameter<double>("maxdeltaPos");
68  upperNumber_ = (unsigned short int)pset.getUntrackedParameter<int>("UpperNumber");
69  lowerNumber_ = (unsigned short int)pset.getUntrackedParameter<int>("LowerNumber");
70 
71  // HITS ASSOCIATION CONFIGURATION
72  maxDistanceToWire_ = pset.getUntrackedParameter<double>("MaxDistanceToWire");
73 
74  // CANDIDATE QUALITY CONFIGURATION
75  minNLayerHits_ = (unsigned short int)pset.getUntrackedParameter<int>("minNLayerHits");
76  minSingleSLHitsMax_ = (unsigned short int)pset.getUntrackedParameter<int>("minSingleSLHitsMax");
77  minSingleSLHitsMin_ = (unsigned short int)pset.getUntrackedParameter<int>("minSingleSLHitsMin");
78  allowUncorrelatedPatterns_ = pset.getUntrackedParameter<bool>("allowUncorrelatedPatterns");
79  minUncorrelatedHits_ = (unsigned short int)pset.getUntrackedParameter<int>("minUncorrelatedHits");
80 
82 }
83 
85  if (debug_)
86  LogDebug("HoughGrouping") << "HoughGrouping: destructor" << endl;
87 }
88 
89 // ============================================================================
90 // Main methods (initialise, run, finish)
91 // ============================================================================
92 void HoughGrouping::initialise(const edm::EventSetup& iEventSetup) {
93  if (debug_)
94  LogDebug("HoughGrouping") << "initialise";
95 
96  resetAttributes();
97 
98  maxrads_ = 0.5 * M_PI - atan(angletan_);
99  minangle_ = (double)convertDegToRad(anglebinwidth_);
100  halfanglebins_ = round(maxrads_ / minangle_ + 1);
101  anglebins_ = (unsigned short int)2 * halfanglebins_;
102  oneanglebin_ = maxrads_ / halfanglebins_;
103 
104  maxdeltaAng_ = maxdeltaAngDeg_ * 2 * M_PI / 360;
105 
106  // Initialisation of anglemap. Posmap depends on the size of the chamber.
107  double phi = 0;
108  anglemap_ = {};
109  for (unsigned short int ab = 0; ab < halfanglebins_; ab++) {
110  anglemap_[ab] = phi;
111  phi += oneanglebin_;
112  }
113 
114  phi = (M_PI - maxrads_);
115  for (unsigned short int ab = halfanglebins_; ab < anglebins_; ab++) {
116  anglemap_[ab] = phi;
117  phi += oneanglebin_;
118  }
119 
120  if (debug_) {
121  LogDebug("HoughGrouping")
122  << "\nHoughGrouping::ResetAttributes - Information from the initialisation of HoughGrouping:";
123  LogDebug("HoughGrouping") << "ResetAttributes - maxrads: " << maxrads_;
124  LogDebug("HoughGrouping") << "ResetAttributes - anglebinwidth: " << anglebinwidth_;
125  LogDebug("HoughGrouping") << "ResetAttributes - minangle: " << minangle_;
126  LogDebug("HoughGrouping") << "ResetAttributes - halfanglebins: " << halfanglebins_;
127  LogDebug("HoughGrouping") << "ResetAttributes - anglebins: " << anglebins_;
128  LogDebug("HoughGrouping") << "ResetAttributes - oneanglebin: " << oneanglebin_;
129  LogDebug("HoughGrouping") << "ResetAttributes - posbinwidth: " << posbinwidth_;
130  }
131 
132  const MuonGeometryRecord& geom = iEventSetup.get<MuonGeometryRecord>();
133  dtGeo_ = &geom.get(dtGeomH);
134 }
135 
137  const edm::EventSetup& iEventSetup,
138  const DTDigiCollection& digis,
139  MuonPathPtrs& outMpath) {
140  if (debug_)
141  LogDebug("HoughGrouping") << "\nHoughGrouping::run";
142 
143  resetAttributes();
144 
145  if (debug_)
146  LogDebug("HoughGrouping") << "run - Beginning digis' loop...";
147  LocalPoint wirePosInLay, wirePosInChamber;
148  GlobalPoint wirePosGlob;
149  for (DTDigiCollection::DigiRangeIterator dtLayerIdIt = digis.begin(); dtLayerIdIt != digis.end(); dtLayerIdIt++) {
150  const DTLayer* lay = dtGeo_->layer((*dtLayerIdIt).first);
151  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerIdIt).second).first;
152  digiIt != ((*dtLayerIdIt).second).second;
153  digiIt++) {
154  if (debug_) {
155  LogDebug("HoughGrouping") << "\nHoughGrouping::run - Digi number " << idigi_;
156  LogDebug("HoughGrouping") << "run - Wheel: " << (*dtLayerIdIt).first.wheel();
157  LogDebug("HoughGrouping") << "run - Chamber: " << (*dtLayerIdIt).first.station();
158  LogDebug("HoughGrouping") << "run - Sector: " << (*dtLayerIdIt).first.sector();
159  LogDebug("HoughGrouping") << "run - Superlayer: " << (*dtLayerIdIt).first.superLayer();
160  LogDebug("HoughGrouping") << "run - Layer: " << (*dtLayerIdIt).first.layer();
161  LogDebug("HoughGrouping") << "run - Wire: " << (*digiIt).wire();
162  LogDebug("HoughGrouping") << "run - First wire: " << lay->specificTopology().firstChannel();
163  LogDebug("HoughGrouping") << "run - Last wire: " << lay->specificTopology().lastChannel();
164  LogDebug("HoughGrouping") << "run - First wire x: "
166  LogDebug("HoughGrouping") << "run - Last wire x: "
168  LogDebug("HoughGrouping") << "run - Cell width: " << lay->specificTopology().cellWidth();
169  LogDebug("HoughGrouping") << "run - Cell height: " << lay->specificTopology().cellHeight();
170  }
171  if ((*dtLayerIdIt).first.superLayer() == 2)
172  continue;
173 
174  wirePosInLay = LocalPoint(lay->specificTopology().wirePosition((*digiIt).wire()), 0, 0);
175  wirePosGlob = lay->toGlobal(wirePosInLay);
176  wirePosInChamber = lay->chamber()->toLocal(wirePosGlob);
177 
178  if ((*dtLayerIdIt).first.superLayer() == 3) {
179  digimap_[(*dtLayerIdIt).first.layer() + 3][(*digiIt).wire()] = DTPrimitive();
180  digimap_[(*dtLayerIdIt).first.layer() + 3][(*digiIt).wire()].setTDCTimeStamp((*digiIt).time());
181  digimap_[(*dtLayerIdIt).first.layer() + 3][(*digiIt).wire()].setChannelId((*digiIt).wire());
182  digimap_[(*dtLayerIdIt).first.layer() + 3][(*digiIt).wire()].setLayerId((*dtLayerIdIt).first.layer());
183  digimap_[(*dtLayerIdIt).first.layer() + 3][(*digiIt).wire()].setSuperLayerId((*dtLayerIdIt).first.superLayer());
184  digimap_[(*dtLayerIdIt).first.layer() + 3][(*digiIt).wire()].setCameraId((*dtLayerIdIt).first.rawId());
185  } else {
186  digimap_[(*dtLayerIdIt).first.layer() - 1][(*digiIt).wire()] = DTPrimitive();
187  digimap_[(*dtLayerIdIt).first.layer() - 1][(*digiIt).wire()].setTDCTimeStamp((*digiIt).time());
188  digimap_[(*dtLayerIdIt).first.layer() - 1][(*digiIt).wire()].setChannelId((*digiIt).wire());
189  digimap_[(*dtLayerIdIt).first.layer() - 1][(*digiIt).wire()].setLayerId((*dtLayerIdIt).first.layer());
190  digimap_[(*dtLayerIdIt).first.layer() - 1][(*digiIt).wire()].setSuperLayerId((*dtLayerIdIt).first.superLayer());
191  digimap_[(*dtLayerIdIt).first.layer() - 1][(*digiIt).wire()].setCameraId((*dtLayerIdIt).first.rawId());
192  }
193 
194  // Obtaining geometrical info of the chosen chamber
195  if (xlowlim_ == 0 && xhighlim_ == 0 && zlowlim_ == 0 && zhighlim_ == 0) {
196  thewheel_ = (*dtLayerIdIt).first.wheel();
197  thestation_ = (*dtLayerIdIt).first.station();
198  thesector_ = (*dtLayerIdIt).first.sector();
199  obtainGeometricalBorders(lay);
200  }
201 
202  if (debug_) {
203  LogDebug("HoughGrouping") << "run - X position of the cell (chamber frame of reference): "
204  << wirePosInChamber.x();
205  LogDebug("HoughGrouping") << "run - Y position of the cell (chamber frame of reference): "
206  << wirePosInChamber.y();
207  LogDebug("HoughGrouping") << "run - Z position of the cell (chamber frame of reference): "
208  << wirePosInChamber.z();
209  }
210 
211  hitvec_.push_back({wirePosInChamber.x() - 1.05, wirePosInChamber.z()});
212  hitvec_.push_back({wirePosInChamber.x() + 1.05, wirePosInChamber.z()});
213  nhits_ += 2;
214 
215  idigi_++;
216  }
217  }
218 
219  if (debug_) {
220  LogDebug("HoughGrouping") << "\nHoughGrouping::run - nhits: " << nhits_;
221  LogDebug("HoughGrouping") << "run - idigi: " << idigi_;
222  }
223 
224  if (hitvec_.empty()) {
225  if (debug_)
226  LogDebug("HoughGrouping") << "run - No digis present in this chamber.";
227  return;
228  }
229 
230  // Perform the Hough transform of the inputs.
231  doHoughTransform();
232 
233  // Obtain the maxima
234  maxima_ = getMaximaVector();
235  resetPosElementsOfLinespace();
236 
237  if (maxima_.empty()) {
238  if (debug_)
239  LogDebug("HoughGrouping") << "run - No good maxima found in this event.";
240  return;
241  }
242 
243  DTChamberId TheChambId(thewheel_, thestation_, thesector_);
244  const DTChamber* TheChamb = dtGeo_->chamber(TheChambId);
245  std::vector<ProtoCand> cands;
246 
247  for (unsigned short int ican = 0; ican < maxima_.size(); ican++) {
248  if (debug_)
249  LogDebug("HoughGrouping") << "\nHoughGrouping::run - Candidate number: " << ican;
250  cands.push_back(associateHits(TheChamb, maxima_.at(ican).first, maxima_.at(ican).second));
251  }
252 
253  // Now we filter them:
254  orderAndFilter(cands, outMpath);
255  if (debug_)
256  LogDebug("HoughGrouping") << "run - now we have our muonpaths! It has " << outMpath.size() << " elements";
257 
258  cands.clear();
259  return;
260 }
261 
263  if (debug_)
264  LogDebug("HoughGrouping") << "finish";
265  return;
266 }
267 
268 // ============================================================================
269 // Other methods
270 // ============================================================================
272  if (debug_)
273  LogDebug("HoughGrouping") << "ResetAttributes";
274  // std::vector's:
275  maxima_.clear();
276  hitvec_.clear();
277 
278  // Integer-type variables:
279  spacebins_ = 0;
280  idigi_ = 0;
281  nhits_ = 0;
282  xlowlim_ = 0;
283  xhighlim_ = 0;
284  zlowlim_ = 0;
285  zhighlim_ = 0;
286  thestation_ = 0;
287  thesector_ = 0;
288  thewheel_ = 0;
289 
290  // Arrays:
291  // NOTE: linespace array is treated and reset separately
292 
293  // Maps (dictionaries):
294  posmap_.clear();
295  for (unsigned short int abslay = 0; abslay < 8; abslay++)
296  digimap_[abslay].clear();
297 }
298 
300  if (debug_)
301  LogDebug("HoughGrouping") << "ResetPosElementsOfLinespace";
302  for (unsigned short int ab = 0; ab < anglebins_; ab++) {
303  linespace_[ab].clear();
304  }
305  linespace_.clear();
306 }
307 
309  if (debug_)
310  LogDebug("HoughGrouping") << "ObtainGeometricalBorders";
311  LocalPoint FirstWireLocal(lay->chamber()->superLayer(1)->layer(1)->specificTopology().wirePosition(
313  0,
314  0); // TAKING INFO FROM L1 OF SL1 OF THE CHOSEN CHAMBER
315  GlobalPoint FirstWireGlobal = lay->chamber()->superLayer(1)->layer(1)->toGlobal(FirstWireLocal);
316  LocalPoint FirstWireLocalCh = lay->chamber()->toLocal(FirstWireGlobal);
317 
318  LocalPoint LastWireLocal(lay->chamber()->superLayer(1)->layer(1)->specificTopology().wirePosition(
319  lay->chamber()->superLayer(1)->layer(1)->specificTopology().lastChannel()),
320  0,
321  0);
322  GlobalPoint LastWireGlobal = lay->chamber()->superLayer(1)->layer(1)->toGlobal(LastWireLocal);
323  LocalPoint LastWireLocalCh = lay->chamber()->toLocal(LastWireGlobal);
324 
325  // unsigned short int upsl = thestation == 4 ? 2 : 3;
326  unsigned short int upsl = thestation_ == 4 ? 3 : 3;
327  if (debug_)
328  LogDebug("HoughGrouping") << "ObtainGeometricalBorders - uppersuperlayer: " << upsl;
329 
330  LocalPoint FirstWireLocalUp(lay->chamber()->superLayer(upsl)->layer(4)->specificTopology().wirePosition(
331  lay->chamber()->superLayer(upsl)->layer(4)->specificTopology().firstChannel()),
332  0,
333  0); // TAKING INFO FROM L1 OF SL1 OF THE CHOSEN CHAMBER
334  GlobalPoint FirstWireGlobalUp = lay->chamber()->superLayer(upsl)->layer(4)->toGlobal(FirstWireLocalUp);
335  LocalPoint FirstWireLocalChUp = lay->chamber()->toLocal(FirstWireGlobalUp);
336 
337  xlowlim_ = FirstWireLocalCh.x() - lay->chamber()->superLayer(1)->layer(1)->specificTopology().cellWidth() / 2;
338  xhighlim_ = LastWireLocalCh.x() + lay->chamber()->superLayer(1)->layer(1)->specificTopology().cellWidth() / 2;
339  zlowlim_ = FirstWireLocalChUp.z() - lay->chamber()->superLayer(upsl)->layer(4)->specificTopology().cellHeight() / 2;
340  zhighlim_ = LastWireLocalCh.z() + lay->chamber()->superLayer(1)->layer(1)->specificTopology().cellHeight() / 2;
341 
342  spacebins_ = round(std::abs(xhighlim_ - xlowlim_) / posbinwidth_);
343 }
344 
346  if (debug_)
347  LogDebug("HoughGrouping") << "DoHoughTransform";
348  // First we want to obtain the number of bins in angle that we want. To do so, we will consider at first a maximum angle of
349  // (in rad.) pi/2 - arctan(0.3) (i.e. ~73º) and a resolution (width of bin angle) of 2º.
350 
351  if (debug_) {
352  LogDebug("HoughGrouping") << "DoHoughTransform - maxrads: " << maxrads_;
353  LogDebug("HoughGrouping") << "DoHoughTransform - minangle: " << minangle_;
354  LogDebug("HoughGrouping") << "DoHoughTransform - halfanglebins: " << halfanglebins_;
355  LogDebug("HoughGrouping") << "DoHoughTransform - anglebins: " << anglebins_;
356  LogDebug("HoughGrouping") << "DoHoughTransform - oneanglebin: " << oneanglebin_;
357  LogDebug("HoughGrouping") << "DoHoughTransform - spacebins: " << spacebins_;
358  }
359 
360  double rho = 0, phi = 0, sbx = 0;
361  double lowinitsb = xlowlim_ + posbinwidth_ / 2;
362 
363  // Initialisation
364  linespace_.resize(anglebins_, std::vector<unsigned short int>(spacebins_));
365  for (unsigned short int ab = 0; ab < anglebins_; ab++) {
366  sbx = lowinitsb;
367  for (unsigned short int sb = 0; sb < spacebins_; sb++) {
368  posmap_[sb] = sbx;
369  linespace_[ab][sb] = 0;
370  sbx += posbinwidth_;
371  }
372  }
373 
374  // Filling of the double array and actually doing the transform
375  for (unsigned short int i = 0; i < hitvec_.size(); i++) {
376  for (unsigned short int ab = 0; ab < anglebins_; ab++) {
377  phi = anglemap_[ab];
378  rho = hitvec_.at(i).first * cos(phi) + hitvec_.at(i).second * sin(phi);
379  sbx = lowinitsb - posbinwidth_ / 2;
380  for (unsigned short int sb = 0; sb < spacebins_; sb++) {
381  if (rho < sbx) {
382  linespace_[ab][sb]++;
383  break;
384  }
385  sbx += posbinwidth_;
386  }
387  }
388  }
389 }
390 
392  if (debug_)
393  LogDebug("HoughGrouping") << "getMaximaVector";
394  PointTuples tmpvec;
395 
396  bool flagsearched = false;
397  unsigned short int numbertolookat = upperNumber_;
398 
399  while (!flagsearched) {
400  for (unsigned short int ab = 0; ab < anglebins_; ab++) {
401  for (unsigned short int sb = 0; sb < spacebins_; sb++) {
402  if (linespace_[ab][sb] >= numbertolookat)
403  tmpvec.push_back({anglemap_[ab], posmap_[sb], linespace_[ab][sb]});
404  }
405  }
406  if (((numbertolookat - 1) < lowerNumber_) || (!tmpvec.empty()))
407  flagsearched = true;
408  else
409  numbertolookat--;
410  }
411 
412  if (tmpvec.empty()) {
413  if (debug_)
414  LogDebug("HoughGrouping") << "GetMaximaVector - No maxima could be found";
415  PointsInPlane finalvec;
416  return finalvec;
417  } else {
418  PointsInPlane finalvec = findTheMaxima(tmpvec);
419 
420  // And now obtain the values of m and n of the lines.
421  for (unsigned short int i = 0; i < finalvec.size(); i++)
422  finalvec.at(i) = transformPair(finalvec.at(i));
423  return finalvec;
424  }
425 }
426 
428  if (debug_)
429  LogDebug("HoughGrouping") << "transformPair";
430  // input: (ang, pos); output: (m, n)
431  if (inputpair.first == 0)
432  return {1000, -1000 * inputpair.second};
433  else
434  return {-1. / tan(inputpair.first), inputpair.second / sin(inputpair.first)};
435 }
436 
438  if (debug_)
439  LogDebug("HoughGrouping") << "findTheMaxima";
440  bool fullyreduced = false;
441  unsigned short int ind = 0;
442 
443  std::vector<unsigned short int> chosenvec;
444  PointsInPlane resultvec;
445  PointInPlane finalpair = {};
446 
447  if (debug_)
448  LogDebug("HoughGrouping") << "findTheMaxima - prewhile";
449  while (!fullyreduced) {
450  if (debug_) {
451  LogDebug("HoughGrouping") << "\nHoughGrouping::findTheMaxima - New iteration";
452  LogDebug("HoughGrouping") << "findTheMaxima - inputvec size: " << inputvec.size();
453  LogDebug("HoughGrouping") << "findTheMaxima - ind: " << ind;
454  LogDebug("HoughGrouping") << "findTheMaxima - maximum deltaang: " << maxdeltaAng_
455  << " and maximum deltapos: " << maxdeltaPos_;
456  }
457  chosenvec.clear();
458  //calculate distances and check out the ones that are near
459  if (debug_)
460  LogDebug("HoughGrouping") << "findTheMaxima - Ours have " << get<2>(inputvec.at(ind))
461  << " entries, ang.: " << get<0>(inputvec.at(ind))
462  << " and pos.: " << get<1>(inputvec.at(ind));
463 
464  for (unsigned short int j = ind + 1; j < inputvec.size(); j++) {
465  if (getTwoDelta(inputvec.at(ind), inputvec.at(j)).first <= maxdeltaAng_ &&
466  getTwoDelta(inputvec.at(ind), inputvec.at(j)).second <= maxdeltaPos_) {
467  chosenvec.push_back(j);
468  if (debug_)
469  LogDebug("HoughGrouping") << "findTheMaxima - - Adding num. " << j
470  << " with deltaang: " << getTwoDelta(inputvec.at(ind), inputvec.at(j)).first
471  << ", and deltapos: " << getTwoDelta(inputvec.at(ind), inputvec.at(j)).second
472  << " and with " << get<2>(inputvec.at(j))
473  << " entries, ang.: " << get<0>(inputvec.at(j))
474  << " and pos.: " << get<1>(inputvec.at(j));
475  } else if (debug_)
476  LogDebug("HoughGrouping") << "findTheMaxima - - Ignoring num. " << j
477  << " with deltaang: " << getTwoDelta(inputvec.at(ind), inputvec.at(j)).first
478  << ", and deltapos: " << getTwoDelta(inputvec.at(ind), inputvec.at(j)).second
479  << " and with " << get<2>(inputvec.at(j)) << " entries.";
480  }
481 
482  if (debug_)
483  LogDebug("HoughGrouping") << "findTheMaxima - chosenvecsize: " << chosenvec.size();
484 
485  if (chosenvec.empty()) {
486  if (ind + 1 >= (unsigned short int)inputvec.size())
487  fullyreduced = true;
488  if ((get<0>(inputvec.at(ind)) <= maxrads_) || (get<0>(inputvec.at(ind)) >= M_PI - maxrads_))
489  resultvec.push_back({get<0>(inputvec.at(ind)), get<1>(inputvec.at(ind))});
490  else if (debug_)
491  LogDebug("HoughGrouping") << "findTheMaxima - - Candidate dropped due to an excess in angle";
492  ind++;
493  continue;
494  }
495 
496  // Now average them
497  finalpair = getAveragePoint(inputvec, ind, chosenvec);
498 
499  // Erase the ones you used
500  inputvec.erase(inputvec.begin() + ind);
501  for (short int j = chosenvec.size() - 1; j > -1; j--) {
502  if (debug_)
503  LogDebug("HoughGrouping") << "findTheMaxima - erasing index: " << chosenvec.at(j) - 1;
504  inputvec.erase(inputvec.begin() + chosenvec.at(j) - 1);
505  }
506 
507  if (debug_)
508  LogDebug("HoughGrouping") << "findTheMaxima - inputvec size: " << inputvec.size();
509 
510  // And add the one you calculated:
511  if ((finalpair.first <= maxrads_) || (finalpair.first >= M_PI - maxrads_))
512  resultvec.push_back(finalpair);
513  else if (debug_)
514  LogDebug("HoughGrouping") << "findTheMaxima - - Candidate dropped due to an excess in angle";
515 
516  if (ind + 1 >= (unsigned short int)inputvec.size())
517  fullyreduced = true;
518  if (debug_)
519  LogDebug("HoughGrouping") << "findTheMaxima - iteration ends";
520  ind++;
521  }
522  if (debug_)
523  LogDebug("HoughGrouping") << "findTheMaxima - postwhile";
524  return resultvec;
525 }
526 
528  if (debug_)
529  LogDebug("HoughGrouping") << "getTwoDelta";
530  return {abs(get<0>(pair1) - get<0>(pair2)), abs(get<1>(pair1) - get<1>(pair2))};
531 }
532 
534  unsigned short int firstindex,
535  const std::vector<unsigned short int>& indexlist) {
536  if (debug_)
537  LogDebug("HoughGrouping") << "getAveragePoint";
538  std::vector<double> xs;
539  std::vector<double> ys;
540  std::vector<double> ws;
541  xs.push_back(get<0>(inputvec.at(firstindex)));
542  ys.push_back(get<1>(inputvec.at(firstindex)));
543  ws.push_back(exp(get<2>(inputvec.at(firstindex))));
544  for (unsigned short int i = 0; i < indexlist.size(); i++) {
545  xs.push_back(get<0>(inputvec.at(indexlist.at(i))));
546  ys.push_back(get<1>(inputvec.at(indexlist.at(i))));
547  ws.push_back(exp(get<2>(inputvec.at(indexlist.at(i)))));
548  }
549  return {TMath::Mean(xs.begin(), xs.end(), ws.begin()), TMath::Mean(ys.begin(), ys.end(), ws.begin())};
550 }
551 
552 ProtoCand HoughGrouping::associateHits(const DTChamber* thechamb, double m, double n) {
553  if (debug_)
554  LogDebug("HoughGrouping") << "associateHits";
555  LocalPoint tmpLocal, AWireLocal, AWireLocalCh, tmpLocalCh, thepoint;
556  GlobalPoint tmpGlobal, AWireGlobal;
557  double tmpx = 0;
558  double distleft = 0;
559  double distright = 0;
560  unsigned short int tmpwire = 0;
561  unsigned short int abslay = 0;
562  LATERAL_CASES lat = NONE;
563  bool isleft = false;
564  bool isright = false;
565 
566  ProtoCand returnPC;
567  for (auto l = 0; l < NUM_LAYERS_2SL; l++) {
568  returnPC.isThereHitInLayer_.push_back(false);
569  returnPC.isThereNeighBourHitInLayer_.push_back(false);
570  returnPC.xDistToPattern_.push_back(0);
571  returnPC.dtHits_.push_back(DTPrimitive());
572  }
573 
574  if (debug_)
575  LogDebug("HoughGrouping") << "associateHits - Beginning SL loop";
576  for (unsigned short int sl = 1; sl < 3 + 1; sl++) {
577  if (sl == 2)
578  continue;
579  if (debug_)
580  LogDebug("HoughGrouping") << "associateHits - SL: " << sl;
581 
582  for (unsigned short int l = 1; l < 4 + 1; l++) {
583  if (debug_)
584  LogDebug("HoughGrouping") << "associateHits - L: " << l;
585  isleft = false;
586  isright = false;
587  lat = NONE;
588  distleft = 0;
589  distright = 0;
590  if (sl == 1)
591  abslay = l - 1;
592  else
593  abslay = l + 3;
594  AWireLocal = LocalPoint(thechamb->superLayer(sl)->layer(l)->specificTopology().wirePosition(
595  thechamb->superLayer(sl)->layer(l)->specificTopology().firstChannel()),
596  0,
597  0);
598  AWireGlobal = thechamb->superLayer(sl)->layer(l)->toGlobal(AWireLocal);
599  AWireLocalCh = thechamb->toLocal(AWireGlobal);
600  tmpx = (AWireLocalCh.z() - n) / m;
601 
602  if ((tmpx <= xlowlim_) || (tmpx >= xhighlim_)) {
603  returnPC.dtHits_[abslay] = DTPrimitive(); // empty primitive
604  continue;
605  }
606 
607  thepoint = LocalPoint(tmpx, 0, AWireLocalCh.z());
608  tmpwire = thechamb->superLayer(sl)->layer(l)->specificTopology().channel(thepoint);
609  if (debug_)
610  LogDebug("HoughGrouping") << "associateHits - Wire number: " << tmpwire;
611  if (debug_)
612  LogDebug("HoughGrouping") << "associateHits - First channel in layer: "
613  << thechamb->superLayer(sl)->layer(l)->specificTopology().firstChannel();
614  if ((digimap_[abslay]).count(tmpwire)) {
615  // OK, we have a digi, let's choose the laterality, if we can:
616  tmpLocal = LocalPoint(thechamb->superLayer(sl)->layer(l)->specificTopology().wirePosition(tmpwire), 0, 0);
617  tmpGlobal = thechamb->superLayer(sl)->layer(l)->toGlobal(tmpLocal);
618  tmpLocalCh = thechamb->toLocal(tmpGlobal);
619 
620  if (abs(tmpLocalCh.x() - thepoint.x()) >= maxDistanceToWire_) {
621  // The distance where lateralities are not put is 0.03 cm, which is a conservative threshold for the resolution of the cells.
622  if ((tmpLocalCh.x() - thepoint.x()) > 0)
623  lat = LEFT;
624  else
625  lat = RIGHT;
626  }
627 
628  // Filling info
629  returnPC.nLayersWithHits_++;
630  returnPC.isThereHitInLayer_[abslay] = true;
631  returnPC.isThereNeighBourHitInLayer_[abslay] = true;
632  if (lat == LEFT)
633  returnPC.xDistToPattern_[abslay] = abs(tmpx - (tmpLocalCh.x() - 1.05));
634  else if (lat == RIGHT)
635  returnPC.xDistToPattern_[abslay] = abs(tmpx - (tmpLocalCh.x() + 1.05));
636  else
637  returnPC.xDistToPattern_[abslay] = abs(tmpx - tmpLocalCh.x());
638  returnPC.dtHits_[abslay] = DTPrimitive(digimap_[abslay][tmpwire]);
639  returnPC.dtHits_[abslay].setLaterality(lat);
640  } else {
641  if (debug_)
642  LogDebug("HoughGrouping") << "associateHits - No hit in the crossing cell";
643  if ((digimap_[abslay]).count(tmpwire - 1))
644  isleft = true;
645  if ((digimap_[abslay]).count(tmpwire + 1))
646  isright = true;
647  if (debug_)
648  LogDebug("HoughGrouping") << "associateHits - There is in the left: " << (int)isleft;
649  if (debug_)
650  LogDebug("HoughGrouping") << "associateHits - There is in the right: " << (int)isright;
651 
652  if ((isleft) && (!isright)) {
653  tmpLocal = LocalPoint(thechamb->superLayer(sl)->layer(l)->specificTopology().wirePosition(tmpwire - 1), 0, 0);
654  tmpGlobal = thechamb->superLayer(sl)->layer(l)->toGlobal(tmpLocal);
655  tmpLocalCh = thechamb->toLocal(tmpGlobal);
656 
657  // Filling info
658  returnPC.nLayersWithHits_++;
659  returnPC.isThereNeighBourHitInLayer_[abslay] = true;
660  returnPC.xDistToPattern_[abslay] = abs(tmpx - (tmpLocalCh.x() + 1.05));
661  returnPC.dtHits_[abslay] = DTPrimitive(digimap_[abslay][tmpwire - 1]);
662  returnPC.dtHits_[abslay].setLaterality(RIGHT);
663 
664  } else if ((!isleft) && (isright)) {
665  tmpLocal = LocalPoint(thechamb->superLayer(sl)->layer(l)->specificTopology().wirePosition(tmpwire + 1), 0, 0);
666  tmpGlobal = thechamb->superLayer(sl)->layer(l)->toGlobal(tmpLocal);
667  tmpLocalCh = thechamb->toLocal(tmpGlobal);
668 
669  // Filling info
670  returnPC.nLayersWithHits_++;
671  returnPC.isThereNeighBourHitInLayer_[abslay] = true;
672  returnPC.xDistToPattern_[abslay] = abs(tmpx - (tmpLocalCh.x() - 1.05));
673  returnPC.dtHits_[abslay] = DTPrimitive(digimap_[abslay][tmpwire + 1]);
674  returnPC.dtHits_[abslay].setLaterality(LEFT);
675  } else if ((isleft) && (isright)) {
676  LocalPoint tmpLocal_l =
677  LocalPoint(thechamb->superLayer(sl)->layer(l)->specificTopology().wirePosition(tmpwire - 1), 0, 0);
678  GlobalPoint tmpGlobal_l = thechamb->superLayer(sl)->layer(l)->toGlobal(tmpLocal_l);
679  LocalPoint tmpLocalCh_l = thechamb->toLocal(tmpGlobal_l);
680 
681  LocalPoint tmpLocal_r =
682  LocalPoint(thechamb->superLayer(sl)->layer(l)->specificTopology().wirePosition(tmpwire + 1), 0, 0);
683  GlobalPoint tmpGlobal_r = thechamb->superLayer(sl)->layer(l)->toGlobal(tmpLocal_r);
684  LocalPoint tmpLocalCh_r = thechamb->toLocal(tmpGlobal_r);
685 
686  distleft = std::abs(thepoint.x() - tmpLocalCh_l.x());
687  distright = std::abs(thepoint.x() - tmpLocalCh_r.x());
688 
689  // Filling info
690  returnPC.nLayersWithHits_++;
691  returnPC.isThereNeighBourHitInLayer_[abslay] = true;
692 
693  returnPC.xDistToPattern_[abslay] = abs(tmpx - (tmpLocalCh.x() - 1.05));
694  returnPC.dtHits_[abslay] = DTPrimitive(digimap_[abslay][tmpwire + 1]);
695  returnPC.dtHits_[abslay].setLaterality(LEFT);
696 
697  if (distleft < distright) {
698  returnPC.xDistToPattern_[abslay] = std::abs(tmpx - (tmpLocalCh.x() + 1.05));
699  returnPC.dtHits_[abslay] = DTPrimitive(digimap_[abslay][tmpwire - 1]);
700  returnPC.dtHits_[abslay].setLaterality(RIGHT);
701  } else {
702  returnPC.xDistToPattern_[abslay] = std::abs(tmpx - (tmpLocalCh.x() - 1.05));
703  returnPC.dtHits_[abslay] = DTPrimitive(digimap_[abslay][tmpwire + 1]);
704  returnPC.dtHits_[abslay].setLaterality(LEFT);
705  }
706  } else { // case where there are no digis
707  returnPC.dtHits_[abslay] = DTPrimitive(); // empty primitive
708  }
709  }
710  }
711  }
712 
713  setDifferenceBetweenSL(returnPC);
714  if (debug_) {
715  LogDebug("HoughGrouping") << "associateHits - Finishing with the candidate. We have found the following of it:";
716  LogDebug("HoughGrouping") << "associateHits - # of layers with hits: " << returnPC.nLayersWithHits_;
717  for (unsigned short int lay = 0; lay < 8; lay++) {
718  LogDebug("HoughGrouping") << "associateHits - For absolute layer: " << lay;
719  LogDebug("HoughGrouping") << "associateHits - # of HQ hits: " << returnPC.isThereHitInLayer_[lay];
720  LogDebug("HoughGrouping") << "associateHits - # of LQ hits: " << returnPC.isThereNeighBourHitInLayer_[lay];
721  }
722  LogDebug("HoughGrouping") << "associateHits - Abs. diff. between SL1 and SL3 hits: " << returnPC.nHitsDiff_;
723  for (unsigned short int lay = 0; lay < 8; lay++) {
724  LogDebug("HoughGrouping") << "associateHits - For absolute layer: " << lay;
725  LogDebug("HoughGrouping") << "associateHits - Abs. distance to digi: " << returnPC.xDistToPattern_[lay];
726  }
727  }
728  return returnPC;
729 }
730 
732  if (debug_)
733  LogDebug("HoughGrouping") << "setDifferenceBetweenSL";
734  short int absres = 0;
735  for (unsigned short int lay = 0; lay < 8; lay++) {
736  if (tupl.dtHits_[lay].channelId() > 0) {
737  if (lay <= 3)
738  absres++;
739  else
740  absres--;
741  }
742  }
743 
744  if (absres >= 0)
745  tupl.nHitsDiff_ = absres;
746  else
747  tupl.nHitsDiff_ = (unsigned short int)(-absres);
748 }
749 
750 void HoughGrouping::orderAndFilter(std::vector<ProtoCand>& invector, MuonPathPtrs& outMuonPath) {
751  if (debug_)
752  LogDebug("HoughGrouping") << "orderAndFilter";
753  // 0: # of layers with hits.
754  // 1: # of hits of high quality (the expected line crosses the cell).
755  // 2: # of hits of low quality (the expected line is in a neighbouring cell).
756  // 3: absolute diff. between the number of hits in SL1 and SL3.
757  // 4: absolute distance to all hits of the segment.
758  // 5: DTPrimitive of the candidate.
759 
760  std::vector<unsigned short int> elstoremove;
761  // ordering:
762  if (debug_)
763  LogDebug("HoughGrouping") << "orderAndFilter - First ordering";
764  std::sort(invector.begin(), invector.end(), HoughOrdering);
765 
766  // Now filtering:
767  unsigned short int ind = 0;
768  bool filtered = false;
769  if (debug_)
770  LogDebug("HoughGrouping") << "orderAndFilter - Entering while";
771  while (!filtered) {
772  if (debug_)
773  LogDebug("HoughGrouping") << "\nHoughGrouping::orderAndFilter - New iteration with ind: " << ind;
774  elstoremove.clear();
775  for (unsigned short int i = ind + 1; i < invector.size(); i++) {
776  if (debug_)
777  LogDebug("HoughGrouping") << "orderAndFilter - Checking index: " << i;
778  for (unsigned short int lay = 0; lay < 8; lay++) {
779  if (debug_)
780  LogDebug("HoughGrouping") << "orderAndFilter - Checking layer number: " << lay;
781  if (invector.at(i).dtHits_[lay].channelId() == invector.at(ind).dtHits_[lay].channelId() &&
782  invector.at(ind).dtHits_[lay].channelId() != -1) {
783  invector.at(i).nLayersWithHits_--;
784  invector.at(i).isThereHitInLayer_[lay] = false;
785  invector.at(i).isThereNeighBourHitInLayer_[lay] = false;
786  setDifferenceBetweenSL(invector.at(i));
787  // We check that if its a different laterality, the best candidate of the two of them changes its laterality to not-known (that is, both).
788  if (invector.at(i).dtHits_[lay].laterality() != invector.at(ind).dtHits_[lay].laterality())
789  invector.at(ind).dtHits_[lay].setLaterality(NONE);
790 
791  invector.at(i).dtHits_[lay] = DTPrimitive();
792  }
793  }
794  if (debug_)
795  LogDebug("HoughGrouping")
796  << "orderAndFilter - Finished checking all the layers, now seeing if we should remove the "
797  "candidate";
798 
799  if (!areThereEnoughHits(invector.at(i))) {
800  if (debug_)
801  LogDebug("HoughGrouping") << "orderAndFilter - This candidate shall be removed!";
802  elstoremove.push_back((unsigned short int)i);
803  }
804  }
805 
806  if (debug_)
807  LogDebug("HoughGrouping") << "orderAndFilter - We are gonna erase " << elstoremove.size() << " elements";
808 
809  for (short int el = (elstoremove.size() - 1); el > -1; el--) {
810  invector.erase(invector.begin() + elstoremove.at(el));
811  }
812 
813  if (ind + 1 == (unsigned short int)invector.size())
814  filtered = true;
815  else
816  std::sort(invector.begin() + ind + 1, invector.end(), HoughOrdering);
817  ind++;
818  }
819 
820  // Ultimate filter: if the remaining do not fill the requirements (configurable through pset arguments), they are removed also.
821  for (short int el = (invector.size() - 1); el > -1; el--) {
822  if (!areThereEnoughHits(invector.at(el))) {
823  invector.erase(invector.begin() + el);
824  }
825  }
826 
827  if (invector.empty()) {
828  if (debug_)
829  LogDebug("HoughGrouping") << "OrderAndFilter - We do not have candidates with the minimum hits required.";
830  return;
831  } else if (debug_)
832  LogDebug("HoughGrouping") << "OrderAndFilter - At the end, we have only " << invector.size() << " good paths!";
833 
834  // Packing dt primitives
835  for (unsigned short int i = 0; i < invector.size(); i++) {
836  DTPrimitivePtrs ptrPrimitive;
837  unsigned short int tmplowfill = 0;
838  unsigned short int tmpupfill = 0;
839  for (unsigned short int lay = 0; lay < 8; lay++) {
840  auto dtAux = std::make_shared<DTPrimitive>(invector.at(i).dtHits_[lay]);
841  ptrPrimitive.push_back(std::move(dtAux));
842  if (debug_) {
843  LogDebug("HoughGrouping") << "\nHoughGrouping::OrderAndFilter - cameraid: " << ptrPrimitive[lay]->cameraId();
844  LogDebug("HoughGrouping") << "OrderAndFilter - channelid (GOOD): " << ptrPrimitive[lay]->channelId();
845  LogDebug("HoughGrouping") << "OrderAndFilter - channelid (AM): " << ptrPrimitive[lay]->channelId() - 1;
846  }
847  // Fixing channel ID to AM conventions...
848  if (ptrPrimitive[lay]->channelId() != -1)
849  ptrPrimitive[lay]->setChannelId(ptrPrimitive[lay]->channelId() - 1);
850 
851  if (ptrPrimitive[lay]->cameraId() > 0) {
852  if (lay < 4)
853  tmplowfill++;
854  else
855  tmpupfill++;
856  }
857  }
858 
859  auto ptrMuonPath = std::make_shared<MuonPath>(ptrPrimitive, tmplowfill, tmpupfill);
860  outMuonPath.push_back(ptrMuonPath);
861  if (debug_) {
862  for (unsigned short int lay = 0; lay < 8; lay++) {
863  LogDebug("HoughGrouping") << "OrderAndFilter - Final cameraID: "
864  << outMuonPath.back()->primitive(lay)->cameraId();
865  LogDebug("HoughGrouping") << "OrderAndFilter - Final channelID: "
866  << outMuonPath.back()->primitive(lay)->channelId();
867  LogDebug("HoughGrouping") << "OrderAndFilter - Final time: "
868  << outMuonPath.back()->primitive(lay)->tdcTimeStamp();
869  }
870  }
871  }
872  return;
873 }
874 
876  if (debug_)
877  LogDebug("HoughGrouping") << "areThereEnoughHits";
878  unsigned short int numhitssl1 = 0;
879  unsigned short int numhitssl3 = 0;
880  for (unsigned short int lay = 0; lay < 8; lay++) {
881  if ((tupl.dtHits_[lay].channelId() > 0) && (lay < 4))
882  numhitssl1++;
883  else if (tupl.dtHits_[lay].channelId() > 0)
884  numhitssl3++;
885  }
886 
887  if (debug_)
888  LogDebug("HoughGrouping") << "areThereEnoughHits - Hits in SL1: " << numhitssl1;
889  if (debug_)
890  LogDebug("HoughGrouping") << "areThereEnoughHits - Hits in SL3: " << numhitssl3;
891 
892  if ((numhitssl1 != 0) && (numhitssl3 != 0)) { // Correlated candidates
893  if ((numhitssl1 + numhitssl3) >= minNLayerHits_) {
894  if (numhitssl1 > numhitssl3) {
895  return ((numhitssl1 >= minSingleSLHitsMax_) && (numhitssl3 >= minSingleSLHitsMin_));
896  } else if (numhitssl3 > numhitssl1) {
897  return ((numhitssl3 >= minSingleSLHitsMax_) && (numhitssl1 >= minSingleSLHitsMin_));
898  } else
899  return true;
900  }
901  } else if (allowUncorrelatedPatterns_) { // Uncorrelated candidates
902  return ((numhitssl1 + numhitssl3) >= minNLayerHits_);
903  }
904  return false;
905 }
HoughGrouping::~HoughGrouping
~HoughGrouping() override
Definition: HoughGrouping.cc:84
DTGeometry
Definition: DTGeometry.h:28
HoughGrouping::maxdeltaPos_
double maxdeltaPos_
Definition: HoughGrouping.h:81
HoughGrouping::obtainGeometricalBorders
void obtainGeometricalBorders(const DTLayer *lay)
Definition: HoughGrouping.cc:308
mps_fire.i
i
Definition: mps_fire.py:428
cms_units::operators
Definition: CMSUnits.h:13
PointTuple
std::tuple< double, double, unsigned short int > PointTuple
Definition: HoughGrouping.h:31
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
DTTopology::channel
int channel(const LocalPoint &p) const override
Definition: DTTopology.cc:54
HoughGrouping::getMaximaVector
PointsInPlane getMaximaVector()
Definition: HoughGrouping.cc:391
HoughGrouping::anglebinwidth_
double anglebinwidth_
Definition: HoughGrouping.h:81
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
edm
HLT enums.
Definition: AlignableModifier.h:19
dqmiodumpindices.firstindex
firstindex
Definition: dqmiodumpindices.py:25
HoughGrouping::minNLayerHits_
unsigned short int minNLayerHits_
Definition: HoughGrouping.h:79
HoughGrouping::allowUncorrelatedPatterns_
bool allowUncorrelatedPatterns_
Definition: HoughGrouping.h:78
DTChamber
Definition: DTChamber.h:24
ZElectronSkim_cff.rho
rho
Definition: ZElectronSkim_cff.py:38
HoughGrouping::finish
void finish() override
Definition: HoughGrouping.cc:262
cmsdt::LEFT
Definition: constants.h:44
angle_units::operators::convertDegToRad
constexpr long double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
HoughGrouping::minSingleSLHitsMin_
unsigned short int minSingleSLHitsMin_
Definition: HoughGrouping.h:79
HoughGrouping::resetAttributes
void resetAttributes()
Definition: HoughGrouping.cc:271
HoughGrouping::doHoughTransform
void doHoughTransform()
Definition: HoughGrouping.cc:345
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
HoughGrouping::transformPair
PointInPlane transformPair(const PointInPlane &inputpair)
Definition: HoughGrouping.cc:427
dqmdumpme.first
first
Definition: dqmdumpme.py:55
HoughGrouping::areThereEnoughHits
bool areThereEnoughHits(const ProtoCand &tupl)
Definition: HoughGrouping.cc:875
DTTopology::cellWidth
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:69
MuonPathPtrs
std::vector< MuonPathPtr > MuonPathPtrs
Definition: MuonPath.h:122
ProtoCand::xDistToPattern_
std::vector< double > xDistToPattern_
Definition: HoughGrouping.h:25
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
Mean
Definition: SiPixelActionExecutor.h:21
HoughGrouping::minUncorrelatedHits_
unsigned short int minUncorrelatedHits_
Definition: HoughGrouping.h:79
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
HoughGrouping::getTwoDelta
PointInPlane getTwoDelta(const PointTuple &pair1, const PointTuple &pair2)
Definition: HoughGrouping.cc:527
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
HoughGrouping::initialise
void initialise(const edm::EventSetup &iEventSetup) override
Definition: HoughGrouping.cc:92
HoughGrouping::angletan_
double angletan_
Definition: HoughGrouping.h:81
DTTopology::wirePosition
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
cmsdt
Definition: constants.h:39
cmsdt::LATERAL_CASES
LATERAL_CASES
Definition: constants.h:44
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
HoughGrouping::associateHits
ProtoCand associateHits(const DTChamber *thechamb, double m, double n)
Definition: HoughGrouping.cc:552
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
HoughGrouping::maxdeltaAngDeg_
double maxdeltaAngDeg_
Definition: HoughGrouping.h:81
DTTopology::firstChannel
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
ProtoCand::nLayersWithHits_
unsigned short int nLayersWithHits_
Definition: HoughGrouping.h:20
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
HoughGrouping::posbinwidth_
double posbinwidth_
Definition: HoughGrouping.h:81
ProtoCand
Definition: HoughGrouping.h:19
HoughGrouping::run
void run(edm::Event &iEvent, const edm::EventSetup &iEventSetup, const DTDigiCollection &digis, MuonPathPtrs &outMpath) override
Definition: HoughGrouping.cc:136
HoughGrouping::lowerNumber_
unsigned short int lowerNumber_
Definition: HoughGrouping.h:79
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
HoughGrouping::HoughGrouping
HoughGrouping(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
Definition: HoughGrouping.cc:54
ProtoCand::dtHits_
DTPrimitives dtHits_
Definition: HoughGrouping.h:26
MotherGrouping
Definition: MotherGrouping.h:29
Point3DBase< float, LocalTag >
GeomDet::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
b
double b
Definition: hdecay.h:118
HoughGrouping.h
HoughGrouping::debug_
bool debug_
Definition: HoughGrouping.h:78
DTPrimitive
Definition: DTprimitive.h:9
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15142
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
clear
void clear(HadCaloObj &c)
Definition: data.h:124
HoughGrouping::dtGeomH
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomH
Definition: HoughGrouping.h:84
HoughGrouping::maxDistanceToWire_
double maxDistanceToWire_
Definition: HoughGrouping.h:81
PVValHelper::phi
Definition: PVValidationHelpers.h:68
ProtoCand::isThereHitInLayer_
std::vector< bool > isThereHitInLayer_
Definition: HoughGrouping.h:21
DTDigiCollection
cmsdt::RIGHT
Definition: constants.h:44
HoughGrouping::minSingleSLHitsMax_
unsigned short int minSingleSLHitsMax_
Definition: HoughGrouping.h:79
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
PointsInPlane
std::vector< PointInPlane > PointsInPlane
Definition: HoughGrouping.h:30
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
filtered
static const TGPicture * filtered(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:100
HoughGrouping::orderAndFilter
void orderAndFilter(std::vector< ProtoCand > &invector, MuonPathPtrs &outMuonPath)
Definition: HoughGrouping.cc:750
PointInPlane
std::pair< double, double > PointInPlane
Definition: HoughGrouping.h:29
edm::EventSetup
Definition: EventSetup.h:57
HoughGrouping::findTheMaxima
PointsInPlane findTheMaxima(PointTuples &inputvec)
Definition: HoughGrouping.cc:437
PointTuples
std::vector< PointTuple > PointTuples
Definition: HoughGrouping.h:32
DTLayer
Definition: DTLayer.h:25
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
ProtoCand::isThereNeighBourHitInLayer_
std::vector< bool > isThereNeighBourHitInLayer_
Definition: HoughGrouping.h:23
DTTopology::lastChannel
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:81
DTTopology::cellHeight
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:71
DTLayer::chamber
const DTChamber * chamber() const
Definition: DTLayer.cc:45
HoughGrouping::upperNumber_
unsigned short int upperNumber_
Definition: HoughGrouping.h:79
cmsdt::NUM_LAYERS_2SL
constexpr int NUM_LAYERS_2SL
Definition: constants.h:239
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
HoughGrouping::getAveragePoint
PointInPlane getAveragePoint(const PointTuples &inputvec, unsigned short int firstindex, const std::vector< unsigned short int > &indexlist)
Definition: HoughGrouping.cc:533
edm::Transition::BeginRun
NONE
Definition: TkAlStyle.cc:47
CMSUnits.h
DTSuperLayer::layer
const DTLayer * layer(const DTLayerId &id) const
Return the layer corresponding to the given id.
Definition: DTSuperLayer.cc:54
DTLayer::specificTopology
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
HoughGrouping::setDifferenceBetweenSL
void setDifferenceBetweenSL(ProtoCand &tupl)
Definition: HoughGrouping.cc:731
ConsumesCollector.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DTChamberId
Definition: DTChamberId.h:14
ParameterSet.h
HoughGrouping::resetPosElementsOfLinespace
void resetPosElementsOfLinespace()
Definition: HoughGrouping.cc:299
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
DTChamber::superLayer
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return the superlayer corresponding to the given id.
Definition: DTChamber.cc:53
DTPrimitivePtrs
std::vector< DTPrimitivePtr > DTPrimitivePtrs
Definition: DTprimitive.h:55
DigiContainerIterator
Definition: MuonDigiCollection.h:30
edm::Event
Definition: Event.h:73
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
ProtoCand::nHitsDiff_
unsigned short int nHitsDiff_
Definition: HoughGrouping.h:24
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27