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" 82 static bool first =
true;
92 if (report)
mf::LogInfo(
"SpacePointAlg") <<
"Updating geometry constants.\n";
94 for (
unsigned int cstat = 0; cstat < geom->
Ncryostats(); ++cstat) {
100 for (
unsigned int tpc = 0; tpc < ntpc; ++tpc) {
105 unsigned int const nplane = tpcgeom.
Nplanes();
107 for (
unsigned int plane = 0; plane < nplane; ++plane) {
115 if (view ==
geo::kU) { viewname =
"U"; }
123 throw cet::exception(
"SpacePointAlg") <<
"Bad view = " << view <<
"\n";
128 sigtypename =
"Induction";
130 sigtypename =
"Collection";
132 throw cet::exception(
"SpacePointAlg") <<
"Bad signal type = " << sigtype <<
"\n";
137 orientname =
"Vertical";
139 orientname =
"Horizontal";
141 throw cet::exception(
"SpacePointAlg") <<
"Bad orientation = " << orient <<
"\n";
146 <<
"\nCryostat, TPC, Plane: " << cstat <<
"," << tpc <<
", " << plane <<
"\n" 147 <<
" View: " << viewname <<
"\n" 148 <<
" SignalType: " << sigtypename <<
"\n" 149 <<
" Orientation: " << orientname <<
"\n" 150 <<
" Plane location: " << xyz[0] <<
"\n" 151 <<
" Plane pitch: " << tpcgeom.
Plane0Pitch(plane) <<
"\n" 153 <<
" Wire pitch: " << tpcgeom.
WirePitch() <<
"\n" 154 <<
" Time offset: " << detProp.
GetXTicksOffset(plane, tpc, cstat) <<
"\n";
158 throw cet::exception(
"SpacePointAlg") <<
"Horizontal wire geometry not implemented.\n";
199 if (hits.
size() < 3)
return 0.;
203 if (hits.
size() > 3) {
204 mf::LogError(
"SpacePointAlg") <<
"Method separation called with more than three htis.";
212 double dist[3] = {0., 0., 0.};
213 double sinth[3] = {0., 0., 0.};
214 double costh[3] = {0., 0., 0.};
215 unsigned int cstats[3];
216 unsigned int tpcs[3];
217 unsigned int planes[3];
219 for (
int i = 0; i < 3; ++i) {
231 for (
int j = 0; j < i; ++j) {
235 <<
"Method separation called with hits from multiple cryostats..";
241 <<
"Method separation called with hits from multiple tpcs..";
247 <<
"Method separation called with hits from the same plane..";
254 double hl = wgeom.
HalfL();
259 double s = (xyz1[1] - xyz[1]) / hl;
260 double c = (xyz1[2] - xyz[2]) / hl;
266 double S = ((sinth[1] * costh[2] - costh[1] * sinth[2]) * dist[0] +
267 (sinth[2] * costh[0] - costh[2] * sinth[0]) * dist[1] +
268 (sinth[0] * costh[1] - costh[0] * sinth[1]) * dist[2]);
283 int nhits = hits.
size();
287 bool result = nhits >= 2 && nhits <= 3;
289 unsigned int tpc = 0;
290 unsigned int cstat = 0;
297 for (
int ihit1 = 0; result && ihit1 < nhits - 1; ++ihit1) {
310 const std::vector<int>& tid1 = mcinfo1.
trackIDs;
311 bool only_neg1 = tid1.size() > 0 && tid1.back() < 0;
315 for (
int ihit2 = ihit1 + 1; result && ihit2 < nhits; ++ihit2) {
322 result = result && hit1WireID.
TPC == hit2WireID.
TPC && view1 != view2 &&
328 tpc = hit1WireID.
TPC;
340 if (result && useMC) {
345 std::vector<int> tid2 = mcinfo2.
trackIDs;
346 bool only_neg2 = tid2.size() > 0 && tid2.back() < 0;
348 tid1.begin(), tid1.end(), tid2.begin(), tid2.end(), tid2.begin());
349 tid2.resize(it - tid2.begin());
356 bool only_neg3 = tid2.size() > 0 && tid2.back() < 0;
357 mc_ok = tid2.size() > 0 && (!only_neg3 || (only_neg1 && only_neg2));
358 result = result && mc_ok;
364 result = mcinfo1.
pchit[hit2WireID.
Plane] == &hit2 ||
375 if (result && nhits == 3) {
379 double dist[3] = {0., 0., 0.};
380 double sinth[3] = {0., 0., 0.};
381 double costh[3] = {0., 0., 0.};
383 for (
int i = 0; i < 3; ++i) {
391 if ((hitWireID.
TPC != tpc) || (hitWireID.
Cryostat != cstat))
392 throw cet::exception(
"SpacePointAlg") <<
"compatible(): geometry mismatch\n";
396 double hl = wgeom.
HalfL();
401 double s = (xyz1[1] - xyz[1]) / hl;
402 double c = (xyz1[2] - xyz[2]) / hl;
410 double S = ((sinth[1] * costh[2] - costh[1] * sinth[2]) * dist[0] +
411 (sinth[2] * costh[0] - costh[2] * sinth[0]) * dist[1] +
412 (sinth[0] * costh[1] - costh[0] * sinth[1]) * dist[2]);
430 std::vector<recob::SpacePoint>& sptv,
437 int nhits = hits.
size();
442 throw cet::exception(
"SpacePointAlg") <<
"fillSpacePoint(): hit already present!\n";
447 double xyz[3] = {0., 0., 0.};
448 double errxyz[6] = {0., 0., 0., 0., 0., 0.};
469 double w = 1. / (et * et);
476 double drift_time = 0.;
477 double var_time = 0.;
480 drift_time = sumtw / sumw;
482 var_time = 1. / sumw;
483 if (var_time < 0.) var_time = 0.;
484 chisq = sumt2w - sumtw * drift_time;
485 if (chisq < 0.) chisq = 0.;
487 xyz[0] = drift_time * timePitch;
488 errxyz[0] = var_time * timePitch * timePitch;
514 double hl = wgeom.
HalfL();
519 double s = (cen1[1] - cen[1]) / hl;
520 double c = (cen1[2] - cen[2]) / hl;
521 double u = cen[2] * s - cen[1] *
c;
523 double w = 1. / (eu * eu);
537 double denom = sc2 * ss2 - ssc * ssc;
539 xyz[1] = (-suc * ss2 + sus * ssc) / denom;
540 xyz[2] = (sus * sc2 - suc * ssc) / denom;
541 errxyz[2] = ss2 / denom;
542 errxyz[4] = ssc / denom;
543 errxyz[5] = sc2 / denom;
574 std::vector<recob::SpacePoint>& spts,
575 std::multimap<double, KHitTrack>
const& trackMap)
const 582 it != trackMap.end();
588 const std::shared_ptr<const KHitBase>&
hit = track.
getHit();
603 if (compatible_hits.
size() >= 2) {
605 compatible_hits.
clear();
616 compatible_hits = hits;
622 if (compatible_hits.
size() >= 2) {
636 std::vector<recob::SpacePoint>& sptv,
647 unsigned int tpc0 = 0;
648 unsigned int cstat0 = 0;
649 int nhits = hits.
size();
651 tpc0 = hits.
front()->WireID().TPC;
652 cstat0 = hits.
front()->WireID().Cryostat;
658 throw cet::exception(
"SpacePointAlg") <<
"fillComplexSpacePoint(): hit already present!\n";
665 std::vector<int> numhits(nplanes, 0);
666 std::vector<double>
weight(nplanes, 0.);
674 assert(hitWireID.
Cryostat == cstat0);
675 assert(hitWireID.
TPC == tpc0);
676 assert(hitWireID.
Plane < nplanes);
677 ++numhits[hitWireID.
Plane];
680 for (
unsigned int plane = 0; plane < nplanes; ++plane) {
681 double np = numhits[plane];
682 if (np > 0.) weight[plane] = 1. / (np * np * np);
687 double xyz[3] = {0., 0., 0.};
688 double errxyz[6] = {0., 0., 0., 0., 0., 0.};
709 double w = weight[hitWireID.
Plane] / (et * et);
716 double drift_time = 0.;
717 double var_time = 0.;
720 drift_time = sumtw / sumw;
721 var_time = sumt2w / sumw - drift_time * drift_time;
722 if (var_time < 0.) var_time = 0.;
723 chisq = sumt2w - sumtw * drift_time;
724 if (chisq < 0.) chisq = 0.;
726 xyz[0] = drift_time * timePitch;
727 errxyz[0] = var_time * timePitch * timePitch;
753 double hl = wgeom.
HalfL();
758 double s = (cen1[1] - cen[1]) / hl;
759 double c = (cen1[2] - cen[2]) / hl;
760 double u = cen[2] * s - cen[1] *
c;
762 double w = weight[hitWireID.
Plane] / (eu * eu);
776 double denom = sc2 * ss2 - ssc * ssc;
778 xyz[1] = (-suc * ss2 + sus * ssc) / denom;
779 xyz[2] = (sus * sc2 - suc * ssc) / denom;
780 errxyz[2] = ss2 / denom;
781 errxyz[4] = ssc / denom;
782 errxyz[5] = sc2 / denom;
800 std::vector<recob::SpacePoint>& spts)
const 813 std::vector<recob::SpacePoint>& spts)
const 826 std::vector<recob::SpacePoint>& spts,
839 spts.erase(spts.begin(), spts.end());
852 std::vector<std::vector<std::vector<std::multimap<unsigned int, art::Ptr<recob::Hit>>>>> hitmap;
856 hitmap.resize(ncstat);
857 for (
unsigned int cstat = 0; cstat < ncstat; ++cstat) {
859 hitmap[cstat].resize(ntpc);
860 for (
unsigned int tpc = 0; tpc < ntpc; ++tpc) {
862 hitmap[cstat][tpc].resize(nplane);
874 std::make_pair(phitWireID.
Wire, phit));
886 for (
unsigned int cstat = 0; cstat < ncstat; ++cstat) {
887 for (
unsigned int tpc = 0; tpc < geom->
Cryostat(cstat).
NTPC(); ++tpc) {
889 for (
int plane = 0; plane < nplane; ++plane) {
891 hitmap[cstat][tpc][plane].
begin();
892 ihit != hitmap[cstat][tpc][plane].end();
900 mcinfo.
pchit.resize(nplane, 0);
901 mcinfo.
dist2.resize(nplane, 1.e20);
905 std::vector<sim::IDE> ides = bt_serv->
HitToAvgSimIDEs(clockData, phit);
909 mcinfo.
trackIDs.reserve(ides.size());
911 mcinfo.
trackIDs.push_back(i->trackID);
928 for (
unsigned int cstat = 0; cstat < ncstat; ++cstat) {
929 for (
unsigned int tpc = 0; tpc < geom->
Cryostat(cstat).
NTPC(); ++tpc) {
931 for (
int plane = 0; plane < nplane; ++plane) {
933 hitmap[cstat][tpc][plane].
begin();
934 ihit != hitmap[cstat][tpc][plane].end();
939 if (mcinfo.
xyz.size() != 0) {
940 assert(mcinfo.
xyz.size() == 3);
944 for (
int plane2 = 0; plane2 < nplane; ++plane2) {
946 hitmap[cstat][tpc][plane2].
begin();
947 jhit != hitmap[cstat][tpc][plane2].end();
953 if (mcinfo2.
xyz.size() != 0) {
954 assert(mcinfo2.
xyz.size() == 3);
955 double dx = mcinfo.
xyz[0] - mcinfo2.
xyz[0];
956 double dy = mcinfo.
xyz[1] - mcinfo2.
xyz[1];
957 double dz = mcinfo.
xyz[2] - mcinfo2.
xyz[2];
958 double dist2 = dx * dx + dy * dy + dz * dz;
959 if (dist2 < mcinfo.
dist2[plane2]) {
960 mcinfo.
dist2[plane2] = dist2;
961 mcinfo.
pchit[plane2] = &hit2;
977 debug <<
"Total hits = " << hits.
size() <<
"\n\n";
979 for (
unsigned int cstat = 0; cstat < ncstat; ++cstat) {
980 for (
unsigned int tpc = 0; tpc < geom->
Cryostat(cstat).
NTPC(); ++tpc) {
981 int nplane = hitmap[cstat][tpc].size();
982 for (
int plane = 0; plane < nplane; ++plane) {
983 debug <<
"TPC, Plane: " << tpc <<
", " << plane
984 <<
", hits = " << hitmap[cstat][tpc][plane].size() <<
"\n";
996 std::multimap<sptkey_type, recob::SpacePoint> sptmap;
997 std::set<sptkey_type> sptkeys;
1000 for (
unsigned int cstat = 0; cstat < ncstat; ++cstat) {
1001 for (
unsigned int tpc = 0; tpc < geom->
Cryostat(cstat).
NTPC(); ++tpc) {
1016 int nplane = hitmap[cstat][tpc].size();
1017 std::vector<int>
index(nplane);
1019 for (
int i = 0; i < nplane; ++i)
1022 for (
int i = 0; i < nplane - 1; ++i) {
1024 for (
int j = i + 1; j < nplane; ++j) {
1029 if ((hitmap[cstat][tpc][index[i]].
size() > hitmap[cstat][tpc][index[j]].
size() &&
1032 int temp = index[i];
1033 index[i] = index[j];
1042 std::vector<std::multimap<unsigned int, art::Ptr<recob::Hit>>>& hitsByPlaneVec =
1044 int nViewsWithHits(0);
1046 for (
int i = 0; i < nplane; i++) {
1047 if (hitsByPlaneVec[index[i]].
size() > 0) nViewsWithHits++;
1053 if ((nViewsWithHits == 2 || nplane == 2) &&
fMinViews <= 2) {
1056 for (
int i = 0; i < nplane - 1; ++i) {
1057 unsigned int plane1 = index[i];
1059 if (hitmap[cstat][tpc][plane1].
empty())
continue;
1061 for (
int j = i + 1; j < nplane; ++j) {
1062 unsigned int plane2 = index[j];
1064 if (hitmap[cstat][tpc][plane2].
empty())
continue;
1068 double hl2 = wgeo2.
HalfL();
1073 double s2 = (xyz22[1] - xyz21[1]) / (2. * hl2);
1074 double c2 = (xyz22[2] - xyz21[2]) / (2. * hl2);
1075 double dist2 = -xyz21[1] * c2 + xyz21[2] * s2;
1076 double pitch2 = geom->
WirePitch(plane2, tpc, cstat);
1079 hitmap[cstat][tpc][plane1].
size() > hitmap[cstat][tpc][plane2].
size())
1081 <<
"makeSpacePoints(): hitmaps with incompatible size\n";
1089 hitmap[cstat][tpc][plane1].
begin();
1090 ihit1 != hitmap[cstat][tpc][plane1].end();
1099 assert(phit1WireID.
Cryostat == cstat);
1100 assert(phit1WireID.
TPC == tpc);
1101 assert(phit1WireID.
Plane == plane1);
1102 double hl1 = wgeo.
HalfL();
1110 double wire21 = (-xyz1[1] * c2 + xyz1[2] * s2 - dist2) / pitch2;
1111 double wire22 = (-xyz2[1] * c2 + xyz2[2] * s2 - dist2) / pitch2;
1117 ihit2 = hitmap[cstat][tpc][plane2].lower_bound(wmin),
1118 ihit2end = hitmap[cstat][tpc][plane2].upper_bound(wmax);
1120 for (; ihit2 != ihit2end; ++ihit2) {
1131 bool ok =
compatible(detProp, hitvec, useMC);
1145 std::vector<recob::SpacePoint> sptv;
1147 sptkey_type
key = &*phit2;
1148 sptmap.insert(std::pair<sptkey_type, recob::SpacePoint>(key, sptv.back()));
1149 sptkeys.insert(key);
1167 unsigned int plane1 = index[0];
1168 unsigned int plane2 = index[1];
1169 unsigned int plane3 = index[2];
1174 double hl1 = wgeo1.
HalfL();
1179 double s1 = (xyz12[1] - xyz11[1]) / (2. * hl1);
1180 double c1 = (xyz12[2] - xyz11[2]) / (2. * hl1);
1181 double dist1 = -xyz11[1] * c1 + xyz11[2] * s1;
1182 double pitch1 = geom->
WirePitch(plane1, tpc, cstat);
1183 const double TicksOffset1 = detProp.
GetXTicksOffset(plane1, tpc, cstat);
1188 double hl2 = wgeo2.
HalfL();
1193 double s2 = (xyz22[1] - xyz21[1]) / (2. * hl2);
1194 double c2 = (xyz22[2] - xyz21[2]) / (2. * hl2);
1195 double dist2 = -xyz21[1] * c2 + xyz21[2] * s2;
1196 double pitch2 = geom->
WirePitch(plane2, tpc, cstat);
1197 const double TicksOffset2 = detProp.
GetXTicksOffset(plane2, tpc, cstat);
1202 double hl3 = wgeo3.
HalfL();
1207 double s3 = (xyz32[1] - xyz31[1]) / (2. * hl3);
1208 double c3 = (xyz32[2] - xyz31[2]) / (2. * hl3);
1209 double dist3 = -xyz31[1] * c3 + xyz31[2] * s3;
1210 double pitch3 = geom->
WirePitch(plane3, tpc, cstat);
1211 const double TicksOffset3 = detProp.
GetXTicksOffset(plane3, tpc, cstat);
1215 double s12 = s1 * c2 - s2 *
c1;
1216 double s23 = s2 * c3 - s3 * c2;
1217 double s31 = s3 * c1 - s1 * c3;
1222 ihit1 = hitmap[cstat][tpc][plane1].begin(),
1223 ihit1end = hitmap[cstat][tpc][plane1].end();
1224 for (; ihit1 != ihit1end; ++ihit1) {
1226 unsigned int wire1 = ihit1->first;
1233 assert(phit1WireID.
Cryostat == cstat);
1234 assert(phit1WireID.
TPC == tpc);
1235 assert(phit1WireID.
Plane == plane1);
1236 assert(phit1WireID.
Wire == wire1);
1237 double hl1 = wgeo.
HalfL();
1245 double t1 = phit1->
PeakTime() - TicksOffset1;
1246 double u1 = wire1 * pitch1 + dist1;
1250 double wire21 = (-xyz1[1] * c2 + xyz1[2] * s2 - dist2) / pitch2;
1251 double wire22 = (-xyz2[1] * c2 + xyz2[2] * s2 - dist2) / pitch2;
1257 ihit2 = hitmap[cstat][tpc][plane2].lower_bound(wmin),
1258 ihit2end = hitmap[cstat][tpc][plane2].upper_bound(wmax);
1260 for (; ihit2 != ihit2end; ++ihit2) {
1262 int wire2 = ihit2->first;
1267 double t2 = phit2->
PeakTime() - TicksOffset2;
1280 bool h12ok =
compatible(detProp, hitvec, useMC);
1285 double u2 = wire2 * pitch2 + dist2;
1289 double u3pred = (-u1 * s23 - u2 * s31) / s12;
1290 double w3pred = (u3pred - dist3) / pitch3;
1292 int w3min =
std::max(0., std::ceil(w3pred - w3delta));
1293 int w3max =
std::max(0., std::floor(w3pred + w3delta));
1296 ihit3 = hitmap[cstat][tpc][plane3].lower_bound(w3min),
1297 ihit3end = hitmap[cstat][tpc][plane3].upper_bound(w3max);
1299 for (; ihit3 != ihit3end; ++ihit3) {
1301 int wire3 = ihit3->first;
1306 double t3 = phit3->
PeakTime() - TicksOffset3;
1315 double u3 = wire3 * pitch3 + dist3;
1316 double S = s23 * u1 + s31 * u2 + s12 * u3;
1326 bool h123ok =
compatible(detProp, hitvec, useMC);
1340 std::vector<recob::SpacePoint> sptv;
1342 sptkey_type
key = &*phit3;
1344 std::pair<sptkey_type, recob::SpacePoint>(key, sptv.back()));
1345 sptkeys.insert(key);
1362 spts.reserve(spts.size() + sptkeys.size());
1368 sptkey_type
key = *i;
1373 double best_chisq = 0.;
1377 sptmap.lower_bound(key);
1378 j != sptmap.upper_bound(key);
1381 if (best_spt == 0 || spt.
Chisq() < best_chisq) {
1383 best_chisq = spt.
Chisq();
1390 throw cet::exception(
"SpacePointAlg") <<
"makeSpacePoints(): no best point\n";
1391 spts.push_back(*best_spt);
1405 spts.reserve(spts.size() + sptkeys.size());
1411 sptkey_type
key = *i;
1418 sptmap.lower_bound(key),
1420 sptmap.upper_bound(key);
1423 for (; jSPT != jSPTend; ++jSPT) {
1433 k != spt_hits.
end();
1442 std::sort(merged_hits.
begin(), merged_hits.
end());
1444 std::unique(merged_hits.
begin(), merged_hits.
end());
1445 merged_hits.
erase(it, merged_hits.
end());
1464 spts.reserve(spts.size() + sptkeys.size());
1472 spts.push_back(spt);
1484 debug <<
"\n2-hit space points = " << n2 <<
"\n" 1485 <<
"3-hit space points = " << n3 <<
"\n" 1486 <<
"2-hit filtered/merged space points = " << n2filt <<
"\n" 1487 <<
"3-hit filtered/merged space points = " << n3filt;
1503 throw cet::exception(
"SpacePointAlg") <<
"No Hits associated with space point.\n";
1505 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.
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
geo::WireID WireID() const
enum geo::_plane_orient Orient_t
unsigned int Nplanes() const
Number of planes in this tpc.
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).
Geometry information for a single TPC.
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.
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.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
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 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.
View_t View() const
Which coordinate does this plane measure.
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
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.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
double WirePitch(unsigned plane=0) const
double fMaxS
Maximum space separation between wires.
static int max(int a, int b)
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.
double Plane0Pitch(unsigned int p) const
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.
Orient_t Orientation() const
What is the orientation of the plane.
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.
Declaration of signal hit object.
double fTickOffsetV
Tick offset for plane V.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
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).
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
2D representation of charge deposited in the TDC/wire plane
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
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
const double * PlaneLocation(unsigned int p) const
cet::coded_exception< error, detail::translate > exception
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
QTextStream & endl(QTextStream &s)
Encapsulate the construction of a single detector plane.
Signal from collection planes.
bool fEnableV
Enable flag (V).
WireGeo const & WireIDToWireGeo(geo::WireID const &wireid) const