13 #include "cetlib_except/exception.h" 39 : fMaxDT{pset.
get<
double>(
"MaxDT")}
40 ,
fMaxS{pset.get<
double>(
"MaxS")}
42 ,
fEnableU{pset.get<
bool>(
"EnableU")}
43 ,
fEnableV{pset.get<
bool>(
"EnableV")}
44 ,
fEnableW{pset.get<
bool>(
"EnableW")}
45 ,
fFilter{pset.get<
bool>(
"Filter")}
46 ,
fMerge{pset.get<
bool>(
"Merge")}
55 throw cet::exception(
"SpacePointAlg") <<
"Filter and Merge flags are both true.\n";
59 std::cout <<
"SpacePointAlg configured with the following parameters:\n" 60 <<
" MaxDT = " <<
fMaxDT <<
"\n" 61 <<
" MaxS = " <<
fMaxS <<
"\n" 66 <<
" Filter = " <<
fFilter <<
"\n" 67 <<
" Merge = " <<
fMerge <<
"\n" 81 static bool first =
true;
91 if (report)
mf::LogInfo(
"SpacePointAlg") <<
"Updating geometry constants.\n";
98 std::string viewname =
"?";
99 if (view ==
geo::kU) { viewname =
"U"; }
107 throw cet::exception(
"SpacePointAlg") <<
"Bad view = " << view <<
"\n";
109 std::string sigtypename =
"?";
112 sigtypename =
"Induction";
114 sigtypename =
"Collection";
116 throw cet::exception(
"SpacePointAlg") <<
"Bad signal type = " << sigtype <<
"\n";
118 std::string orientname =
"?";
121 orientname =
"Vertical";
123 orientname =
"Horizontal";
125 throw cet::exception(
"SpacePointAlg") <<
"Bad orientation = " << orient <<
"\n";
128 auto const xyz = plane.GetCenter();
129 auto const& tpcgeom = geom->
TPC(plane.ID());
132 << plane.ID() <<
'\n' 133 <<
" View: " << viewname <<
"\n" 134 <<
" SignalType: " << sigtypename <<
"\n" 135 <<
" Orientation: " << orientname <<
"\n" 136 <<
" Plane location: " << xyz.X() <<
"\n" 137 <<
" Plane pitch: " << tpcgeom.Plane0Pitch(plane.ID().Plane) <<
"\n" 138 <<
" Wire angle: " << plane.Wire(0).ThetaZ() <<
"\n" 139 <<
" Wire pitch: " << tpcgeom.WirePitch() <<
"\n" 144 throw cet::exception(
"SpacePointAlg") <<
"Horizontal wire geometry not implemented.\n";
180 if (hits.
size() < 3)
return 0.;
184 if (hits.
size() > 3) {
185 mf::LogError(
"SpacePointAlg") <<
"Method separation called with more than three htis.";
193 double dist[3] = {0., 0., 0.};
194 double sinth[3] = {0., 0., 0.};
195 double costh[3] = {0., 0., 0.};
196 unsigned int cstats[3];
197 unsigned int tpcs[3];
198 unsigned int planes[3];
200 for (
int i = 0; i < 3; ++i) {
212 for (
int j = 0; j < i; ++j) {
216 <<
"Method separation called with hits from multiple cryostats..";
222 <<
"Method separation called with hits from multiple tpcs..";
228 <<
"Method separation called with hits from the same plane..";
235 double const hl = wgeom.
HalfL();
237 auto const xyz1 = wgeom.
GetEnd();
238 double s = (xyz1.Y() - xyz.Y()) / hl;
239 double c = (xyz1.Z() - xyz.Z()) / hl;
242 dist[hit.
WireID().
Plane] = xyz.Z() * s - xyz.Y() * c;
245 double S = ((sinth[1] * costh[2] - costh[1] * sinth[2]) * dist[0] +
246 (sinth[2] * costh[0] - costh[2] * sinth[0]) * dist[1] +
247 (sinth[0] * costh[1] - costh[0] * sinth[1]) * dist[2]);
261 int nhits = hits.
size();
265 bool result = nhits >= 2 && nhits <= 3;
267 unsigned int tpc = 0;
268 unsigned int cstat = 0;
275 for (
int ihit1 = 0; result && ihit1 < nhits - 1; ++ihit1) {
288 const std::vector<int>& tid1 = mcinfo1.
trackIDs;
289 bool only_neg1 = tid1.size() > 0 && tid1.back() < 0;
293 for (
int ihit2 = ihit1 + 1; result && ihit2 < nhits; ++ihit2) {
300 result = result && hit1WireID.
TPC == hit2WireID.
TPC && view1 != view2 &&
306 tpc = hit1WireID.
TPC;
318 if (result && useMC) {
323 std::vector<int> tid2 = mcinfo2.
trackIDs;
324 bool only_neg2 = tid2.size() > 0 && tid2.back() < 0;
326 tid1.begin(), tid1.end(), tid2.begin(), tid2.end(), tid2.begin());
327 tid2.resize(it - tid2.begin());
334 bool only_neg3 = tid2.size() > 0 && tid2.back() < 0;
335 mc_ok = tid2.size() > 0 && (!only_neg3 || (only_neg1 && only_neg2));
336 result = result && mc_ok;
342 result = mcinfo1.
pchit[hit2WireID.
Plane] == &hit2 ||
353 if (result && nhits == 3) {
357 double dist[3] = {0., 0., 0.};
358 double sinth[3] = {0., 0., 0.};
359 double costh[3] = {0., 0., 0.};
361 for (
int i = 0; i < 3; ++i) {
369 if ((hitWireID.
TPC != tpc) || (hitWireID.
Cryostat != cstat))
370 throw cet::exception(
"SpacePointAlg") <<
"compatible(): geometry mismatch\n";
374 double const hl = wgeom.
HalfL();
376 auto const xyz1 = wgeom.
GetEnd();
377 double s = (xyz1.Y() - xyz.Y()) / hl;
378 double c = (xyz1.Z() - xyz.Z()) / hl;
381 dist[hit.
WireID().
Plane] = xyz.Z() * s - xyz.Y() * c;
386 double S = ((sinth[1] * costh[2] - costh[1] * sinth[2]) * dist[0] +
387 (sinth[2] * costh[0] - costh[2] * sinth[0]) * dist[1] +
388 (sinth[0] * costh[1] - costh[0] * sinth[1]) * dist[2]);
405 std::vector<recob::SpacePoint>& sptv,
412 int nhits = hits.
size();
417 throw cet::exception(
"SpacePointAlg") <<
"fillSpacePoint(): hit already present!\n";
422 double xyz[3] = {0., 0., 0.};
423 double errxyz[6] = {0., 0., 0., 0., 0., 0.};
444 double w = 1. / (et * et);
451 double drift_time = 0.;
452 double var_time = 0.;
455 drift_time = sumtw / sumw;
457 var_time = 1. / sumw;
458 if (var_time < 0.) var_time = 0.;
459 chisq = sumt2w - sumtw * drift_time;
460 if (chisq < 0.) chisq = 0.;
462 xyz[0] = drift_time * timePitch;
463 errxyz[0] = var_time * timePitch * timePitch;
488 double const hl = wgeom.
HalfL();
490 auto const cen1 = wgeom.
GetEnd();
491 double s = (cen1.Y() - cen.Y()) / hl;
492 double c = (cen1.Z() - cen.Z()) / hl;
493 double u = cen.Z() * s - cen.Y() * c;
495 double w = 1. / (eu * eu);
508 double denom = sc2 * ss2 - ssc *
ssc;
510 xyz[1] = (-suc * ss2 + sus *
ssc) / denom;
511 xyz[2] = (sus * sc2 - suc *
ssc) / denom;
512 errxyz[2] = ss2 / denom;
513 errxyz[4] = ssc / denom;
514 errxyz[5] = sc2 / denom;
544 std::vector<recob::SpacePoint>& spts,
545 std::multimap<double, KHitTrack>
const& trackMap)
const 552 it != trackMap.end();
558 const std::shared_ptr<const KHitBase>&
hit = track.
getHit();
573 if (compatible_hits.
size() >= 2) {
575 compatible_hits.
clear();
586 compatible_hits =
hits;
592 if (compatible_hits.
size() >= 2) {
605 std::vector<recob::SpacePoint>& sptv,
616 unsigned int tpc0 = 0;
617 unsigned int cstat0 = 0;
618 int nhits = hits.
size();
620 tpc0 = hits.
front()->WireID().TPC;
621 cstat0 = hits.
front()->WireID().Cryostat;
627 throw cet::exception(
"SpacePointAlg") <<
"fillComplexSpacePoint(): hit already present!\n";
634 std::vector<int> numhits(nplanes, 0);
635 std::vector<double>
weight(nplanes, 0.);
643 assert(hitWireID.
Cryostat == cstat0);
644 assert(hitWireID.
TPC == tpc0);
645 assert(hitWireID.
Plane < nplanes);
646 ++numhits[hitWireID.
Plane];
649 for (
unsigned int plane = 0; plane < nplanes; ++plane) {
650 double np = numhits[plane];
651 if (np > 0.) weight[plane] = 1. / (np * np * np);
656 double xyz[3] = {0., 0., 0.};
657 double errxyz[6] = {0., 0., 0., 0., 0., 0.};
678 double w = weight[hitWireID.
Plane] / (et * et);
685 double drift_time = 0.;
686 double var_time = 0.;
689 drift_time = sumtw / sumw;
690 var_time = sumt2w / sumw - drift_time * drift_time;
691 if (var_time < 0.) var_time = 0.;
692 chisq = sumt2w - sumtw * drift_time;
693 if (chisq < 0.) chisq = 0.;
695 xyz[0] = drift_time * timePitch;
696 errxyz[0] = var_time * timePitch * timePitch;
721 double const hl = wgeom.
HalfL();
723 auto const cen1 = wgeom.
GetEnd();
724 double s = (cen1.Y() - cen.Y()) / hl;
725 double c = (cen1.Z() - cen.Z()) / hl;
726 double u = cen.Z() * s - cen.Y() * c;
728 double w = weight[hitWireID.
Plane] / (eu * eu);
741 double denom = sc2 * ss2 - ssc *
ssc;
743 xyz[1] = (-suc * ss2 + sus *
ssc) / denom;
744 xyz[2] = (sus * sc2 - suc *
ssc) / denom;
745 errxyz[2] = ss2 / denom;
746 errxyz[4] = ssc / denom;
747 errxyz[5] = sc2 / denom;
764 std::vector<recob::SpacePoint>& spts)
const 776 std::vector<recob::SpacePoint>& spts)
const 788 std::vector<recob::SpacePoint>& spts,
801 spts.erase(spts.begin(), spts.end());
814 std::vector<std::vector<std::vector<std::multimap<unsigned int, art::Ptr<recob::Hit>>>>> hitmap;
818 hitmap.resize(ncstat);
820 unsigned int cstat = cryoid.Cryostat;
822 hitmap[cstat].resize(ntpc);
823 for (
unsigned int tpc = 0; tpc < ntpc; ++tpc) {
825 hitmap[cstat][tpc].resize(nplane);
837 std::make_pair(phitWireID.
Wire, phit));
850 auto const [cstat, tpc, plane] = std::make_tuple(
id.Cryostat,
id.TPC,
id.
Plane);
853 hitmap[cstat][tpc][plane].
begin();
854 ihit != hitmap[cstat][tpc][plane].end();
862 mcinfo.
pchit.resize(nplane, 0);
863 mcinfo.
dist2.resize(nplane, 1.e20);
867 std::vector<sim::IDE> ides = bt_serv->
HitToAvgSimIDEs(clockData, phit);
871 mcinfo.
trackIDs.reserve(ides.size());
873 mcinfo.
trackIDs.push_back(i->trackID);
889 auto const [cstat, tpc, plane] = std::make_tuple(
id.Cryostat,
id.TPC,
id.
Plane);
892 hitmap[cstat][tpc][plane].
begin();
893 ihit != hitmap[cstat][tpc][plane].end();
898 if (mcinfo.
xyz.size() != 0) {
899 assert(mcinfo.
xyz.size() == 3);
903 for (
int plane2 = 0; plane2 < nplane; ++plane2) {
905 hitmap[cstat][tpc][plane2].
begin();
906 jhit != hitmap[cstat][tpc][plane2].end();
912 if (mcinfo2.
xyz.size() != 0) {
913 assert(mcinfo2.
xyz.size() == 3);
914 double dx = mcinfo.
xyz[0] - mcinfo2.
xyz[0];
915 double dy = mcinfo.
xyz[1] - mcinfo2.
xyz[1];
916 double dz = mcinfo.
xyz[2] - mcinfo2.
xyz[2];
917 double dist2 = dx * dx + dy * dy + dz * dz;
918 if (dist2 < mcinfo.
dist2[plane2]) {
919 mcinfo.
dist2[plane2] = dist2;
920 mcinfo.
pchit[plane2] = &hit2;
934 debug <<
"Total hits = " << hits.
size() <<
"\n\n";
936 auto const [cstat, tpc] = std::make_tuple(
id.Cryostat,
id.TPC);
937 int nplane = hitmap[cstat][tpc].size();
938 for (
int plane = 0; plane < nplane; ++plane) {
939 debug <<
"TPC, Plane: " << tpc <<
", " << plane
940 <<
", hits = " << hitmap[cstat][tpc][plane].size() <<
"\n";
951 std::multimap<sptkey_type, recob::SpacePoint> sptmap;
952 std::set<sptkey_type> sptkeys;
957 auto const [cstat, tpc] = std::make_tuple(tpcid.Cryostat, tpcid.TPC);
969 int nplane = hitmap[cstat][tpc].size();
970 std::vector<int> index(nplane);
972 for (
int i = 0; i < nplane; ++i)
975 for (
int i = 0; i < nplane - 1; ++i) {
977 for (
int j = i + 1; j < nplane; ++j) {
982 if ((hitmap[cstat][tpc][index[i]].
size() > hitmap[cstat][tpc][index[j]].
size() &&
995 std::vector<std::multimap<unsigned int, art::Ptr<recob::Hit>>>& hitsByPlaneVec =
997 int nViewsWithHits(0);
999 for (
int i = 0; i < nplane; i++) {
1000 if (hitsByPlaneVec[index[i]].
size() > 0) nViewsWithHits++;
1006 if ((nViewsWithHits == 2 || nplane == 2) &&
fMinViews <= 2) {
1009 for (
int i = 0; i < nplane - 1; ++i) {
1010 unsigned int plane1 = index[i];
1012 if (hitmap[cstat][tpc][plane1].
empty())
continue;
1014 for (
int j = i + 1; j < nplane; ++j) {
1015 unsigned int plane2 = index[j];
1017 if (hitmap[cstat][tpc][plane2].
empty())
continue;
1022 double const hl2 = wgeo2.
HalfL();
1023 auto const xyz21 = wgeo2.
GetStart();
1024 auto const xyz22 = wgeo2.
GetEnd();
1025 double s2 = (xyz22.Y() - xyz21.Y()) / (2. * hl2);
1026 double c2 = (xyz22.Z() - xyz21.Z()) / (2. * hl2);
1027 double dist2 = -xyz21.Y() * c2 + xyz21.Z() * s2;
1028 double pitch2 = geom->
WirePitch(plane2_id);
1031 hitmap[cstat][tpc][plane1].
size() > hitmap[cstat][tpc][plane2].
size())
1033 <<
"makeSpacePoints(): hitmaps with incompatible size\n";
1041 hitmap[cstat][tpc][plane1].
begin();
1042 ihit1 != hitmap[cstat][tpc][plane1].end();
1051 assert(phit1WireID.
Cryostat == cstat);
1052 assert(phit1WireID.
TPC == tpc);
1053 assert(phit1WireID.
Plane == plane1);
1055 auto const xyz2 = wgeo.
GetEnd();
1059 double wire21 = (-xyz1.Y() * c2 + xyz1.Z() * s2 - dist2) / pitch2;
1060 double wire22 = (-xyz2.Y() * c2 + xyz2.Z() * s2 - dist2) / pitch2;
1062 int wmin = std::max(0., std::min(wire21, wire22));
1063 int wmax = std::max(0., std::max(wire21, wire22) + 1.);
1066 ihit2 = hitmap[cstat][tpc][plane2].lower_bound(wmin),
1067 ihit2end = hitmap[cstat][tpc][plane2].upper_bound(wmax);
1069 for (; ihit2 != ihit2end; ++ihit2) {
1080 bool ok =
compatible(detProp, hitvec, useMC);
1094 std::vector<recob::SpacePoint> sptv;
1096 sptkey_type key = &*phit2;
1097 sptmap.insert(std::pair<sptkey_type, recob::SpacePoint>(key, sptv.back()));
1098 sptkeys.insert(key);
1116 unsigned int plane1 = index[0];
1117 unsigned int plane2 = index[1];
1118 unsigned int plane3 = index[2];
1124 double const hl1 = wgeo1.
HalfL();
1125 auto const xyz11 = wgeo1.
GetStart();
1126 auto const xyz12 = wgeo1.
GetEnd();
1127 double s1 = (xyz12.Y() - xyz11.Y()) / (2. * hl1);
1128 double c1 = (xyz12.Z() - xyz11.Z()) / (2. * hl1);
1129 double dist1 = -xyz11.Y() * c1 + xyz11.Z() * s1;
1130 double pitch1 = geom->
WirePitch(plane1_id);
1137 double const hl2 = wgeo2.
HalfL();
1138 auto const xyz21 = wgeo2.
GetStart();
1139 auto const xyz22 = wgeo2.
GetEnd();
1140 double s2 = (xyz22.Y() - xyz21.Y()) / (2. * hl2);
1141 double c2 = (xyz22.Z() - xyz21.Z()) / (2. * hl2);
1142 double dist2 = -xyz21.Y() * c2 + xyz21.Z() * s2;
1143 double pitch2 = geom->
WirePitch(plane2_id);
1150 double const hl3 = wgeo3.
HalfL();
1151 auto const xyz31 = wgeo3.
GetStart();
1152 auto const xyz32 = wgeo3.
GetEnd();
1153 double s3 = (xyz32.Y() - xyz31.Y()) / (2. * hl3);
1154 double c3 = (xyz32.Z() - xyz31.Z()) / (2. * hl3);
1155 double dist3 = -xyz31.Y() * c3 + xyz31.Z() * s3;
1156 double pitch3 = geom->
WirePitch(plane3_id);
1161 double s12 = s1 * c2 - s2 *
c1;
1162 double s23 = s2 * c3 - s3 *
c2;
1163 double s31 = s3 * c1 - s1 * c3;
1168 ihit1 = hitmap[cstat][tpc][plane1].begin(),
1169 ihit1end = hitmap[cstat][tpc][plane1].end();
1170 for (; ihit1 != ihit1end; ++ihit1) {
1172 unsigned int wire1 = ihit1->first;
1179 assert(phit1WireID.
Cryostat == cstat);
1180 assert(phit1WireID.
TPC == tpc);
1181 assert(phit1WireID.
Plane == plane1);
1182 assert(phit1WireID.
Wire == wire1);
1184 auto const xyz2 = wgeo.
GetEnd();
1188 double t1 = phit1->
PeakTime() - TicksOffset1;
1189 double u1 = wire1 * pitch1 + dist1;
1193 double wire21 = (-xyz1.Y() * c2 + xyz1.Z() * s2 - dist2) / pitch2;
1194 double wire22 = (-xyz2.Y() * c2 + xyz2.Z() * s2 - dist2) / pitch2;
1196 int wmin = std::max(0., std::min(wire21, wire22));
1197 int wmax = std::max(0., std::max(wire21, wire22) + 1.);
1200 ihit2 = hitmap[cstat][tpc][plane2].lower_bound(wmin),
1201 ihit2end = hitmap[cstat][tpc][plane2].upper_bound(wmax);
1203 for (; ihit2 != ihit2end; ++ihit2) {
1205 int wire2 = ihit2->first;
1210 double t2 = phit2->
PeakTime() - TicksOffset2;
1223 bool h12ok =
compatible(detProp, hitvec, useMC);
1228 double u2 = wire2 * pitch2 + dist2;
1232 double u3pred = (-u1 * s23 - u2 * s31) / s12;
1233 double w3pred = (u3pred - dist3) / pitch3;
1235 int w3min = std::max(0., std::ceil(w3pred - w3delta));
1236 int w3max = std::max(0., std::floor(w3pred + w3delta));
1239 ihit3 = hitmap[cstat][tpc][plane3].lower_bound(w3min),
1240 ihit3end = hitmap[cstat][tpc][plane3].upper_bound(w3max);
1242 for (; ihit3 != ihit3end; ++ihit3) {
1244 int wire3 = ihit3->first;
1249 double t3 = phit3->
PeakTime() - TicksOffset3;
1258 double u3 = wire3 * pitch3 + dist3;
1259 double S = s23 * u1 + s31 * u2 + s12 * u3;
1269 bool h123ok =
compatible(detProp, hitvec, useMC);
1283 std::vector<recob::SpacePoint> sptv;
1285 sptkey_type key = &*phit3;
1286 sptmap.insert(std::pair<sptkey_type, recob::SpacePoint>(key, sptv.back()));
1287 sptkeys.insert(key);
1304 spts.reserve(spts.size() + sptkeys.size());
1310 sptkey_type key = *i;
1315 double best_chisq = 0.;
1319 sptmap.lower_bound(key);
1320 j != sptmap.upper_bound(key);
1323 if (best_spt == 0 || spt.
Chisq() < best_chisq) {
1325 best_chisq = spt.
Chisq();
1332 throw cet::exception(
"SpacePointAlg") <<
"makeSpacePoints(): no best point\n";
1333 spts.push_back(*best_spt);
1347 spts.reserve(spts.size() + sptkeys.size());
1353 sptkey_type key = *i;
1360 sptmap.lower_bound(key),
1362 sptmap.upper_bound(key);
1365 for (; jSPT != jSPTend; ++jSPT) {
1375 k != spt_hits.
end();
1384 std::sort(merged_hits.
begin(), merged_hits.
end());
1386 std::unique(merged_hits.
begin(), merged_hits.
end());
1387 merged_hits.
erase(it, merged_hits.
end());
1406 spts.reserve(spts.size() + sptkeys.size());
1414 spts.push_back(spt);
1425 debug <<
"\n2-hit space points = " << n2 <<
"\n" 1426 <<
"3-hit space points = " << n3 <<
"\n" 1427 <<
"2-hit filtered/merged space points = " << n2filt <<
"\n" 1428 <<
"3-hit filtered/merged space points = " << n3filt;
1443 <<
"Looking for ID " << spt.
ID() <<
" from " <<
fSptHitMap.size() << std::endl;
1444 throw cet::exception(
"SpacePointAlg") <<
"No Hits associated with space point.\n";
1446 return (*it).second;
code to link reconstructed objects back to the MC truth information
details::range_type< T > Iterate() const
Initializes the specified ID with the ID of the first cryostat.
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].
WireGeo const & WireIDToWireGeo(WireID const &wireid) const
Returns the specified wire.
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.
Encapsulate the construction of a single cyostat.
double fMaxDT
Maximum time difference between planes.
double GetXTicksCoefficient(int t, int c) const
WireGeo const & Wire(unsigned int iwire) 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.
unsigned int Nplanes() const
Number of planes in this tpc.
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.
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.
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
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
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
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.
constexpr PlaneID const & asPlaneID() const
Conversion to PlaneID (for convenience of notation).
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.
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.
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
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)
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
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
Length_t WirePitch(PlaneID const &planeid=plane_zero) const
Returns the distance between two consecutive wires.
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).