14 #include "TPolyLine.h" 15 #include "TPolyLine3D.h" 16 #include "TPolyMarker.h" 17 #include "TPolyMarker3D.h" 18 #include "TRotation.h" 53 #include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h" 54 #include "larevt/CalibrationDBI/Interface/ChannelStatusService.h" 66 #include "cetlib_except/exception.h" 73 mf::LogWarning(
"RecoBaseDrawer") <<
"RecoBaseDrawer::" << fcn <<
" failed with message:\n" <<
e;
95 unsigned int nplanes = tpc.Nplanes();
103 auto const p = plane.ID().Plane;
130 lariov::ChannelStatusProvider
const& channelStatus =
143 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod) {
149 if (wires.
size() < 1)
continue;
151 for (
size_t i = 0; i < wires.
size(); ++i) {
153 uint32_t channel = wires[i]->Channel();
155 if (!rawOpt->
fSeeBadChannels && channelStatus.IsBad(channel))
continue;
157 std::vector<geo::WireID> wireids = geo->
ChannelToWire(channel);
161 for (
auto const& wid : wireids) {
162 if (wid.planeID() != pid)
continue;
164 double wire = 1. * wid.Wire;
167 std::vector<float> wirSig = wires[i]->Signal();
168 if (wirSig.size() == 0)
continue;
171 while (itr != wirSig.end()) {
175 while (ticksUsed < ticksPerPoint && itr != wirSig.end()) {
177 adcsum += (1. * (*itr));
182 double adc = adcsum / ticksPerPoint;
183 double tdc = tdcsum / ticksPerPoint;
185 if (TMath::Abs(adc) < rawOpt->
fMinSignal)
continue;
186 if (tdc > rawOpt->
fTicks)
continue;
195 if (sf > 1.0) sf = 1.0;
198 if (wire < minw) minw = wire;
199 if (wire > maxw) maxw = wire;
200 if (tdc < mint) mint = tdc;
201 if (tdc > maxt) maxt = tdc;
204 TBox& b1 = view->
AddBox(wire - sf * 0.5,
205 tdc - sf * 0.5 * ticksPerPoint,
207 tdc + sf * 0.5 * ticksPerPoint);
208 b1.SetFillStyle(1001);
210 b1.SetBit(kCannotPick);
213 TBox& b1 = view->
AddBox(tdc - sf * 0.5 * ticksPerPoint,
215 tdc + sf * 0.5 * ticksPerPoint,
217 b1.SetFillStyle(1001);
219 b1.SetBit(kCannotPick);
232 double startTick(50.);
233 double endTick((rawOpt->
fTicks - 50.) * ticksPerPoint);
235 for (
size_t wireNo = 0; wireNo < geo->
Nwires(pid); wireNo++) {
240 double wire = 1. * wireNo;
241 TLine& line = view->
AddLine(wire, startTick, wire, endTick);
242 line.SetLineColor(kGray);
243 line.SetLineWidth(1.0);
244 line.SetBit(kCannotPick);
268 if (recoOpt->
fDrawHits == 0)
return nHitsDrawn;
274 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
277 std::vector<const recob::Hit*>
hits;
278 this->
GetHits(evt, which, hits, plane);
281 for (
auto itr : hits) {
283 if (itr->WireID().TPC != rawOpt->
fTPC || itr->WireID().Cryostat != rawOpt->
fCryostat)
288 fRawCharge[itr->WireID().Plane] += itr->PeakAmplitude();
313 bool drawConnectingLines,
321 unsigned int wold = 0;
328 for (
const auto&
hit : hits) {
333 std::vector<geo::WireID> wireIDs;
338 wireIDs.push_back(
hit->WireID());
341 for (
const auto& wireID : wireIDs) {
342 if (wireID.TPC != rawOpt->
fTPC || wireID.Cryostat != rawOpt->
fCryostat)
continue;
344 if (std::isnan(
hit->PeakTime()) || std::isnan(
hit->Integral())) {
345 std::cout <<
"====>> Found hit with a NAN, channel: " <<
hit->Channel()
346 <<
", start/end: " <<
hit->StartTick() <<
"/" <<
hit->EndTick()
347 <<
", chisquare: " <<
hit->GoodnessOfFit() << std::endl;
350 if (
hit->PeakTime() > rawOpt->
fTicks)
continue;
356 float time =
hit->PeakTime();
357 float rms = 0.5 *
hit->RMS();
360 TBox& b1 = view->
AddBox(w - 0.5, time - rms, w + 0.5, time + rms);
361 if (drawConnectingLines && nHitsDrawn > 0) {
362 TLine& l = view->
AddLine(w, time, wold, timeold);
363 l.SetLineColor(color);
364 l.SetBit(kCannotPick);
367 b1.SetBit(kCannotPick);
368 b1.SetLineColor(color);
369 b1.SetLineWidth(lineWidth);
372 TBox& b1 = view->
AddBox(time - rms, w - 0.5, time + rms, w + 0.5);
373 if (drawConnectingLines && nHitsDrawn > 0) {
374 TLine& l = view->
AddLine(time, w, timeold, wold);
375 l.SetLineColor(color);
376 l.SetBit(kCannotPick);
379 b1.SetBit(kCannotPick);
380 b1.SetLineColor(color);
381 b1.SetLineWidth(lineWidth);
402 unsigned int wold(0);
406 for (
const auto&
hit : hits) {
412 w =
hit->WireID().Wire;
416 float time =
hit->PeakTime();
419 if (nHitsDrawn > 0) {
420 TLine& l = view->
AddLine(w, time + 100, wold, timeold + 100);
423 if (cosmicscore > 0.5) l.SetLineColor(kMagenta);
424 l.SetBit(kCannotPick);
428 if (nHitsDrawn > 0) {
429 TLine& l = view->
AddLine(time + 20, w, timeold + 20, wold);
431 if (cosmicscore > 0.5) l.SetLineStyle(2);
432 l.SetBit(kCannotPick);
450 if ((
unsigned int)plane >
fWireMin.size()) {
452 <<
" Requested plane " << plane <<
" is larger than those available ";
462 minw = (minw - 30 < 0) ? 0 : minw - 30;
463 mint = (mint - 10 < 0) ? 0 : mint - 10;
465 int fTicks = rawOpt->
fTicks;
468 maxw = (maxw + 10 > (int)geo->
Nwires(planeid)) ? geo->
Nwires(planeid) : maxw + 10;
469 maxt = (maxt + 10 > fTicks) ? fTicks : maxt + 10;
502 for (
size_t iep = 0; iep < ep2d.
size(); ++iep) {
504 if (ep2d[iep]->View() != gview)
continue;
513 double x = ep2d[iep]->WireID().Wire;
514 double y = ep2d[iep]->DriftTime();
517 x = ep2d[iep]->DriftTime();
518 y = ep2d[iep]->WireID().Wire;
521 TMarker& strt = view->
AddMarker(x, y, color, 30, 2.0);
522 strt.SetMarkerColor(color);
526 char const* txt = s.c_str();
527 TText& vtxID = view->
AddText(x, y + 20, txt);
528 vtxID.SetTextColor(color);
529 vtxID.SetTextSize(0.05);
554 for (
size_t imod = 0; imod < recoOpt->
fOpFlashLabels.size(); ++imod) {
560 if (opflashes.
size() < 1)
continue;
562 int NFlashes = opflashes.
size();
565 MF_LOG_VERBATIM(
"RecoBaseDrawer") <<
"Total " << NFlashes <<
" flashes.";
568 for (
size_t iof = 0; iof < opflashes.
size(); ++iof) {
569 if (opflashes[iof]->TotalPE() < recoOpt->
fFlashMinPE)
continue;
570 if (opflashes[iof]->Time() < recoOpt->
fFlashTMin)
continue;
571 if (opflashes[iof]->Time() > recoOpt->
fFlashTMax)
continue;
574 <<
"Flash t: " << opflashes[iof]->Time() <<
"\t y,z : " << opflashes[iof]->YCenter()
575 <<
", " << opflashes[iof]->ZCenter() <<
" \t PE :" << opflashes[iof]->TotalPE();
579 float wire0 = FLT_MAX;
580 float wire1 = FLT_MIN;
583 std::vector<geo::Point_t> points;
584 points.emplace_back(0,
585 opflashes[iof]->YCenter() - opflashes[iof]->YWidth(),
586 opflashes[iof]->ZCenter() - opflashes[iof]->ZWidth());
587 points.emplace_back(0,
588 opflashes[iof]->YCenter() - opflashes[iof]->YWidth(),
589 opflashes[iof]->ZCenter() + opflashes[iof]->ZWidth());
590 points.emplace_back(0,
591 opflashes[iof]->YCenter() + opflashes[iof]->YWidth(),
592 opflashes[iof]->ZCenter() - opflashes[iof]->ZWidth());
593 points.emplace_back(0,
594 opflashes[iof]->YCenter() + opflashes[iof]->YWidth(),
595 opflashes[iof]->ZCenter() + opflashes[iof]->ZWidth());
597 for (
size_t i = 0; i < points.size(); ++i) {
605 if (wireID.
Wire < wire0) wire0 = wireID.
Wire;
606 if (wireID.
Wire > wire1) wire1 = wireID.
Wire;
609 TLine& line = view->
AddLine(flashtick, wire0, flashtick, wire1);
610 line.SetLineWidth(2);
611 line.SetLineStyle(2);
612 line.SetLineColor(Color);
615 TLine& line = view->
AddLine(wire0, flashtick, wire1, flashtick);
616 line.SetLineWidth(2);
617 line.SetLineStyle(2);
618 line.SetLineColor(Color);
639 for (
size_t imod = 0; imod < recoOpt->
fSeedLabels.size(); ++imod) {
645 if (seeds.
size() < 1)
continue;
648 for (
size_t isd = 0; isd < seeds.
size(); ++isd) {
651 double SeedPointErr[3];
652 double SeedDirErr[3];
656 seeds[isd]->GetPoint(SeedPoint, SeedPointErr);
657 seeds[isd]->GetDirection(SeedDir, SeedDirErr);
659 SeedEnd1[0] = SeedPoint[0] + SeedDir[0];
660 SeedEnd1[1] = SeedPoint[1] + SeedDir[1];
661 SeedEnd1[2] = SeedPoint[2] + SeedDir[2];
663 SeedEnd2[0] = SeedPoint[0] - SeedDir[0];
664 SeedEnd2[1] = SeedPoint[1] - SeedDir[1];
665 SeedEnd2[2] = SeedPoint[2] - SeedDir[2];
670 unsigned int wirepoint = 0;
671 unsigned int wireend1 = 0;
672 unsigned int wireend2 = 0;
679 wirepoint = atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
685 wireend1 = atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
691 wireend2 = atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
694 double x = wirepoint;
696 double x1 = wireend1;
698 double x2 = wireend2;
710 TMarker& strt = view->
AddMarker(x, y, color, 4, 1.5);
711 TLine& line = view->
AddLine(x1, y1, x2, y2);
712 strt.SetMarkerColor(color);
713 line.SetLineColor(color);
714 line.SetLineWidth(2.0);
735 static bool first =
true;
738 <<
"******** DrawSlices: 0 = none, 1 = color coded, 2 = color coded + ID at slice center\n";
739 std::cout <<
" 3 = open circle at slice center with size proportional to the AspectRatio. " 741 std::cout <<
" at the slice ends with connecting dotted lines\n";
745 unsigned int t = rawOpt->
fTPC;
748 for (
size_t imod = 0; imod < recoOpt->
fSliceLabels.size(); ++imod) {
752 if (slices.
size() < 1)
continue;
754 for (
size_t isl = 0; isl < slices.
size(); ++isl) {
755 int slcID(
std::abs(slices[isl]->ID()));
759 std::vector<const recob::Hit*>
hits = fmh.at(isl);
760 std::vector<const recob::Hit*> hits_on_plane;
761 for (
auto hit : hits) {
762 if (
hit->WireID().Plane == plane) { hits_on_plane.push_back(
hit); }
764 if (this->
Hit2D(hits_on_plane, color, view,
false,
false) < 1)
continue;
767 slices[isl]->Center().
X(), slices[isl]->Center().
Y(), slices[isl]->Center().
Z());
771 char const* txt = s.c_str();
772 TText& slcID = view->
AddText(wire, tick, txt);
773 slcID.SetTextSize(0.05);
774 slcID.SetTextColor(color);
780 slices[isl]->Center().
X(), slices[isl]->Center().
Y(), slices[isl]->Center().
Z());
783 float markerSize = 1;
784 if (slices[isl]->AspectRatio() > 0) {
785 markerSize = 1 / slices[isl]->AspectRatio();
786 if (markerSize > 3) markerSize = 3;
788 TMarker& ctr = view->
AddMarker(wire, tick, color, 24, markerSize);
789 ctr.SetMarkerColor(color);
791 TPolyLine& pline = view->
AddPolyLine(2, color, 2, 3);
793 slices[isl]->End0Pos().
X(), slices[isl]->End0Pos().
Y(), slices[isl]->End0Pos().
Z());
796 TMarker& end0 = view->
AddMarker(wire, tick, color, 20, 1.0);
797 end0.SetMarkerColor(color);
798 pline.SetPoint(0, wire, tick);
800 slices[isl]->End1Pos().
X(), slices[isl]->End1Pos().
Y(), slices[isl]->End1Pos().
Z());
803 TMarker& end1 = view->
AddMarker(wire, tick, color, 20, 1.0);
804 end1.SetMarkerColor(color);
805 pline.SetPoint(1, wire, tick);
837 static bool first =
true;
839 std::cout <<
"******** DrawClusters: 0 = none, 1 = cluster hits, 2 = unique marker, 3 = " 840 "cluster hits with connecting lines.\n";
841 std::cout <<
" 4 = with T<cluster or trajectory ID> P<PFParticle ID> color-matched. " 842 "Unmatched cluster IDs shown in black.\n";
843 std::cout <<
" Color scheme: By cluster ID in each plane or by PFParticle ID (Self) if a " 844 "PFParticle - Cluster association exists.\n";
848 for (
size_t imod = 0; imod < recoOpt->
fClusterLabels.size(); ++imod) {
854 if (clust.
size() < 1)
continue;
860 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
864 if (spacePointVec.size() > 0) {
868 if (spHitAssnVec.isValid()) {
870 std::vector<const recob::Hit*> freeHitVec;
873 for (
const auto& spacePointPtr : spacePointVec) {
874 if (spacePointPtr->Chisq() < -99.) {
876 const std::vector<art::Ptr<recob::Hit>>& hitVec =
877 spHitAssnVec.at(spacePointPtr.key());
879 for (
const auto& hitPtr : hitVec) {
880 if (hitPtr.get()->WireID().Plane != plane)
continue;
882 freeHitVec.push_back(hitPtr.get());
888 this->
Hit2D(freeHitVec, kGray, view,
false,
false,
false);
896 for (
size_t ic = 0; ic < clust.
size(); ++ic) {
899 if (clust[ic]->
Plane().
Plane != plane)
continue;
902 int clusterIdx(
std::abs(clust[ic]->ID()));
904 bool pfpAssociation =
false;
905 int pfpIndex = INT_MAX;
906 float cosmicscore = FLT_MIN;
909 std::vector<art::Ptr<recob::PFParticle>> pfplist = fmc.at(ic);
911 if (!pfplist.empty()) {
912 clusterIdx = pfplist[0]->Self();
914 pfpAssociation =
true;
915 pfpIndex = pfplist[0]->Self();
919 if (fmct.isValid()) {
920 std::vector<art::Ptr<anab::CosmicTag>> ctlist = fmct.at(0);
921 if (!ctlist.empty()) {
923 cosmicscore = ctlist[0]->CosmicScore();
930 std::vector<const recob::Hit*>
hits = fmh.at(ic);
939 if (this->
Hit2D(hits, color, view,
false, drawConnectingLines) < 1)
continue;
942 this->
Hit2D(hits, view, cosmicscore);
952 if (pfpIndex != INT_MAX) s = s +
" P" +
std::to_string(pfpIndex + 1);
953 char const* txt = s.c_str();
954 double wire = 0.5 * (clust[ic]->StartWire() + clust[ic]->EndWire());
955 double tick = 20 + 0.5 * (clust[ic]->StartTick() + clust[ic]->EndTick());
956 TText& clID = view->
AddText(wire, tick, txt);
957 clID.SetTextSize(0.05);
958 if (pfpAssociation) { clID.SetTextColor(color); }
960 clID.SetTextColor(kBlack);
967 std::vector<double> tpts, wpts;
976 TPolyLine& p1 = view->
AddPolyLine(wpts.size(), lcolor, width, style);
977 TPolyLine& p2 = view->
AddPolyLine(wpts.size(), lcolor, width, style);
979 p1.SetFillStyle(3003);
980 p1.SetFillColor(fcolor);
981 for (
size_t i = 0; i < wpts.size(); ++i) {
983 p1.SetPoint(i, wpts[i], tpts[i]);
984 p2.SetPoint(i, wpts[i], tpts[i]);
987 p1.SetPoint(i, tpts[i], wpts[i]);
988 p2.SetPoint(i, tpts[i], wpts[i]);
998 double wirePitch = geo->
WirePitch(gview);
1009 clust[ic]->StartWire(),
1010 clust[ic]->StartTick(),
1011 clust[ic]->EndWire(),
1012 clust[ic]->EndTick(),
1013 std::tan((clust[ic]->StartAngle() + clust[ic]->EndAngle()) / 2.) * wirePitch /
1014 driftvelocity / timetick,
1041 double slope1 = slope;
1049 slope1 = 1. / slope;
1054 double deltaX = 0.5 * (x2 -
x1);
1055 double xm = x1 + deltaX;
1056 double ym = y1 + deltaX * slope;
1058 TMarker& strt = view->
AddMarker(xm, ym, color, kFullCircle, 1.0);
1059 strt.SetMarkerColor(color);
1062 double stublen = 2. * deltaX;
1063 TLine& l = view->
AddLine(x1, y1, x1 + stublen, y1 + slope1 * stublen);
1064 l.SetLineColor(color);
1084 double slope1 = slope;
1091 slope1 = 1. / slope;
1096 TMarker& strt = view->
AddMarker(x1, y1, color, kFullStar, 2.0);
1097 strt.SetMarkerColor(color);
1100 double stublen = 300.0;
1101 TLine& l = view->
AddLine(x1, y1, x1 + stublen, y1 + slope1 * stublen);
1102 l.SetLineColor(color);
1124 double cosx1 = cosx;
1125 double cosy1 = cosy;
1135 TMarker& strt = view->
AddMarker(x1, y1, color, kFullStar, 2.0);
1136 strt.SetMarkerColor(color);
1139 double stublen = 300.0;
1140 TLine& l = view->
AddLine(x1, y1, x1 + stublen * cosx1, y1 + stublen * cosy1);
1141 l.SetLineColor(color);
1158 std::vector<double>& wpts,
1159 std::vector<double>& tpts,
1165 std::map<unsigned int, double> wlo, whi;
1167 for (
size_t j = 0; j < hits.size(); ++j) {
1169 if (hits[j]->
WireID().Plane != plane || hits[j]->WireID().TPC != rawOpt->
fTPC ||
1170 hits[j]->WireID().Cryostat != rawOpt->
fCryostat)
1173 wlo[hits[j]->WireID().Wire] = hits[j]->PeakTime();
1174 whi[hits[j]->WireID().Wire] = hits[j]->PeakTime();
1180 for (
size_t j = 0; j < hits.size(); ++j) {
1181 t = hits[j]->PeakTime();
1183 if (t < wlo[hits[j]->
WireID().Wire]) wlo[hits[j]->WireID().Wire] = t;
1184 if (t > whi[hits[j]->
WireID().Wire]) whi[hits[j]->WireID().Wire] = t;
1191 for (; itr != itrEnd; ++itr) {
1192 unsigned int w = itr->first;
1195 wpts.push_back(1. * w - 0.1);
1196 tpts.push_back(t - 0.1);
1197 wpts.push_back(1. * w + 0.1);
1198 tpts.push_back(t - 0.1);
1203 std::map<unsigned int, double>::reverse_iterator ritr(whi.rbegin());
1204 std::map<unsigned int, double>::reverse_iterator ritrEnd(whi.rend());
1205 for (; ritr != ritrEnd; ++ritr) {
1206 unsigned int w = ritr->first;
1209 wpts.push_back(1. * w + 0.1);
1210 tpts.push_back(t + 0.1);
1211 wpts.push_back(1. * w - 0.1);
1212 tpts.push_back(t + 0.1);
1216 wpts.push_back(wpts[0]);
1217 tpts.push_back(tpts[0]);
1224 std::vector<const recob::Hit*>&
hits,
1227 TVector3
const& startPos,
1228 TVector3
const& startDir,
1237 unsigned int t = rawOpt->
fTPC;
1239 geo::Point_t localPos(startPos.X(), startPos.Y(), startPos.Z());
1246 if (cscore < 0.6) color = kMagenta;
1249 else if (cscore < -10000) {
1254 if (cscore < -1000) {
1255 this->
Hit2D(hits, color, view,
false,
false, lineWidth);
1259 char const* txt = s.c_str();
1262 TText& shwID = view->
AddText(wire, tick, txt);
1264 shwID.SetTextSize(0.1);
1268 this->
Hit2D(hits, color, view,
false,
false, lineWidth);
1275 double tick1 = detProp.
ConvertXToTicks((startPos + startDir).
X(), planeID);
1279 double ds = sqrt(pow(tick0 - tick1, 2) + pow(wire0 - wire1, 2));
1282 cost = (tick1 - tick0) / ds;
1283 cosw = (wire1 - wire0) / ds;
1294 std::vector<const recob::Hit*>&
hits,
1307 this->
Hit2D(hits, color, view,
false,
true, lineWidth);
1309 const auto& startPos = track->
Vertex();
1315 world.SetY(startPos.Y());
1316 world.SetZ(startPos.Z());
1325 wire = 1. * atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
1330 double wirePitch = geo->
WirePitch(hits[0]->View());
1339 double rotang = 3.1416 - thetawire;
1340 double yprime = std::cos(rotang) * startDir.Y() + std::sin(rotang) * startDir.Z();
1341 double dTdW = startDir.X() * wirePitch / driftvelocity / timetick / yprime;
1351 for (
size_t idx = 0; idx < nTrackHits; idx++) {
1356 world.SetY(hitPos.Y());
1357 world.SetZ(hitPos.Z());
1361 double wireHit = 0.;
1366 wireHit = 1. * atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
1369 if (tpcid.TPC == planeID.TPC && tpcid.Cryostat == planeID.Cryostat) {
1370 pl.SetPoint(vidx++, wireHit, tickHit);
1401 for (
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
1407 if (track.
vals().size() < 1)
continue;
1415 auto tracksProxy = proxy::getCollection<proxy::Tracks>(
evt, which);
1419 for (
size_t t = 0; t < track.
vals().size(); ++t) {
1421 if (track.
vals().at(t)->NumberTrajectoryPoints() == 0) {
1422 std::cout <<
"***** Track with no trajectory points ********" << std::endl;
1429 track.
vals().at(t)->End().Y(),
1430 track.
vals().at(t)->End().Z());
1434 track.
vals().at(t)->ID() &
1437 char const* txt = s.c_str();
1438 TText& trkID = view->
AddText(wire, tick, txt);
1440 trkID.SetTextSize(0.1);
1444 if (cosmicTrackTags.isValid()) {
1445 if (cosmicTrackTags.at(t).size() > 0) {
1451 std::vector<const recob::Hit*>
hits;
1452 if (track.
vals().at(t)->NumberTrajectoryPoints() == fmh.at(t).size()) {
1453 auto tp = tracksProxy[t];
1454 for (
auto point : tp.points()) {
1455 if (!point.isPointValid())
continue;
1456 hits.push_back(point.hit());
1464 while (itr < hits.end()) {
1465 if ((*itr)->View() != gview)
1477 if (Score < 0.6) color = kMagenta;
1480 else if (Score < -10000) {
1484 this->
DrawTrack2D(clockData, detProp, hits, view, plane, aTrack, color, lineWidth);
1490 static bool first =
true;
1493 std::cout <<
"DrawShower options: \n";
1494 std::cout <<
" 1 = Hits in shower color-coded by the shower ID\n";
1495 std::cout <<
" 2 = Same as 1 + shower axis and circle representing the shower cone\n";
1496 std::cout <<
" Black cone = shower start dE/dx < 1 MeV/cm (< 1/2 MIP)\n";
1497 std::cout <<
" Blue cone = shower start dE/dx < 3 MeV/cm (~1 MIP)\n";
1498 std::cout <<
" Green cone = shower start 3 MeV/cm < dE/dx < 5 MeV/cm (~2 MIP)\n";
1499 std::cout <<
" Red cone = shower start 5 MeV/cm < dE/dx (>2 MIP)\n";
1502 for (
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod) {
1507 if (shower.
vals().size() < 1)
continue;
1513 for (
size_t s = 0; s < shower.
vals().size(); ++s) {
1515 std::vector<const recob::Hit*>
hits = fmh.at(s);
1518 while (itr < hits.end()) {
1519 if ((*itr)->View() != gview)
1527 if (!shower.
vals().at(s)->has_length())
continue;
1528 if (!shower.
vals().at(s)->has_open_angle())
continue;
1530 TVector3 startPos = shower.
vals().at(s)->ShowerStart();
1531 TVector3
dir = shower.
vals().at(s)->Direction();
1532 double length = shower.
vals().at(s)->Length();
1533 double openAngle = shower.
vals().at(s)->OpenAngle();
1536 TVector3 endPos = startPos + length *
dir;
1545 TLine& coneLine = view->
AddLine(swire, stick, ewire, etick);
1547 std::vector<double> dedxVec = shower.
vals().at(s)->dEdx();
1551 if (plane < dedxVec.size()) {
1552 if (dedxVec[plane] > 1 && dedxVec[plane] < 3) {
1556 else if (dedxVec[plane] < 5) {
1565 coneLine.SetLineColor(color);
1568 double radius = length * openAngle;
1569 auto coneRim =
Circle3D(endPos, dir, radius);
1572 for (
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
1573 geo::Point_t localPos(coneRim[ipt][0], coneRim[ipt][1], coneRim[ipt][2]);
1577 pline.SetPoint(ipt, wire, tick);
1584 shower.
vals().at(s)->ShowerStart(),
1585 shower.
vals().at(s)->Direction(),
1624 if (trackCol.
vals().size() < 1)
continue;
1627 std::unique_ptr<art::Assns<recob::Vertex, recob::Track>> vertexTrackAssociations(
1636 if (vertexTrackAssnsHandle->size() < 1)
continue;
1644 auto tracksProxy = proxy::getCollection<proxy::Tracks>(
evt, which);
1650 std::cout <<
"==> Neutrino Candidate drawing for tagger " 1654 for (
const auto& vertexTrackAssn : *vertexTrackAssnsHandle) {
1658 if (vertex->
ID() != lastVtxIdx) {
1669 TMarker& strt = view->
AddMarker(wire, time, color, 24, 3.0);
1670 strt.SetMarkerColor(color);
1672 std::cout <<
" --> Drawing vertex id: " << vertex->
ID() << std::endl;
1675 lastVtxIdx = vertex->
ID();
1680 double x = track->
End().X();
1685 tid = track->
ID() & 65535;
1687 std::cout <<
" --> Drawing Track id: " << tid << std::endl;
1690 char const* txt = s.c_str();
1692 TText& trkID = view->
AddText(wire, tick, txt);
1693 trkID.SetTextColor(color);
1694 trkID.SetTextSize(0.1);
1696 float cosmicScore = -999;
1697 if (cosmicTrackTags.isValid()) {
1698 if (cosmicTrackTags.at(track.
key()).
size() > 0) {
1704 std::vector<const recob::Hit*>
hits;
1706 auto tp = tracksProxy[track.
key()];
1707 for (
auto point : tp.points()) {
1708 if (!point.isPointValid())
continue;
1709 hits.push_back(point.hit());
1713 hits = fmh.at(track.
key());
1717 while (itr < hits.end()) {
1718 if ((*itr)->View() != gview)
1726 if (cosmicScore > 0.1) {
1728 if (cosmicScore < 0.6) color = kMagenta;
1731 else if (cosmicScore < -10000) {
1755 static bool first =
true;
1758 std::cout <<
"******** DrawVertices: Open circles color coded across all planes. Set " 1759 "DrawVertices > 1 to display the vertex ID\n";
1765 for (
size_t imod = 0; imod < recoOpt->
fVertexLabels.size(); ++imod) {
1771 if (vertex.
size() < 1)
continue;
1775 double minxyz[3], maxxyz[3];
1776 minxyz[0] = world.X() - tpc.
HalfWidth();
1777 maxxyz[0] = world.X() + tpc.
HalfWidth();
1778 minxyz[1] = world.Y() - tpc.
HalfWidth();
1779 maxxyz[1] = world.Y() + tpc.
HalfWidth();
1780 minxyz[2] = world.Z() - tpc.
Length() / 2;
1781 maxxyz[2] = world.Z() + tpc.
Length() / 2;
1783 for (
size_t v = 0; v < vertex.
size(); ++v) {
1786 vertex[v]->XYZ(xyz);
1787 if (xyz[0] < minxyz[0] || xyz[0] > maxxyz[0])
continue;
1788 if (xyz[1] < minxyz[1] || xyz[1] > maxxyz[1])
continue;
1789 if (xyz[2] < minxyz[2] || xyz[2] > maxxyz[2])
continue;
1797 TMarker& strt = view->
AddMarker(wire, time, color, 24, 1.0);
1798 strt.SetMarkerColor(color);
1803 char const* txt = s.c_str();
1804 TText& vtxID = view->
AddText(wire, time + 30, txt);
1805 vtxID.SetTextColor(color);
1806 vtxID.SetTextSize(0.05);
1827 for (
unsigned int imod = 0; imod < recoOpt->
fEventLabels.size(); ++imod) {
1833 if (event.
size() < 1)
continue;
1837 for (
size_t e = 0;
e <
event.size(); ++
e) {
1838 std::vector<const recob::Hit*>
hits;
1844 while (itr < hits.end()) {
1845 if ((*itr)->View() != gview)
1865 std::vector<art::InputTag> labels;
1867 for (
size_t imod = 0; imod < recoOpt->
fSeedLabels.size(); ++imod)
1870 for (
size_t imod = 0; imod < labels.size(); ++imod) {
1878 if (seeds.
size() < 1)
continue;
1882 for (
size_t iseed = 0; iseed != seeds.
size(); ++iseed) {
1883 double pt[3], pterr[3],
dir[3], direrr[3];
1884 seeds.
at(iseed)->GetPoint(pt, pterr);
1885 seeds.
at(iseed)->GetDirection(dir, direrr);
1887 double end1[3], end2[3];
1888 for (
int i = 0; i != 3; ++i) {
1889 end1[i] = pt[i] + dir[i];
1890 end2[i] = pt[i] - dir[i];
1895 pmrk.SetPoint(iseed, pt[0], pt[1], pt[2]);
1896 pline.SetPoint(0, end1[0], end1[1], end1[2]);
1897 pline.SetPoint(1, end2[0], end2[1], end2[2]);
1910 std::vector<art::InputTag> labels;
1912 for (
size_t imod = 0; imod < recoOpt->
fSeedLabels.size(); ++imod)
1915 for (
size_t imod = 0; imod < labels.size(); ++imod) {
1923 for (
size_t iseed = 0; iseed != seeds.
size(); ++iseed) {
1924 double pt[3], pterr[3],
dir[3], direrr[3];
1925 seeds.
at(iseed)->GetPoint(pt, pterr);
1926 seeds.
at(iseed)->GetDirection(dir, direrr);
1928 double end1[3], end2[3];
1929 for (
int i = 0; i != 3; ++i) {
1930 end1[i] = pt[i] + dir[i];
1931 end2[i] = pt[i] - dir[i];
1935 TMarker& strt = view->
AddMarker(pt[1], pt[0], color, 4, 1.5);
1936 TLine& line = view->
AddLine(end1[1], end1[0], end2[1], end2[0]);
1939 line.SetLineWidth(2.0);
1942 TMarker& strt = view->
AddMarker(pt[2], pt[0], color, 4, 1.5);
1943 TLine& line = view->
AddLine(end1[2], end1[0], end2[2], end2[0]);
1946 line.SetLineWidth(2.0);
1951 <<
"projection is not YZ as expected\n";
1953 TMarker& strt = view->
AddMarker(pt[2], pt[1], color, 4, 1.5);
1954 TLine& line = view->
AddLine(end1[2], end1[1], end2[2], end2[1]);
1957 line.SetLineWidth(2.0);
1971 std::vector<art::InputTag> labels;
1977 for (
size_t imod = 0; imod < labels.size(); ++imod) {
1980 std::vector<art::Ptr<recob::SpacePoint>> spts;
1982 int color = 10 * imod + 11;
2019 <<
"RecoBaseDrawer: number PFParticles to draw: " << pfParticleVec.
size() << std::endl;
2022 if (pfParticleVec.
size() < 1)
continue;
2025 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
2029 std::vector<art::Ptr<recob::Edge>> edgeVec;
2033 if (spacePointVec.empty())
continue;
2042 if (!spacePointAssnVec.isValid())
continue;
2061 for (
size_t idx = 0; idx < pfParticleVec.
size(); idx++) {
2067 if (!pfParticle->IsPrimary())
continue;
2075 edgeSpacePointAssnsVec,
2092 bool usePlane[] = {
false,
false,
false};
2093 float peakTimeVec[] = {0., 0., 0.};
2094 float peakSigmaVec[] = {0., 0., 0.};
2096 float weightSum(0.);
2099 std::map<size_t, double> planeOffsetMap;
2101 planeOffsetMap[0] = 0.;
2102 planeOffsetMap[1] = 4.;
2103 planeOffsetMap[2] = 8.;
2105 for (
const auto&
hit : hitVec) {
2108 float peakTime =
hit->PeakTime() - planeOffsetMap[
hit->WireID().Plane];
2109 float peakRMS =
hit->RMS();
2111 aveSum += peakTime / (peakRMS * peakRMS);
2112 weightSum += 1. / (peakRMS * peakRMS);
2114 peakTimeVec[
hit->WireID().Plane] = peakTime;
2115 peakSigmaVec[
hit->WireID().Plane] = peakRMS;
2116 usePlane[
hit->WireID().Plane] =
true;
2119 aveSum /= weightSum;
2121 for (
int idx = 0; idx < 3; idx++) {
2122 if (usePlane[idx]) {
2123 float deltaTime = peakTimeVec[idx] - aveSum;
2124 float sigmaPeakTimeSq = peakSigmaVec[idx] * peakSigmaVec[idx];
2126 hitChiSq += deltaTime * deltaTime / sigmaPeakTimeSq;
2151 const std::vector<art::Ptr<recob::SpacePoint>>& hitsVec(spacePointAssnVec.at(pfPart.
key()));
2155 bool isCosmic(
false);
2160 std::vector<const anab::CosmicTag*> pfCosmicTagVec = cosmicTagAssnVec.at(pfPart.
key());
2162 if (!pfCosmicTagVec.empty()) {
2165 if (cosmicTag->
CosmicScore() > 0.6) isCosmic =
true;
2170 if (isCosmic) colorIdx = 12;
2256 const std::vector<art::Ptr<recob::Edge>>& edgeVec(edgeAssnsVec.at(pfPart.
key()));
2258 if (!edgeVec.empty()) {
2260 2 * edgeVec.size(), colorIdx, kFullDotMedium, 1.25);
2262 for (
const auto& edge : edgeVec) {
2264 const std::vector<art::Ptr<recob::SpacePoint>>& spacePointVec(
2265 edgeSPAssnVec.at(edge.key()));
2267 if (spacePointVec.size() != 2) {
2268 std::cout <<
"Space Point vector associated to edge is not of size 2: " 2269 << spacePointVec.size() << std::endl;
2276 TVector3 startPoint(firstSP->
XYZ()[0], firstSP->
XYZ()[1], firstSP->
XYZ()[2]);
2277 TVector3 endPoint(secondSP->
XYZ()[0], secondSP->
XYZ()[1], secondSP->
XYZ()[2]);
2278 TVector3 lineVec(endPoint - startPoint);
2280 pm.SetNextPoint(startPoint[0], startPoint[1], startPoint[2]);
2281 pm.SetNextPoint(endPoint[0], endPoint[1], endPoint[2]);
2283 double length = lineVec.Mag();
2286 std::cout <<
"Edge length is zero, index 1: " << edge->FirstPointID()
2287 <<
", index 2: " << edge->SecondPointID() << std::endl;
2291 double minLen = std::max(2.01, length);
2293 if (minLen > length) {
2296 startPoint += -0.5 * (minLen - length) * lineVec;
2297 endPoint += 0.5 * (minLen - length) * lineVec;
2303 pl.SetPoint(0, startPoint[0], startPoint[1], startPoint[2]);
2304 pl.SetPoint(1, endPoint[0], endPoint[1], endPoint[2]);
2314 if (trackAssnVec.isValid()) {
2315 std::vector<const recob::Track*> trackVec(trackAssnVec.at(pfPart.
key()));
2317 if (!trackVec.empty()) {
2318 for (
const auto&
track : trackVec)
2325 std::vector<const recob::PCAxis*> pcaVec(pcAxisAssnVec.at(pfPart.
key()));
2327 if (!pcaVec.empty()) {
2331 int lineWidth[2] = {2, 1};
2332 int lineStyle[2] = {1, 13};
2333 int lineColor[2] = {colorIdx, 18};
2335 int markStyle[2] = {kFullDotLarge, kFullDotLarge};
2336 double markSize[2] = {0.5, 0.2};
2339 if (!isCosmic) lineColor[1] = colorIdx;
2343 if (pcaVec.size() > 1 && pcaVec.front()->getID() > pcaVec.back()->getID())
2344 std::reverse(pcaVec.begin(), pcaVec.end());
2346 for (
const auto& pca : pcaVec) {
2348 const double* avePosition = pca->getAvePosition();
2352 TPolyMarker3D& pmrk =
2353 view->
AddPolyMarker3D(7, lineColor[pcaIdx], markStyle[pcaIdx], markSize[pcaIdx]);
2355 pmrk.SetPoint(pmrkIdx++, avePosition[0], avePosition[1], avePosition[2]);
2358 for (
int dimIdx = 0; dimIdx < 3; dimIdx++) {
2361 numPoints, lineColor[pcaIdx], lineWidth[pcaIdx], lineStyle[pcaIdx]);
2364 double eigenValue = pca->getEigenValues()[dimIdx];
2367 if (eigenValue > 0) {
2369 eigenValue = 3. * sqrt(eigenValue);
2372 const std::vector<double>& eigenVector = pca->getEigenVectors()[dimIdx];
2375 double xl = avePosition[0] - 0.5 * eigenValue * eigenVector[0];
2376 double yl = avePosition[1] - 0.5 * eigenValue * eigenVector[1];
2377 double zl = avePosition[2] - 0.5 * eigenValue * eigenVector[2];
2379 pl.SetPoint(0, xl, yl, zl);
2380 pmrk.SetPoint(pmrkIdx++, xl, yl, zl);
2383 double xu = avePosition[0] + 0.5 * eigenValue * eigenVector[0];
2384 double yu = avePosition[1] + 0.5 * eigenValue * eigenVector[1];
2385 double zu = avePosition[2] + 0.5 * eigenValue * eigenVector[2];
2387 pl.SetPoint(1, xu, yu, zu);
2388 pmrk.SetPoint(pmrkIdx++, xu, yu, zu);
2408 for (
const auto& daughterIdx : pfPart->
Daughters()) {
2435 for (
size_t imod = 0; imod < recoOpt->
fEdgeLabels.size(); ++imod) {
2439 std::vector<art::Ptr<recob::Edge>> edgeVec;
2440 this->
GetEdges(evt, which, edgeVec);
2443 <<
"RecoBaseDrawer: number Edges to draw: " << edgeVec.size() << std::endl;
2445 if (!edgeVec.empty()) {
2447 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
2454 spacePointVec.size(), colorIdx, kFullDotMedium, 0.5);
2456 for (
const auto& spacePoint : spacePointVec) {
2457 TVector3 spPosition(spacePoint->XYZ()[0], spacePoint->XYZ()[1], spacePoint->XYZ()[2]);
2459 pm.SetNextPoint(spPosition[0], spPosition[1], spPosition[2]);
2463 for (
const auto& edge : edgeVec) {
2467 if (firstSP->
ID() != edge->FirstPointID() || secondSP->
ID() != edge->SecondPointID()) {
2469 <<
"Edge: Space point index mismatch, first: " << firstSP->
ID() <<
", " 2470 << edge->FirstPointID() <<
", second: " << secondSP->
ID() <<
", " 2471 << edge->SecondPointID() << std::endl;
2475 TVector3 startPoint(firstSP->
XYZ()[0], firstSP->
XYZ()[1], firstSP->
XYZ()[2]);
2476 TVector3 endPoint(secondSP->
XYZ()[0], secondSP->
XYZ()[1], secondSP->
XYZ()[2]);
2477 TVector3 lineVec(endPoint - startPoint);
2479 double length = lineVec.Mag();
2491 TPolyMarker3D& fakeLine = view->
AddPolyMarker3D(10, 5, kFullDotMedium, 1.0);
2495 for (
int idx = 1; idx <= 10; idx++) {
2496 TVector3 plotPoint = startPoint + 0.1 * double(idx) * length * lineVec;
2498 fakeLine.SetNextPoint(plotPoint[0], plotPoint[1], plotPoint[2]);
2509 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
2513 <<
"RecoBaseDrawer: number Extreme points to draw: " << spacePointVec.size() << std::endl;
2515 if (!spacePointVec.empty()) {
2517 int colorIdx(kYellow);
2520 spacePointVec.size(), colorIdx, kFullDotLarge, 1.0);
2522 for (
const auto& spacePoint : spacePointVec) {
2523 TVector3 spPosition(spacePoint->XYZ()[0], spacePoint->XYZ()[1], spacePoint->XYZ()[2]);
2525 pm.SetNextPoint(spPosition[0], spPosition[1], spPosition[2]);
2548 for (
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
2557 trackView.
fill(trackVec);
2563 for (
const auto&
track : trackVec) {
2565 int marker = kFullDotLarge;
2571 if (cosmicTagAssnVec.isValid()) {
2572 std::vector<const anab::CosmicTag*> tkCosmicTagVec = cosmicTagAssnVec.at(
track.key());
2574 if (!tkCosmicTagVec.empty()) {
2595 for (
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod) {
2600 for (
size_t s = 0; s < shower.
vals().size(); ++s) {
2628 auto handles = evt->
getMany<std::vector<recob::Track>>();
2630 for (
auto ih : handles) {
2634 const std::string& which = handle.
provenance()->moduleLabel();
2637 if (fmsp.isValid() && fmsp.size() > 0) {
2638 int n = handle->size();
2639 float spSize = 0.5 *
size;
2641 for (
int i = 0; i <
n; ++i) {
2643 if (&*p == &track) {
2644 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
2657 int lineSize =
size;
2659 if (lineSize < 1) lineSize = 1;
2663 TPolyMarker3D& pmStart = view->
AddPolyMarker3D(1, 0, marker, 2. * size);
2666 pmStart.SetPoint(0, firstPos.X(), firstPos.Y(), firstPos.Z());
2671 for (
int p = 0; p < np; ++p) {
2675 pm.SetPoint(p, pos.X(), pos.Y(), pos.Z());
2681 for (
int p = 0; p < np; ++p) {
2686 pl.SetPoint(p, pos.X(), pos.Y(), pos.Z());
2695 for (
int p = 1; p < np; ++p) {
2701 auto deltaPos = nextPos - startPos;
2702 double arcLen = deltaPos.Dot(
2705 if (arcLen < 0.) arcLen = 3.;
2707 auto endPoint = startPos + arcLen * startDir;
2709 pl.SetPoint(0, startPos.X(), startPos.Y(), startPos.Z());
2710 pl.SetPoint(1, endPoint.X(), endPoint.Y(), endPoint.Z());
2732 auto handles = evt->
getMany<std::vector<recob::Shower>>();
2734 bool noSpts =
false;
2736 for (
auto ih : handles) {
2741 const std::string& which = handle.
provenance()->moduleLabel();
2744 int n = handle->size();
2745 for (
int i = 0; i <
n; ++i) {
2747 if (&*p == &shower) {
2749 std::vector<art::Ptr<recob::SpacePoint>> spts;
2764 std::cout <<
"No space points associated with the shower. Drawing a cone instead\n";
2766 auto& dedx = shower.
dEdx();
2767 if (!dedx.empty()) {
2769 for (
auto& dedxInPln : dedx)
2770 dedxAve += dedxInPln;
2771 dedxAve /= (double)dedx.size();
2775 if (dedxAve > 3 && dedxAve < 5) color = kGreen;
2782 for (
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
2783 auto&
pt = coneRim[ipt];
2784 pl.SetPoint(ipt,
pt[0],
pt[1],
pt[2]);
2787 for (
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
2789 panel.SetPoint(0, startPos.X(), startPos.Y(), startPos.Z());
2790 panel.SetPoint(1, coneRim[ipt][0], coneRim[ipt][1], coneRim[ipt][2]);
2800 const TVector3& axisDir,
2807 r.RotateX(axisDir.X());
2808 r.RotateY(axisDir.Y());
2809 r.RotateZ(axisDir.Z());
2810 constexpr
unsigned short nRimPts = 16;
2811 std::vector<std::array<double, 3>> rimPts(nRimPts + 1);
2812 for (
unsigned short iang = 0; iang < nRimPts; ++iang) {
2813 double rimAngle = iang * 2 * M_PI / (float)nRimPts;
2814 TVector3 rim = {0, 0, 1};
2815 rim.SetX(radius * cos(rimAngle));
2816 rim.SetY(radius * sin(rimAngle));
2820 for (
unsigned short ixyz = 0; ixyz < 3; ++ixyz)
2821 rimPts[iang][ixyz] = rim[ixyz];
2824 rimPts[nRimPts] = rimPts[0];
2838 for (
size_t imod = 0; imod < recoOpt->
fVertexLabels.size(); ++imod) {
2847 for (
size_t v = 0; v < vertex.
size(); ++v) {
2849 if (fmt.isValid()) {
2850 std::vector<art::Ptr<recob::Track>> tracks = fmt.at(v);
2853 for (
size_t t = 0; t < tracks.size(); ++t)
2854 this->
DrawTrack3D(*(tracks[t]), view, vertex[v]->ID());
2857 if (fms.isValid()) {
2858 std::vector<art::Ptr<recob::Shower>> showers = fms.at(v);
2860 for (
size_t s = 0; s < showers.size(); ++s)
2861 this->
DrawShower3D(*(showers[s]), vertex[v]->ID(), view);
2864 double xyz[3] = {0.};
2865 vertex[v]->XYZ(xyz);
2868 pm.SetPoint(0, xyz[0], xyz[1], xyz[2]);
2886 for (
size_t imod = 0; imod < recoOpt->
fEventLabels.size(); ++imod) {
2892 if (event.
size() < 1)
continue;
2897 for (
size_t e = 0;
e <
event.size(); ++
e) {
2900 std::vector<art::Ptr<recob::Vertex>>
vertex = fmvp.at(
e);
2902 if (vertex.size() < 1)
continue;
2907 for (
size_t v = 0; v < vertex.size(); ++v) {
2911 std::vector<art::Ptr<recob::Track>> tracks = fmt.at(v);
2912 std::vector<art::Ptr<recob::Shower>> showers = fms.at(v);
2915 for (
size_t t = 0; t < tracks.size(); ++t)
2918 for (
size_t s = 0; s < showers.size(); ++s)
2923 double xyz[3] = {0.};
2924 std::vector<const recob::Vertex*> vts = fmv.at(
e);
2926 event[
e]->PrimaryVertex(vts)->XYZ(xyz);
2929 pm.SetPoint(0, xyz[0], xyz[1], xyz[2]);
2946 for (
size_t imod = 0; imod < recoOpt->
fSliceLabels.size(); ++imod) {
2950 if (slices.
size() < 1)
continue;
2952 for (
size_t isl = 0; isl < slices.
size(); ++isl) {
2953 int slcID =
std::abs(slices[isl]->ID());
2955 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(isl);
2977 auto const world = tpc.GetCenter();
2978 if (minx > world.X() - tpc.HalfWidth()) minx = world.X() - tpc.HalfWidth();
2979 if (maxx < world.X() + tpc.HalfWidth()) maxx = world.X() + tpc.HalfWidth();
2984 for (
size_t imod = 0; imod < recoOpt->
fOpFlashLabels.size(); ++imod) {
2990 if (opflashes.
size() < 1)
continue;
2992 int NFlashes = opflashes.
size();
2995 for (
int iof = 0; iof < NFlashes; ++iof) {
2997 if (opflashes[iof]->TotalPE() < recoOpt->
fFlashMinPE)
continue;
2998 if (opflashes[iof]->Time() < recoOpt->
fFlashTMin)
continue;
2999 if (opflashes[iof]->Time() > recoOpt->
fFlashTMax)
continue;
3001 double YCentre = opflashes[iof]->YCenter();
3002 double YHalfWidth = opflashes[iof]->YWidth();
3003 double ZCentre = opflashes[iof]->ZCenter();
3004 double ZHalfWidth = opflashes[iof]->ZWidth();
3009 TBox& b1 = view->
AddBox(YCentre - YHalfWidth, minx, YCentre + YHalfWidth, maxx);
3010 b1.SetFillStyle(3004 + (iof % 3));
3011 b1.SetFillColor(Colour);
3018 TLine& line = view->
AddLine(ZCentre - ZHalfWidth, xflash, ZCentre + ZHalfWidth, xflash);
3019 line.SetLineWidth(2);
3020 line.SetLineStyle(2);
3021 line.SetLineColor(Colour);
3025 ZCentre - ZHalfWidth, YCentre - YHalfWidth, ZCentre + ZHalfWidth, YCentre + YHalfWidth);
3026 b1.SetFillStyle(3004 + (iof % 3));
3027 b1.SetFillColor(Colour);
3028 view->
AddMarker(ZCentre, YCentre, Colour, 4, 1.5);
3040 for (
size_t v = 0; v < vertex.
size(); ++v) {
3042 double xyz[3] = {0.};
3043 vertex[v]->XYZ(xyz);
3048 TMarker& strt = view->
AddMarker(xyz[1], xyz[0], color, marker, 1.0);
3049 strt.SetMarkerColor(color);
3052 TMarker& strt = view->
AddMarker(xyz[2], xyz[0], color, marker, 1.0);
3053 strt.SetMarkerColor(color);
3056 TMarker& strt = view->
AddMarker(xyz[2], xyz[1], color, marker, 1.0);
3057 strt.SetMarkerColor(color);
3070 for (
size_t imod = 0; imod < recoOpt->
fVertexLabels.size(); ++imod) {
3097 std::vector<art::InputTag> labels;
3103 for (
size_t imod = 0; imod < labels.size(); ++imod) {
3106 std::vector<art::Ptr<recob::SpacePoint>> spts;
3137 if (pfParticleVec.
size() < 1)
continue;
3143 if (!spacePointAssnVec.isValid())
continue;
3148 if (!pcAxisAssnVec.isValid())
continue;
3151 for (
size_t idx = 0; idx < pfParticleVec.
size(); idx++) {
3157 if (!pfParticle->IsPrimary())
continue;
3161 pfParticle, pfParticleVec, spacePointAssnVec, pcAxisAssnVec, 0, proj, view);
3180 const std::vector<const recob::SpacePoint*>& hitsVec(spacePointAssnVec.at(pfPart->
Self()));
3187 if (!hitsVec.empty()) {
3188 std::vector<const recob::SpacePoint*> hitPosVec;
3189 std::vector<const recob::SpacePoint*> skeletonPosVec;
3190 std::vector<const recob::SpacePoint*> skelEdgePosVec;
3191 std::vector<const recob::SpacePoint*> edgePosVec;
3192 std::vector<const recob::SpacePoint*> seedPosVec;
3193 std::vector<const recob::SpacePoint*> pairPosVec;
3195 for (
const auto& spacePoint : hitsVec) {
3196 if (spacePoint->Chisq() > 0.)
3197 hitPosVec.push_back(spacePoint);
3198 else if (spacePoint->Chisq() == -1.)
3199 skeletonPosVec.push_back(spacePoint);
3200 else if (spacePoint->Chisq() == -3.)
3201 skelEdgePosVec.push_back(spacePoint);
3202 else if (spacePoint->Chisq() == -4.)
3203 seedPosVec.push_back(spacePoint);
3204 else if (spacePoint->Chisq() > -10.)
3205 edgePosVec.push_back(spacePoint);
3207 pairPosVec.push_back(spacePoint);
3213 TPolyMarker& pm1 = view->
AddPolyMarker(hitPosVec.size(), colorIdx, kFullDotMedium, 1);
3214 for (
const auto* spacePoint : hitPosVec) {
3215 const double* pos = spacePoint->XYZ();
3218 pm1.SetPoint(hitIdx++, pos[0], pos[1]);
3220 pm1.SetPoint(hitIdx++, pos[2], pos[0]);
3222 pm1.SetPoint(hitIdx++, pos[2], pos[1]);
3227 TPolyMarker& pm2 = view->
AddPolyMarker(edgePosVec.size(), 28, kFullDotMedium, 1);
3228 for (
const auto* spacePoint : edgePosVec) {
3229 const double* pos = spacePoint->XYZ();
3232 pm2.SetPoint(hitIdx++, pos[0], pos[1]);
3234 pm2.SetPoint(hitIdx++, pos[2], pos[0]);
3236 pm2.SetPoint(hitIdx++, pos[2], pos[1]);
3241 TPolyMarker& pm3 = view->
AddPolyMarker(pairPosVec.size(), 2, kFullDotMedium, 1);
3242 for (
const auto* spacePoint : pairPosVec) {
3243 const double* pos = spacePoint->XYZ();
3246 pm3.SetPoint(hitIdx++, pos[0], pos[1]);
3248 pm3.SetPoint(hitIdx++, pos[2], pos[0]);
3250 pm3.SetPoint(hitIdx++, pos[2], pos[1]);
3256 TPolyMarker& pm4 = view->
AddPolyMarker(skeletonPosVec.size(), 1, kFullDotMedium, 1);
3257 for (
const auto* spacePoint : skeletonPosVec) {
3258 const double* pos = spacePoint->XYZ();
3261 pm4.SetPoint(hitIdx++, pos[0], pos[1]);
3263 pm4.SetPoint(hitIdx++, pos[2], pos[0]);
3265 pm4.SetPoint(hitIdx++, pos[2], pos[1]);
3270 TPolyMarker& pm5 = view->
AddPolyMarker(skelEdgePosVec.size(), 3, kFullDotMedium, 1);
3271 for (
const auto* spacePoint : skelEdgePosVec) {
3272 const double* pos = spacePoint->XYZ();
3275 pm5.SetPoint(hitIdx++, pos[0], pos[1]);
3277 pm5.SetPoint(hitIdx++, pos[2], pos[0]);
3279 pm5.SetPoint(hitIdx++, pos[2], pos[1]);
3284 TPolyMarker& pm6 = view->
AddPolyMarker(seedPosVec.size(), 6, kFullDotMedium, 1);
3285 for (
const auto* spacePoint : seedPosVec) {
3286 const double* pos = spacePoint->XYZ();
3289 pm6.SetPoint(hitIdx++, pos[0], pos[1]);
3291 pm6.SetPoint(hitIdx++, pos[2], pos[0]);
3293 pm6.SetPoint(hitIdx++, pos[2], pos[1]);
3298 if (pcAxisAssnVec.isValid()) {
3299 std::vector<const recob::PCAxis*> pcaVec(pcAxisAssnVec.at(pfPart->
Self()));
3301 if (!pcaVec.empty()) {
3304 int lineWidth[2] = {3, 1};
3305 int lineStyle[2] = {1, 13};
3306 int lineColor[2] = {colorIdx, 18};
3307 int markStyle[2] = {4, 4};
3312 if (pcaVec.size() > 1 && pcaVec.front()->getID() > pcaVec.back()->getID())
3313 std::reverse(pcaVec.begin(), pcaVec.end());
3315 for (
const auto& pca : pcaVec) {
3317 const double* avePosition = pca->getAvePosition();
3321 TPolyMarker& pmrk = view->
AddPolyMarker(7, lineColor[pcaIdx], markStyle[pcaIdx], 1);
3324 pmrk.SetPoint(pmrkIdx++, avePosition[0], avePosition[1]);
3326 pmrk.SetPoint(pmrkIdx++, avePosition[2], avePosition[0]);
3328 pmrk.SetPoint(pmrkIdx++, avePosition[2], avePosition[1]);
3331 for (
int dimIdx = 0; dimIdx < 3; dimIdx++) {
3334 view->
AddPolyLine(numPoints, lineColor[pcaIdx], lineWidth[pcaIdx], lineStyle[pcaIdx]);
3337 double eigenValue = pca->getEigenValues()[dimIdx];
3340 if (eigenValue > 0) {
3342 eigenValue = 3. * sqrt(eigenValue);
3345 const std::vector<double>& eigenVector = pca->getEigenVectors()[dimIdx];
3348 double xl = avePosition[0] - 0.5 * eigenValue * eigenVector[0];
3349 double yl = avePosition[1] - 0.5 * eigenValue * eigenVector[1];
3350 double zl = avePosition[2] - 0.5 * eigenValue * eigenVector[2];
3353 pl.SetPoint(0, xl, yl);
3354 pmrk.SetPoint(pmrkIdx++, xl, yl);
3357 pl.SetPoint(0, zl, xl);
3358 pmrk.SetPoint(pmrkIdx++, zl, xl);
3361 pl.SetPoint(0, zl, yl);
3362 pmrk.SetPoint(pmrkIdx++, zl, yl);
3366 double xu = avePosition[0] + 0.5 * eigenValue * eigenVector[0];
3367 double yu = avePosition[1] + 0.5 * eigenValue * eigenVector[1];
3368 double zu = avePosition[2] + 0.5 * eigenValue * eigenVector[2];
3371 pl.SetPoint(1, xu, yu);
3372 pmrk.SetPoint(pmrkIdx++, xu, yu);
3375 pl.SetPoint(1, zu, xu);
3376 pmrk.SetPoint(pmrkIdx++, zu, xu);
3379 pl.SetPoint(1, zu, yu);
3380 pmrk.SetPoint(pmrkIdx++, zu, yu);
3397 for (
const auto& daughterIdx : pfPart->
Daughters()) {
3429 for (
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
3434 for (
size_t t = 0; t < track.
vals().size(); ++t) {
3436 int color = ptrack->
ID() & 65535;
3448 for (
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod) {
3453 for (
size_t s = 0; s < shower.
vals().size(); ++s) {
3482 std::map<int, std::vector<art::Ptr<recob::SpacePoint>>> spmap;
3484 for (
auto& pspt : spts) {
3496 spcolor = 100 - 2.5 * pspt->Chisq();
3497 if (spcolor < 51) spcolor = 51;
3498 if (spcolor > 100) spcolor = 100;
3500 spmap[spcolor].push_back(pspt);
3507 for (
auto icolor : spmap) {
3508 int spcolor = icolor.first;
3509 std::vector<art::Ptr<recob::SpacePoint>>& psps = icolor.second;
3513 TPolyMarker& pm = view->
AddPolyMarker(psps.size(), spcolor, kFullCircle, msize);
3514 for (
size_t s = 0; s < psps.size(); ++s) {
3516 const double* xyz = spt.
XYZ();
3518 case evd::kXY: pm.SetPoint(s, xyz[0], xyz[1]);
break;
3519 case evd::kXZ: pm.SetPoint(s, xyz[2], xyz[0]);
break;
3520 case evd::kYZ: pm.SetPoint(s, xyz[2], xyz[1]);
break;
3523 << __func__ <<
": unknown projection #" << ((int)proj) <<
"\n";
3551 auto handles = evt->
getMany<std::vector<recob::Track>>();
3552 for (
auto ih : handles) {
3555 const std::string& which = handle.
provenance()->moduleLabel();
3558 int n = handle->size();
3559 for (
int i = 0; i <
n; ++i) {
3561 if (&*p == &track) {
3562 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
3581 for (
int p = 0; p < np; ++p) {
3586 pm.SetPoint(p, pos.X(), pos.Y());
3587 pl.SetPoint(p, pos.X(), pos.Y());
3590 pm.SetPoint(p, pos.Z(), pos.X());
3591 pl.SetPoint(p, pos.Z(), pos.X());
3594 pm.SetPoint(p, pos.Z(), pos.Y());
3595 pl.SetPoint(p, pos.Z(), pos.Y());
3599 << __func__ <<
": unknown projection #" << ((int)proj) <<
"\n";
3608 char const* txt = s.c_str();
3609 double x = track.
End().X();
3610 double y = track.
End().Y();
3611 double z = track.
End().Z();
3613 TText& trkID = view->
AddText(x, y, txt);
3614 trkID.SetTextColor(
evd::kColor[tid % evd::kNCOLS]);
3615 trkID.SetTextSize(0.03);
3618 TText& trkID = view->
AddText(z, x, txt);
3619 trkID.SetTextColor(
evd::kColor[tid % evd::kNCOLS]);
3620 trkID.SetTextSize(0.03);
3623 TText& trkID = view->
AddText(z, y, txt);
3624 trkID.SetTextColor(
evd::kColor[tid % evd::kNCOLS]);
3625 trkID.SetTextSize(0.03);
3647 auto handles = evt->
getMany<std::vector<recob::Shower>>();
3648 for (
auto ih : handles) {
3651 const std::string& which = handle.
provenance()->moduleLabel();
3653 if (!fmsp.isValid())
continue;
3654 int n = handle->size();
3655 for (
int i = 0; i <
n; ++i) {
3657 if (&*p == &shower) {
3682 << __func__ <<
": unknown projection #" << ((int)proj) <<
"\n";
3685 if (fmsp.isValid()) {
3686 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
3710 for (
unsigned int i = 0; i < wcol->size(); ++i) {
3717 writeErrMsg(
"GetWires", e);
3720 return wires.
size();
3726 std::vector<const recob::Hit*>&
hits,
3734 std::vector<const recob::Hit*> temp;
3738 for (
const auto&
hit : temp) {
3742 const std::vector<geo::WireID>& wireIDs = geo->
ChannelToWire(
hit->Channel());
3745 for (
const auto& wireID : wireIDs) {
3746 if (wireID.Plane == plane && wireID.TPC == rawOpt->
fTPC &&
3748 hits.push_back(
hit);
3753 writeErrMsg(
"GetHits", e);
3772 for (
unsigned int i = 0; i < slcCol->size(); ++i) {
3779 writeErrMsg(
"GetSlices", e);
3782 return slices.
size();
3798 for (
unsigned int i = 0; i < clcol->size(); ++i) {
3805 writeErrMsg(
"GetClusters", e);
3808 return clust.
size();
3823 for (
unsigned int i = 0; i < clcol->size(); ++i) {
3830 writeErrMsg(
"GetPFParticles", e);
3833 return clust.
size();
3848 for (
unsigned int i = 0; i < epcol->size(); ++i) {
3855 writeErrMsg(
"GetEndPoint2D", e);
3874 for (
unsigned int i = 0; i < opflashcol->size(); ++i) {
3878 temp.
swap(opflashes);
3881 writeErrMsg(
"GetOpFlashes", e);
3884 return opflashes.
size();
3900 for (
unsigned int i = 0; i < seedcol->size(); ++i) {
3907 writeErrMsg(
"GetSeeds", e);
3910 return seeds.
size();
3936 for (
unsigned int i = 0; i < edgeCol->size(); ++i)
3937 edges.emplace_back(edgeCol, i);
3939 return edges.size();
3951 writeErrMsg(
"GetTracks", e);
3954 return track.
vals().size();
3966 writeErrMsg(
"GetShowers", e);
3969 return shower.
vals().size();
3984 for (
size_t i = 0; i < vcol->size(); ++i) {
3991 writeErrMsg(
"GetVertices", e);
3994 return vertex.
size();
4009 for (
size_t i = 0; i < ecol->size(); ++i) {
4016 writeErrMsg(
"GetEvents", e);
4019 return event.size();
4025 unsigned int cryostat,
4029 std::vector<const recob::Hit*> temp;
4030 int NumberOfHitsBeforeThisPlane = 0;
4034 for (
size_t t = 0; t < temp.size(); ++t) {
4035 if (temp[t]->
WireID().Cryostat == cryostat && temp[t]->WireID().TPC == tpc &&
4036 temp[t]->WireID().Plane == plane)
4038 NumberOfHitsBeforeThisPlane++;
4040 return NumberOfHitsBeforeThisPlane;
4053 float minSig(std::numeric_limits<float>::max());
4054 float maxSig(std::numeric_limits<float>::lowest());
4055 bool setLimits(
false);
4060 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod) {
4066 for (
size_t i = 0; i < wires.
size(); ++i) {
4068 std::vector<geo::WireID> wireids = geo->
ChannelToWire(wires[i]->Channel());
4070 bool goodWID =
false;
4071 for (
auto const& wid : wireids) {
4073 if (wid.Plane == plane && wid.Wire == wire && wid.TPC == rawOpt->
fTPC &&
4077 if (!goodWID)
continue;
4079 std::vector<float> wirSig = wires[i]->Signal();
4080 for (
unsigned int ii = 0; ii < wirSig.size(); ++ii) {
4083 minSig = std::min(minSig, wirSig[ii]);
4084 maxSig = std::max(maxSig, wirSig[ii]);
4092 histo->SetMaximum(1.2 * maxSig);
4093 histo->SetMinimum(1.2 * minSig);
4109 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod) {
4115 for (
unsigned int i = 0; i < wires.
size(); ++i) {
4117 std::vector<geo::WireID> wireids = geo->
ChannelToWire(wires[i]->Channel());
4119 bool goodWID =
false;
4120 for (
auto const& wid : wireids) {
4122 if (wid.Plane == plane && wid.TPC == rawOpt->
fTPC && wid.Cryostat == rawOpt->
fCryostat)
4125 if (!goodWID)
continue;
4126 std::vector<float> wirSig = wires[i]->Signal();
4127 for (
unsigned int ii = 0; ii < wirSig.size(); ++ii)
4128 histo->Fill(wirSig[ii]);
4145 std::vector<double>& htau1,
4146 std::vector<double>& htau2,
4147 std::vector<double>& hitamplitudes,
4148 std::vector<double>& hpeaktimes,
4149 std::vector<int>& hstartT,
4150 std::vector<int>& hendT,
4151 std::vector<int>& hNMultiHit,
4152 std::vector<int>& hLocalHitIndex)
4161 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod) {
4167 for (
size_t i = 0; i < wires.
size(); ++i) {
4169 std::vector<geo::WireID> wireids = geo->
ChannelToWire(wires[i]->Channel());
4171 bool goodWID =
false;
4172 for (
auto const& wid : wireids) {
4173 if (wid.Plane == plane && wid.Wire == wire && wid.TPC == rawOpt->
fTPC &&
4178 if (!goodWID)
continue;
4180 std::vector<float> wirSig = wires[i]->Signal();
4181 for (
unsigned int ii = 0; ii < wirSig.size(); ++ii)
4182 histo->Fill(1. * ii, wirSig[ii]);
4187 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
4190 std::vector<const recob::Hit*>
hits;
4191 this->
GetHits(evt, which, hits, plane);
4194 const auto& fitParams = hitResults->vectors();
4198 for (
size_t i = 0; i < hits.size(); ++i) {
4200 if (hits[i]->
WireID().Wire != wire)
continue;
4202 hpeaktimes.push_back(fitParams[FitParamsOffset + i][0]);
4203 htau1.push_back(fitParams[FitParamsOffset + i][1]);
4204 htau2.push_back(fitParams[FitParamsOffset + i][2]);
4205 hitamplitudes.push_back(fitParams[FitParamsOffset + i][3]);
4206 hstartT.push_back(hits[i]->StartTick());
4207 hendT.push_back(hits[i]->EndTick());
4208 hNMultiHit.push_back(hits[i]->Multiplicity());
4209 hLocalHitIndex.push_back(hits[i]->LocalIndex());
ISpacePointDrawerPtr fSpacePointDrawer
int fDraw2DSlopeEndPoints
void SpacePointOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
void DrawShowerOrtho(const recob::Shower &shower, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
details::range_type< T > Iterate() const
Initializes the specified ID with the ID of the first cryostat.
void SpacePoint3D(const art::Event &evt, evdb::View3D *view)
void reserve(size_type n)
int GetTracks(const art::Event &evt, const art::InputTag &which, art::View< recob::Track > &track)
std::vector< double > fRawCharge
Sum of Raw Charge.
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
fhicl::ParameterSet fSpacePointDrawerParams
FHICL parameters for SpacePoint drawing.
void FillTQHisto(const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo)
const TVector3 & ShowerStart() const
Length_t WireCoordinate(Point_t const &pos, PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
int fScaleDigitsByCharge
scale the size of the digit by the charge
const art::Event * GetEvent() const
void PFParticleOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
std::vector< art::InputTag > fEndPoint2DLabels
module labels that produced end point 2d objects
An object to define a "edge" which is used to connect space points in a triangulation algorithm...
unsigned int fTPC
TPC number to draw, typically set by TWQProjectionView.
void DrawProng2D(detinfo::DetectorPropertiesData const &detProp, std::vector< const recob::Hit * > &hits, evdb::View2D *view, unsigned int plane, TVector3 const &startPos, TVector3 const &startDir, int id, float cscore=-5)
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
std::vector< art::InputTag > fTrkVtxCosmicLabels
module labels that tagged track as CR (Track/Vertex module)
ISpacePointDrawerPtr fAllSpacePointDrawer
std::vector< WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
std::vector< art::InputTag > fOpFlashLabels
module labels that produced events
Encapsulate the construction of a single cyostat.
size_t Self() const
Returns the index of this particle.
Float_t y1[n_points_granero]
bool has_length() const
Returns whether the shower has a valid length.
TPolyLine & AddPolyLine(int n, int c, int w, int s)
void Prong3D(const art::Event &evt, evdb::View3D *view)
float SpacePointChiSq(const std::vector< art::Ptr< recob::Hit >> &) const
std::vector< art::InputTag > fTrackLabels
module labels that produced tracks
WireGeo const & Wire(unsigned int iwire) const
void DrawPFParticle3D(const art::Ptr< recob::PFParticle > &pfPart, const art::PtrVector< recob::PFParticle > &pfParticleVec, const std::vector< art::Ptr< recob::SpacePoint >> &spacePointVec, const art::FindManyP< recob::Edge > &edgeAssnsVec, const art::FindManyP< recob::SpacePoint > &spacePointAssnsVec, const art::FindManyP< recob::SpacePoint > &edgeSPAssnVec, const art::FindManyP< recob::Hit > &spHitAssnVec, const art::FindMany< recob::Track > &trackAssnVec, const art::FindMany< recob::PCAxis > &pcAxisAssnVec, const art::FindMany< anab::CosmicTag > &cosmicTagAssnVec, int depth, evdb::View3D *view)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
void swap(PtrVector &other)
int GetSpacePoints(const art::Event &evt, const art::InputTag &which, std::vector< art::Ptr< recob::SpacePoint >> &spts)
int fDrawRawDataOrCalibWires
0 for raw
double GetXTicksOffset(int p, int t, int c) const
Float_t x1[n_points_granero]
void SeedOrtho(const art::Event &evt, evd::OrthoProj_t proj, evdb::View2D *view)
TLine & AddLine(double x1, double y1, double x2, double y2)
Declaration of signal hit object.
std::vector< art::InputTag > fTrkVtxTrackLabels
module labels that produced tracks (Track/Vertex module)
int fColorSpacePointsByChisq
Generate space point colors by chisquare?
Point_t const & LocationAtPoint(size_t i) const
Access to track position at different points.
The data type to uniquely identify a Plane.
Geometry information for a single TPC.
void Vertex3D(const art::Event &evt, evdb::View3D *view)
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
bool HasValidPoint(size_t i) const
Various functions related to the presence and the number of (valid) points.
void Event3D(const art::Event &evt, evdb::View3D *view)
static std::unique_ptr< FVectorReader > create(const art::Event &evt, const art::InputTag &tag)
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
constexpr auto abs(T v)
Returns the absolute value of the argument.
Vector_t VertexDirection() const
Access to track direction at different points.
void ProngOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
int GetClusters(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Cluster > &clust)
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
void DrawShower3D(const recob::Shower &shower, int color, evdb::View3D *view)
A collection of drawable 2-D objects.
WireID_t Wire
Index of the wire within its plane.
int GetColor(double x) const
void DrawSpacePointOrtho(std::vector< art::Ptr< recob::SpacePoint >> &spts, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view, int mode=0)
0: track, 1: shower
void Edge3D(const art::Event &evt, evdb::View3D *view)
void fill(PtrVector< T > &pv) const
int GetEvents(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Event > &event)
int fDrawSliceSpacePoints
double fFlashTMin
Minimal time for a flash to be displayed.
int fDrawTrackTrajectoryPoints
void Prong2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
Singleton to hold the current art::Event for the event display.
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
std::vector< art::InputTag > fExtremePointLabels
module labels that produced Extreme Points
std::vector< art::InputTag > fCosmicTagLabels
module labels that produced cosmic tags
std::vector< double > fConvertedCharge
Sum of Charge Converted using Birks' formula.
bool has_open_angle() const
Returns whether the shower has a valid opening angle.
Float_t y2[n_points_geant4]
double fFlashTMax
Maximum time for a flash to be displayed.
double Length() const
Length is associated with z coordinate [cm].
void Slice2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
void Cluster2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
void DrawTrackVertexAssns2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
bool isValid() const noexcept
The color scales used by the event display.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
unsigned int CountValidPoints() const
Various functions related to the presence and the number of (valid) points.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
TPolyLine3D & AddPolyLine3D(int n, int c, int w, int s)
TBox & AddBox(double x1, double y1, double x2, double y2)
void Seed3D(const art::Event &evt, evdb::View3D *view)
int CountHits(const art::Event &evt, const art::InputTag &which, unsigned int cryostat, unsigned int tpc, unsigned int plane)
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
Point_t GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].
View_t View() const
Which coordinate does this plane measure.
Collection of exceptions for Geometry system.
std::vector< art::InputTag > fWireLabels
module labels that produced wires
TPCID FindTPCAtPosition(Point_t const &point) const
Returns the ID of the TPC at specified location.
void Seed2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
int GetEndPoint2D(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::EndPoint2D > &ep2d)
const std::vector< double > & dEdx() const
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
Offers proxy::Tracks and proxy::Track class for recob::Track access.
void push_back(Ptr< U > const &p)
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
void FillTQHistoDP(const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo, std::vector< double > &htau1, std::vector< double > &htau2, std::vector< double > &hitamplitudes, std::vector< double > &hpeaktimes, std::vector< int > &hstartT, std::vector< int > &hendT, std::vector< int > &hNMultiHit, std::vector< int > &hLocalHitIndex)
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local plane frame to world frame.
unsigned int fCryostat
Cryostat number to draw, typically set by TWQProjectionView.
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
Provenance const * provenance() const
static EventHolder * Instance()
void PFParticle3D(const art::Event &evt, evdb::View3D *view)
std::vector< art::InputTag > fPFParticleLabels
module labels that produced PFParticles
std::vector< art::InputTag > fVertexLabels
module labels that produced vertices
key_type key() const noexcept
void Draw2DSlopeEndPoints(double xStart, double yStart, double xEnd, double yEnd, double slope, int color, evdb::View2D *view)
TPolyMarker & AddPolyMarker(int n, int c, int st, double sz)
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Point_t const & Vertex() const
Access to track position at different points.
const evdb::ColorScale & CalQ(geo::SigType_t st) const
std::vector< art::InputTag > fEdgeLabels
module labels that produced Edge objects
TText & AddText(double x, double y, const char *text)
double fMinSignal
minimum ADC count to display a time bin
double fTicks
number of TDC ticks to display, ie # fTicks past fStartTick
int Hit2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
double ConvertXToTicks(double X, int p, int t, int c) const
int GetSlices(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Slice > &slices)
void Slice3D(const art::Event &evt, evdb::View3D *view)
void DrawTrack2D(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< const recob::Hit * > &hits, evdb::View2D *view, unsigned int plane, const recob::Track *track, int color, int lineWidth)
std::vector< int > fWireMax
highest wire in interesting region for each plane
Provides recob::Track data product.
int GetHits(const art::Event &evt, const art::InputTag &which, std::vector< const recob::Hit * > &hits, unsigned int plane)
std::vector< std::array< double, 3 > > Circle3D(const TVector3 &pos, const TVector3 &axisDir, const double &radius)
int GetWires(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Wire > &wires)
fhicl::ParameterSet fAllSpacePointDrawerParams
FHICL parameters for SpacePoint drawing.
const Double32_t * XYZ() const
std::vector< art::InputTag > fSliceLabels
module labels that produced slices
const TVector3 & Direction() const
int GetOpFlashes(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::OpFlash > &opflash)
int GetSeeds(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Seed > &seed)
double ElectronsToADC() const
int GetShowers(const art::Event &evt, const art::InputTag &which, art::View< recob::Shower > &shower)
reference at(size_type n)
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
double fFlashMinPE
Minimal PE for a flash to be displayed.
std::vector< int > fWireMin
lowest wire in interesting region for each plane
The data type to uniquely identify a TPC.
std::vector< art::InputTag > fSeedLabels
module labels that produced events
Declaration of cluster object.
Class to aid in the rendering of RecoBase objects.
static const int kColor[kNCOLS]
void GetChargeSum(int plane, double &charge, double &convcharge)
std::vector< TCSlice > slices
Detector simulation of raw signals on wires.
Encapsulate the geometry of a wire.
double ConvertTicksToX(double ticks, int p, int t, int c) const
std::vector< art::InputTag > fSpacePointLabels
module labels that produced space points
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
std::size_t color(std::string const &procname)
std::vector< TrajPoint > seeds
void DrawTrack3D(const recob::Track &track, evdb::View3D *view, int color, int marker=1, float size=2.)
bool fDrawTrackVertexAssns
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Place to keep constants for event display.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
int fDrawTrackSpacePoints
int fTicksPerPoint
number of ticks to include in one point
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
WireID NearestWireID(Point_t const &point, PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Encapsulate the construction of a single detector plane.
auto isValid() const noexcept
bool fSeeBadChannels
Allow "bad" channels to be viewed.
Contains all timing reference information for the detector.
#define MF_LOG_VERBATIM(category)
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
void FillQHisto(const art::Event &evt, unsigned int plane, TH1F *histo)
double BirksCorrection(double dQdX) const
dQ/dX in electrons/cm, returns dE/dX in MeV/cm.
int ID() const
Return vertex id.
int GetPFParticles(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::PFParticle > &pfpart)
void EndPoint2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void Wire2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
unsigned int Nwires(PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
int fAxisOrientation
0 = TDC values on y-axis, wire number on x-axis, 1 = swapped
void DrawPFParticleOrtho(const art::Ptr< recob::PFParticle > &pfPart, const art::PtrVector< recob::PFParticle > &pfParticleVec, const art::FindMany< recob::SpacePoint > &spacePointAssnsVec, const art::FindMany< recob::PCAxis > &pcAxisAssnVec, int depth, evd::OrthoProj_t proj, evdb::View2D *view)
Exception thrown on invalid wire number.
Point_t const & End() const
Access to track position at different points.
Declaration of basic channel signal object.
void OpFlash2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
int GetRegionOfInterest(int plane, int &minw, int &maxw, int &mint, int &maxt)
Vector_t DirectionAtPoint(size_t i) const
Access to track direction at different points.
void Event2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void GetClusterOutlines(std::vector< const recob::Hit * > &hits, std::vector< double > &tpts, std::vector< double > &wpts, unsigned int plane)
A collection of 3D drawable objects.
void OpFlashOrtho(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evd::OrthoProj_t proj, evdb::View2D *view)
std::vector< art::InputTag > fHitLabels
module labels that produced hits
std::vector< art::InputTag > fShowerLabels
module labels that produced showers
unsigned int ChannelID_t
Type representing the ID of a readout channel.
void Vertex2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::vector< art::InputTag > fTrkVtxFilterLabels
module labels that filtered event (Track/Vertex module)
void DrawTrackOrtho(const recob::Track &track, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
Float_t x2[n_points_geant4]
static const int kColor2[kNCOLS]
geo::WireID suggestedWireID() const
Returns a better wire ID.
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
recob::tracking::Plane Plane
Namespace collecting geometry-related classes utilities.
TMarker & AddMarker(double x, double y, int c, int st, double sz)
std::vector< int > fTimeMax
highest time in interesting region for each plane
Length_t WirePitch(PlaneID const &planeid=plane_zero) const
Returns the distance between two consecutive wires.
std::vector< art::InputTag > fClusterLabels
module labels that produced clusters
std::vector< art::InputTag > fEventLabels
module labels that produced events
int GetVertices(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Vertex > &vertex)
art framework interface to geometry description
double HalfWidth() const
Width is associated with x coordinate [cm].
geo::Point3DBase_t< PlaneGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML wire plane frame.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
void VertexOrtho(const art::PtrVector< recob::Vertex > &vertex, evd::OrthoProj_t proj, evdb::View2D *view, int marker)
cet::coded_exception< error, detail::translate > exception
int GetEdges(const art::Event &evt, const art::InputTag &which, std::vector< art::Ptr< recob::Edge >> &edges)
Event finding and building.
TPolyMarker3D & AddPolyMarker3D(int n, int c, int st, double sz)
Encapsulate the construction of a single detector plane.
The data type to uniquely identify a cryostat.
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const
std::vector< int > fTimeMin
lowest time in interesting region for each plane