16 using namespace cmsdt;
22 unsigned short int sumhqa = 0;
23 unsigned short int sumhqb = 0;
24 unsigned short int sumlqa = 0;
25 unsigned short int sumlqb = 0;
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];
38 if (
a.nLayersWithHits_ !=
b.nLayersWithHits_)
39 return (
a.nLayersWithHits_ >
b.nLayersWithHits_);
40 else if (sumhqa != sumhqb)
41 return (sumhqa > sumhqb);
42 else if (sumlqa != sumlqb)
43 return (sumlqa > sumlqb);
44 else if (
a.nHitsDiff_ !=
b.nHitsDiff_)
45 return (
a.nHitsDiff_ <
b.nHitsDiff_);
47 return (sumdista < sumdistb);
49 }
const HoughOrdering;
56 debug_ =
pset.getUntrackedParameter<
bool>(
"debug");
58 LogDebug(
"HoughGrouping") <<
"HoughGrouping: constructor";
86 LogDebug(
"HoughGrouping") <<
"HoughGrouping: destructor" << endl;
94 LogDebug(
"HoughGrouping") <<
"initialise";
98 maxrads_ = 0.5 *
M_PI - atan(angletan_);
100 halfanglebins_ = round(maxrads_ / minangle_ + 1);
101 anglebins_ = (
unsigned short int)2 * halfanglebins_;
102 oneanglebin_ = maxrads_ / halfanglebins_;
104 maxdeltaAng_ = maxdeltaAngDeg_ * 2 *
M_PI / 360;
109 for (
unsigned short int ab = 0; ab < halfanglebins_; ab++) {
115 for (
unsigned short int ab = halfanglebins_; ab < anglebins_; ab++) {
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_;
133 dtGeo_ = &
geom.get(dtGeomH);
141 LogDebug(
"HoughGrouping") <<
"\nHoughGrouping::run";
146 LogDebug(
"HoughGrouping") <<
"run - Beginning digis' loop...";
150 const DTLayer* lay = dtGeo_->layer((*dtLayerIdIt).first);
152 digiIt != ((*dtLayerIdIt).second).second;
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();
164 LogDebug(
"HoughGrouping") <<
"run - First wire x: "
166 LogDebug(
"HoughGrouping") <<
"run - Last wire x: "
171 if ((*dtLayerIdIt).first.superLayer() == 2)
175 wirePosGlob = lay->
toGlobal(wirePosInLay);
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());
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());
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);
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();
211 hitvec_.push_back({wirePosInChamber.
x() - 1.05, wirePosInChamber.
z()});
212 hitvec_.push_back({wirePosInChamber.
x() + 1.05, wirePosInChamber.
z()});
220 LogDebug(
"HoughGrouping") <<
"\nHoughGrouping::run - nhits: " << nhits_;
221 LogDebug(
"HoughGrouping") <<
"run - idigi: " << idigi_;
224 if (hitvec_.empty()) {
226 LogDebug(
"HoughGrouping") <<
"run - No digis present in this chamber.";
234 maxima_ = getMaximaVector();
235 resetPosElementsOfLinespace();
237 if (maxima_.empty()) {
239 LogDebug(
"HoughGrouping") <<
"run - No good maxima found in this event.";
243 DTChamberId TheChambId(thewheel_, thestation_, thesector_);
244 const DTChamber* TheChamb = dtGeo_->chamber(TheChambId);
245 std::vector<ProtoCand>
cands;
247 for (
unsigned short int ican = 0; ican < maxima_.size(); ican++) {
249 LogDebug(
"HoughGrouping") <<
"\nHoughGrouping::run - Candidate number: " << ican;
250 cands.push_back(associateHits(TheChamb, maxima_.at(ican).first, maxima_.at(ican).second));
254 orderAndFilter(
cands, outMpath);
256 LogDebug(
"HoughGrouping") <<
"run - now we have our muonpaths! It has " << outMpath.size() <<
" elements";
264 LogDebug(
"HoughGrouping") <<
"finish";
273 LogDebug(
"HoughGrouping") <<
"ResetAttributes";
295 for (
unsigned short int abslay = 0; abslay < 8; abslay++)
296 digimap_[abslay].
clear();
301 LogDebug(
"HoughGrouping") <<
"ResetPosElementsOfLinespace";
302 for (
unsigned short int ab = 0; ab < anglebins_; ab++) {
303 linespace_[ab].clear();
310 LogDebug(
"HoughGrouping") <<
"ObtainGeometricalBorders";
326 unsigned short int upsl = thestation_ == 4 ? 3 : 3;
328 LogDebug(
"HoughGrouping") <<
"ObtainGeometricalBorders - uppersuperlayer: " << upsl;
342 spacebins_ = round(
std::abs(xhighlim_ - xlowlim_) / posbinwidth_);
347 LogDebug(
"HoughGrouping") <<
"DoHoughTransform";
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_;
360 double rho = 0,
phi = 0, sbx = 0;
361 double lowinitsb = xlowlim_ + posbinwidth_ / 2;
364 linespace_.resize(anglebins_, std::vector<unsigned short int>(spacebins_));
365 for (
unsigned short int ab = 0; ab < anglebins_; ab++) {
367 for (
unsigned short int sb = 0; sb < spacebins_; sb++) {
369 linespace_[ab][sb] = 0;
375 for (
unsigned short int i = 0;
i < hitvec_.size();
i++) {
376 for (
unsigned short int ab = 0; ab < anglebins_; ab++) {
379 sbx = lowinitsb - posbinwidth_ / 2;
380 for (
unsigned short int sb = 0; sb < spacebins_; sb++) {
382 linespace_[ab][sb]++;
393 LogDebug(
"HoughGrouping") <<
"getMaximaVector";
396 bool flagsearched =
false;
397 unsigned short int numbertolookat = upperNumber_;
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]});
406 if (((numbertolookat - 1) < lowerNumber_) || (!tmpvec.empty()))
412 if (tmpvec.empty()) {
414 LogDebug(
"HoughGrouping") <<
"GetMaximaVector - No maxima could be found";
421 for (
unsigned short int i = 0;
i < finalvec.size();
i++)
422 finalvec.at(
i) = transformPair(finalvec.at(
i));
429 LogDebug(
"HoughGrouping") <<
"transformPair";
431 if (inputpair.first == 0)
432 return {1000, -1000 * inputpair.second};
434 return {-1. /
tan(inputpair.first), inputpair.second /
sin(inputpair.first)};
439 LogDebug(
"HoughGrouping") <<
"findTheMaxima";
440 bool fullyreduced =
false;
441 unsigned short int ind = 0;
443 std::vector<unsigned short int> chosenvec;
448 LogDebug(
"HoughGrouping") <<
"findTheMaxima - prewhile";
449 while (!fullyreduced) {
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_;
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));
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);
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));
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.";
483 LogDebug(
"HoughGrouping") <<
"findTheMaxima - chosenvecsize: " << chosenvec.size();
485 if (chosenvec.empty()) {
486 if (ind + 1 >= (
unsigned short int)inputvec.size())
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))});
491 LogDebug(
"HoughGrouping") <<
"findTheMaxima - - Candidate dropped due to an excess in angle";
497 finalpair = getAveragePoint(inputvec, ind, chosenvec);
500 inputvec.erase(inputvec.begin() + ind);
501 for (
short int j = chosenvec.size() - 1;
j > -1;
j--) {
503 LogDebug(
"HoughGrouping") <<
"findTheMaxima - erasing index: " << chosenvec.at(
j) - 1;
504 inputvec.erase(inputvec.begin() + chosenvec.at(
j) - 1);
508 LogDebug(
"HoughGrouping") <<
"findTheMaxima - inputvec size: " << inputvec.size();
511 if ((finalpair.first <= maxrads_) || (finalpair.first >=
M_PI - maxrads_))
512 resultvec.push_back(finalpair);
514 LogDebug(
"HoughGrouping") <<
"findTheMaxima - - Candidate dropped due to an excess in angle";
516 if (ind + 1 >= (
unsigned short int)inputvec.size())
519 LogDebug(
"HoughGrouping") <<
"findTheMaxima - iteration ends";
523 LogDebug(
"HoughGrouping") <<
"findTheMaxima - postwhile";
529 LogDebug(
"HoughGrouping") <<
"getTwoDelta";
530 return {
abs(get<0>(pair1) - get<0>(pair2)),
abs(get<1>(pair1) - get<1>(pair2))};
535 const std::vector<unsigned short int>& indexlist) {
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)));
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)))));
554 LogDebug(
"HoughGrouping") <<
"associateHits";
555 LocalPoint tmpLocal, AWireLocal, AWireLocalCh, tmpLocalCh, thepoint;
559 double distright = 0;
560 unsigned short int tmpwire = 0;
561 unsigned short int abslay = 0;
564 bool isright =
false;
575 LogDebug(
"HoughGrouping") <<
"associateHits - Beginning SL loop";
576 for (
unsigned short int sl = 1; sl < 3 + 1; sl++) {
580 LogDebug(
"HoughGrouping") <<
"associateHits - SL: " << sl;
582 for (
unsigned short int l = 1;
l < 4 + 1;
l++) {
584 LogDebug(
"HoughGrouping") <<
"associateHits - L: " <<
l;
599 AWireLocalCh = thechamb->
toLocal(AWireGlobal);
600 tmpx = (AWireLocalCh.
z() -
n) /
m;
602 if ((tmpx <= xlowlim_) || (tmpx >= xhighlim_)) {
610 LogDebug(
"HoughGrouping") <<
"associateHits - Wire number: " << tmpwire;
612 LogDebug(
"HoughGrouping") <<
"associateHits - First channel in layer: "
614 if ((digimap_[abslay]).
count(tmpwire)) {
618 tmpLocalCh = thechamb->
toLocal(tmpGlobal);
620 if (
abs(tmpLocalCh.
x() - thepoint.
x()) >= maxDistanceToWire_) {
622 if ((tmpLocalCh.
x() - thepoint.
x()) > 0)
634 else if (lat ==
RIGHT)
639 returnPC.
dtHits_[abslay].setLaterality(lat);
642 LogDebug(
"HoughGrouping") <<
"associateHits - No hit in the crossing cell";
643 if ((digimap_[abslay]).
count(tmpwire - 1))
645 if ((digimap_[abslay]).
count(tmpwire + 1))
648 LogDebug(
"HoughGrouping") <<
"associateHits - There is in the left: " << (
int)isleft;
650 LogDebug(
"HoughGrouping") <<
"associateHits - There is in the right: " << (
int)isright;
652 if ((isleft) && (!isright)) {
655 tmpLocalCh = thechamb->
toLocal(tmpGlobal);
664 }
else if ((!isleft) && (isright)) {
667 tmpLocalCh = thechamb->
toLocal(tmpGlobal);
675 }
else if ((isleft) && (isright)) {
686 distleft =
std::abs(thepoint.
x() - tmpLocalCh_l.
x());
687 distright =
std::abs(thepoint.
x() - tmpLocalCh_r.
x());
697 if (distleft < distright) {
713 setDifferenceBetweenSL(returnPC);
715 LogDebug(
"HoughGrouping") <<
"associateHits - Finishing with the candidate. We have found the following of it:";
717 for (
unsigned short int lay = 0; lay < 8; lay++) {
718 LogDebug(
"HoughGrouping") <<
"associateHits - For absolute layer: " << lay;
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;
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) {
752 LogDebug(
"HoughGrouping") <<
"orderAndFilter";
760 std::vector<unsigned short int> elstoremove;
763 LogDebug(
"HoughGrouping") <<
"orderAndFilter - First ordering";
764 std::sort(invector.begin(), invector.end(), HoughOrdering);
767 unsigned short int ind = 0;
770 LogDebug(
"HoughGrouping") <<
"orderAndFilter - Entering while";
773 LogDebug(
"HoughGrouping") <<
"\nHoughGrouping::orderAndFilter - New iteration with ind: " << ind;
775 for (
unsigned short int i = ind + 1;
i < invector.size();
i++) {
777 LogDebug(
"HoughGrouping") <<
"orderAndFilter - Checking index: " <<
i;
778 for (
unsigned short int lay = 0; lay < 8; lay++) {
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));
788 if (invector.at(
i).dtHits_[lay].laterality() != invector.at(ind).dtHits_[lay].laterality())
789 invector.at(ind).dtHits_[lay].setLaterality(
NONE);
796 <<
"orderAndFilter - Finished checking all the layers, now seeing if we should remove the "
799 if (!areThereEnoughHits(invector.at(
i))) {
801 LogDebug(
"HoughGrouping") <<
"orderAndFilter - This candidate shall be removed!";
802 elstoremove.push_back((
unsigned short int)
i);
807 LogDebug(
"HoughGrouping") <<
"orderAndFilter - We are gonna erase " << elstoremove.size() <<
" elements";
809 for (
short int el = (elstoremove.size() - 1); el > -1; el--) {
810 invector.erase(invector.begin() + elstoremove.at(el));
813 if (ind + 1 == (
unsigned short int)invector.size())
816 std::sort(invector.begin() + ind + 1, invector.end(), HoughOrdering);
821 for (
short int el = (invector.size() - 1); el > -1; el--) {
822 if (!areThereEnoughHits(invector.at(el))) {
823 invector.erase(invector.begin() + el);
827 if (invector.empty()) {
829 LogDebug(
"HoughGrouping") <<
"OrderAndFilter - We do not have candidates with the minimum hits required.";
832 LogDebug(
"HoughGrouping") <<
"OrderAndFilter - At the end, we have only " << invector.size() <<
" good paths!";
835 for (
unsigned short int i = 0;
i < invector.size();
i++) {
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));
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;
848 if (ptrPrimitive[lay]->channelId() != -1)
849 ptrPrimitive[lay]->setChannelId(ptrPrimitive[lay]->channelId() - 1);
851 if (ptrPrimitive[lay]->cameraId() > 0) {
859 auto ptrMuonPath = std::make_shared<MuonPath>(ptrPrimitive, tmplowfill, tmpupfill);
860 outMuonPath.push_back(ptrMuonPath);
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();
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))
883 else if (tupl.
dtHits_[lay].channelId() > 0)
888 LogDebug(
"HoughGrouping") <<
"areThereEnoughHits - Hits in SL1: " << numhitssl1;
890 LogDebug(
"HoughGrouping") <<
"areThereEnoughHits - Hits in SL3: " << numhitssl3;
892 if ((numhitssl1 != 0) && (numhitssl3 != 0)) {
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_));
901 }
else if (allowUncorrelatedPatterns_) {
902 return ((numhitssl1 + numhitssl3) >= minNLayerHits_);