67 unsigned int StopAfter)
const 70 std::vector<recob::Seed> ReturnVector;
73 std::vector<recob::SpacePoint> spts;
78 if (
int(spts.size()) <
fMinPointsInSeed) {
return std::vector<recob::Seed>(); }
86 std::vector<std::vector<std::vector<int>>> OrgHits(3);
87 for (
size_t n = 0;
n != 3; ++
n)
92 std::vector<std::vector<int>> SpacePointsPerHit(HitsFlat.
size(), std::vector<int>());
93 std::vector<std::vector<int>> HitsPerSpacePoint(spts.size(), std::vector<int>());
101 std::vector<char> HitStatus(HitsFlat.
size(), 0);
105 for (
size_t i = 0; i != HitsFlat.
size(); ++i) {
106 OrgHits[HitsFlat.
at(i)->View()][HitsFlat.
at(i)->Channel()].push_back(i);
111 for (
size_t iSP = 0; iSP != spts.size(); ++iSP) {
114 for (
size_t iH = 0; iH != HitsThisSP.
size(); ++iH) {
116 uint32_t ThisChannel = HitsThisSP.
at(iH)->Channel();
117 float ThisTime = HitsThisSP.
at(iH)->PeakTime();
120 for (
size_t iOrg = 0; iOrg != OrgHits[ThisView][ThisChannel].size(); ++iOrg) {
121 if (fabs(ThisTime - HitsFlat.
at(OrgHits[ThisView][ThisChannel][iOrg])->PeakTime()) <
123 SpacePointsPerHit.at(OrgHits[ThisView][ThisChannel][iOrg]).push_back(iSP);
124 HitsPerSpacePoint.at(iSP).push_back(OrgHits[ThisView][ThisChannel][iOrg]);
144 std::vector<char> PointStatus(spts.size(), 0);
146 std::vector<std::map<geo::View_t, std::vector<int>>> WhichHitsPerSeed;
148 bool KeepChopping =
true;
150 while (KeepChopping) {
152 std::vector<int> PointsUsed;
156 FindSeedAtEnd(detProp, spts, PointStatus, PointsUsed, HitsFlat, OrgHits);
163 for (
size_t iP = 0; iP != PointsUsed.size(); ++iP) {
164 for (
size_t iH = 0; iH != HitsPerSpacePoint.at(PointsUsed.at(iP)).
size(); ++iH) {
165 int UsedHitID = HitsPerSpacePoint.at(PointsUsed.at(iP)).at(iH);
166 HitStatus[UsedHitID] = 2;
169 PointStatus[PointsUsed.at(0)] = 1;
170 ConsolidateSeed(detProp, TheSeed, HitsFlat, HitStatus, OrgHits,
false);
175 std::vector<char> HitStatusGood;
177 for (
size_t r = 0;
r != (
unsigned int)
fRefits; ++
r) {
181 HitStatusGood = HitStatus;
183 std::vector<int> PresentHitList;
184 for (
size_t iH = 0; iH != HitStatus.size(); ++iH) {
185 if (HitStatus[iH] == 2) { PresentHitList.push_back(iH); }
187 double pt[3],
dir[3], err[3];
193 std::vector<double> ViewRMS;
194 std::vector<int> HitsPerView;
196 detProp, HitsFlat, PresentHitList, Center, Direction, ViewRMS, HitsPerView);
198 Direction = Direction.Unit() * TheSeed.
GetLength();
200 int nViewsWithHits(0);
201 for (
size_t n = 0;
n != 3; ++
n) {
203 dir[
n] = Direction[
n];
208 if (HitsPerView[
n] > 0) nViewsWithHits++;
211 if (nViewsWithHits < 2) TheSeed.
SetValidity(
false);
220 HitStatus = HitStatusGood;
233 WhichHitsPerSeed.push_back(std::map<
geo::View_t, std::vector<int>>());
236 for (
size_t iH = 0; iH != HitStatus.size(); ++iH) {
237 if (HitStatus.at(iH) == 2) {
238 WhichHitsPerSeed.at(WhichHitsPerSeed.size() - 1)[HitsFlat[iH]->View()].push_back(iH);
240 HitStatus.at(iH) = 1;
242 for (
size_t iSP = 0; iSP != SpacePointsPerHit.at(iH).size(); ++iSP) {
243 PointStatus[SpacePointsPerHit.at(iH).at(iSP)] = 1;
249 ReturnVector.push_back(TheSeed);
250 CataloguedHits.push_back(HitsWithThisSeed);
253 HitsWithThisSeed.
clear();
257 PointStatus.at(PointsUsed.at(0)) = 2;
260 int TotalSPsUsed = 0;
261 for (
size_t i = 0; i != PointStatus.size(); ++i) {
262 if (PointStatus[i] != 0) TotalSPsUsed++;
265 if ((
int(spts.size()) - TotalSPsUsed) <
fMinPointsInSeed) KeepChopping =
false;
267 if ((PointStatus[0] == 3) || (PointStatus.size() == 0)) KeepChopping =
false;
271 if ((ReturnVector.size() >= StopAfter) && (StopAfter > 0))
break;
279 if (ReturnVector.size() == 0) {
280 std::vector<int> ListAllHits;
281 for (
size_t i = 0; i != HitsFlat.
size(); ++i) {
282 ListAllHits.push_back(i);
285 TVector3 SeedCenter(0, 0, 0);
286 TVector3 SeedDirection(0, 0, 0);
288 std::vector<double> ViewRMS;
289 std::vector<int> HitsPerView;
291 std::vector<art::PtrVector<recob::Hit>> HitsInThisCollection(3);
294 detProp, HitsFlat, ListAllHits, SeedCenter, SeedDirection, ViewRMS, HitsPerView);
296 bool ThrowOutSeed =
false;
298 double PtArray[3], DirArray[3];
299 int nViewsWithHits(0);
300 for (
size_t n = 0;
n != 3; ++
n) {
301 PtArray[
n] = SeedCenter[
n];
302 DirArray[
n] = SeedDirection[
n];
303 if (HitsPerView[
n] > 0) nViewsWithHits++;
307 if (nViewsWithHits < 2 || (nViewsWithHits < 3 && !
fAllow2DSeeds)) ThrowOutSeed =
true;
310 ConsolidateSeed(detProp, TheSeed, HitsFlat, HitStatus, OrgHits,
false);
315 for (
size_t i = 0; i != HitStatus.size(); ++i) {
316 if (HitStatus.at(i) == 2) ListAllHits.push_back(i);
318 std::vector<int> HitsPerView;
320 detProp, HitsFlat, ListAllHits, SeedCenter, SeedDirection, ViewRMS, HitsPerView);
322 int nViewsWithHits(0);
323 for (
size_t n = 0;
n != 3; ++
n) {
324 PtArray[
n] = SeedCenter[
n];
325 DirArray[
n] = SeedDirection[
n];
327 if (HitsPerView[
n] > 0) nViewsWithHits++;
330 if (nViewsWithHits < 2 || (nViewsWithHits < 3 && !
fAllow2DSeeds)) ThrowOutSeed =
true;
336 if (
fMaxViewRMS.at(j) < ViewRMS.at(j)) { ThrowOutSeed =
true; }
341 if ((!ThrowOutSeed) && (TheSeed.
IsValid())) {
342 ReturnVector.push_back(TheSeed);
344 for (
size_t i = 0; i != ListAllHits.size(); ++i) {
345 HitsThisSeed.
push_back(HitsFlat.
at(ListAllHits.at(i)));
347 CataloguedHits.push_back(HitsThisSeed);
352 SpacePointsPerHit.clear();
353 HitsPerSpacePoint.clear();
358 for (
size_t i = 0; i != ReturnVector.size(); ++i) {
359 double CrazyValue = 1000000;
360 double Length = ReturnVector.at(i).GetLength();
361 if (!((Length >
fLengthCut) && (Length < CrazyValue))) {
362 ReturnVector.erase(ReturnVector.begin() + i);
363 CataloguedHits.erase(CataloguedHits.begin() + i);
378 std::vector<char>& HitStatus,
383 bool ThrowOutSeed =
false;
386 std::map<geo::View_t, std::map<uint32_t, std::vector<int>>> HitsInThisSeed;
388 int NHitsThisSeed = 0;
390 double MinS = 1000, MaxS = -1000;
391 for (
size_t i = 0; i != HitStatus.size(); ++i) {
392 if (HitStatus.at(i) == 2) {
402 if (s < MinS) MinS = s;
403 if (s > MaxS) MaxS = s;
404 HitsInThisSeed[HitsFlat.
at(i)->View()][HitsFlat.
at(i)->Channel()].push_back(i);
409 double LengthRescale = (MaxS - MinS) / 2.;
410 double PositionShift = (MaxS + MinS) / 2.;
412 double pt[3],
dir[3], err[3];
416 for (
size_t n = 0;
n != 3; ++
n) {
417 pt[
n] += dir[
n] * PositionShift;
418 dir[
n] *= LengthRescale;
425 for (
auto itP = HitsInThisSeed.begin(); itP != HitsInThisSeed.end(); ++itP) {
428 uint32_t LowestChan = itP->second.begin()->first;
429 uint32_t HighestChan = itP->second.rbegin()->first;
430 for (uint32_t c = LowestChan; c != HighestChan; ++c) {
431 for (
size_t h = 0; h != OrgHits[View][c].size(); ++h) {
432 if (HitStatus[OrgHits[View][c].at(h)] == 0) {
437 HitStatus[OrgHits[View][c].at(h)] = 2;
439 HitsInThisSeed[View][c].push_back(OrgHits[View][c].at(h));
442 HitStatus[OrgHits[View][c].at(h)] = 0;
448 if (NHitsThisSeed == 0) ThrowOutSeed =
true;
452 uint32_t LowestChanInSeed[3], HighestChanInSeed[3];
453 double Occupancy[] = {0., 0., 0.};
454 int nHitsPerView[] = {0, 0, 0};
456 for (
auto itP = HitsInThisSeed.begin(); itP != HitsInThisSeed.end(); ++itP) {
460 LowestChanInSeed[View] = itP->second.begin()->first;
461 HighestChanInSeed[View] = itP->second.rbegin()->first;
463 nHitsPerView[View]++;
465 int FilledChanCount = 0;
467 for (
size_t c = LowestChanInSeed[View]; c != HighestChanInSeed[View]; ++c) {
468 if (itP->second[c].size() > 0) ++FilledChanCount;
472 float(FilledChanCount) / float(HighestChanInSeed[View] - LowestChanInSeed[View]);
476 int nViewsWithHits(0);
477 for (
size_t n = 0;
n != 3; ++
n) {
479 if (nHitsPerView[
n] > 0) nViewsWithHits++;
486 if (nBelowCut > belowCut) ThrowOutSeed =
true;
488 if ((Extend) && (!ThrowOutSeed)) {
489 std::vector<std::vector<double>> ToAddNegativeS(3, std::vector<double>());
490 std::vector<std::vector<double>> ToAddPositiveS(3, std::vector<double>());
491 std::vector<std::vector<int>> ToAddNegativeH(3, std::vector<int>());
492 std::vector<std::vector<int>> ToAddPositiveH(3, std::vector<int>());
494 for (
auto itP = HitsInThisSeed.begin(); itP != HitsInThisSeed.end(); ++itP) {
499 if (LowestChanInSeed[View] > 0) {
500 for (uint32_t c = LowestChanInSeed[View] - 1; c != 0; --c) {
501 bool GotOneThisChannel =
false;
502 for (
size_t h = 0; h != OrgHits[View][c].size(); ++h) {
503 if (HitStatus[OrgHits[View][c][h]] == 0) {
506 GotOneThisChannel =
true;
508 ToAddNegativeS[View].push_back(s);
509 ToAddNegativeH[View].push_back(OrgHits[View][c].at(h));
512 ToAddPositiveS[View].push_back(s);
513 ToAddPositiveH[View].push_back(OrgHits[View][c].at(h));
518 if (GotOneThisChannel ==
false)
break;
523 for (uint32_t c = HighestChanInSeed[View] + 1; c !=
fNChannels; ++c) {
524 bool GotOneThisChannel =
false;
525 for (
size_t h = 0; h != OrgHits[View][c].size(); ++h) {
526 if (HitStatus[OrgHits[View][c][h]] == 0) {
529 GotOneThisChannel =
true;
532 ToAddNegativeS[View].push_back(s);
533 ToAddNegativeH[View].push_back(OrgHits[View][c].at(h));
536 ToAddPositiveS[View].push_back(s);
537 ToAddPositiveH[View].push_back(OrgHits[View][c].at(h));
542 if (GotOneThisChannel ==
false)
break;
546 double ExtendPositiveS = 0, ExtendNegativeS = 0;
548 if ((ToAddPositiveS[0].
size() > 0) && (ToAddPositiveS[1].
size() > 0) &&
549 (ToAddPositiveS[2].
size() > 0)) {
550 for (
size_t n = 0;
n != 3; ++
n) {
551 int n1 = (
n + 1) % 3;
552 int n2 = (
n + 2) % 3;
554 if ((ToAddPositiveS[
n].back() <= ToAddPositiveS[n1].back()) &&
555 (ToAddPositiveS[
n].back() <= ToAddPositiveS[n2].back())) {
556 ExtendPositiveS = ToAddPositiveS[
n].back();
561 if ((ToAddNegativeS[0].
size() > 0) && (ToAddNegativeS[1].
size() > 0) &&
562 (ToAddNegativeS[2].
size() > 0)) {
563 for (
size_t n = 0;
n != 3; ++
n) {
564 int n1 = (
n + 1) % 3;
565 int n2 = (
n + 2) % 3;
566 if ((ToAddNegativeS[
n].back() >= ToAddNegativeS[n1].back()) &&
567 (ToAddNegativeS[
n].back() >= ToAddNegativeS[n2].back())) {
568 ExtendNegativeS = ToAddNegativeS[
n].back();
573 if (fabs(ExtendNegativeS) < 1.) ExtendNegativeS = -1.;
574 if (fabs(ExtendPositiveS) < 1.) ExtendPositiveS = 1.;
576 LengthRescale = (ExtendPositiveS - ExtendNegativeS) / 2.;
577 PositionShift = (ExtendPositiveS + ExtendNegativeS) / 2.;
579 for (
size_t n = 0;
n != 3; ++
n) {
580 pt[
n] += dir[
n] * PositionShift;
581 dir[
n] *= LengthRescale;
583 for (
size_t i = 0; i != ToAddPositiveS[
n].size(); ++i) {
584 if (ToAddPositiveS[
n].at(i) < ExtendPositiveS)
585 HitStatus[ToAddPositiveH[
n].at(i)] = 2;
587 HitStatus[ToAddPositiveH[
n].at(i)] = 0;
590 for (
size_t i = 0; i != ToAddNegativeS[
n].size(); ++i) {
591 if (ToAddNegativeS[
n].at(i) > ExtendNegativeS)
592 HitStatus[ToAddNegativeH[
n].at(i)] = 2;
594 HitStatus[ToAddNegativeH[
n].at(i)] = 0;
615 double xyzStart[3], xyzEnd[3];
626 double HitWidth = HitXHigh - HitXLow;
628 double pt[3],
dir[3], err[3];
633 TVector3 sPt(pt[0], pt[1], pt[2]);
634 TVector3 sDir(dir[0], dir[1], dir[2]);
635 TVector3 hPt(HitX, xyzStart[1], xyzStart[2]);
636 TVector3 hDir(0, xyzStart[1] - xyzEnd[1], xyzStart[2] - xyzEnd[2]);
638 s = (sPt - hPt).Dot(hDir * (hDir.Dot(sDir)) - sDir * (hDir.Dot(hDir))) /
639 (hDir.Dot(hDir) * sDir.Dot(sDir) - pow(hDir.Dot(sDir), 2));
641 disp = fabs((sPt - hPt).Dot(sDir.Cross(hDir)) / (sDir.Cross(hDir)).Mag()) / HitWidth;
650 std::vector<recob::SpacePoint>
const& Points,
651 std::vector<char>& PointStatus,
652 std::vector<int>& PointsInRange,
660 std::vector<recob::SpacePoint> PointsUsed;
663 PointsInRange.clear();
666 TVector3 HighestZPoint;
667 bool NoPointFound =
true;
668 int counter = Points.size() - 1;
669 while ((NoPointFound ==
true) && (counter >= 0)) {
670 if (PointStatus[counter] == 0) {
671 HighestZPoint = TVector3(
672 Points.at(counter).XYZ()[0], Points.at(counter).XYZ()[1], Points.at(counter).XYZ()[2]);
673 NoPointFound =
false;
690 for (
int index = Points.size() - 1; index != -1; --index) {
691 if (PointStatus[index] == 0) {
694 if ((HighestZPoint[2] - Points.at(index).XYZ()[2]) < TwiceLength) {
695 double DistanceToHighZ = pow(pow(HighestZPoint[1] - Points.at(index).XYZ()[1], 2) +
696 pow(HighestZPoint[2] - Points.at(index).XYZ()[2], 2),
698 if (DistanceToHighZ < TwiceLength) {
699 PointsInRange.push_back(index);
700 PointsUsed.push_back(Points.at(index));
708 TVector3 SeedCenter(0, 0, 0);
709 TVector3 SeedDirection(0, 0, 0);
713 int NPoints = PointsInRange.size();
717 std::map<int, bool>
HitMap;
720 for (
unsigned int i = 0; i != PointsInRange.size(); i++) {
721 std::vector<art::PtrVector<recob::Hit>> HitsInThisCollection(3);
726 itHit != HitsThisSP.
end();
728 uint32_t Channel = (*itHit)->Channel();
732 for (
size_t iH = 0; iH != OrgHits[View][Channel].size(); ++iH) {
733 if (fabs(HitsFlat[OrgHits[View][Channel][iH]]->PeakTime() - (*itHit)->PeakTime()) < eta) {
734 HitMap[OrgHits[View][Channel][iH]] =
true;
740 for (
auto itH = HitMap.begin(); itH != HitMap.end(); ++itH) {
741 HitList.push_back(itH->first);
744 std::vector<double> ViewRMS;
745 std::vector<int> HitsPerView;
748 detProp, HitsFlat, HitList, SeedCenter, SeedDirection, ViewRMS, HitsPerView);
755 bool ThrowOutSeed =
false;
757 double PtArray[3], DirArray[3];
759 pow(pow(SeedDirection.Y(), 2) + pow(SeedDirection.Z(), 2), 0.5) / SeedDirection.Mag();
761 int nViewsWithHits(0);
763 for (
size_t n = 0;
n != 3; ++
n) {
765 PtArray[
n] = SeedCenter[
n];
766 if (HitsPerView[
n] > 0) nViewsWithHits++;
769 if (nViewsWithHits < 2 || (nViewsWithHits < 3 && !
fAllow2DSeeds)) ThrowOutSeed =
true;
776 if (
fMaxViewRMS.at(j) < ViewRMS.at(j)) { ThrowOutSeed =
true; }
793 std::vector<int>& HitsToUse,
796 std::vector<double>& ViewRMS,
797 std::vector<int>& N)
const 801 std::map<uint32_t, bool> HitsClaimed;
805 std::vector<std::vector<double>> HitTimes(3);
806 std::vector<std::vector<double>> HitWires(3);
807 std::vector<std::vector<double>> HitWidths(3);
808 std::vector<double> MeanWireCoord(3, 0);
809 std::vector<double> MeanTimeCoord(3, 0);
813 std::vector<double>
x(3, 0),
y(3, 0),
xx(3, 0), xy(3, 0), yy(3, 0), sig(3, 0);
815 for (
size_t i = 0; i != HitsToUse.size(); ++i) {
816 auto itHit = HitsFlat.
begin() + HitsToUse[i];
820 auto const hitView = (*itHit)->View();
832 double WireCoord = (*itHit)->WireID().Wire *
fPitches.at(ViewIndex);
833 double TimeCoord = detProp.
ConvertTicksToX((*itHit)->PeakTime(), ViewIndex, 0, 0);
834 double TimeUpper = detProp.
ConvertTicksToX((*itHit)->PeakTimePlusRMS(), ViewIndex, 0, 0);
835 double TimeLower = detProp.
ConvertTicksToX((*itHit)->PeakTimeMinusRMS(), ViewIndex, 0, 0);
836 double Width = fabs(0.5 * (TimeUpper - TimeLower));
837 double Width2 = pow(Width, 2);
839 HitWires.at(ViewIndex).push_back(WireCoord);
840 HitTimes.at(ViewIndex).push_back(TimeCoord);
841 HitWidths.at(ViewIndex).push_back(fabs(0.5 * (TimeUpper - TimeLower)));
843 MeanWireCoord.at(ViewIndex) += WireCoord;
844 MeanTimeCoord.at(ViewIndex) += TimeCoord;
847 x.at(ViewIndex) += WireCoord / Width2;
848 y.at(ViewIndex) += TimeCoord / Width2;
849 xy.at(ViewIndex) += (TimeCoord * WireCoord) / Width2;
850 xx.at(ViewIndex) += (WireCoord * WireCoord) / Width2;
851 yy.at(ViewIndex) += (TimeCoord * TimeCoord) / Width2;
852 sig.at(ViewIndex) += 1. / Width2;
858 std::vector<double> ViewGrad(3);
859 std::vector<double> ViewOffset(3);
861 for (
size_t n = 0;
n != 3; ++
n) {
862 MeanWireCoord[
n] /= N[
n];
863 MeanTimeCoord[
n] /= N[
n];
865 double BigN = 1000000;
866 double SmallN = 1. / BigN;
869 double Numerator = (
y[
n] / sig[
n] - xy[
n] /
x[
n]);
870 double Denominator = (
x[
n] / sig[
n] -
xx[
n] /
x[
n]);
871 if (fabs(Denominator) > SmallN)
872 ViewGrad.at(
n) = Numerator / Denominator;
877 ViewGrad[
n] = xy[
n] /
xx[
n];
881 ViewOffset.at(
n) = (
y[
n] - ViewGrad[
n] *
x[
n]) / sig[
n];
882 ViewRMS.at(
n) = pow((yy[
n] + pow(ViewGrad[
n], 2) *
xx[n] + pow(ViewOffset[n], 2) * sig[n] -
883 2 * ViewGrad[n] * xy[n] - 2 * ViewOffset[n] *
y[n] +
884 2 * ViewGrad[n] * ViewOffset[n] *
x[n]) /
888 if (ViewGrad.at(n) != 0) ViewRMS[n] *= sin(atan(1. / ViewGrad.at(n)));
891 for (
size_t n = 0;
n != 3; ++
n) {
892 size_t n1 = (
n + 1) % 3;
893 size_t n2 = (
n + 2) % 3;
894 if ((N[
n] <= N[n1]) && (N[
n] <= N[n2])) {
896 if (N[n1] < N[n2]) { std::swap(n1, n2); }
897 if ((N[n1] == 0) || (N[n2] == 0))
continue;
913 double TimeCoord = 0.5 * (MeanTimeCoord[n1] + MeanTimeCoord[n2]);
914 double WireCoordIn1 = (TimeCoord - ViewOffset[n1]) / ViewGrad[n1] +
fWireZeroOffset[n1];
915 double WireCoordIn2 = (TimeCoord - ViewOffset[n2]) / ViewGrad[n2] +
fWireZeroOffset[n2];
921 ViewRMS[
n] = -fabs(ViewRMS[
n]);
922 ViewRMS[n1] = fabs(ViewRMS[n1]);
923 ViewRMS[n2] = fabs(ViewRMS[n2]);
945 fXDir = TVector3(1, 0, 0);
946 fYDir = TVector3(0, 1, 0);
947 fZDir = TVector3(0, 0, 1);
953 double xyzStart1[3], xyzStart2[3];
954 double xyzEnd1[3], xyzEnd2[3];
957 for (
unsigned int n = 0;
n != 3u; ++
n) {
961 TVector3(xyzEnd1[0] - xyzStart1[0], xyzEnd1[1] - xyzStart1[1], xyzEnd1[2] - xyzStart1[2])
965 xyzEnd2[0] - xyzEnd1[0], xyzEnd2[1] - xyzEnd1[1], xyzEnd2[2] - xyzEnd1[2])) < 0)
980 unsigned int StopAfter)
const 982 return FindSeeds(clockData, detProp, Hits, HitCatalogue, StopAfter);
992 unsigned int StopAfter)
const 995 std::vector<std::vector<recob::Seed>> ReturnVec;
1002 <<
"Warning: SpacePointAlg is does not have three views enabled. This may cause unexpected " 1003 "behaviour in the bezier tracker.";
1007 SortedHits.at(
geo::kU).begin();
1008 itU != SortedHits.at(
geo::kU).end();
1011 SortedHits.at(
geo::kV).begin();
1012 itV != SortedHits.at(
geo::kV).end();
1015 SortedHits.at(
geo::kW).begin();
1016 itW != SortedHits.at(
geo::kW).end();
1021 for (
size_t i = 0; i != itU->size(); ++i)
1022 HitsThisComboFlat.
push_back(itU->at(i));
1025 for (
size_t i = 0; i != itV->size(); ++i)
1026 HitsThisComboFlat.
push_back(itV->at(i));
1029 for (
size_t i = 0; i != itW->size(); ++i)
1030 HitsThisComboFlat.
push_back(itW->at(i));
1032 std::vector<art::PtrVector<recob::Hit>> CataloguedHits;
1034 std::vector<recob::Seed> Seeds =
1035 FindSeeds(clockData, detProp, HitsThisComboFlat, CataloguedHits, StopAfter);
1038 HitsPerSeed.push_back(CataloguedHits);
1039 ReturnVec.push_back(Seeds);
1042 CataloguedHits.clear();
1048 <<
" bailed during hit map lookup - have you enabled all 3 planes?";
1049 ReturnVec.push_back(std::vector<recob::Seed>());
std::vector< double > fPitches
float Length(const PFPStruct &pfp)
SeedFinderAlgorithm(const fhicl::ParameterSet &pset)
bool enableW() const noexcept
bool enableV() const noexcept
static std::string ViewName(geo::View_t view)
Returns the name of the specified view.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Declaration of signal hit object.
void GetPoint(double *Pt, double *Err) const
void CalculateGeometricalElements()
The data type to uniquely identify a Plane.
void GetHitDistAndProj(detinfo::DetectorPropertiesData const &detProp, recob::Seed const &ASeed, art::Ptr< recob::Hit > const &AHit, double &disp, double &s) const
void reconfigure(fhicl::ParameterSet const &pset)
geo::WireID const & WireID() const
Initial tdc tick for hit.
recob::Seed FindSeedAtEnd(detinfo::DetectorPropertiesData const &detProp, std::vector< recob::SpacePoint > const &, std::vector< char > &, std::vector< int > &, art::PtrVector< recob::Hit > const &HitsFlat, std::vector< std::vector< std::vector< int >>> &OrgHits) const
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
void ConsolidateSeed(detinfo::DetectorPropertiesData const &detProp, recob::Seed &TheSeed, art::PtrVector< recob::Hit > const &, std::vector< char > &HitStatus, std::vector< std::vector< std::vector< int >>> &OrgHits, bool Extend) const
std::map< int, art::Ptr< recob::Hit > > HitMap
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
typename data_t::const_iterator const_iterator
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
void SetPoint(double *Pt, double *Err)
void push_back(Ptr< U > const &p)
void makeSpacePoints(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
T get(std::string const &key) const
void GetCenterAndDirection(detinfo::DetectorPropertiesData const &detProp, art::PtrVector< recob::Hit > const &HitsFlat, std::vector< int > &HitsToUse, TVector3 &Center, TVector3 &Direction, std::vector< double > &ViewRMS, std::vector< int > &HitsPerView) const
reference at(size_type n)
The data type to uniquely identify a TPC.
PlaneID_t Plane
Index of the plane within its TPC.
std::vector< recob::Seed > FindSeeds(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, art::PtrVector< recob::Hit > const &HitsFlat, std::vector< art::PtrVector< recob::Hit >> &CataloguedHits, unsigned int StopAfter) const
float PeakTimeMinusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
std::vector< recob::Seed > GetSeedsFromUnSortedHits(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, art::PtrVector< recob::Hit > const &, std::vector< art::PtrVector< recob::Hit >> &, unsigned int StopAfter=0) const
double ConvertTicksToX(double ticks, int p, int t, int c) const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
float PeakTime() const
Time of the signal peak, in tick units.
Encapsulate the construction of a single detector plane.
Contains all timing reference information for the detector.
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
bool enableU() const noexcept
std::vector< TVector3 > fWireDir
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< TVector3 > fPitchDir
Planes which measure W (third view for Bo, MicroBooNE, etc).
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
Algorithm for generating space points from hits.
std::set< art::Ptr< recob::Hit > > HitList
void SetValidity(bool Validity)
std::vector< std::vector< recob::Seed > > GetSeedsFromSortedHits(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< std::vector< art::PtrVector< recob::Hit >>> const &SortedHits, std::vector< std::vector< art::PtrVector< recob::Hit >>> &HitsPerSeed, unsigned int StopAfter=0) const
void GetDirection(double *Dir, double *Err) const
Length_t WirePitch(PlaneID const &planeid=plane_zero) const
Returns the distance between two consecutive wires.
std::vector< double > fWireZeroOffset
art framework interface to geometry description
void WireEndPoints(WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
void SetDirection(double *Dir, double *Err)
std::vector< double > fMaxViewRMS