59 std::vector<recob::Seed>
64 unsigned int StopAfter)
const 67 std::vector<recob::Seed> ReturnVector;
70 std::vector<recob::SpacePoint> spts;
75 if (
int(spts.size()) <
fMinPointsInSeed) {
return std::vector<recob::Seed>(); }
83 std::vector<std::vector<std::vector<int>>> OrgHits(3);
84 for (
size_t n = 0;
n != 3; ++
n)
89 std::vector<std::vector<int>> SpacePointsPerHit(HitsFlat.
size(), std::vector<int>());
90 std::vector<std::vector<int>> HitsPerSpacePoint(spts.size(), std::vector<int>());
98 std::vector<char> HitStatus(HitsFlat.
size(), 0);
102 for (
size_t i = 0; i != HitsFlat.
size(); ++i) {
103 OrgHits[HitsFlat.
at(i)->View()][HitsFlat.
at(i)->Channel()].push_back(i);
108 for (
size_t iSP = 0; iSP != spts.size(); ++iSP) {
111 for (
size_t iH = 0; iH != HitsThisSP.
size(); ++iH) {
113 uint32_t ThisChannel = HitsThisSP.
at(iH)->Channel();
114 float ThisTime = HitsThisSP.
at(iH)->PeakTime();
117 for (
size_t iOrg = 0; iOrg != OrgHits[ThisView][ThisChannel].size(); ++iOrg) {
118 if (fabs(ThisTime - HitsFlat.
at(OrgHits[ThisView][ThisChannel][iOrg])->PeakTime()) <
120 SpacePointsPerHit.at(OrgHits[ThisView][ThisChannel][iOrg]).push_back(iSP);
121 HitsPerSpacePoint.at(iSP).push_back(OrgHits[ThisView][ThisChannel][iOrg]);
141 std::vector<char> PointStatus(spts.size(), 0);
143 std::vector<std::map<geo::View_t, std::vector<int>>> WhichHitsPerSeed;
145 bool KeepChopping =
true;
147 while (KeepChopping) {
149 std::vector<int> PointsUsed;
153 FindSeedAtEnd(detProp, spts, PointStatus, PointsUsed, HitsFlat, OrgHits);
160 for (
size_t iP = 0; iP != PointsUsed.size(); ++iP) {
161 for (
size_t iH = 0; iH != HitsPerSpacePoint.at(PointsUsed.at(iP)).
size(); ++iH) {
162 int UsedHitID = HitsPerSpacePoint.at(PointsUsed.at(iP)).at(iH);
163 HitStatus[UsedHitID] = 2;
166 PointStatus[PointsUsed.at(0)] = 1;
167 ConsolidateSeed(detProp, TheSeed, HitsFlat, HitStatus, OrgHits,
false);
172 std::vector<char> HitStatusGood;
178 HitStatusGood = HitStatus;
180 std::vector<int> PresentHitList;
181 for (
size_t iH = 0; iH != HitStatus.size(); ++iH) {
182 if (HitStatus[iH] == 2) { PresentHitList.push_back(iH); }
184 double pt[3],
dir[3],
err[3];
190 std::vector<double> ViewRMS;
191 std::vector<int> HitsPerView;
193 detProp, HitsFlat, PresentHitList, Center, Direction, ViewRMS, HitsPerView);
195 Direction = Direction.Unit() * TheSeed.
GetLength();
197 int nViewsWithHits(0);
198 for (
size_t n = 0;
n != 3; ++
n) {
200 dir[
n] = Direction[
n];
205 if (HitsPerView[
n] > 0) nViewsWithHits++;
208 if (nViewsWithHits < 2) TheSeed.
SetValidity(
false);
217 HitStatus = HitStatusGood;
230 WhichHitsPerSeed.push_back(std::map<
geo::View_t, std::vector<int>>());
233 for (
size_t iH = 0; iH != HitStatus.size(); ++iH) {
234 if (HitStatus.at(iH) == 2) {
235 WhichHitsPerSeed.at(WhichHitsPerSeed.size() - 1)[HitsFlat[iH]->
View()].push_back(iH);
237 HitStatus.at(iH) = 1;
239 for (
size_t iSP = 0; iSP != SpacePointsPerHit.at(iH).size(); ++iSP) {
240 PointStatus[SpacePointsPerHit.at(iH).at(iSP)] = 1;
246 ReturnVector.push_back(TheSeed);
247 CataloguedHits.push_back(HitsWithThisSeed);
250 HitsWithThisSeed.
clear();
254 PointStatus.at(PointsUsed.at(0)) = 2;
257 int TotalSPsUsed = 0;
258 for (
size_t i = 0; i != PointStatus.size(); ++i) {
259 if (PointStatus[i] != 0) TotalSPsUsed++;
262 if ((
int(spts.size()) - TotalSPsUsed) <
fMinPointsInSeed) KeepChopping =
false;
264 if ((PointStatus[0] == 3) || (PointStatus.size() == 0)) KeepChopping =
false;
268 if ((ReturnVector.size() >= StopAfter) && (StopAfter > 0))
break;
276 if (ReturnVector.size() == 0) {
277 std::vector<int> ListAllHits;
278 for (
size_t i = 0; i != HitsFlat.
size(); ++i) {
279 ListAllHits.push_back(i);
282 TVector3 SeedCenter(0, 0, 0);
283 TVector3 SeedDirection(0, 0, 0);
285 std::vector<double> ViewRMS;
286 std::vector<int> HitsPerView;
288 std::vector<art::PtrVector<recob::Hit>> HitsInThisCollection(3);
291 detProp, HitsFlat, ListAllHits, SeedCenter, SeedDirection, ViewRMS, HitsPerView);
293 bool ThrowOutSeed =
false;
295 double PtArray[3], DirArray[3];
296 int nViewsWithHits(0);
297 for (
size_t n = 0;
n != 3; ++
n) {
298 PtArray[
n] = SeedCenter[
n];
299 DirArray[
n] = SeedDirection[
n];
300 if (HitsPerView[
n] > 0) nViewsWithHits++;
304 if (nViewsWithHits < 2 || (nViewsWithHits < 3 && !
fAllow2DSeeds)) ThrowOutSeed =
true;
307 ConsolidateSeed(detProp, TheSeed, HitsFlat, HitStatus, OrgHits,
false);
312 for (
size_t i = 0; i != HitStatus.size(); ++i) {
313 if (HitStatus.at(i) == 2) ListAllHits.push_back(i);
315 std::vector<int> HitsPerView;
317 detProp, HitsFlat, ListAllHits, SeedCenter, SeedDirection, ViewRMS, HitsPerView);
319 int nViewsWithHits(0);
320 for (
size_t n = 0;
n != 3; ++
n) {
321 PtArray[
n] = SeedCenter[
n];
322 DirArray[
n] = SeedDirection[
n];
324 if (HitsPerView[
n] > 0) nViewsWithHits++;
327 if (nViewsWithHits < 2 || (nViewsWithHits < 3 && !
fAllow2DSeeds)) ThrowOutSeed =
true;
333 if (
fMaxViewRMS.at(j) < ViewRMS.at(j)) { ThrowOutSeed =
true; }
338 if ((!ThrowOutSeed) && (TheSeed.
IsValid())) {
339 ReturnVector.push_back(TheSeed);
341 for (
size_t i = 0; i != ListAllHits.size(); ++i) {
342 HitsThisSeed.
push_back(HitsFlat.
at(ListAllHits.at(i)));
344 CataloguedHits.push_back(HitsThisSeed);
349 SpacePointsPerHit.clear();
350 HitsPerSpacePoint.clear();
355 for (
size_t i = 0; i != ReturnVector.size(); ++i) {
356 double CrazyValue = 1000000;
357 double Length = ReturnVector.at(i).GetLength();
358 if (!((Length >
fLengthCut) && (Length < CrazyValue))) {
359 ReturnVector.erase(ReturnVector.begin() + i);
360 CataloguedHits.erase(CataloguedHits.begin() + i);
376 std::vector<char>& HitStatus,
381 bool ThrowOutSeed =
false;
384 std::map<geo::View_t, std::map<uint32_t, std::vector<int>>> HitsInThisSeed;
386 int NHitsThisSeed = 0;
388 double MinS = 1000, MaxS = -1000;
389 for (
size_t i = 0; i != HitStatus.size(); ++i) {
390 if (HitStatus.at(i) == 2) {
400 if (s < MinS) MinS =
s;
401 if (s > MaxS) MaxS =
s;
402 HitsInThisSeed[HitsFlat.
at(i)->View()][HitsFlat.
at(i)->Channel()].push_back(i);
407 double LengthRescale = (MaxS - MinS) / 2.;
408 double PositionShift = (MaxS + MinS) / 2.;
410 double pt[3],
dir[3],
err[3];
414 for (
size_t n = 0;
n != 3; ++
n) {
415 pt[
n] += dir[
n] * PositionShift;
416 dir[
n] *= LengthRescale;
423 for (
auto itP = HitsInThisSeed.begin(); itP != HitsInThisSeed.end(); ++itP) {
426 uint32_t LowestChan = itP->second.begin()->first;
427 uint32_t HighestChan = itP->second.rbegin()->first;
428 for (uint32_t
c = LowestChan;
c != HighestChan; ++
c) {
429 for (
size_t h = 0;
h != OrgHits[
View][
c].size(); ++
h) {
430 if (HitStatus[OrgHits[View][
c].at(
h)] == 0) {
435 HitStatus[OrgHits[
View][
c].at(
h)] = 2;
437 HitsInThisSeed[
View][
c].push_back(OrgHits[View][
c].at(
h));
440 HitStatus[OrgHits[
View][
c].at(
h)] = 0;
446 if (NHitsThisSeed == 0) ThrowOutSeed =
true;
450 uint32_t LowestChanInSeed[3], HighestChanInSeed[3];
451 double Occupancy[] = {0., 0., 0.};
452 int nHitsPerView[] = {0, 0, 0};
454 for (
auto itP = HitsInThisSeed.begin(); itP != HitsInThisSeed.end(); ++itP) {
458 LowestChanInSeed[
View] = itP->second.begin()->first;
459 HighestChanInSeed[
View] = itP->second.rbegin()->first;
461 nHitsPerView[
View]++;
463 int FilledChanCount = 0;
465 for (
size_t c = LowestChanInSeed[View];
c != HighestChanInSeed[
View]; ++
c) {
466 if (itP->second[
c].size() > 0) ++FilledChanCount;
470 float(FilledChanCount) /
float(HighestChanInSeed[View] - LowestChanInSeed[View]);
474 int nViewsWithHits(0);
475 for (
size_t n = 0;
n != 3; ++
n) {
477 if (nHitsPerView[
n] > 0) nViewsWithHits++;
484 if (nBelowCut > belowCut) ThrowOutSeed =
true;
486 if ((Extend) && (!ThrowOutSeed)) {
487 std::vector<std::vector<double>> ToAddNegativeS(3, std::vector<double>());
488 std::vector<std::vector<double>> ToAddPositiveS(3, std::vector<double>());
489 std::vector<std::vector<int>> ToAddNegativeH(3, std::vector<int>());
490 std::vector<std::vector<int>> ToAddPositiveH(3, std::vector<int>());
492 for (
auto itP = HitsInThisSeed.begin(); itP != HitsInThisSeed.end(); ++itP) {
497 if (LowestChanInSeed[View] > 0) {
498 for (uint32_t
c = LowestChanInSeed[View] - 1;
c != 0; --
c) {
499 bool GotOneThisChannel =
false;
500 for (
size_t h = 0;
h != OrgHits[
View][
c].size(); ++
h) {
501 if (HitStatus[OrgHits[View][
c][
h]] == 0) {
504 GotOneThisChannel =
true;
506 ToAddNegativeS[
View].push_back(s);
507 ToAddNegativeH[
View].push_back(OrgHits[View][
c].at(
h));
510 ToAddPositiveS[
View].push_back(s);
511 ToAddPositiveH[
View].push_back(OrgHits[View][
c].at(
h));
516 if (GotOneThisChannel ==
false)
break;
521 for (uint32_t
c = HighestChanInSeed[View] + 1;
c !=
fNChannels; ++
c) {
522 bool GotOneThisChannel =
false;
523 for (
size_t h = 0;
h != OrgHits[
View][
c].size(); ++
h) {
524 if (HitStatus[OrgHits[View][
c][
h]] == 0) {
527 GotOneThisChannel =
true;
530 ToAddNegativeS[
View].push_back(s);
531 ToAddNegativeH[
View].push_back(OrgHits[View][
c].at(
h));
534 ToAddPositiveS[
View].push_back(s);
535 ToAddPositiveH[
View].push_back(OrgHits[View][
c].at(
h));
540 if (GotOneThisChannel ==
false)
break;
544 double ExtendPositiveS = 0, ExtendNegativeS = 0;
546 if ((ToAddPositiveS[0].
size() > 0) && (ToAddPositiveS[1].
size() > 0) &&
547 (ToAddPositiveS[2].
size() > 0)) {
548 for (
size_t n = 0;
n != 3; ++
n) {
549 int n1 = (
n + 1) % 3;
550 int n2 = (
n + 2) % 3;
552 if ((ToAddPositiveS[
n].back() <= ToAddPositiveS[n1].back()) &&
553 (ToAddPositiveS[
n].back() <= ToAddPositiveS[n2].back())) {
554 ExtendPositiveS = ToAddPositiveS[
n].back();
559 if ((ToAddNegativeS[0].
size() > 0) && (ToAddNegativeS[1].
size() > 0) &&
560 (ToAddNegativeS[2].
size() > 0)) {
561 for (
size_t n = 0;
n != 3; ++
n) {
562 int n1 = (
n + 1) % 3;
563 int n2 = (
n + 2) % 3;
564 if ((ToAddNegativeS[
n].back() >= ToAddNegativeS[n1].back()) &&
565 (ToAddNegativeS[
n].back() >= ToAddNegativeS[n2].back())) {
566 ExtendNegativeS = ToAddNegativeS[
n].back();
571 if (fabs(ExtendNegativeS) < 1.) ExtendNegativeS = -1.;
572 if (fabs(ExtendPositiveS) < 1.) ExtendPositiveS = 1.;
574 LengthRescale = (ExtendPositiveS - ExtendNegativeS) / 2.;
575 PositionShift = (ExtendPositiveS + ExtendNegativeS) / 2.;
577 for (
size_t n = 0;
n != 3; ++
n) {
578 pt[
n] += dir[
n] * PositionShift;
579 dir[
n] *= LengthRescale;
581 for (
size_t i = 0; i != ToAddPositiveS[
n].size(); ++i) {
582 if (ToAddPositiveS[
n].at(i) < ExtendPositiveS)
583 HitStatus[ToAddPositiveH[
n].at(i)] = 2;
585 HitStatus[ToAddPositiveH[
n].at(i)] = 0;
588 for (
size_t i = 0; i != ToAddNegativeS[
n].size(); ++i) {
589 if (ToAddNegativeS[
n].at(i) > ExtendNegativeS)
590 HitStatus[ToAddNegativeH[
n].at(i)] = 2;
592 HitStatus[ToAddNegativeH[
n].at(i)] = 0;
614 double xyzStart[3], xyzEnd[3];
623 double HitWidth = HitXHigh - HitXLow;
625 double pt[3],
dir[3],
err[3];
630 TVector3 sPt(pt[0], pt[1], pt[2]);
631 TVector3 sDir(dir[0], dir[1], dir[2]);
632 TVector3 hPt(HitX, xyzStart[1], xyzStart[2]);
633 TVector3 hDir(0, xyzStart[1] - xyzEnd[1], xyzStart[2] - xyzEnd[2]);
635 s = (sPt - hPt).Dot(hDir * (hDir.Dot(sDir)) - sDir * (hDir.Dot(hDir))) /
636 (hDir.Dot(hDir) * sDir.Dot(sDir) -
pow(hDir.Dot(sDir), 2));
638 disp = fabs((sPt - hPt).Dot(sDir.Cross(hDir)) / (sDir.Cross(hDir)).Mag()) / HitWidth;
647 std::vector<recob::SpacePoint>
const& Points,
648 std::vector<char>& PointStatus,
649 std::vector<int>& PointsInRange,
657 std::vector<recob::SpacePoint> PointsUsed;
660 PointsInRange.clear();
663 TVector3 HighestZPoint;
664 bool NoPointFound =
true;
665 int counter = Points.size() - 1;
666 while ((NoPointFound ==
true) && (counter >= 0)) {
667 if (PointStatus[counter] == 0) {
668 HighestZPoint = TVector3(
669 Points.at(counter).XYZ()[0], Points.at(counter).XYZ()[1], Points.at(counter).XYZ()[2]);
670 NoPointFound =
false;
688 if (PointStatus[
index] == 0) {
691 if ((HighestZPoint[2] - Points.at(
index).XYZ()[2]) < TwiceLength) {
692 double DistanceToHighZ =
pow(
pow(HighestZPoint[1] - Points.at(
index).XYZ()[1], 2) +
693 pow(HighestZPoint[2] - Points.at(
index).XYZ()[2], 2),
695 if (DistanceToHighZ < TwiceLength) {
696 PointsInRange.push_back(
index);
697 PointsUsed.push_back(Points.at(
index));
705 TVector3 SeedCenter(0, 0, 0);
706 TVector3 SeedDirection(0, 0, 0);
710 int NPoints = PointsInRange.size();
714 std::map<int, bool>
HitMap;
717 for (
unsigned int i = 0; i != PointsInRange.size(); i++) {
718 std::vector<art::PtrVector<recob::Hit>> HitsInThisCollection(3);
723 itHit != HitsThisSP.
end();
725 uint32_t Channel = (*itHit)->Channel();
729 for (
size_t iH = 0; iH != OrgHits[
View][Channel].size(); ++iH) {
730 if (fabs(HitsFlat[OrgHits[View][Channel][iH]]->PeakTime() - (*itHit)->PeakTime()) < eta) {
731 HitMap[OrgHits[
View][Channel][iH]] =
true;
737 for (
auto itH = HitMap.begin(); itH != HitMap.end(); ++itH) {
738 HitList.push_back(itH->first);
741 std::vector<double> ViewRMS;
742 std::vector<int> HitsPerView;
745 detProp, HitsFlat, HitList, SeedCenter, SeedDirection, ViewRMS, HitsPerView);
752 bool ThrowOutSeed =
false;
754 double PtArray[3], DirArray[3];
756 pow(
pow(SeedDirection.Y(), 2) +
pow(SeedDirection.Z(), 2), 0.5) / SeedDirection.Mag();
758 int nViewsWithHits(0);
760 for (
size_t n = 0;
n != 3; ++
n) {
762 PtArray[
n] = SeedCenter[
n];
763 if (HitsPerView[
n] > 0) nViewsWithHits++;
766 if (nViewsWithHits < 2 || (nViewsWithHits < 3 && !
fAllow2DSeeds)) ThrowOutSeed =
true;
773 if (
fMaxViewRMS.at(j) < ViewRMS.at(j)) { ThrowOutSeed =
true; }
791 std::vector<int>& HitsToUse,
794 std::vector<double>& ViewRMS,
795 std::vector<int>&
N)
const 799 std::map<uint32_t, bool> HitsClaimed;
803 std::vector<std::vector<double>> HitTimes(3);
804 std::vector<std::vector<double>> HitWires(3);
805 std::vector<std::vector<double>> HitWidths(3);
806 std::vector<double> MeanWireCoord(3, 0);
807 std::vector<double> MeanTimeCoord(3, 0);
811 std::vector<double>
x(3, 0),
y(3, 0), xx(3, 0), xy(3, 0), yy(3, 0), sig(3, 0);
813 for (
size_t i = 0; i != HitsToUse.size(); ++i) {
814 auto itHit = HitsFlat.
begin() + HitsToUse[i];
818 auto const hitView = (*itHit)->View();
830 double WireCoord = (*itHit)->WireID().Wire *
fPitches.at(ViewIndex);
831 double TimeCoord = detProp.
ConvertTicksToX((*itHit)->PeakTime(), ViewIndex, 0, 0);
832 double TimeUpper = detProp.
ConvertTicksToX((*itHit)->PeakTimePlusRMS(), ViewIndex, 0, 0);
833 double TimeLower = detProp.
ConvertTicksToX((*itHit)->PeakTimeMinusRMS(), ViewIndex, 0, 0);
834 double Width = fabs(0.5 * (TimeUpper - TimeLower));
835 double Width2 =
pow(Width, 2);
837 HitWires.at(ViewIndex).push_back(WireCoord);
838 HitTimes.at(ViewIndex).push_back(TimeCoord);
839 HitWidths.at(ViewIndex).push_back(fabs(0.5 * (TimeUpper - TimeLower)));
841 MeanWireCoord.at(ViewIndex) += WireCoord;
842 MeanTimeCoord.at(ViewIndex) += TimeCoord;
845 x.at(ViewIndex) += WireCoord / Width2;
846 y.at(ViewIndex) += TimeCoord / Width2;
847 xy.at(ViewIndex) += (TimeCoord * WireCoord) / Width2;
848 xx.at(ViewIndex) += (WireCoord * WireCoord) / Width2;
849 yy.at(ViewIndex) += (TimeCoord * TimeCoord) / Width2;
850 sig.at(ViewIndex) += 1. / Width2;
856 std::vector<double> ViewGrad(3);
857 std::vector<double> ViewOffset(3);
859 for (
size_t n = 0;
n != 3; ++
n) {
860 MeanWireCoord[
n] /= N[
n];
861 MeanTimeCoord[
n] /= N[
n];
863 double BigN = 1000000;
864 double SmallN = 1. / BigN;
867 double Numerator = (
y[
n] / sig[
n] - xy[
n] /
x[
n]);
868 double Denominator = (
x[
n] / sig[
n] - xx[
n] /
x[
n]);
869 if (fabs(Denominator) > SmallN)
870 ViewGrad.at(
n) = Numerator / Denominator;
875 ViewGrad[
n] = xy[
n] / xx[
n];
879 ViewOffset.at(
n) = (
y[
n] - ViewGrad[
n] *
x[
n]) / sig[
n];
880 ViewRMS.at(
n) =
pow((yy[
n] +
pow(ViewGrad[
n], 2) * xx[n] +
pow(ViewOffset[n], 2) * sig[n] -
881 2 * ViewGrad[n] * xy[n] - 2 * ViewOffset[n] *
y[n] +
882 2 * ViewGrad[n] * ViewOffset[n] *
x[n]) /
886 if (ViewGrad.at(n) != 0) ViewRMS[n] *= sin(atan(1. / ViewGrad.at(n)));
889 for (
size_t n = 0;
n != 3; ++
n) {
890 size_t n1 = (
n + 1) % 3;
891 size_t n2 = (
n + 2) % 3;
892 if ((N[
n] <= N[n1]) && (N[
n] <= N[n2])) {
894 if (N[n1] < N[n2]) {
std::swap(n1, n2); }
895 if ((N[n1] == 0) || (N[n2] == 0))
continue;
911 double TimeCoord = 0.5 * (MeanTimeCoord[n1] + MeanTimeCoord[n2]);
912 double WireCoordIn1 = (TimeCoord - ViewOffset[n1]) / ViewGrad[n1] +
fWireZeroOffset[n1];
913 double WireCoordIn2 = (TimeCoord - ViewOffset[n2]) / ViewGrad[n2] +
fWireZeroOffset[n2];
919 ViewRMS[
n] = -fabs(ViewRMS[
n]);
920 ViewRMS[n1] = fabs(ViewRMS[n1]);
921 ViewRMS[n2] = fabs(ViewRMS[n2]);
944 fXDir = TVector3(1, 0, 0);
945 fYDir = TVector3(0, 1, 0);
946 fZDir = TVector3(0, 0, 1);
952 double xyzStart1[3], xyzStart2[3];
953 double xyzEnd1[3], xyzEnd2[3];
956 for (
size_t n = 0;
n != 3; ++
n) {
960 TVector3(xyzEnd1[0] - xyzStart1[0], xyzEnd1[1] - xyzStart1[1], xyzEnd1[2] - xyzStart1[2])
964 xyzEnd2[0] - xyzEnd1[0], xyzEnd2[1] - xyzEnd1[1], xyzEnd2[2] - xyzEnd1[2])) < 0)
974 std::vector<recob::Seed>
980 unsigned int StopAfter)
const 982 std::vector<recob::Seed> ReturnVec;
983 return FindSeeds(clockData, detProp, Hits, HitCatalogue, StopAfter);
988 std::vector<std::vector<recob::Seed>>
994 unsigned int StopAfter)
const 997 std::vector<std::vector<recob::Seed>> ReturnVec;
1004 <<
"Warning: SpacePointAlg is does not have three views enabled. This may cause unexpected " 1005 "behaviour in the bezier tracker.";
1009 SortedHits.at(
geo::kU).begin();
1010 itU != SortedHits.at(
geo::kU).end();
1013 SortedHits.at(
geo::kV).begin();
1014 itV != SortedHits.at(
geo::kV).end();
1017 SortedHits.at(
geo::kW).begin();
1018 itW != SortedHits.at(
geo::kW).end();
1023 for (
size_t i = 0; i != itU->size(); ++i)
1024 HitsThisComboFlat.
push_back(itU->at(i));
1027 for (
size_t i = 0; i != itV->size(); ++i)
1028 HitsThisComboFlat.
push_back(itV->at(i));
1031 for (
size_t i = 0; i != itW->size(); ++i)
1032 HitsThisComboFlat.
push_back(itW->at(i));
1034 std::vector<art::PtrVector<recob::Hit>> CataloguedHits;
1036 std::vector<recob::Seed> Seeds =
1037 FindSeeds(clockData, detProp, HitsThisComboFlat, CataloguedHits, StopAfter);
1040 HitsPerSeed.push_back(CataloguedHits);
1041 ReturnVec.push_back(Seeds);
1044 CataloguedHits.clear();
1050 <<
" bailed during hit map lookup - have you enabled all 3 planes?";
1051 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.
AdcChannelData::View View
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
geo::WireID WireID() const
void GetPoint(double *Pt, double *Err) const
void CalculateGeometricalElements()
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)
double Width(Resonance_t res)
resonance width (GeV)
WireID_t Wire
Index of the wire within its plane.
void resize(Vector< T > &vec1, Index n1, const V &val)
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
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
art framework interface to geometry description
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.
typename data_t::const_iterator const_iterator
void SetPoint(double *Pt, double *Err)
void push_back(Ptr< U > const &p)
void swap(Handle< T > &a, Handle< T > &b)
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)
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
void err(const char *fmt,...)
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.
Declaration of signal hit object.
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
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
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.
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
std::vector< double > fWireZeroOffset
void SetDirection(double *Dir, double *Err)
std::vector< double > fMaxViewRMS