30 #include "cetlib_except/exception.h" 48 : fMaxDT{pset.
get<
double>(
"MaxDT")}
49 ,
fMaxS{pset.get<
double>(
"MaxS")}
51 ,
fEnableU{pset.get<
bool>(
"EnableU")}
52 ,
fEnableV{pset.get<
bool>(
"EnableV")}
53 ,
fEnableW{pset.get<
bool>(
"EnableW")}
54 ,
fFilter{pset.get<
bool>(
"Filter")}
55 ,
fMerge{pset.get<
bool>(
"Merge")}
64 throw cet::exception(
"SpacePointAlg") <<
"Filter and Merge flags are both true.\n";
68 std::cout <<
"SpacePointAlg configured with the following parameters:\n" 69 <<
" MaxDT = " <<
fMaxDT <<
"\n" 70 <<
" MaxS = " <<
fMaxS <<
"\n" 75 <<
" Filter = " <<
fFilter <<
"\n" 76 <<
" Merge = " <<
fMerge <<
"\n" 90 static bool first =
true;
101 if (report)
mf::LogInfo(
"SpacePointAlg") <<
"Updating geometry constants.\n";
103 for (
auto const& plane : wireReadoutGeom.Iterate<
geo::PlaneGeo>()) {
108 std::string viewname =
"?";
109 if (view ==
geo::kU) { viewname =
"U"; }
117 throw cet::exception(
"SpacePointAlg") <<
"Bad view = " << view <<
"\n";
119 std::string sigtypename =
"?";
122 sigtypename =
"Induction";
124 sigtypename =
"Collection";
126 throw cet::exception(
"SpacePointAlg") <<
"Bad signal type = " << sigtype <<
"\n";
128 std::string orientname =
"?";
131 orientname =
"Vertical";
133 orientname =
"Horizontal";
135 throw cet::exception(
"SpacePointAlg") <<
"Bad orientation = " << orient <<
"\n";
138 auto const xyz = plane.GetCenter();
139 auto const& planeid = plane.ID();
143 <<
" View: " << viewname <<
"\n" 144 <<
" SignalType: " << sigtypename <<
"\n" 145 <<
" Orientation: " << orientname <<
"\n" 146 <<
" Plane location: " << xyz.X() <<
"\n" 147 <<
" Plane pitch: " << wireReadoutGeom.Plane0Pitch(planeid.parentID(), planeid.Plane)
149 <<
" Wire angle: " << plane.Wire(0).ThetaZ() <<
"\n" 150 <<
" Wire pitch: " << wireReadoutGeom.Plane(planeid).WirePitch() <<
"\n" 155 throw cet::exception(
"SpacePointAlg") <<
"Horizontal wire geometry not implemented.\n";
183 if (hits.
size() < 3)
return 0.;
187 if (hits.
size() > 3) {
188 mf::LogError(
"SpacePointAlg") <<
"Method separation called with more than three htis.";
196 double dist[3] = {0., 0., 0.};
197 double sinth[3] = {0., 0., 0.};
198 double costh[3] = {0., 0., 0.};
199 unsigned int cstats[3];
200 unsigned int tpcs[3];
201 unsigned int planes[3];
205 for (
int i = 0; i < 3; ++i) {
217 for (
int j = 0; j < i; ++j) {
221 <<
"Method separation called with hits from multiple cryostats..";
227 <<
"Method separation called with hits from multiple tpcs..";
233 <<
"Method separation called with hits from the same plane..";
240 double const hl = wgeom.
HalfL();
242 auto const xyz1 = wgeom.
GetEnd();
243 double s = (xyz1.Y() - xyz.Y()) / hl;
244 double c = (xyz1.Z() - xyz.Z()) / hl;
247 dist[hit.
WireID().
Plane] = xyz.Z() * s - xyz.Y() * c;
250 double S = ((sinth[1] * costh[2] - costh[1] * sinth[2]) * dist[0] +
251 (sinth[2] * costh[0] - costh[2] * sinth[0]) * dist[1] +
252 (sinth[0] * costh[1] - costh[0] * sinth[1]) * dist[2]);
266 int nhits = hits.
size();
270 bool result = nhits >= 2 && nhits <= 3;
272 unsigned int tpc = 0;
273 unsigned int cstat = 0;
280 for (
int ihit1 = 0; result && ihit1 < nhits - 1; ++ihit1) {
293 const std::vector<int>& tid1 = mcinfo1.
trackIDs;
294 bool only_neg1 = tid1.size() > 0 && tid1.back() < 0;
298 for (
int ihit2 = ihit1 + 1; result && ihit2 < nhits; ++ihit2) {
305 result = result && hit1WireID.
TPC == hit2WireID.
TPC && view1 != view2 &&
311 tpc = hit1WireID.
TPC;
323 if (result && useMC) {
328 std::vector<int> tid2 = mcinfo2.
trackIDs;
329 bool only_neg2 = tid2.size() > 0 && tid2.back() < 0;
331 tid1.begin(), tid1.end(), tid2.begin(), tid2.end(), tid2.begin());
332 tid2.resize(it - tid2.begin());
339 bool only_neg3 = tid2.size() > 0 && tid2.back() < 0;
340 mc_ok = tid2.size() > 0 && (!only_neg3 || (only_neg1 && only_neg2));
341 result = result && mc_ok;
347 result = mcinfo1.
pchit[hit2WireID.
Plane] == &hit2 ||
358 if (result && nhits == 3) {
362 double dist[3] = {0., 0., 0.};
363 double sinth[3] = {0., 0., 0.};
364 double costh[3] = {0., 0., 0.};
368 for (
int i = 0; i < 3; ++i) {
376 if ((hitWireID.
TPC != tpc) || (hitWireID.
Cryostat != cstat))
377 throw cet::exception(
"SpacePointAlg") <<
"compatible(): geometry mismatch\n";
381 double const hl = wgeom.
HalfL();
383 auto const xyz1 = wgeom.
GetEnd();
384 double s = (xyz1.Y() - xyz.Y()) / hl;
385 double c = (xyz1.Z() - xyz.Z()) / hl;
388 dist[hit.
WireID().
Plane] = xyz.Z() * s - xyz.Y() * c;
393 double S = ((sinth[1] * costh[2] - costh[1] * sinth[2]) * dist[0] +
394 (sinth[2] * costh[0] - costh[2] * sinth[0]) * dist[1] +
395 (sinth[0] * costh[1] - costh[0] * sinth[1]) * dist[2]);
412 std::vector<recob::SpacePoint>& sptv,
419 int nhits = hits.
size();
424 throw cet::exception(
"SpacePointAlg") <<
"fillSpacePoint(): hit already present!\n";
429 double xyz[3] = {0., 0., 0.};
430 double errxyz[6] = {0., 0., 0., 0., 0., 0.};
451 double w = 1. / (et * et);
458 double drift_time = 0.;
459 double var_time = 0.;
462 drift_time = sumtw / sumw;
464 var_time = 1. / sumw;
465 if (var_time < 0.) var_time = 0.;
466 chisq = sumt2w - sumtw * drift_time;
467 if (chisq < 0.) chisq = 0.;
469 xyz[0] = drift_time * timePitch;
470 errxyz[0] = var_time * timePitch * timePitch;
487 for (
auto const&
hit : hits | ranges::views::transform(
to_element)) {
493 double const hl = wgeom.
HalfL();
495 auto const cen1 = wgeom.
GetEnd();
496 double s = (cen1.Y() - cen.Y()) / hl;
497 double c = (cen1.Z() - cen.Z()) / hl;
498 double u = cen.Z() * s - cen.Y() * c;
499 double eu = wireReadoutGeom.Plane(hitWireID).WirePitch() / std::sqrt(12.);
500 double w = 1. / (eu * eu);
513 double denom = sc2 * ss2 - ssc *
ssc;
515 xyz[1] = (-suc * ss2 + sus *
ssc) / denom;
516 xyz[2] = (sus * sc2 - suc *
ssc) / denom;
517 errxyz[2] = ss2 / denom;
518 errxyz[4] = ssc / denom;
519 errxyz[5] = sc2 / denom;
549 std::vector<recob::SpacePoint>& spts,
550 std::multimap<double, KHitTrack>
const& trackMap)
const 557 it != trackMap.end();
563 const std::shared_ptr<const KHitBase>&
hit = track.
getHit();
578 if (compatible_hits.
size() >= 2) {
580 compatible_hits.
clear();
591 compatible_hits =
hits;
597 if (compatible_hits.
size() >= 2) {
610 std::vector<recob::SpacePoint>& sptv,
622 unsigned int tpc0 = 0;
623 unsigned int cstat0 = 0;
624 int nhits = hits.
size();
626 tpc0 = hits.
front()->WireID().TPC;
627 cstat0 = hits.
front()->WireID().Cryostat;
633 throw cet::exception(
"SpacePointAlg") <<
"fillComplexSpacePoint(): hit already present!\n";
639 unsigned int nplanes = wireReadoutGeom.Nplanes(
geo::TPCID(cstat0, tpc0));
640 std::vector<int> numhits(nplanes, 0);
641 std::vector<double>
weight(nplanes, 0.);
649 assert(hitWireID.
Cryostat == cstat0);
650 assert(hitWireID.
TPC == tpc0);
651 assert(hitWireID.
Plane < nplanes);
652 ++numhits[hitWireID.
Plane];
655 for (
unsigned int plane = 0; plane < nplanes; ++plane) {
656 double np = numhits[plane];
657 if (np > 0.) weight[plane] = 1. / (np * np * np);
662 double xyz[3] = {0., 0., 0.};
663 double errxyz[6] = {0., 0., 0., 0., 0., 0.};
684 double w = weight[hitWireID.
Plane] / (et * et);
691 double drift_time = 0.;
692 double var_time = 0.;
695 drift_time = sumtw / sumw;
696 var_time = sumt2w / sumw - drift_time * drift_time;
697 if (var_time < 0.) var_time = 0.;
698 chisq = sumt2w - sumtw * drift_time;
699 if (chisq < 0.) chisq = 0.;
701 xyz[0] = drift_time * timePitch;
702 errxyz[0] = var_time * timePitch * timePitch;
719 for (
auto const&
hit : hits | ranges::views::transform(
to_element)) {
725 double const hl = wgeom.
HalfL();
727 auto const cen1 = wgeom.
GetEnd();
728 double s = (cen1.Y() - cen.Y()) / hl;
729 double c = (cen1.Z() - cen.Z()) / hl;
730 double u = cen.Z() * s - cen.Y() * c;
731 double eu = wireReadoutGeom.Plane(hitWireID).WirePitch() / std::sqrt(12.);
732 double w = weight[hitWireID.
Plane] / (eu * eu);
745 double denom = sc2 * ss2 - ssc *
ssc;
747 xyz[1] = (-suc * ss2 + sus *
ssc) / denom;
748 xyz[2] = (sus * sc2 - suc *
ssc) / denom;
749 errxyz[2] = ss2 / denom;
750 errxyz[4] = ssc / denom;
751 errxyz[5] = sc2 / denom;
768 std::vector<recob::SpacePoint>& spts)
const 780 std::vector<recob::SpacePoint>& spts)
const 792 std::vector<recob::SpacePoint>& spts,
805 spts.erase(spts.begin(), spts.end());
818 std::vector<std::vector<std::vector<std::multimap<unsigned int, art::Ptr<recob::Hit>>>>> hitmap;
822 hitmap.resize(ncstat);
827 unsigned int cstat = cryoid.Cryostat;
829 hitmap[cstat].resize(ntpc);
830 for (
unsigned int tpc = 0; tpc < ntpc; ++tpc) {
831 unsigned int nplane = wireReadoutGeom.Nplanes({cstat, tpc});
832 hitmap[cstat][tpc].resize(nplane);
844 std::make_pair(phitWireID.
Wire, phit));
856 for (
auto const&
id : wireReadoutGeom.Iterate<
geo::PlaneID>()) {
857 auto const [cstat, tpc, plane] = std::make_tuple(
id.Cryostat,
id.TPC,
id.
Plane);
858 int nplane = wireReadoutGeom.Nplanes(
id);
860 hitmap[cstat][tpc][plane].
begin();
861 ihit != hitmap[cstat][tpc][plane].end();
869 mcinfo.
pchit.resize(nplane, 0);
870 mcinfo.
dist2.resize(nplane, 1.e20);
874 std::vector<sim::IDE> ides = bt_serv->
HitToAvgSimIDEs(clockData, phit);
878 mcinfo.
trackIDs.reserve(ides.size());
880 mcinfo.
trackIDs.push_back(i->trackID);
895 for (
auto const&
id : wireReadoutGeom.Iterate<
geo::PlaneID>()) {
896 auto const [cstat, tpc, plane] = std::make_tuple(
id.Cryostat,
id.TPC,
id.
Plane);
897 int nplane = wireReadoutGeom.Nplanes(
id);
899 hitmap[cstat][tpc][plane].
begin();
900 ihit != hitmap[cstat][tpc][plane].end();
905 if (mcinfo.
xyz.size() != 0) {
906 assert(mcinfo.
xyz.size() == 3);
910 for (
int plane2 = 0; plane2 < nplane; ++plane2) {
912 hitmap[cstat][tpc][plane2].
begin();
913 jhit != hitmap[cstat][tpc][plane2].end();
919 if (mcinfo2.
xyz.size() != 0) {
920 assert(mcinfo2.
xyz.size() == 3);
921 double dx = mcinfo.
xyz[0] - mcinfo2.
xyz[0];
922 double dy = mcinfo.
xyz[1] - mcinfo2.
xyz[1];
923 double dz = mcinfo.
xyz[2] - mcinfo2.
xyz[2];
924 double dist2 = dx * dx + dy * dy + dz * dz;
925 if (dist2 < mcinfo.
dist2[plane2]) {
926 mcinfo.
dist2[plane2] = dist2;
927 mcinfo.
pchit[plane2] = &hit2;
941 debug <<
"Total hits = " << hits.
size() <<
"\n\n";
942 for (
auto const&
id : geom->Iterate<
geo::TPCID>()) {
943 auto const [cstat, tpc] = std::make_tuple(
id.Cryostat,
id.TPC);
944 int nplane = hitmap[cstat][tpc].size();
945 for (
int plane = 0; plane < nplane; ++plane) {
946 debug <<
"TPC, Plane: " << tpc <<
", " << plane
947 <<
", hits = " << hitmap[cstat][tpc][plane].size() <<
"\n";
958 std::multimap<sptkey_type, recob::SpacePoint> sptmap;
959 std::set<sptkey_type> sptkeys;
962 for (
auto const& tpcid : geom->Iterate<
geo::TPCID>()) {
964 auto const [cstat, tpc] = std::make_tuple(tpcid.Cryostat, tpcid.TPC);
976 int nplane = hitmap[cstat][tpc].size();
977 std::vector<int> index(nplane);
979 for (
int i = 0; i < nplane; ++i)
982 for (
int i = 0; i < nplane - 1; ++i) {
983 for (
int j = i + 1; j < nplane; ++j) {
988 if ((hitmap[cstat][tpc][index[i]].
size() > hitmap[cstat][tpc][index[j]].
size() &&
1001 std::vector<std::multimap<unsigned int, art::Ptr<recob::Hit>>>& hitsByPlaneVec =
1003 int nViewsWithHits(0);
1005 for (
int i = 0; i < nplane; i++) {
1006 if (hitsByPlaneVec[index[i]].
size() > 0) nViewsWithHits++;
1012 if ((nViewsWithHits == 2 || nplane == 2) &&
fMinViews <= 2) {
1015 for (
int i = 0; i < nplane - 1; ++i) {
1016 unsigned int plane1 = index[i];
1018 if (hitmap[cstat][tpc][plane1].
empty())
continue;
1020 for (
int j = i + 1; j < nplane; ++j) {
1021 unsigned int plane2 = index[j];
1023 if (hitmap[cstat][tpc][plane2].
empty())
continue;
1027 const geo::WireGeo& wgeo2 = wireReadoutGeom.Plane(plane2_id).Wire(0);
1028 double const hl2 = wgeo2.
HalfL();
1029 auto const xyz21 = wgeo2.
GetStart();
1030 auto const xyz22 = wgeo2.
GetEnd();
1031 double s2 = (xyz22.Y() - xyz21.Y()) / (2. * hl2);
1032 double c2 = (xyz22.Z() - xyz21.Z()) / (2. * hl2);
1033 double dist2 = -xyz21.Y() * c2 + xyz21.Z() * s2;
1034 double pitch2 = wireReadoutGeom.Plane(plane2_id).WirePitch();
1037 hitmap[cstat][tpc][plane1].
size() > hitmap[cstat][tpc][plane2].
size())
1039 <<
"makeSpacePoints(): hitmaps with incompatible size\n";
1047 hitmap[cstat][tpc][plane1].
begin();
1048 ihit1 != hitmap[cstat][tpc][plane1].end();
1053 const geo::WireGeo& wgeo = wireReadoutGeom.Wire(phit1WireID);
1057 assert(phit1WireID.
Cryostat == cstat);
1058 assert(phit1WireID.
TPC == tpc);
1059 assert(phit1WireID.
Plane == plane1);
1061 auto const xyz2 = wgeo.
GetEnd();
1065 double wire21 = (-xyz1.Y() * c2 + xyz1.Z() * s2 - dist2) / pitch2;
1066 double wire22 = (-xyz2.Y() * c2 + xyz2.Z() * s2 - dist2) / pitch2;
1068 int wmin = std::max(0., std::min(wire21, wire22));
1069 int wmax = std::max(0., std::max(wire21, wire22) + 1.);
1072 ihit2 = hitmap[cstat][tpc][plane2].lower_bound(wmin),
1073 ihit2end = hitmap[cstat][tpc][plane2].upper_bound(wmax);
1075 for (; ihit2 != ihit2end; ++ihit2) {
1086 bool ok =
compatible(detProp, hitvec, useMC);
1100 std::vector<recob::SpacePoint> sptv;
1102 sptkey_type key = &*phit2;
1103 sptmap.insert(std::pair<sptkey_type, recob::SpacePoint>(key, sptv.back()));
1104 sptkeys.insert(key);
1122 unsigned int plane1 = index[0];
1123 unsigned int plane2 = index[1];
1124 unsigned int plane3 = index[2];
1129 const geo::WireGeo& wgeo1 = wireReadoutGeom.Plane(plane1_id).Wire(0);
1130 double const hl1 = wgeo1.
HalfL();
1131 auto const xyz11 = wgeo1.
GetStart();
1132 auto const xyz12 = wgeo1.
GetEnd();
1133 double s1 = (xyz12.Y() - xyz11.Y()) / (2. * hl1);
1134 double c1 = (xyz12.Z() - xyz11.Z()) / (2. * hl1);
1135 double dist1 = -xyz11.Y() * c1 + xyz11.Z() * s1;
1136 double pitch1 = wireReadoutGeom.Plane(plane1_id).WirePitch();
1142 const geo::WireGeo& wgeo2 = wireReadoutGeom.Plane(plane2_id).Wire(0);
1143 double const hl2 = wgeo2.
HalfL();
1144 auto const xyz21 = wgeo2.
GetStart();
1145 auto const xyz22 = wgeo2.
GetEnd();
1146 double s2 = (xyz22.Y() - xyz21.Y()) / (2. * hl2);
1147 double c2 = (xyz22.Z() - xyz21.Z()) / (2. * hl2);
1148 double dist2 = -xyz21.Y() * c2 + xyz21.Z() * s2;
1149 double pitch2 = wireReadoutGeom.Plane(plane2_id).WirePitch();
1155 const geo::WireGeo& wgeo3 = wireReadoutGeom.Plane(plane3_id).Wire(0);
1156 double const hl3 = wgeo3.
HalfL();
1157 auto const xyz31 = wgeo3.
GetStart();
1158 auto const xyz32 = wgeo3.
GetEnd();
1159 double s3 = (xyz32.Y() - xyz31.Y()) / (2. * hl3);
1160 double c3 = (xyz32.Z() - xyz31.Z()) / (2. * hl3);
1161 double dist3 = -xyz31.Y() * c3 + xyz31.Z() * s3;
1162 double pitch3 = wireReadoutGeom.Plane(plane3_id).WirePitch();
1167 double s12 = s1 * c2 - s2 *
c1;
1168 double s23 = s2 * c3 - s3 *
c2;
1169 double s31 = s3 * c1 - s1 * c3;
1174 ihit1 = hitmap[cstat][tpc][plane1].begin(),
1175 ihit1end = hitmap[cstat][tpc][plane1].end();
1176 for (; ihit1 != ihit1end; ++ihit1) {
1178 unsigned int wire1 = ihit1->first;
1181 const geo::WireGeo& wgeo = wireReadoutGeom.Wire(phit1WireID);
1185 assert(phit1WireID.
Cryostat == cstat);
1186 assert(phit1WireID.
TPC == tpc);
1187 assert(phit1WireID.
Plane == plane1);
1188 assert(phit1WireID.
Wire == wire1);
1190 auto const xyz2 = wgeo.
GetEnd();
1194 double t1 = phit1->
PeakTime() - TicksOffset1;
1195 double u1 = wire1 * pitch1 + dist1;
1199 double wire21 = (-xyz1.Y() * c2 + xyz1.Z() * s2 - dist2) / pitch2;
1200 double wire22 = (-xyz2.Y() * c2 + xyz2.Z() * s2 - dist2) / pitch2;
1202 int wmin = std::max(0., std::min(wire21, wire22));
1203 int wmax = std::max(0., std::max(wire21, wire22) + 1.);
1206 ihit2 = hitmap[cstat][tpc][plane2].lower_bound(wmin),
1207 ihit2end = hitmap[cstat][tpc][plane2].upper_bound(wmax);
1209 for (; ihit2 != ihit2end; ++ihit2) {
1211 int wire2 = ihit2->first;
1216 double t2 = phit2->
PeakTime() - TicksOffset2;
1229 bool h12ok =
compatible(detProp, hitvec, useMC);
1234 double u2 = wire2 * pitch2 + dist2;
1238 double u3pred = (-u1 * s23 - u2 * s31) / s12;
1239 double w3pred = (u3pred - dist3) / pitch3;
1241 int w3min = std::max(0., std::ceil(w3pred - w3delta));
1242 int w3max = std::max(0., std::floor(w3pred + w3delta));
1245 ihit3 = hitmap[cstat][tpc][plane3].lower_bound(w3min),
1246 ihit3end = hitmap[cstat][tpc][plane3].upper_bound(w3max);
1248 for (; ihit3 != ihit3end; ++ihit3) {
1250 int wire3 = ihit3->first;
1255 double t3 = phit3->
PeakTime() - TicksOffset3;
1264 double u3 = wire3 * pitch3 + dist3;
1265 double S = s23 * u1 + s31 * u2 + s12 * u3;
1275 bool h123ok =
compatible(detProp, hitvec, useMC);
1289 std::vector<recob::SpacePoint> sptv;
1291 sptkey_type key = &*phit3;
1292 sptmap.insert(std::pair<sptkey_type, recob::SpacePoint>(key, sptv.back()));
1293 sptkeys.insert(key);
1310 spts.reserve(spts.size() + sptkeys.size());
1316 sptkey_type key = *i;
1321 double best_chisq = 0.;
1325 sptmap.lower_bound(key);
1326 j != sptmap.upper_bound(key);
1329 if (best_spt == 0 || spt.
Chisq() < best_chisq) {
1331 best_chisq = spt.
Chisq();
1338 throw cet::exception(
"SpacePointAlg") <<
"makeSpacePoints(): no best point\n";
1339 spts.push_back(*best_spt);
1353 spts.reserve(spts.size() + sptkeys.size());
1359 sptkey_type key = *i;
1366 sptmap.lower_bound(key),
1368 sptmap.upper_bound(key);
1371 for (; jSPT != jSPTend; ++jSPT) {
1381 k != spt_hits.
end();
1390 std::sort(merged_hits.
begin(), merged_hits.
end());
1392 std::unique(merged_hits.
begin(), merged_hits.
end());
1393 merged_hits.
erase(it, merged_hits.
end());
1412 spts.reserve(spts.size() + sptkeys.size());
1420 spts.push_back(spt);
1431 debug <<
"\n2-hit space points = " << n2 <<
"\n" 1432 <<
"3-hit space points = " << n3 <<
"\n" 1433 <<
"2-hit filtered/merged space points = " << n2filt <<
"\n" 1434 <<
"3-hit filtered/merged space points = " << n3filt;
1449 <<
"Looking for ID " << spt.
ID() <<
" from " <<
fSptHitMap.size() << std::endl;
1450 throw cet::exception(
"SpacePointAlg") <<
"No Hits associated with space point.\n";
1452 return (*it).second;
code to link reconstructed objects back to the MC truth information
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
void reserve(size_type n)
Basic Kalman filter track class, plus one measurement on same surface.
const std::shared_ptr< const KHitBase > & getHit() const
Measurement.
Point_t const & GetCenter() const
Returns the world coordinate of the center of the wire [cm].
std::vector< const recob::Hit * > pchit
Pointer to nearest neighbor hit (indexed by plane).
typename data_t::iterator iterator
std::map< const recob::Hit *, HitMCInfo > fHitMCMap
double fTickOffsetU
Tick offset for plane U.
constexpr to_element_t to_element
Encapsulate the construction of a single cyostat .
double fMaxDT
Maximum time difference between planes.
double GetXTicksCoefficient(int t, int c) const
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
double GetXTicksOffset(int p, int t, int c) const
enum geo::_plane_orient Orient_t
Enumerate the possible plane projections.
Declaration of signal hit object.
Kalman filter wire-time measurement on a SurfWireX surface.
void update(detinfo::DetectorPropertiesData const &detProp) const
The data type to uniquely identify a Plane.
std::vector< double > dist2
Distance to nearest neighbor hit (indexed by plane).
bool fEnableW
Enable flag (W).
iterator erase(iterator position)
std::vector< int > trackIDs
Parent trackIDs.
const art::Ptr< recob::Hit > & getHit() const
Get original hit.
constexpr auto abs(T v)
Returns the absolute value of the argument.
CryostatID_t Cryostat
Index of cryostat.
Planes which measure Z direction.
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
geo::View_t View() const
View for the plane of the hit.
WireID_t Wire
Index of the wire within its plane.
geo::WireID const & WireID() const
Initial tdc tick for hit.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Point_t GetStart() const
Returns the world coordinate of one end of the wire [cm].
Point_t GetEnd() const
Returns the world coordinate of one end of the wire [cm].
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
void makeMCTruthSpacePoints(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
double separation(const art::PtrVector< recob::Hit > &hits) const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Planes that are in the horizontal plane.
SpacePointAlg(const fhicl::ParameterSet &pset)
typename data_t::const_iterator const_iterator
bool fEnableU
Enable flag (U).
void push_back(Ptr< U > const &p)
Signal from induction planes.
std::map< int, art::PtrVector< recob::Hit > > fSptHitMap
Planes that are in the vertical plane (e.g. ArgoNeuT).
std::vector< double > xyz
Location of ionization (all tracks).
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
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
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
void fillComplexSpacePoint(detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &sptv, int sptid) const
unsigned int NTPC() const
Number of TPCs in this cryostat.
double fMaxS
Maximum space separation between wires.
The data type to uniquely identify a TPC.
PlaneID_t Plane
Index of the plane within its TPC.
double correctedTime(detinfo::DetectorPropertiesData const &detProp, const recob::Hit &hit) const
bool fPreferColl
Sort by collection wire.
CryostatGeo const & Cryostat(CryostatID const &cryoid=details::cryostat_zero) const
Returns the specified cryostat.
void fillSpacePoints(detinfo::DetectorPropertiesData const &detProp, std::vector< recob::SpacePoint > &spts, std::multimap< double, KHitTrack > const &trackMap) const
Fill a collection of space points.
Detector simulation of raw signals on wires.
Class defining a plane for tracking. It provides various functionalities to convert track parameters ...
Encapsulate the geometry of a wire .
double HalfL() const
Returns half the length of the wire [cm].
float PeakTime() const
Time of the signal peak, in tick units.
double fTickOffsetV
Tick offset for plane V.
Encapsulate the construction of a single detector plane .
double dist(const TReal *x, const TReal *y, const unsigned int dimension)
Contains all timing reference information for the detector.
std::vector< sim::IDE > HitToAvgSimIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
double fTickOffsetW
Tick offset for plane W.
std::vector< double > SimIDEsToXYZ(std::vector< sim::IDE > const &ides) const
bool compatible(detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, bool useMC=false) const
int fMinViews
Mininum number of views per space point.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
Planes which measure W (third view for Bo, MicroBooNE, etc).
2D representation of charge deposited in the TDC/wire plane
TPCID_t TPC
Index of the TPC within its cryostat.
Algorithm for generating space points from hits.
void fillSpacePoint(detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &sptv, int sptid) const
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Encapsulate the construction of a single detector plane .
The data type to uniquely identify a cryostat.
Signal from collection planes.
bool fEnableV
Enable flag (V).