47 #include "art/Framework/Core/EDProducer.h"
48 #include "art/Framework/Core/ModuleMacros.h"
49 #include "art/Framework/Principal/Event.h"
50 #include "art/Framework/Principal/Handle.h"
51 #include "art/Framework/Services/Registry/ServiceHandle.h"
52 #include "canvas/Persistency/Common/FindManyP.h"
53 #include "canvas/Persistency/Common/Ptr.h"
54 #include "canvas/Persistency/Common/PtrVector.h"
55 #include "fhiclcpp/ParameterSet.h"
56 #include "messagefacility/MessageLogger/MessageLogger.h"
93 art::PtrVector<recob::Cluster> RawClusters,
94 art::FindManyP<recob::Hit> fmhit);
100 std::vector<double>
const& Wire_2dvtx,
101 std::vector<double>
const& Time_2dvtx,
102 std::vector<double>
const& Plane_2dvtx);
109 std::vector<double> merge_vtxY,
110 std::vector<double> merge_vtxZ,
111 std::vector<double> merge_vtxStgth);
137 std::vector<std::vector<int>>
Cls;
165 fCornerFinderModuleLabel = pset.get<std::string>(
"CornerFinderModuleLabel");
166 fClusterModuleLabel = pset.get<std::string>(
"ClusterModuleLabel");
167 fHitModuleLabel = pset.get<std::string>(
"HitModuleLabel");
168 fCCrawlerEndPoint2dModuleLabel = pset.get<std::string>(
"CCrawlerEndPoint2dModuleLabel");
169 fRunningMode = pset.get<
double>(
"RunningMode");
171 produces<std::vector<recob::Vertex>>();
172 produces<std::vector<recob::EndPoint2D>>();
173 produces<art::Assns<recob::EndPoint2D, recob::Hit>>();
177 produces<art::Assns<recob::Vertex, recob::Hit>>();
178 produces<art::Assns<recob::Vertex, recob::Shower>>();
179 produces<art::Assns<recob::Vertex, recob::Track>>();
181 art::ServiceHandle<geo::Geometry const> geom;
182 Cls.resize(geom->Nplanes(), std::vector<int>());
190 art::ServiceHandle<geo::Geometry const> geom;
192 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt);
198 for (
size_t cstat = 0; cstat < geom->Ncryostats(); ++cstat) {
199 for (
size_t tpc = 0; tpc < geom->Cryostat(cstat).NTPC(); ++tpc) {
200 if (geom->Cryostat(cstat).TPC(tpc).Nplanes() > 2) {
GT2PlaneDetector =
true; }
208 auto vcol = std::make_unique<std::vector<recob::Vertex>>();
209 auto epcol = std::make_unique<std::vector<recob::EndPoint2D>>();
210 auto assnep = std::make_unique<art::Assns<recob::EndPoint2D, recob::Hit>>();
211 auto assnsh = std::make_unique<art::Assns<recob::Vertex, recob::Shower>>();
212 auto assntr = std::make_unique<art::Assns<recob::Vertex, recob::Track>>();
213 auto assnh = std::make_unique<art::Assns<recob::Vertex, recob::Hit>>();
220 art::Handle<std::vector<recob::EndPoint2D>> ccrawlerFinderHandle;
221 evt.getByLabel(fCCrawlerEndPoint2dModuleLabel, ccrawlerFinderHandle);
222 std::vector<art::Ptr<recob::EndPoint2D>> ccrawlerEndPoints;
223 art::fill_ptr_vector(ccrawlerEndPoints, ccrawlerFinderHandle);
229 mf::LogWarning(
"FeatureVertexFinder") <<
"Failed to get EndPoint2d's from Cluster Crawler";
236 art::Handle<std::vector<recob::EndPoint2D>> CornerFinderHandle;
238 std::vector<art::Ptr<recob::EndPoint2D>> cornerEndPoints;
239 art::fill_ptr_vector(cornerEndPoints, CornerFinderHandle);
245 mf::LogWarning(
"FeatureVertexFinder") <<
"Failed to get EndPoint2d's from Corner Finder";
252 art::Handle<std::vector<recob::Cluster>> clusterListHandle;
253 evt.getByLabel(fClusterModuleLabel, clusterListHandle);
256 art::FindManyP<recob::Hit> fmh(clusterListHandle, evt, fClusterModuleLabel);
259 art::PtrVector<recob::Cluster> clusters;
260 for (
unsigned int ii = 0; ii < clusterListHandle->size(); ++ii) {
261 art::Ptr<recob::Cluster> clusterHolder(clusterListHandle, ii);
262 clusters.push_back(clusterHolder);
272 mf::LogWarning(
"FeatureVertexFinder") <<
"Failed to get Cluster from default cluster module";
287 if (fRunningMode == 0) {
294 double tempxyz[3] = {
299 if (tempxyz[0] == 0 && tempxyz[1] == 0 && tempxyz[2] == 0) {
continue; }
301 vcol->push_back(the3Dvertex);
307 for (
size_t cstat = 0; cstat < geom->Ncryostats(); ++cstat) {
308 for (
size_t tpc = 0; tpc < geom->Cryostat(cstat).NTPC(); ++tpc) {
309 for (
size_t plane = 0; plane < geom->Cryostat(cstat).TPC(tpc).Nplanes(); ++plane) {
310 double temp2dXYZ[3] = {
316 if (temp2dXYZ[0] == 0 && temp2dXYZ[1] == 0 && temp2dXYZ[2] == 0) {
continue; }
321 double EndPoint2d_TimeTick =
detProp.ConvertXToTicks(temp2dXYZ[0], plane, tpc, cstat);
322 int EndPoint2d_Wire = 0;
323 int EndPoint2d_Channel = 0;
326 EndPoint2d_Wire = geom->NearestWire(temp2dXYZ, plane, tpc, cstat);
329 mf::LogWarning(
"FeatureVertexFinder") <<
"2dWire failed";
334 EndPoint2d_Channel = geom->NearestChannel(temp2dXYZ, plane, tpc, cstat);
337 mf::LogWarning(
"FeatureVertexFinder") <<
"2dWire failed";
343 geo::WireID wireID(cstat, tpc, plane, EndPoint2d_Wire);
363 if (fRunningMode != 0) {
373 double tempxyz[3] = {
378 if (bail > 0) {
continue; }
379 if (tempxyz[0] == 0 && tempxyz[1] == 0 && tempxyz[2] == 0) {
continue; }
383 vcol->push_back(the3Dvertex);
392 for (
size_t cstat = 0; cstat < geom->Ncryostats(); ++cstat) {
394 for (
size_t tpc = 0; tpc < geom->Cryostat(cstat).NTPC(); ++tpc) {
396 for (
size_t plane = 0; plane < geom->Cryostat(cstat).TPC(tpc).Nplanes(); ++plane) {
405 double EndPoint2d_TimeTick =
detProp.ConvertXToTicks(temp2dXYZ[0], plane, tpc, cstat);
406 int EndPoint2d_Wire = 0;
407 int EndPoint2d_Channel = 0;
410 EndPoint2d_Wire = geom->NearestWire(temp2dXYZ, plane, tpc, cstat);
413 mf::LogWarning(
"FeatureVertexFinder") <<
"2dWire failed";
418 EndPoint2d_Channel = geom->NearestChannel(temp2dXYZ, plane, tpc, cstat);
421 mf::LogWarning(
"FeatureVertexFinder") <<
"2dWire failed";
427 geo::WireID wireID(cstat, tpc, plane, EndPoint2d_Wire);
443 mf::LogVerbatim(
"Summary") << std::setfill(
'-') << std::setw(175) <<
"-" << std::setfill(
' ');
444 mf::LogVerbatim(
"Summary") <<
"FeatureVertexFinder Summary:";
445 for (
size_t i = 0; i < epcol->size(); ++i)
446 mf::LogVerbatim(
"Summary") << epcol->at(i);
447 for (
size_t i = 0; i < vcol->size(); ++i)
448 mf::LogVerbatim(
"Summary") << vcol->at(i);
450 evt.put(std::move(epcol));
451 evt.put(std::move(vcol));
452 evt.put(std::move(assnep));
453 evt.put(std::move(assntr));
454 evt.put(std::move(assnsh));
455 evt.put(std::move(assnh));
492 std::vector<art::Ptr<recob::EndPoint2D>> EndPoints,
495 art::ServiceHandle<geo::Geometry const> geom;
497 double y = 0.,
z = 0.;
498 double yy = 0., zz = 0.;
499 double yy2 = 0., zz2 = 0.;
500 double yy3 = 0., zz3 = 0.;
502 for (
size_t cstat = 0; cstat < geom->Ncryostats(); ++cstat) {
503 for (
size_t tpc = 0; tpc < geom->Cryostat(cstat).NTPC(); ++tpc) {
504 for (
size_t endpt1 = 0; endpt1 < EndPoints.size(); endpt1++) {
505 for (
size_t endpt2 = endpt1 + 1; endpt2 < EndPoints.size(); endpt2++) {
510 if (EndPoints.at(endpt1)->WireID().Plane != EndPoints.at(endpt2)->WireID().Plane) {
515 float tempXFeature1 = detProp.
ConvertTicksToX(EndPoints.at(endpt1)->DriftTime(),
516 EndPoints.at(endpt1)->WireID().Plane,
519 float tempXFeature2 = detProp.
ConvertTicksToX(EndPoints.at(endpt2)->DriftTime(),
520 EndPoints.at(endpt2)->WireID().Plane,
527 if (geom->ChannelsIntersect(
528 geom->PlaneWireToChannel(EndPoints.at(endpt2)->WireID().Plane,
529 EndPoints.at(endpt2)->WireID().Wire,
532 geom->PlaneWireToChannel(EndPoints.at(endpt1)->WireID().Plane,
533 EndPoints.at(endpt1)->WireID().Wire,
538 std::abs(tempXFeature1 - tempXFeature2) < 0.5) {
544 candidate_x.push_back(tempXFeature1);
545 candidate_y.push_back(yy);
546 candidate_z.push_back(zz);
547 candidate_strength.push_back(EndPoints.at(endpt1)->Strength() +
548 EndPoints.at(endpt2)->Strength());
558 for (
size_t endpt3 = endpt2 + 1; endpt3 < EndPoints.size(); endpt3++) {
563 if (EndPoints.at(endpt3)->WireID().Plane !=
564 EndPoints.at(endpt2)->WireID().Plane &&
565 EndPoints.at(endpt3)->WireID().Plane !=
566 EndPoints.at(endpt1)->WireID().Plane &&
567 EndPoints.at(endpt1)->WireID().Plane !=
568 EndPoints.at(endpt2)->WireID().Plane) {
569 float tempXFeature3 =
571 EndPoints.at(endpt3)->WireID().Plane,
580 if (geom->ChannelsIntersect(
581 geom->PlaneWireToChannel(EndPoints.at(endpt3)->WireID().Plane,
582 EndPoints.at(endpt3)->WireID().Wire,
585 geom->PlaneWireToChannel(EndPoints.at(endpt1)->WireID().Plane,
586 EndPoints.at(endpt1)->WireID().Wire,
591 geom->ChannelsIntersect(
592 geom->PlaneWireToChannel(EndPoints.at(endpt3)->WireID().Plane,
593 EndPoints.at(endpt3)->WireID().Wire,
596 geom->PlaneWireToChannel(EndPoints.at(endpt2)->WireID().Plane,
597 EndPoints.at(endpt2)->WireID().Wire,
602 geom->ChannelsIntersect(
603 geom->PlaneWireToChannel(EndPoints.at(endpt2)->WireID().Plane,
604 EndPoints.at(endpt2)->WireID().Wire,
607 geom->PlaneWireToChannel(EndPoints.at(endpt1)->WireID().Plane,
608 EndPoints.at(endpt1)->WireID().Wire,
613 std::abs(tempXFeature3 - tempXFeature2) < 1.0 &&
614 std::abs(tempXFeature3 - tempXFeature1) < 1.0 &&
615 std::abs(tempXFeature1 - tempXFeature2) < 1.0) {
616 candidate_x.push_back(
618 EndPoints.at(endpt1)->WireID().Plane,
624 geom->IntersectionPoint(EndPoints.at(endpt1)->WireID().Wire,
625 EndPoints.at(endpt2)->WireID().Wire,
626 EndPoints.at(endpt1)->WireID().Plane,
627 EndPoints.at(endpt2)->WireID().Plane,
633 candidate_y.push_back(y);
634 candidate_z.push_back(
z);
635 candidate_strength.push_back(EndPoints.at(endpt1)->Strength() +
636 EndPoints.at(endpt2)->Strength() +
637 EndPoints.at(endpt3)->Strength());
644 if (endpt1 < EndPoints.size()) { endpt1++; }
645 if (endpt2 < EndPoints.size()) { endpt2++; }
646 if (endpt3 < EndPoints.size()) { endpt3++; }
670 art::PtrVector<recob::Cluster> RawClusters,
671 art::FindManyP<recob::Hit> fmhit)
673 art::ServiceHandle<geo::Geometry const> geom;
675 int nClustersFound = 0;
681 for (
size_t iclu = 0; iclu < RawClusters.size(); ++iclu) {
683 std::vector<art::Ptr<recob::Hit>>
hit = fmhit.at(iclu);
687 if (hit.size() < 15) {
continue; }
691 const geo::View_t view = RawClusters.at(iclu)->View();
692 if (view >= Cls.size()) {
693 std::cerr << __PRETTY_FUNCTION__ <<
"\033[93m Logic error in my code ... view " << view
694 <<
" not supported ! \033[00m" << std::endl;
695 throw std::exception();
698 Cls.at(RawClusters.at(iclu)->View()).push_back(iclu);
702 std::vector<double> wires;
703 std::vector<double> times;
710 for (
size_t i = 0; i < hit.size(); ++i) {
711 wires.push_back(hit[i]->
WireID().Wire);
712 times.push_back(hit[i]->PeakTime());
723 TGraph* the2Dtrack =
new TGraph(n, &wires[0], ×[0]);
726 the2Dtrack->Fit(
"pol1",
"Q");
727 TF1* pol1 = (TF1*)the2Dtrack->GetFunction(
"pol1");
730 pol1->GetParameters(par);
731 parerror[1] = pol1->GetParError(1);
732 double FitChi2 = pol1->GetChisquare();
733 double FitNDF = pol1->GetNDF();
735 double fitGoodness = FitChi2 / FitNDF;
738 if (fitGoodness > 10) {
739 dtdwstart.push_back(std::tan(RawClusters[iclu]->StartAngle()));
745 dtdwstart.push_back(par[1]);
746 dtdwstartError.push_back(parerror[1]);
751 mf::LogWarning(
"FeatureVertexFinder")
752 <<
"Fitter failed, using the clusters default dTdW()";
754 dtdwstart.push_back(std::tan(RawClusters[iclu]->StartAngle()));
765 dtdwstart.push_back(std::tan(RawClusters[iclu]->StartAngle()));
774 for (
size_t cstat = 0; cstat < geom->Ncryostats(); ++cstat) {
775 for (
size_t tpc = 0; tpc < geom->Cryostat(cstat).NTPC(); ++tpc) {
776 for (
unsigned int i = 0; i < geom->Cryostat(cstat).TPC(tpc).Nplanes(); ++i) {
780 if (Cls[i].
size() >= 1) {
784 for (
unsigned int j = 0; j < Cls[i].size(); ++j) {
786 Clu_Plane.push_back(RawClusters.at(Cls.at(i).at(j))->View());
788 Clu_StartPos_Wire.push_back(RawClusters.at(Cls.at(i).at(j))->StartWire());
789 Clu_StartPos_TimeTick.push_back(RawClusters.at(Cls.at(i).at(j))->
StartTick());
791 Clu_EndPos_Wire.push_back(RawClusters.at(Cls.at(i).at(j))->EndWire());
792 Clu_EndPos_TimeTick.push_back(RawClusters.at(Cls.at(i).at(j))->EndTick());
794 Clu_Slope.push_back(dtdwstart[Cls[i][j]]);
795 Clu_Length.push_back(std::sqrt(pow((RawClusters.at(Cls.at(i).at(j))->StartWire() -
796 RawClusters.at(Cls.at(i).at(j))->EndWire()) *
799 pow(RawClusters.at(Cls.at(i).at(j))->
StartTick() -
800 RawClusters.at(Cls.at(i).at(j))->EndTick(),
806 Clu_Yintercept.push_back(
807 RawClusters.at(Cls.at(i).at(j))->
StartTick() -
808 (dtdwstart[Cls[i][j]] * RawClusters.at(Cls.at(i).at(j))->StartWire()));
814 Clu_Yintercept2.push_back(
815 RawClusters.at(Cls.at(i).at(j))->EndTick() -
816 (dtdwstart[Cls[i][j]] * RawClusters.at(Cls.at(i).at(j))->EndWire()));
827 TwoDvtx_wire.push_back(-1);
828 TwoDvtx_time.push_back(-1);
829 TwoDvtx_plane.push_back(-1);
840 for (
unsigned int n = nClustersFound;
n > 0;
n--) {
845 for (
unsigned int m = 0;
m <
n;
m++) {
849 if (Clu_Plane[n] == Clu_Plane[
m]) {
851 if (Clu_Slope[m] - Clu_Slope[n] == 0) {
break; }
854 float intersection_X =
855 (Clu_Yintercept[
n] - Clu_Yintercept[
m]) / (Clu_Slope[m] - Clu_Slope[n]);
858 float intersection_Y = (Clu_Slope[
m] * intersection_X) + Clu_Yintercept[m];
861 float intersection_X2 =
862 (Clu_Yintercept2[
n] - Clu_Yintercept2[
m]) / (Clu_Slope[m] - Clu_Slope[n]);
865 float intersection_Y2 = (Clu_Slope[
m] * intersection_X2) + Clu_Yintercept2[m];
869 if (intersection_X2 < 1) { intersection_X2 = -999; }
870 if (intersection_X2 > geom->Nwires(Clu_Plane[m], 0, 0)) { intersection_X2 = -999; }
871 if (intersection_Y2 < 0) { intersection_Y2 = -999; }
873 if (intersection_X < 1) { intersection_X = -999; }
874 if (intersection_X > geom->Nwires(Clu_Plane[m], 0, 0)) { intersection_X = -999; }
875 if (intersection_Y < 0) { intersection_Y = -999; }
882 std::vector<art::Ptr<recob::Hit>> hitClu1 = fmhit.at(m);
883 std::vector<art::Ptr<recob::Hit>> hitClu2 = fmhit.at(n);
888 if ((
abs(Clu_EndPos_Wire[m] - intersection_X2) > 80 && hitClu1.size() < 8) ||
889 (
abs(Clu_EndPos_Wire[n] - intersection_X2) > 80 && hitClu2.size() < 8)) {
890 intersection_X2 = -999;
891 intersection_Y2 = -999;
894 if ((
abs(Clu_StartPos_Wire[m] - intersection_X) > 80 && hitClu1.size() < 8) ||
895 (
abs(Clu_StartPos_Wire[n] - intersection_X) > 80 && hitClu2.size() < 8)) {
896 intersection_X = -999;
897 intersection_Y = -999;
904 if ((
abs(Clu_EndPos_Wire[m] - intersection_X2) > 50 && hitClu1.size() < 4) ||
905 (
abs(Clu_EndPos_Wire[n] - intersection_X2) > 50 && hitClu2.size() < 4)) {
906 intersection_X2 = -999;
907 intersection_Y2 = -999;
910 if ((
abs(Clu_StartPos_Wire[m] - intersection_X) > 50 && hitClu1.size() < 4) ||
911 (
abs(Clu_StartPos_Wire[n] - intersection_X) > 50 && hitClu2.size() < 4)) {
912 intersection_X = -999;
913 intersection_Y = -999;
917 mf::LogWarning(
"FeatureVertexFinder") <<
"FindManyHit Function faild";
918 intersection_X = -999;
919 intersection_Y = -999;
920 intersection_X2 = -999;
921 intersection_Y2 = -999;
928 if (intersection_X2 > 1 && intersection_Y2 > 0 &&
929 (intersection_X2 < geom->Nwires(Clu_Plane[m], 0, 0)) &&
932 TwoDvtx_wire.push_back(intersection_X2);
933 TwoDvtx_time.push_back(intersection_Y2);
934 TwoDvtx_plane.push_back(Clu_Plane[m]);
940 if (intersection_X > 1 && intersection_Y > 0 &&
941 (intersection_X < geom->Nwires(Clu_Plane[m], 0, 0)) &&
943 TwoDvtx_wire.push_back(intersection_X);
944 TwoDvtx_time.push_back(intersection_Y);
945 TwoDvtx_plane.push_back(Clu_Plane[m]);
960 std::vector<double>
const& Wire_2dvtx,
961 std::vector<double>
const& Time_2dvtx,
962 std::vector<double>
const& Plane_2dvtx)
965 std::vector<double> vtx_wire_merged;
966 std::vector<double> vtx_time_merged;
967 std::vector<double> vtx_plane_merged;
969 double y_coord = 0, z_coord = 0;
973 art::ServiceHandle<geo::Geometry const> geom;
979 for (
size_t vtxloop1 = 0; vtxloop1 < Wire_2dvtx.size(); vtxloop1++) {
980 if (Wire_2dvtx[vtxloop1] < 0) {
continue; }
986 for (
size_t vtxloop2 = vtxloop1 + 1; vtxloop2 < Wire_2dvtx.size(); vtxloop2++) {
987 if (Wire_2dvtx[vtxloop2] < 0) {
continue; }
991 if (Plane_2dvtx[vtxloop1] == Plane_2dvtx[vtxloop2]) {
996 if (fabs(Wire_2dvtx[vtxloop1] - Wire_2dvtx[vtxloop2]) < 4) {
1000 if (fabs(Time_2dvtx[vtxloop1] - Time_2dvtx[vtxloop2]) < 10) {
1001 vtx_wire_merged.push_back(((Wire_2dvtx[vtxloop2] + Wire_2dvtx[vtxloop1]) / 2));
1002 vtx_time_merged.push_back(((Time_2dvtx[vtxloop2] + Time_2dvtx[vtxloop1]) / 2));
1003 vtx_plane_merged.push_back(Plane_2dvtx[vtxloop1]);
1006 if (vtxloop2 < Wire_2dvtx.size()) { vtxloop2++; }
1007 if (vtxloop1 < Wire_2dvtx.size()) { vtxloop1++; }
1013 vtx_wire_merged.push_back(Wire_2dvtx[vtxloop1]);
1014 vtx_time_merged.push_back(Time_2dvtx[vtxloop1]);
1015 vtx_plane_merged.push_back(Plane_2dvtx[vtxloop1]);
1021 uint32_t vtx1_channel = 0;
1022 uint32_t vtx2_channel = 0;
1030 for (
size_t cstat = 0; cstat < geom->Ncryostats(); ++cstat) {
1034 for (
size_t tpc = 0; tpc < geom->Cryostat(cstat).NTPC(); ++tpc) {
1035 for (
unsigned int vtx = vtx_wire_merged.size(); vtx > 0; vtx--) {
1036 for (
unsigned int vtx1 = 0; vtx1 < vtx; vtx1++) {
1041 if (vtx_plane_merged[vtx1] != vtx_plane_merged[vtx]) {
1050 unsigned int vtx1_plane = vtx_plane_merged[vtx1];
1051 unsigned int vtx1_wire = vtx_wire_merged[vtx1];
1053 vtx1_channel = geom->PlaneWireToChannel(vtx1_plane, vtx1_wire, tpc, cstat);
1056 mf::LogWarning(
"FeatureVertexFinder") <<
"PlaneWireToChannel Failed";
1061 unsigned int vtx2_plane = vtx_plane_merged[vtx];
1062 unsigned int vtx2_wire = vtx_wire_merged[vtx];
1064 vtx2_channel = geom->PlaneWireToChannel(vtx2_plane, vtx2_wire, tpc, cstat);
1067 mf::LogWarning(
"FeatureVertexFinder") <<
"PlaneWireToChannel Failed";
1076 match = geom->ChannelsIntersect(vtx1_channel, vtx2_channel, y_coord, z_coord);
1079 mf::LogWarning(
"FeatureVertexFinder") <<
"match failed for some reason";
1088 float tempXCluster1 =
1089 detProp.
ConvertTicksToX(vtx_time_merged[vtx1], vtx1_plane, tpc, cstat);
1090 float tempXCluster2 =
1091 detProp.
ConvertTicksToX(vtx_time_merged[vtx], vtx2_plane, tpc, cstat);
1097 if (
std::abs(tempXCluster1 - tempXCluster2) < 0.5 && candidate_x.size() < 101) {
1099 vtx_time_merged[vtx1], vtx_plane_merged[vtx1], tpc, cstat));
1100 candidate_y.push_back(y_coord);
1101 candidate_z.push_back(z_coord);
1102 candidate_strength.push_back(
1123 std::vector<double> merge_vtxY,
1124 std::vector<double> merge_vtxZ,
1125 std::vector<double> merge_vtxStgth)
1128 std::vector<double> x_3dVertex_dupRemoved = {0.};
1129 std::vector<double> y_3dVertex_dupRemoved = {0.};
1130 std::vector<double> z_3dVertex_dupRemoved = {0.};
1131 std::vector<double> strength_dupRemoved = {0.};
1135 for (
size_t dup = 0; dup < merge_vtxX.size(); dup++) {
1137 float tempX_dup = merge_vtxX[dup];
1138 float tempY_dup = merge_vtxY[dup];
1139 float tempZ_dup = merge_vtxZ[dup];
1140 float tempStgth = merge_vtxStgth[dup];
1144 bool duplicate_found =
false;
1156 duplicate_found =
true;
1164 if (!duplicate_found && tempX_dup > 0) {
1165 x_3dVertex_dupRemoved.push_back(tempX_dup);
1166 y_3dVertex_dupRemoved.push_back(tempY_dup);
1167 z_3dVertex_dupRemoved.push_back(tempZ_dup);
1168 strength_dupRemoved.push_back(tempStgth);
1178 double tempX, tempY, tempZ, tempS;
1182 for (
size_t npri = 0; (npri < x_3dVertex_dupRemoved.size()) && flag; npri++) {
1184 for (
size_t mpri = 0; mpri < x_3dVertex_dupRemoved.size() - 1; mpri++) {
1186 if (strength_dupRemoved[mpri + 1] > strength_dupRemoved[mpri] ||
1187 (strength_dupRemoved[mpri + 1] == strength_dupRemoved[mpri] &&
1188 z_3dVertex_dupRemoved[mpri] > z_3dVertex_dupRemoved[mpri + 1])) {
1189 tempX = x_3dVertex_dupRemoved[mpri];
1190 x_3dVertex_dupRemoved[mpri] = x_3dVertex_dupRemoved[mpri + 1];
1191 x_3dVertex_dupRemoved[mpri + 1] = tempX;
1193 tempY = y_3dVertex_dupRemoved[mpri];
1194 y_3dVertex_dupRemoved[mpri] = y_3dVertex_dupRemoved[mpri + 1];
1195 y_3dVertex_dupRemoved[mpri + 1] = tempY;
1197 tempZ = z_3dVertex_dupRemoved[mpri];
1198 z_3dVertex_dupRemoved[mpri] = z_3dVertex_dupRemoved[mpri + 1];
1199 z_3dVertex_dupRemoved[mpri + 1] = tempZ;
1201 tempS = strength_dupRemoved[mpri];
1202 strength_dupRemoved[mpri] = strength_dupRemoved[mpri + 1];
1203 strength_dupRemoved[mpri + 1] = tempS;
1213 for (
size_t count = 0;
count < x_3dVertex_dupRemoved.size();
count++) {
1214 MergeSort3dVtx_xpos.push_back(x_3dVertex_dupRemoved[
count]);
1215 MergeSort3dVtx_ypos.push_back(y_3dVertex_dupRemoved[count]);
1216 MergeSort3dVtx_zpos.push_back(z_3dVertex_dupRemoved[count]);
1217 MergeSort3dVtx_strength.push_back(strength_dupRemoved[count]);
std::vector< double > Clu_Plane
process_name opflash particleana ie ie ie z
void MergeAndSort3dVtxCandidate(std::vector< double > merge_vtxX, std::vector< double > merge_vtxY, std::vector< double > merge_vtxZ, std::vector< double > merge_vtxStgth)
std::vector< double > TwoDvtx_wire
Encapsulate the construction of a single cyostat.
BEGIN_PROLOG could also be cerr
then echo unknown compiler flag
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::vector< double > TwoDvtx_time
Declaration of signal hit object.
std::vector< double > Clu_EndPos_Wire
std::vector< double > candidate_y
void produce(art::Event &evt) override
std::vector< double > candidate_strength
std::vector< double > Clu_Length
std::vector< double > Clu_Yintercept
std::size_t size(FixedBins< T, C > const &) noexcept
std::vector< double > Clu_EndPos_TimeTick
std::vector< double > MergeSort3dVtx_strength
std::vector< double > candidate_z
Definition of vertex object for LArSoft.
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
std::vector< double > Clu_StartPos_TimeTick
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::vector< std::vector< int > > Cls
void Find3dVtxFrom2dClusterVtxCand(detinfo::DetectorPropertiesData const &detProp, std::vector< double > const &Wire_2dvtx, std::vector< double > const &Time_2dvtx, std::vector< double > const &Plane_2dvtx)
process_name opflash particleana ie ie y
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
void Get3dVertexCandidates(detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::EndPoint2D >> EndPoints, bool PlaneDet)
std::vector< double > Clu_StartPos_Wire
std::vector< double > MergeSort3dVtx_zpos
std::string fClusterModuleLabel
void Find2dClusterVertexCandidates(detinfo::DetectorPropertiesData const &detProp, art::PtrVector< recob::Cluster > RawClusters, art::FindManyP< recob::Hit > fmhit)
unsigned int NumberTimeSamples() const
std::string fCornerFinderModuleLabel
process_name tightIsolTest check
std::vector< double > dtdwstart
FeatureVertexFinder(fhicl::ParameterSet const &pset)
Declaration of cluster object.
Provides recob::Track data product.
std::vector< double > MergeSort3dVtx_ypos
double ConvertTicksToX(double ticks, int p, int t, int c) const
std::vector< double > MergeSort3dVtx_xpos
std::vector< double > Clu_Slope
std::vector< double > TwoDvtx_plane
std::vector< double > dtdwstartError
std::vector< double > candidate_x
std::string fCCrawlerEndPoint2dModuleLabel
std::size_t count(Cont const &cont)
std::string fHitModuleLabel
art framework interface to geometry description
BEGIN_PROLOG could also be cout
Encapsulate the construction of a single detector plane.
std::vector< double > Clu_Yintercept2