195 unsigned int Ucount(0), Vcount(0);
196 for (
size_t h = 0;
h < ChHits.size();
h++) {
204 std::pair<double, double> ChanTime((
double)chit.
Channel(),
208 std::vector<const sim::IDE*> ides;
216 bool hasIDEs = !ides.empty();
229 fHitToWids[ChanTime] = std::vector<geo::WireID>();
237 std::vector<geo::WireID> widsWithIdes;
238 for (
size_t i = 0; i < ides.size(); i++) {
239 const double xyzIde[] = {ides[i]->x, ides[i]->y, ides[i]->z};
246 <<
"IDE at x = " << xyzIde[0] <<
", y = " << xyzIde[1] <<
", z = " << xyzIde[2]
247 <<
" does not correspond to a TPC.";
250 unsigned int tpc = tpcID.
TPC, cryo = tpcID.
Cryostat;
262 mf::LogError(
"DisambigCheat") <<
"Detected a point out of its wire plane:\n" 263 << e.what() <<
"\nUsing suggested wire " << IdeWid <<
"\n";
266 bool foundmatch(
false);
267 for (
size_t w = 0;
w < cwids.size();
w++) {
268 if (cwids[
w].
TPC != tpc || cwids[
w].Cryostat != cryo)
continue;
269 if ((
unsigned int)
std::abs((
int)(IdeWid.
Wire) - (
int)(cwids[
w].Wire)) <=
271 storethis = cwids[
w];
278 <<
"IDE NearestWire return more than 1 off from channel wids: wire " << IdeWid.
Wire;
282 bool alreadyStored(
false);
283 for (
size_t wid = 0; wid < widsWithIdes.size(); wid++)
284 if (storethis == widsWithIdes[wid]) alreadyStored =
true;
285 if (!alreadyStored) widsWithIdes.push_back(storethis);
294 <<
"Nhits mismatch: " <<
fHitToWids.size() <<
" " << Ucount + Vcount;
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
art::ServiceHandle< cheat::BackTrackerService const > bt_serv
AdcChannelData::View View
std::vector< unsigned int > fMaxWireShift
bool isValid
Whether this ID points to a valid element.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
CryostatID_t Cryostat
Index of cryostat.
Planes which measure Z direction.
WireID_t Wire
Index of the wire within its plane.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
art::ServiceHandle< geo::Geometry const > geom
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
unsigned int fBadIDENearestWire
std::map< std::pair< double, double >, std::vector< geo::WireID > > fHitToWids
The data type to uniquely identify a TPC.
float PeakTimeMinusRMS(float sigmas=+1.) const
float PeakTime() const
Time of the signal peak, in tick units.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< double > SimIDEsToXYZ(std::vector< sim::IDE > const &ides) const
Exception thrown on invalid wire number.
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
std::vector< const sim::IDE * > HitToSimIDEs_Ps(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
2D representation of charge deposited in the TDC/wire plane
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
TPCID_t TPC
Index of the TPC within its cryostat.
geo::WireID suggestedWireID() const
Returns a better wire ID.
recob::tracking::Plane Plane
bool hasSuggestedWire() const
Returns whether we known a better wire number.
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.