14 #include "TPolyLine.h"
15 #include "TPolyLine3D.h"
16 #include "TPolyMarker.h"
17 #include "TPolyMarker3D.h"
18 #include "TRotation.h"
55 #include "nuevdb/EventDisplayBase/EventHolder.h"
56 #include "nuevdb/EventDisplayBase/View2D.h"
57 #include "nuevdb/EventDisplayBase/View3D.h"
59 #include "art/Framework/Principal/Event.h"
60 #include "art/Framework/Principal/Handle.h"
61 #include "art/Framework/Services/Registry/ServiceHandle.h"
62 #include "art/Utilities/make_tool.h"
63 #include "canvas/Persistency/Common/FindMany.h"
64 #include "canvas/Persistency/Common/Ptr.h"
65 #include "canvas/Persistency/Common/PtrVector.h"
66 #include "cetlib_except/exception.h"
67 #include "messagefacility/MessageLogger/MessageLogger.h"
72 writeErrMsg(
const char* fcn, cet::exception
const&
e)
74 mf::LogWarning(
"RecoBaseDrawer") <<
"RecoBaseDrawer::" << fcn <<
" failed with message:\n" <<
e;
83 art::ServiceHandle<geo::Geometry const> geo;
84 art::ServiceHandle<evd::RawDrawingOptions const> rawOptions;
85 art::ServiceHandle<evd::RecoDrawingOptions const> recoOptions;
95 for (
size_t t = 0; t < geo->NTPC(); ++t) {
96 unsigned int nplanes = geo->Nplanes(t);
103 for (
size_t p = 0;
p < geo->Nplanes(t); ++
p) {
112 art::make_tool<evdb_tool::ISpacePoints3D>(recoOptions->fAllSpacePointDrawerParams);
114 art::make_tool<evdb_tool::ISpacePoints3D>(recoOptions->fSpacePointDrawerParams);
124 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
125 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
126 art::ServiceHandle<geo::Geometry const> geo;
127 art::ServiceHandle<evd::ColorDrawingOptions const> cst;
129 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
132 art::ServiceHandle<lariov::ChannelStatusService const>()->GetProvider();
134 int ticksPerPoint = rawOpt->fTicksPerPoint;
142 geo::PlaneID pid(rawOpt->fCryostat, rawOpt->fTPC, plane);
144 for (
size_t imod = 0; imod < recoOpt->fWireLabels.size(); ++imod) {
145 art::InputTag
const which = recoOpt->fWireLabels[imod];
147 art::PtrVector<recob::Wire> wires;
150 if (wires.size() < 1)
continue;
152 for (
size_t i = 0; i < wires.size(); ++i) {
154 uint32_t channel = wires[i]->Channel();
156 if (!rawOpt->fSeeBadChannels && channelStatus.
IsBad(channel))
continue;
158 std::vector<geo::WireID> wireids = geo->ChannelToWire(channel);
162 for (
auto const& wid : wireids) {
163 if (wid.planeID() != pid)
continue;
165 double wire = 1. * wid.Wire;
168 std::vector<float> wirSig = wires[i]->Signal();
169 if (wirSig.size() == 0)
continue;
171 std::vector<float>::const_iterator itr = wirSig.begin();
172 while (itr != wirSig.end()) {
176 while (ticksUsed < ticksPerPoint && itr != wirSig.end()) {
178 adcsum += (1. * (*itr));
183 double adc = adcsum / ticksPerPoint;
184 double tdc = tdcsum / ticksPerPoint;
186 if (TMath::Abs(adc) < rawOpt->fMinSignal)
continue;
187 if (tdc > rawOpt->fTicks)
continue;
193 co = cst->CalQ(sigType).GetColor(adc);
194 if (rawOpt->fScaleDigitsByCharge) {
196 if (sf > 1.0) sf = 1.0;
199 if (wire < minw) minw = wire;
200 if (wire > maxw) maxw = wire;
201 if (tdc < mint) mint = tdc;
202 if (tdc > maxt) maxt = tdc;
204 if (rawOpt->fAxisOrientation < 1) {
205 TBox& b1 = view->AddBox(wire - sf * 0.5,
206 tdc - sf * 0.5 * ticksPerPoint,
208 tdc + sf * 0.5 * ticksPerPoint);
209 b1.SetFillStyle(1001);
211 b1.SetBit(kCannotPick);
214 TBox& b1 = view->AddBox(tdc - sf * 0.5 * ticksPerPoint,
216 tdc + sf * 0.5 * ticksPerPoint,
218 b1.SetFillStyle(1001);
220 b1.SetBit(kCannotPick);
233 double startTick(50.);
234 double endTick((rawOpt->fTicks - 50.) * ticksPerPoint);
236 for (
size_t wireNo = 0; wireNo < geo->Nwires(pid); wireNo++) {
238 geo->PlaneWireToChannel(
geo::WireID(rawOpt->fCryostat, rawOpt->fTPC, plane, wireNo));
240 if (!rawOpt->fSeeBadChannels && channelStatus.
IsBad(channel)) {
241 double wire = 1. * wireNo;
242 TLine& line = view->AddLine(wire, startTick, wire, endTick);
243 line.SetLineColor(kGray);
244 line.SetLineWidth(1.0);
245 line.SetBit(kCannotPick);
264 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
265 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
266 art::ServiceHandle<geo::Geometry const> geo;
270 if (recoOpt->fDrawHits == 0)
return nHitsDrawn;
271 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return nHitsDrawn;
276 for (
size_t imod = 0; imod < recoOpt->fHitLabels.size(); ++imod) {
277 art::InputTag
const which = recoOpt->fHitLabels[imod];
279 std::vector<const recob::Hit*> hits;
280 this->
GetHits(evt, which, hits, plane);
283 for (
auto itr : hits) {
285 if (itr->WireID().TPC != rawOpt->fTPC || itr->WireID().Cryostat != rawOpt->fCryostat)
290 fRawCharge[itr->WireID().Plane] += itr->PeakAmplitude();
291 double dQdX = itr->PeakAmplitude() / geo->WirePitch() / detProp.
ElectronsToADC();
295 nHitsDrawn = this->
Hit2D(hits, kBlack, view, recoOpt->fDrawAllWireIDs);
316 bool drawConnectingLines,
319 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
320 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
321 art::ServiceHandle<geo::Geometry const> geo;
324 unsigned int wold = 0;
327 if (color == -1) color = recoOpt->fSelectedHitColor;
331 for (
const auto&
hit : hits) {
336 std::vector<geo::WireID> wireIDs;
339 wireIDs = geo->ChannelToWire(
hit->Channel());
341 wireIDs.push_back(
hit->WireID());
344 for (
const auto& wireID : wireIDs) {
345 if (wireID.TPC != rawOpt->fTPC || wireID.Cryostat != rawOpt->fCryostat)
continue;
347 if (std::isnan(
hit->PeakTime()) || std::isnan(
hit->Integral())) {
348 std::cout <<
"====>> Found hit with a NAN, channel: " <<
hit->Channel()
349 <<
", start/end: " <<
hit->StartTick() <<
"/" <<
hit->EndTick()
350 <<
", chisquare: " <<
hit->GoodnessOfFit() << std::endl;
353 if (
hit->PeakTime() > rawOpt->fTicks)
continue;
359 float time =
hit->PeakTime();
360 float rms = 0.5 *
hit->RMS();
362 if (rawOpt->fAxisOrientation < 1) {
363 TBox& b1 = view->AddBox(w - 0.5, time - rms, w + 0.5, time + rms);
364 if (drawConnectingLines && nHitsDrawn > 0) {
365 TLine& l = view->AddLine(w, time, wold, timeold);
366 l.SetLineColor(color);
367 l.SetBit(kCannotPick);
370 b1.SetBit(kCannotPick);
371 b1.SetLineColor(color);
372 b1.SetLineWidth(lineWidth);
375 TBox& b1 = view->AddBox(time - rms, w - 0.5, time + rms, w + 0.5);
376 if (drawConnectingLines && nHitsDrawn > 0) {
377 TLine& l = view->AddLine(time, w, timeold, wold);
378 l.SetLineColor(color);
379 l.SetBit(kCannotPick);
382 b1.SetBit(kCannotPick);
383 b1.SetLineColor(color);
384 b1.SetLineWidth(lineWidth);
399 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
400 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
401 art::ServiceHandle<geo::Geometry const> geo;
404 unsigned int wold(0);
408 for (
const auto&
hit : hits) {
411 if (
hit->WireID().TPC != rawOpt->fTPC ||
hit->WireID().Cryostat != rawOpt->fCryostat)
414 w =
hit->WireID().Wire;
418 float time =
hit->PeakTime();
420 if (rawOpt->fAxisOrientation < 1) {
421 if (nHitsDrawn > 0) {
422 TLine& l = view->AddLine(w, time + 100, wold, timeold + 100);
425 if (cosmicscore > 0.5) l.SetLineColor(kMagenta);
426 l.SetBit(kCannotPick);
430 if (nHitsDrawn > 0) {
431 TLine& l = view->AddLine(time + 20, w, timeold + 20, wold);
433 if (cosmicscore > 0.5) l.SetLineStyle(2);
434 l.SetBit(kCannotPick);
450 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
451 art::ServiceHandle<geo::Geometry const> geo;
453 if ((
unsigned int)plane >
fWireMin.size()) {
454 mf::LogWarning(
"RecoBaseDrawer")
455 <<
" Requested plane " << plane <<
" is larger than those available ";
465 minw = (minw - 30 < 0) ? 0 : minw - 30;
466 mint = (mint - 10 < 0) ? 0 : mint - 10;
468 int fTicks = rawOpt->fTicks;
470 maxw = (maxw + 10 > (int)geo->Nwires(plane)) ? geo->Nwires(plane) : maxw + 10;
471 maxt = (maxt + 10 > fTicks) ? fTicks : maxt + 10;
490 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
491 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
492 art::ServiceHandle<geo::Geometry const> geo;
494 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
495 if (recoOpt->fDraw2DEndPoints == 0)
return;
497 geo::View_t gview = geo->TPC(rawOpt->fTPC).Plane(plane).View();
499 for (
size_t imod = 0; imod < recoOpt->fEndPoint2DLabels.size(); ++imod) {
500 art::InputTag
const which = recoOpt->fEndPoint2DLabels[imod];
502 art::PtrVector<recob::EndPoint2D> ep2d;
505 for (
size_t iep = 0; iep < ep2d.size(); ++iep) {
507 if (ep2d[iep]->View() != gview)
continue;
516 double x = ep2d[iep]->WireID().Wire;
517 double y = ep2d[iep]->DriftTime();
519 if (rawOpt->fAxisOrientation > 0) {
520 x = ep2d[iep]->DriftTime();
521 y = ep2d[iep]->WireID().Wire;
524 TMarker& strt = view->AddMarker(x, y, color, 30, 2.0);
525 strt.SetMarkerColor(color);
527 if (recoOpt->fDraw2DEndPoints > 1) {
529 char const* txt = s.c_str();
530 TText& vtxID = view->AddText(x, y + 20, txt);
531 vtxID.SetTextColor(color);
532 vtxID.SetTextSize(0.05);
549 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
550 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
552 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
553 if (recoOpt->fDrawOpFlashes == 0)
return;
555 art::ServiceHandle<geo::Geometry const> geo;
556 geo::PlaneID pid(rawOpt->fCryostat, rawOpt->fTPC, plane);
558 for (
size_t imod = 0; imod < recoOpt->fOpFlashLabels.size(); ++imod) {
559 const art::InputTag which = recoOpt->fOpFlashLabels[imod];
561 art::PtrVector<recob::OpFlash> opflashes;
564 if (opflashes.size() < 1)
continue;
566 int NFlashes = opflashes.size();
569 MF_LOG_VERBATIM(
"RecoBaseDrawer") <<
"Total " << NFlashes <<
" flashes.";
572 for (
size_t iof = 0; iof < opflashes.size(); ++iof) {
573 if (opflashes[iof]->TotalPE() < recoOpt->fFlashMinPE)
continue;
574 if (opflashes[iof]->Time() < recoOpt->fFlashTMin)
continue;
575 if (opflashes[iof]->Time() > recoOpt->fFlashTMax)
continue;
577 MF_LOG_VERBATIM(
"RecoBaseDrawer")
578 <<
"Flash t: " << opflashes[iof]->Time() <<
"\t y,z : " << opflashes[iof]->YCenter()
579 <<
", " << opflashes[iof]->ZCenter() <<
" \t PE :" << opflashes[iof]->TotalPE();
583 float wire0 = FLT_MAX;
584 float wire1 = FLT_MIN;
587 std::vector<TVector3> points;
588 points.push_back(TVector3(0,
589 opflashes[iof]->YCenter() - opflashes[iof]->YWidth(),
590 opflashes[iof]->ZCenter() - opflashes[iof]->ZWidth()));
591 points.push_back(TVector3(0,
592 opflashes[iof]->YCenter() - opflashes[iof]->YWidth(),
593 opflashes[iof]->ZCenter() + opflashes[iof]->ZWidth()));
594 points.push_back(TVector3(0,
595 opflashes[iof]->YCenter() + opflashes[iof]->YWidth(),
596 opflashes[iof]->ZCenter() - opflashes[iof]->ZWidth()));
597 points.push_back(TVector3(0,
598 opflashes[iof]->YCenter() + opflashes[iof]->YWidth(),
599 opflashes[iof]->ZCenter() + opflashes[iof]->ZWidth()));
601 for (
size_t i = 0; i < points.size(); ++i) {
604 wireID = geo->NearestWireID(points[i], pid);
609 if (wireID.
Wire < wire0) wire0 = wireID.
Wire;
610 if (wireID.
Wire > wire1) wire1 = wireID.
Wire;
612 if (rawOpt->fAxisOrientation > 0) {
613 TLine& line = view->AddLine(flashtick, wire0, flashtick, wire1);
614 line.SetLineWidth(2);
615 line.SetLineStyle(2);
616 line.SetLineColor(Color);
619 TLine& line = view->AddLine(wire0, flashtick, wire1, flashtick);
620 line.SetLineWidth(2);
621 line.SetLineStyle(2);
622 line.SetLineColor(Color);
637 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
638 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
639 art::ServiceHandle<geo::Geometry const> geo;
641 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
642 if (recoOpt->fDrawSeeds == 0)
return;
644 for (
size_t imod = 0; imod < recoOpt->fSeedLabels.size(); ++imod) {
645 art::InputTag
const which = recoOpt->fSeedLabels[imod];
647 art::PtrVector<recob::Seed>
seeds;
650 if (seeds.size() < 1)
continue;
653 for (
size_t isd = 0; isd < seeds.size(); ++isd) {
656 double SeedPointErr[3];
657 double SeedDirErr[3];
661 seeds[isd]->GetPoint(SeedPoint, SeedPointErr);
662 seeds[isd]->GetDirection(SeedDir, SeedDirErr);
664 SeedEnd1[0] = SeedPoint[0] + SeedDir[0];
665 SeedEnd1[1] = SeedPoint[1] + SeedDir[1];
666 SeedEnd1[2] = SeedPoint[2] + SeedDir[2];
668 SeedEnd2[0] = SeedPoint[0] - SeedDir[0];
669 SeedEnd2[1] = SeedPoint[1] - SeedDir[1];
670 SeedEnd2[2] = SeedPoint[2] - SeedDir[2];
675 unsigned int wirepoint = 0;
676 unsigned int wireend1 = 0;
677 unsigned int wireend2 = 0;
679 wirepoint = geo->NearestWire(SeedPoint, plane, rawOpt->fTPC, rawOpt->fCryostat);
681 catch (cet::exception&
e) {
682 wirepoint = atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
685 wireend1 = geo->NearestWire(SeedEnd1, plane, rawOpt->fTPC, rawOpt->fCryostat);
687 catch (cet::exception& e) {
688 wireend1 = atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
691 wireend2 = geo->NearestWire(SeedEnd2, plane, rawOpt->fTPC, rawOpt->fCryostat);
693 catch (cet::exception& e) {
694 wireend2 = atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
697 double x = wirepoint;
698 double y = detProp.
ConvertXToTicks(SeedPoint[0], plane, rawOpt->fTPC, rawOpt->fCryostat);
699 double x1 = wireend1;
700 double y1 = detProp.
ConvertXToTicks(SeedEnd1[0], plane, rawOpt->fTPC, rawOpt->fCryostat);
701 double x2 = wireend2;
702 double y2 = detProp.
ConvertXToTicks(SeedEnd2[0], plane, rawOpt->fTPC, rawOpt->fCryostat);
704 if (rawOpt->fAxisOrientation > 0) {
705 x = detProp.
ConvertXToTicks(SeedPoint[0], plane, rawOpt->fTPC, rawOpt->fCryostat);
707 x1 = detProp.
ConvertXToTicks(SeedEnd1[0], plane, rawOpt->fTPC, rawOpt->fCryostat);
709 x2 = detProp.
ConvertXToTicks(SeedEnd2[0], plane, rawOpt->fTPC, rawOpt->fCryostat);
713 TMarker& strt = view->AddMarker(x, y, color, 4, 1.5);
714 TLine& line = view->AddLine(x1, y1, x2, y2);
715 strt.SetMarkerColor(color);
716 line.SetLineColor(color);
717 line.SetLineWidth(2.0);
732 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
733 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
734 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
735 if (recoOpt->fDrawSlices == 0)
return;
737 art::ServiceHandle<geo::Geometry const> geo;
739 static bool first =
true;
742 <<
"******** DrawSlices: 0 = none, 1 = color coded, 2 = color coded + ID at slice center\n";
743 std::cout <<
" 3 = open circle at slice center with size proportional to the AspectRatio. "
745 std::cout <<
" at the slice ends with connecting dotted lines\n";
748 unsigned int c = rawOpt->fCryostat;
749 unsigned int t = rawOpt->fTPC;
752 for (
size_t imod = 0; imod < recoOpt->fSliceLabels.size(); ++imod) {
753 art::InputTag
const which = recoOpt->fSliceLabels[imod];
754 art::PtrVector<recob::Slice>
slices;
756 if (slices.size() < 1)
continue;
757 art::FindMany<recob::Hit> fmh(slices, evt, which);
758 for (
size_t isl = 0; isl < slices.size(); ++isl) {
759 int slcID(
std::abs(slices[isl]->ID()));
761 if (recoOpt->fDrawSlices < 3) {
763 std::vector<const recob::Hit*> hits = fmh.at(isl);
764 std::vector<const recob::Hit*> hits_on_plane;
765 for (
auto hit : hits) {
766 if (
hit->WireID().Plane == plane) { hits_on_plane.push_back(
hit); }
768 if (this->
Hit2D(hits_on_plane, color, view,
false,
false) < 1)
continue;
769 if (recoOpt->fDrawSlices == 2) {
771 slices[isl]->Center().
X(), slices[isl]->Center().Y(), slices[isl]->Center().Z());
773 double wire = geo->WireCoordinate(slicePos, planeID);
775 char const* txt = s.c_str();
776 TText& slcID = view->AddText(wire, tick, txt);
777 slcID.SetTextSize(0.05);
778 slcID.SetTextColor(color);
784 slices[isl]->Center().
X(), slices[isl]->Center().Y(), slices[isl]->Center().Z());
786 double wire = geo->WireCoordinate(slicePos, planeID);
787 float markerSize = 1;
788 if (slices[isl]->AspectRatio() > 0) {
789 markerSize = 1 / slices[isl]->AspectRatio();
790 if (markerSize > 3) markerSize = 3;
792 TMarker& ctr = view->AddMarker(wire, tick, color, 24, markerSize);
793 ctr.SetMarkerColor(color);
795 TPolyLine& pline = view->AddPolyLine(2, color, 2, 3);
797 slices[isl]->End0Pos().
X(), slices[isl]->End0Pos().Y(), slices[isl]->End0Pos().Z());
799 wire = geo->WireCoordinate(slicePos0, planeID);
800 TMarker& end0 = view->AddMarker(wire, tick, color, 20, 1.0);
801 end0.SetMarkerColor(color);
802 pline.SetPoint(0, wire, tick);
804 slices[isl]->End1Pos().
X(), slices[isl]->End1Pos().Y(), slices[isl]->End1Pos().Z());
806 wire = geo->WireCoordinate(slicePos1, planeID);
807 TMarker& end1 = view->AddMarker(wire, tick, color, 20, 1.0);
808 end1.SetMarkerColor(color);
809 pline.SetPoint(1, wire, tick);
824 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
825 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
826 art::ServiceHandle<geo::Geometry const> geo;
828 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
829 if (recoOpt->fDrawClusters == 0)
return;
831 geo::View_t gview = geo->TPC(rawOpt->fTPC).Plane(plane).View();
836 bool drawAsMarkers = recoOpt->fDrawClusters != 2;
839 bool drawConnectingLines = (recoOpt->fDrawClusters >= 3);
841 static bool first =
true;
843 std::cout <<
"******** DrawClusters: 0 = none, 1 = cluster hits, 2 = unique marker, 3 = "
844 "cluster hits with connecting lines.\n";
845 std::cout <<
" 4 = with T<cluster or trajectory ID> P<PFParticle ID> color-matched. "
846 "Unmatched cluster IDs shown in black.\n";
847 std::cout <<
" Color scheme: By cluster ID in each plane or by PFParticle ID (Self) if a "
848 "PFParticle - Cluster association exists.\n";
852 for (
size_t imod = 0; imod < recoOpt->fClusterLabels.size(); ++imod) {
853 art::InputTag
const which = recoOpt->fClusterLabels[imod];
855 art::PtrVector<recob::Cluster> clust;
858 if (clust.size() < 1)
continue;
864 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
868 if (spacePointVec.size() > 0) {
870 art::FindManyP<recob::Hit> spHitAssnVec(spacePointVec, evt, which);
872 if (spHitAssnVec.isValid()) {
874 std::vector<const recob::Hit*> freeHitVec;
877 for (
const auto& spacePointPtr : spacePointVec) {
878 if (spacePointPtr->Chisq() < -99.) {
880 const std::vector<art::Ptr<recob::Hit>>& hitVec =
881 spHitAssnVec.at(spacePointPtr.key());
883 for (
const auto& hitPtr : hitVec) {
884 if (hitPtr.get()->WireID().Plane != plane)
continue;
886 freeHitVec.push_back(hitPtr.get());
892 this->
Hit2D(freeHitVec, kGray, view,
false,
false,
false);
897 art::FindMany<recob::Hit> fmh(clust, evt, which);
898 art::FindManyP<recob::PFParticle> fmc(clust, evt, which);
900 for (
size_t ic = 0; ic < clust.size(); ++ic) {
903 if (clust[ic]->
Plane().Plane != plane)
continue;
906 int clusterIdx(
std::abs(clust[ic]->ID()));
908 bool pfpAssociation =
false;
909 int pfpIndex = INT_MAX;
910 float cosmicscore = FLT_MIN;
913 std::vector<art::Ptr<recob::PFParticle>> pfplist = fmc.at(ic);
915 if (!pfplist.empty()) {
916 clusterIdx = pfplist[0]->Self();
918 pfpAssociation =
true;
919 pfpIndex = pfplist[0]->Self();
921 if (recoOpt->fDrawCosmicTags) {
922 art::FindManyP<anab::CosmicTag> fmct(pfplist, evt, which);
923 if (fmct.isValid()) {
924 std::vector<art::Ptr<anab::CosmicTag>> ctlist = fmct.at(0);
925 if (!ctlist.empty()) {
927 cosmicscore = ctlist[0]->CosmicScore();
934 std::vector<const recob::Hit*> hits = fmh.at(ic);
943 if (this->
Hit2D(hits, color, view,
false, drawConnectingLines) < 1)
continue;
945 if (recoOpt->fDrawCosmicTags && cosmicscore != FLT_MIN)
946 this->
Hit2D(hits, view, cosmicscore);
948 if (recoOpt->fDrawClusters > 3) {
956 if (pfpIndex != INT_MAX) s = s +
" P" +
std::to_string(pfpIndex + 1);
957 char const* txt = s.c_str();
958 double wire = 0.5 * (clust[ic]->StartWire() + clust[ic]->EndWire());
959 double tick = 20 + 0.5 * (clust[ic]->StartTick() + clust[ic]->EndTick());
960 TText& clID = view->AddText(wire, tick, txt);
961 clID.SetTextSize(0.05);
962 if (pfpAssociation) { clID.SetTextColor(color); }
964 clID.SetTextColor(kBlack);
971 std::vector<double> tpts, wpts;
980 TPolyLine&
p1 = view->AddPolyLine(wpts.size(), lcolor, width,
style);
981 TPolyLine& p2 = view->AddPolyLine(wpts.size(), lcolor, width,
style);
983 p1.SetFillStyle(3003);
984 p1.SetFillColor(fcolor);
985 for (
size_t i = 0; i < wpts.size(); ++i) {
986 if (rawOpt->fAxisOrientation < 1) {
987 p1.SetPoint(i, wpts[i], tpts[i]);
988 p2.SetPoint(i, wpts[i], tpts[i]);
991 p1.SetPoint(i, tpts[i], wpts[i]);
992 p2.SetPoint(i, tpts[i], wpts[i]);
1002 double wirePitch = geo->WirePitch(gview);
1013 clust[ic]->StartWire(),
1015 clust[ic]->EndWire(),
1016 clust[ic]->EndTick(),
1017 std::tan((clust[ic]->StartAngle() + clust[ic]->EndAngle()) / 2.) * wirePitch /
1018 driftvelocity / timetick,
1038 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1039 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1041 if (recoOpt->fDraw2DSlopeEndPoints < 1)
return;
1046 double slope1 = slope;
1048 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
1049 if (rawOpt->fAxisOrientation > 0) {
1054 slope1 = 1. / slope;
1059 double deltaX = 0.5 * (x2 - x1);
1060 double xm = x1 + deltaX;
1061 double ym = y1 + deltaX * slope;
1063 TMarker& strt = view->AddMarker(xm, ym, color, kFullCircle, 1.0);
1064 strt.SetMarkerColor(color);
1067 double stublen = 2. * deltaX;
1068 TLine& l = view->AddLine(x1, y1, x1 + stublen, y1 + slope1 * stublen);
1069 l.SetLineColor(color);
1083 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1084 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1086 if (recoOpt->fDraw2DSlopeEndPoints < 1)
return;
1090 double slope1 = slope;
1092 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
1093 if (rawOpt->fAxisOrientation > 0) {
1097 slope1 = 1. / slope;
1102 TMarker& strt = view->AddMarker(x1, y1, color, kFullStar, 2.0);
1103 strt.SetMarkerColor(color);
1106 double stublen = 300.0;
1107 TLine& l = view->AddLine(x1, y1, x1 + stublen, y1 + slope1 * stublen);
1108 l.SetLineColor(color);
1124 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1125 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1127 if (recoOpt->fDraw2DSlopeEndPoints < 1)
return;
1131 double cosx1 = cosx;
1132 double cosy1 = cosy;
1134 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
1135 if (rawOpt->fAxisOrientation > 0) {
1142 TMarker& strt = view->AddMarker(x1, y1, color, kFullStar, 2.0);
1143 strt.SetMarkerColor(color);
1146 double stublen = 300.0;
1147 TLine& l = view->AddLine(x1, y1, x1 + stublen * cosx1, y1 + stublen * cosy1);
1148 l.SetLineColor(color);
1166 std::vector<double>& wpts,
1167 std::vector<double>& tpts,
1170 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1173 std::map<unsigned int, double> wlo, whi;
1175 for (
size_t j = 0; j < hits.size(); ++j) {
1177 if (hits[j]->
WireID().Plane != plane || hits[j]->WireID().TPC != rawOpt->fTPC ||
1178 hits[j]->WireID().Cryostat != rawOpt->fCryostat)
1181 wlo[hits[j]->WireID().Wire] = hits[j]->PeakTime();
1182 whi[hits[j]->WireID().Wire] = hits[j]->PeakTime();
1188 for (
size_t j = 0; j < hits.size(); ++j) {
1189 t = hits[j]->PeakTime();
1191 if (t < wlo[hits[j]->
WireID().Wire]) wlo[hits[j]->WireID().Wire] = t;
1192 if (t > whi[hits[j]->
WireID().Wire]) whi[hits[j]->WireID().Wire] = t;
1197 std::map<unsigned int, double>::iterator itr(wlo.begin());
1198 std::map<unsigned int, double>::iterator itrEnd(wlo.end());
1199 for (; itr != itrEnd; ++itr) {
1200 unsigned int w = itr->first;
1203 wpts.push_back(1. * w - 0.1);
1204 tpts.push_back(t - 0.1);
1205 wpts.push_back(1. * w + 0.1);
1206 tpts.push_back(t - 0.1);
1211 std::map<unsigned int, double>::reverse_iterator ritr(whi.rbegin());
1212 std::map<unsigned int, double>::reverse_iterator ritrEnd(whi.rend());
1213 for (; ritr != ritrEnd; ++ritr) {
1214 unsigned int w = ritr->first;
1217 wpts.push_back(1. * w + 0.1);
1218 tpts.push_back(t + 0.1);
1219 wpts.push_back(1. * w - 0.1);
1220 tpts.push_back(t + 0.1);
1224 wpts.push_back(wpts[0]);
1225 tpts.push_back(tpts[0]);
1233 std::vector<const recob::Hit*>& hits,
1236 TVector3
const& startPos,
1237 TVector3
const& startDir,
1241 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1242 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1243 art::ServiceHandle<geo::Geometry const> geo;
1245 unsigned int c = rawOpt->fCryostat;
1246 unsigned int t = rawOpt->fTPC;
1248 geo::Point_t localPos(startPos.X(), startPos.Y(), startPos.Z());
1253 if (cscore > 0.1 && recoOpt->fDrawCosmicTags) {
1255 if (cscore < 0.6) color = kMagenta;
1258 else if (cscore < -10000) {
1263 if (cscore < -1000) {
1264 this->
Hit2D(hits, color, view,
false,
false, lineWidth);
1265 if (recoOpt->fDrawShowers >= 1) {
1268 char const* txt = s.c_str();
1270 double wire = geo->WireCoordinate(localPos, planeID);
1271 TText& shwID = view->AddText(wire, tick, txt);
1273 shwID.SetTextSize(0.1);
1277 this->
Hit2D(hits, color, view,
false,
false, lineWidth);
1280 double wire0 = geo->WireCoordinate(localPos, planeID);
1284 double tick1 = detProp.
ConvertXToTicks((startPos + startDir).
X(), planeID);
1285 double wire1 = geo->WireCoordinate(localPos, planeID);
1288 double ds = sqrt(pow(tick0 - tick1, 2) + pow(wire0 - wire1, 2));
1291 cost = (tick1 - tick0) / ds;
1292 cosw = (wire1 - wire0) / ds;
1304 std::vector<const recob::Hit*>& hits,
1311 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1312 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1313 art::ServiceHandle<geo::Geometry const> geo;
1314 unsigned int c = rawOpt->fCryostat;
1315 unsigned int t = rawOpt->fTPC;
1318 this->
Hit2D(hits, color, view,
false,
true, lineWidth);
1320 const auto& startPos = track->
Vertex();
1324 double local[3] = {0.};
1325 double world[3] = {0.};
1326 geo->Cryostat(c).TPC(t).Plane(plane).LocalToWorld(local, world);
1327 world[1] = startPos.Y();
1328 world[2] = startPos.Z();
1334 wire = 1. * geo->NearestWire(world, plane, t, c);
1336 catch (cet::exception&
e) {
1337 wire = 1. * atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
1341 double thetawire = geo->TPC(t).Plane(plane).Wire(0).ThetaZ();
1342 double wirePitch = geo->WirePitch(hits[0]->View());
1351 double rotang = 3.1416 - thetawire;
1352 double yprime = std::cos(rotang) * startDir.Y() + std::sin(rotang) * startDir.Z();
1353 double dTdW = startDir.X() * wirePitch / driftvelocity / timetick / yprime;
1360 TPolyLine& pl = view->AddPolyLine(0, 1, 1, 0);
1363 for (
size_t idx = 0; idx < nTrackHits; idx++) {
1368 world[1] = hitPos.Y();
1369 world[2] = hitPos.Z();
1373 double wireHit = 0.;
1375 wireHit = 1. * geo->NearestWire(world, plane, t, c);
1377 catch (cet::exception& e) {
1378 wireHit = 1. * atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
1380 const size_t tpc = geo->FindTPCAtPosition(hitPos).TPC;
1381 const size_t cryo = geo->FindCryostatAtPosition(hitPos);
1382 if (tpc == t && cryo == c) { pl.SetPoint(vidx++, wireHit, tickHit); }
1397 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1398 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1399 art::ServiceHandle<geo::Geometry const> geo;
1401 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
1403 geo::View_t gview = geo->TPC(rawOpt->fTPC).Plane(plane).View();
1409 unsigned int cstat = rawOpt->fCryostat;
1410 unsigned int tpc = rawOpt->fTPC;
1414 if (recoOpt->fDrawTracks != 0) {
1415 for (
size_t imod = 0; imod < recoOpt->fTrackLabels.size(); ++imod) {
1416 art::InputTag
const which = recoOpt->fTrackLabels[imod];
1418 art::View<recob::Track>
track;
1421 if (track.vals().size() < 1)
continue;
1423 art::FindMany<recob::Hit> fmh(track, evt, which);
1425 art::InputTag
const whichTag(
1426 recoOpt->fCosmicTagLabels.size() > imod ? recoOpt->fCosmicTagLabels[imod] :
"");
1427 art::FindManyP<anab::CosmicTag> cosmicTrackTags(track, evt, whichTag);
1429 auto tracksProxy = proxy::getCollection<proxy::Tracks>(
evt, which);
1433 for (
size_t t = 0; t < track.vals().size(); ++t) {
1435 if (track.vals().at(t)->NumberTrajectoryPoints() == 0) {
1436 std::cout <<
"***** Track with no trajectory points ********" << std::endl;
1440 if (recoOpt->fDrawTracks > 1) {
1443 track.vals().at(t)->End().Y(),
1444 track.vals().at(t)->End().Z());
1446 double wire = geo->WireCoordinate(trackPos,
geo::PlaneID(cstat, tpc, plane));
1448 track.vals().at(t)->ID() &
1451 char const* txt = s.c_str();
1452 TText& trkID = view->AddText(wire, tick, txt);
1454 trkID.SetTextSize(0.1);
1458 if (cosmicTrackTags.isValid()) {
1459 if (cosmicTrackTags.at(t).size() > 0) {
1460 art::Ptr<anab::CosmicTag> currentTag = cosmicTrackTags.at(t).at(0);
1461 Score = currentTag->CosmicScore();
1465 std::vector<const recob::Hit*> hits;
1466 if (track.vals().at(t)->NumberTrajectoryPoints() == fmh.at(t).size()) {
1467 auto tp = tracksProxy[t];
1468 for (
auto point : tp.points()) {
1469 if (!point.isPointValid())
continue;
1470 hits.push_back(point.hit());
1477 std::vector<const recob::Hit*>::iterator itr = hits.begin();
1478 while (itr < hits.end()) {
1479 if ((*itr)->View() != gview)
1489 if (Score > 0.1 && recoOpt->fDrawCosmicTags) {
1491 if (Score < 0.6) color = kMagenta;
1494 else if (Score < -10000) {
1498 this->
DrawTrack2D(clockData, detProp, hits, view, plane, aTrack, color, lineWidth);
1503 if (recoOpt->fDrawShowers != 0) {
1504 static bool first =
true;
1508 std::cout <<
" 1 = Hits in shower color-coded by the shower ID\n";
1509 std::cout <<
" 2 = Same as 1 + shower axis and circle representing the shower cone\n";
1510 std::cout <<
" Black cone = shower start dE/dx < 1 MeV/cm (< 1/2 MIP)\n";
1511 std::cout <<
" Blue cone = shower start dE/dx < 3 MeV/cm (~1 MIP)\n";
1512 std::cout <<
" Green cone = shower start 3 MeV/cm < dE/dx < 5 MeV/cm (~2 MIP)\n";
1513 std::cout <<
" Red cone = shower start 5 MeV/cm < dE/dx (>2 MIP)\n";
1516 for (
size_t imod = 0; imod < recoOpt->fShowerLabels.size(); ++imod) {
1517 art::InputTag
const which = recoOpt->fShowerLabels[imod];
1519 art::View<recob::Shower>
shower;
1521 if (shower.vals().size() < 1)
continue;
1523 art::FindMany<recob::Hit> fmh(shower, evt, which);
1527 for (
size_t s = 0;
s < shower.vals().size(); ++
s) {
1529 std::vector<const recob::Hit*> hits = fmh.at(
s);
1531 std::vector<const recob::Hit*>::iterator itr = hits.begin();
1532 while (itr < hits.end()) {
1533 if ((*itr)->View() != gview)
1538 if (recoOpt->fDrawShowers > 1) {
1541 if (!shower.vals().at(
s)->has_length())
continue;
1542 if (!shower.vals().at(
s)->has_open_angle())
continue;
1544 TVector3 startPos = shower.vals().at(
s)->ShowerStart();
1545 TVector3
dir = shower.vals().at(
s)->Direction();
1546 double length = shower.vals().at(
s)->Length();
1547 double openAngle = shower.vals().at(
s)->OpenAngle();
1550 TVector3 endPos = startPos + length *
dir;
1555 double swire = geo->WireCoordinate(localStart, planeID);
1557 double ewire = geo->WireCoordinate(localEnd, planeID);
1559 TLine& coneLine = view->AddLine(swire, stick, ewire, etick);
1561 std::vector<double> dedxVec = shower.vals().at(
s)->dEdx();
1565 if (plane < dedxVec.size()) {
1566 if (dedxVec[plane] > 1 && dedxVec[plane] < 3) {
1570 else if (dedxVec[plane] < 5) {
1579 coneLine.SetLineColor(color);
1582 double radius = length * openAngle;
1583 auto coneRim =
Circle3D(endPos, dir, radius);
1584 TPolyLine& pline = view->AddPolyLine(coneRim.size(), color, 2, 0);
1586 for (
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
1587 geo::Point_t localPos(coneRim[ipt][0], coneRim[ipt][1], coneRim[ipt][2]);
1589 double wire = geo->WireCoordinate(localPos, planeID);
1591 pline.SetPoint(ipt, wire, tick);
1598 shower.vals().at(
s)->ShowerStart(),
1599 shower.vals().at(
s)->Direction(),
1618 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1619 if (!recoOpt->fDrawTrackVertexAssns)
return;
1621 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1622 art::ServiceHandle<geo::Geometry const> geo;
1624 geo::View_t gview = geo->TPC(rawOpt->fTPC).Plane(plane).View();
1630 unsigned int cstat = rawOpt->fCryostat;
1631 unsigned int tpc = rawOpt->fTPC;
1635 for (
size_t imod = 0; imod < recoOpt->fTrkVtxTrackLabels.size(); ++imod) {
1636 art::InputTag
const which = recoOpt->fTrkVtxTrackLabels[imod];
1638 art::View<recob::Track> trackCol;
1641 if (trackCol.vals().size() < 1)
continue;
1644 std::unique_ptr<art::Assns<recob::Vertex, recob::Track>> vertexTrackAssociations(
1645 new art::Assns<recob::Vertex, recob::Track>);
1649 art::Handle<art::Assns<recob::Vertex, recob::Track>> vertexTrackAssnsHandle;
1651 evt.getByLabel(recoOpt->fTrkVtxFilterLabels[imod], vertexTrackAssnsHandle);
1653 if (vertexTrackAssnsHandle->size() < 1)
continue;
1656 art::FindMany<recob::Hit> fmh(trackCol, evt, which);
1658 art::FindManyP<anab::CosmicTag> cosmicTrackTags(
1659 trackCol, evt, recoOpt->fTrkVtxCosmicLabels[imod]);
1661 auto tracksProxy = proxy::getCollection<proxy::Tracks>(
evt, which);
1667 std::cout <<
"==> Neutrino Candidate drawing for tagger "
1668 << recoOpt->fTrkVtxFilterLabels[imod] << std::endl;
1671 for (
const auto& vertexTrackAssn : *vertexTrackAssnsHandle) {
1673 art::Ptr<recob::Vertex>
vertex = vertexTrackAssn.first;
1675 if (vertex->ID() != lastVtxIdx) {
1683 double wire = geo->WireCoordinate(localXYZ, planeID);
1686 TMarker& strt = view->AddMarker(wire, time, color, 24, 3.0);
1687 strt.SetMarkerColor(color);
1689 std::cout <<
" --> Drawing vertex id: " << vertex->ID() << std::endl;
1692 lastVtxIdx = vertex->ID();
1694 const art::Ptr<recob::Track>&
track = vertexTrackAssn.second;
1697 double x = track->End().X();
1700 double wire = geo->WireCoordinate(trackEnd, planeID);
1702 tid = track->ID() & 65535;
1704 std::cout <<
" --> Drawing Track id: " << tid << std::endl;
1707 char const* txt = s.c_str();
1709 TText& trkID = view->AddText(wire, tick, txt);
1710 trkID.SetTextColor(color);
1711 trkID.SetTextSize(0.1);
1713 float cosmicScore = -999;
1714 if (cosmicTrackTags.isValid()) {
1715 if (cosmicTrackTags.at(track.key()).
size() > 0) {
1716 art::Ptr<anab::CosmicTag> currentTag = cosmicTrackTags.at(track.key()).at(0);
1717 cosmicScore = currentTag->CosmicScore();
1721 std::vector<const recob::Hit*> hits;
1722 if (track->NumberTrajectoryPoints() == fmh.at(track.key()).
size()) {
1723 auto tp = tracksProxy[track.key()];
1724 for (
auto point : tp.points()) {
1725 if (!point.isPointValid())
continue;
1726 hits.push_back(point.hit());
1730 hits = fmh.at(track.key());
1733 std::vector<const recob::Hit*>::iterator itr = hits.begin();
1734 while (itr < hits.end()) {
1735 if ((*itr)->View() != gview)
1743 if (cosmicScore > 0.1) {
1745 if (cosmicScore < 0.6) color = kMagenta;
1748 else if (cosmicScore < -10000) {
1752 this->
DrawTrack2D(clockData, detProp, hits, view, plane, track.get(), color, lineWidth);
1766 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1767 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1769 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
1770 if (recoOpt->fDrawVertices == 0)
return;
1772 art::ServiceHandle<geo::Geometry const> geo;
1773 static bool first =
true;
1776 std::cout <<
"******** DrawVertices: Open circles color coded across all planes. Set "
1777 "DrawVertices > 1 to display the vertex ID\n";
1781 for (
size_t imod = 0; imod < recoOpt->fVertexLabels.size(); ++imod) {
1782 art::InputTag
const which = recoOpt->fVertexLabels[imod];
1784 art::PtrVector<recob::Vertex>
vertex;
1787 if (vertex.size() < 1)
continue;
1789 double local[3] = {0., 0., 0.};
1790 double world[3] = {0., 0., 0.};
1793 double minxyz[3], maxxyz[3];
1794 minxyz[0] = world[0] - geo->DetHalfWidth(rawOpt->fTPC, rawOpt->fCryostat);
1795 maxxyz[0] = world[0] + geo->DetHalfWidth(rawOpt->fTPC, rawOpt->fCryostat);
1796 minxyz[1] = world[1] - geo->DetHalfWidth(rawOpt->fTPC, rawOpt->fCryostat);
1797 maxxyz[1] = world[1] + geo->DetHalfWidth(rawOpt->fTPC, rawOpt->fCryostat);
1798 minxyz[2] = world[2] - geo->DetLength(rawOpt->fTPC, rawOpt->fCryostat) / 2;
1799 maxxyz[2] = world[2] + geo->DetLength(rawOpt->fTPC, rawOpt->fCryostat) / 2;
1801 for (
size_t v = 0; v < vertex.size(); ++v) {
1804 vertex[v]->XYZ(xyz);
1805 if (xyz[0] < minxyz[0] || xyz[0] > maxxyz[0])
continue;
1806 if (xyz[1] < minxyz[1] || xyz[1] > maxxyz[1])
continue;
1807 if (xyz[2] < minxyz[2] || xyz[2] > maxxyz[2])
continue;
1813 geo->WireCoordinate(localPos,
geo::PlaneID(rawOpt->fCryostat, rawOpt->fTPC, plane));
1814 double time = detProp.
ConvertXToTicks(xyz[0], plane, rawOpt->fTPC, rawOpt->fCryostat);
1816 TMarker& strt = view->AddMarker(wire, time, color, 24, 1.0);
1817 strt.SetMarkerColor(color);
1820 if (recoOpt->fDrawVertices > 1) {
1822 char const* txt = s.c_str();
1823 TText& vtxID = view->AddText(wire, time + 30, txt);
1824 vtxID.SetTextColor(color);
1825 vtxID.SetTextSize(0.05);
1837 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1838 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1839 art::ServiceHandle<geo::Geometry const> geo;
1841 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
1843 if (recoOpt->fDrawEvents != 0) {
1844 geo::View_t gview = geo->TPC(rawOpt->fTPC).Plane(plane).View();
1846 for (
unsigned int imod = 0; imod < recoOpt->fEventLabels.size(); ++imod) {
1847 art::InputTag
const which = recoOpt->fEventLabels[imod];
1849 art::PtrVector<recob::Event> event;
1852 if (event.size() < 1)
continue;
1854 art::FindMany<recob::Hit> fmh(event, evt, which);
1856 for (
size_t e = 0;
e <
event.size(); ++
e) {
1857 std::vector<const recob::Hit*> hits;
1862 std::vector<const recob::Hit*>::iterator itr = hits.begin();
1863 while (itr < hits.end()) {
1864 if ((*itr)->View() != gview)
1882 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1883 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1885 std::vector<art::InputTag>
labels;
1886 if (recoOpt->fDrawSeeds != 0)
1887 for (
size_t imod = 0; imod < recoOpt->fSeedLabels.size(); ++imod)
1888 labels.push_back(recoOpt->fSeedLabels[imod]);
1890 for (
size_t imod = 0; imod < labels.size(); ++imod) {
1891 art::InputTag
const which = labels[imod];
1893 art::PtrVector<recob::Seed>
seeds;
1898 if (seeds.size() < 1)
continue;
1900 TPolyMarker3D& pmrk = view->AddPolyMarker3D(seeds.size(), color, 4, 1);
1902 for (
size_t iseed = 0; iseed != seeds.size(); ++iseed) {
1903 double pt[3], pterr[3],
dir[3], direrr[3];
1904 seeds.at(iseed)->GetPoint(pt, pterr);
1905 seeds.at(iseed)->GetDirection(dir, direrr);
1907 double end1[3], end2[3];
1908 for (
int i = 0; i != 3; ++i) {
1909 end1[i] = pt[i] + dir[i];
1910 end2[i] = pt[i] - dir[i];
1913 TPolyLine3D& pline = view->AddPolyLine3D(2, color, 2, 0);
1915 pmrk.SetPoint(iseed, pt[0], pt[1], pt[2]);
1916 pline.SetPoint(0, end1[0], end1[1], end1[2]);
1917 pline.SetPoint(1, end2[0], end2[1], end2[2]);
1928 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1929 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1931 std::vector<art::InputTag>
labels;
1932 if (recoOpt->fDrawSeeds != 0)
1933 for (
size_t imod = 0; imod < recoOpt->fSeedLabels.size(); ++imod)
1934 labels.push_back(recoOpt->fSeedLabels[imod]);
1936 for (
size_t imod = 0; imod < labels.size(); ++imod) {
1937 art::InputTag
const which = labels[imod];
1939 art::PtrVector<recob::Seed>
seeds;
1944 for (
size_t iseed = 0; iseed != seeds.size(); ++iseed) {
1945 double pt[3], pterr[3],
dir[3], direrr[3];
1946 seeds.at(iseed)->GetPoint(pt, pterr);
1947 seeds.at(iseed)->GetDirection(dir, direrr);
1949 double end1[3], end2[3];
1950 for (
int i = 0; i != 3; ++i) {
1951 end1[i] = pt[i] + dir[i];
1952 end2[i] = pt[i] - dir[i];
1956 TMarker& strt = view->AddMarker(pt[1], pt[0], color, 4, 1.5);
1957 TLine& line = view->AddLine(end1[1], end1[0], end2[1], end2[0]);
1960 line.SetLineWidth(2.0);
1963 TMarker& strt = view->AddMarker(pt[2], pt[0], color, 4, 1.5);
1964 TLine& line = view->AddLine(end1[2], end1[0], end2[2], end2[0]);
1967 line.SetLineWidth(2.0);
1971 throw cet::exception(
"RecoBaseDrawer:SeedOrtho")
1972 <<
"projection is not YZ as expected\n";
1974 TMarker& strt = view->AddMarker(pt[2], pt[1], color, 4, 1.5);
1975 TLine& line = view->AddLine(end1[2], end1[1], end2[2], end2[1]);
1978 line.SetLineWidth(2.0);
1988 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
1989 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
1991 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
1993 std::vector<art::InputTag>
labels;
1994 if (recoOpt->fDrawSpacePoints != 0) {
1995 for (
size_t imod = 0; imod < recoOpt->fSpacePointLabels.size(); ++imod)
1996 labels.push_back(recoOpt->fSpacePointLabels[imod]);
1999 for (
size_t imod = 0; imod < labels.size(); ++imod) {
2000 art::InputTag
const which = labels[imod];
2002 std::vector<art::Ptr<recob::SpacePoint>> spts;
2004 int color = 10 * imod + 11;
2026 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
2027 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
2029 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
2030 if (recoOpt->fDrawPFParticles < 1)
return;
2033 for (
size_t imod = 0; imod < recoOpt->fPFParticleLabels.size(); ++imod) {
2034 art::InputTag
const which = recoOpt->fPFParticleLabels[imod];
2035 art::InputTag
const assns = recoOpt->fSpacePointLabels[imod];
2038 art::PtrVector<recob::PFParticle> pfParticleVec;
2041 mf::LogDebug(
"RecoBaseDrawer")
2042 <<
"RecoBaseDrawer: number PFParticles to draw: " << pfParticleVec.size() << std::endl;
2045 if (pfParticleVec.size() < 1)
continue;
2048 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
2052 std::vector<art::Ptr<recob::Edge>> edgeVec;
2053 if (recoOpt->fDrawEdges) this->
GetEdges(evt, assns, edgeVec);
2056 if (spacePointVec.empty())
continue;
2059 art::FindManyP<recob::SpacePoint> edgeSpacePointAssnsVec(edgeVec, evt, assns);
2060 art::FindManyP<recob::SpacePoint> spacePointAssnVec(pfParticleVec, evt, assns);
2061 art::FindManyP<recob::Hit> spHitAssnVec(spacePointVec, evt, assns);
2062 art::FindManyP<recob::Edge> edgeAssnsVec(pfParticleVec, evt, assns);
2065 if (!spacePointAssnVec.isValid())
continue;
2068 art::FindMany<recob::PCAxis> pcAxisAssnVec(pfParticleVec, evt, which);
2073 art::InputTag cosmicTagLabel =
2074 imod < recoOpt->fCosmicTagLabels.size() ? recoOpt->fCosmicTagLabels[imod] :
"";
2075 art::FindMany<anab::CosmicTag> pfCosmicAssns(pfParticleVec, evt, cosmicTagLabel);
2079 art::InputTag trackTagLabel =
2080 imod < recoOpt->fTrackLabels.size() ? recoOpt->fTrackLabels[imod] :
"";
2081 art::FindMany<recob::Track> pfTrackAssns(pfParticleVec, evt, trackTagLabel);
2084 for (
size_t idx = 0; idx < pfParticleVec.size(); idx++) {
2086 const art::Ptr<recob::PFParticle> pfParticle(pfParticleVec.at(idx));
2090 if (!pfParticle->IsPrimary())
continue;
2098 edgeSpacePointAssnsVec,
2116 bool usePlane[] = {
false,
false,
false};
2117 float peakTimeVec[] = {0., 0., 0.};
2118 float peakSigmaVec[] = {0., 0., 0.};
2120 float weightSum(0.);
2123 std::map<size_t, double> planeOffsetMap;
2125 planeOffsetMap[0] = 0.;
2126 planeOffsetMap[1] = 4.;
2127 planeOffsetMap[2] = 8.;
2129 for (
const auto&
hit : hitVec) {
2132 float peakTime =
hit->PeakTime() - planeOffsetMap[
hit->WireID().Plane];
2133 float peakRMS =
hit->RMS();
2135 aveSum += peakTime / (peakRMS * peakRMS);
2136 weightSum += 1. / (peakRMS * peakRMS);
2138 peakTimeVec[
hit->WireID().Plane] = peakTime;
2139 peakSigmaVec[
hit->WireID().Plane] = peakRMS;
2140 usePlane[
hit->WireID().Plane] =
true;
2143 aveSum /= weightSum;
2145 for (
int idx = 0; idx < 3; idx++) {
2146 if (usePlane[idx]) {
2147 float deltaTime = peakTimeVec[idx] - aveSum;
2148 float sigmaPeakTimeSq = peakSigmaVec[idx] * peakSigmaVec[idx];
2150 hitChiSq += deltaTime * deltaTime / sigmaPeakTimeSq;
2159 const art::PtrVector<recob::PFParticle>& pfParticleVec,
2160 const std::vector<art::Ptr<recob::SpacePoint>>& spacePointVec,
2161 const art::FindManyP<recob::Edge>& edgeAssnsVec,
2162 const art::FindManyP<recob::SpacePoint>& spacePointAssnVec,
2163 const art::FindManyP<recob::SpacePoint>& edgeSPAssnVec,
2164 const art::FindManyP<recob::Hit>& spHitAssnVec,
2165 const art::FindMany<recob::Track>& trackAssnVec,
2166 const art::FindMany<recob::PCAxis>& pcAxisAssnVec,
2167 const art::FindMany<anab::CosmicTag>& cosmicTagAssnVec,
2171 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
2172 art::ServiceHandle<evd::ColorDrawingOptions const> cst;
2175 const std::vector<art::Ptr<recob::SpacePoint>>& hitsVec(spacePointAssnVec.at(pfPart.key()));
2179 bool isCosmic(
false);
2183 if (cosmicTagAssnVec.isValid() && recoOpt->fDrawPFParticles > 3) {
2184 std::vector<const anab::CosmicTag*> pfCosmicTagVec = cosmicTagAssnVec.at(pfPart.key());
2186 if (!pfCosmicTagVec.empty()) {
2189 if (cosmicTag->
CosmicScore() > 0.6) isCosmic =
true;
2194 if (isCosmic) colorIdx = 12;
2196 if (!hitsVec.empty() && recoOpt->fDraw3DSpacePoints)
2279 if (edgeAssnsVec.isValid() && recoOpt->fDraw3DEdges) {
2280 const std::vector<art::Ptr<recob::Edge>>& edgeVec(edgeAssnsVec.at(pfPart.key()));
2282 if (!edgeVec.empty()) {
2283 TPolyMarker3D& pm = view->AddPolyMarker3D(
2284 2 * edgeVec.size(), colorIdx, kFullDotMedium, 1.25);
2286 for (
const auto& edge : edgeVec) {
2288 const std::vector<art::Ptr<recob::SpacePoint>>& spacePointVec(
2289 edgeSPAssnVec.at(edge.key()));
2291 if (spacePointVec.size() != 2) {
2292 std::cout <<
"Space Point vector associated to edge is not of size 2: "
2293 << spacePointVec.size() << std::endl;
2300 TVector3 startPoint(firstSP->
XYZ()[0], firstSP->
XYZ()[1], firstSP->
XYZ()[2]);
2301 TVector3 endPoint(secondSP->
XYZ()[0], secondSP->
XYZ()[1], secondSP->
XYZ()[2]);
2302 TVector3 lineVec(endPoint - startPoint);
2304 pm.SetNextPoint(startPoint[0], startPoint[1], startPoint[2]);
2305 pm.SetNextPoint(endPoint[0], endPoint[1], endPoint[2]);
2307 double length = lineVec.Mag();
2310 std::cout <<
"Edge length is zero, index 1: " << edge->FirstPointID()
2311 <<
", index 2: " << edge->SecondPointID() << std::endl;
2315 double minLen = std::max(2.01, length);
2317 if (minLen > length) {
2320 startPoint += -0.5 * (minLen - length) * lineVec;
2321 endPoint += 0.5 * (minLen - length) * lineVec;
2325 TPolyLine3D& pl = view->AddPolyLine3D(2, colorIdx, 4, 1);
2327 pl.SetPoint(0, startPoint[0], startPoint[1], startPoint[2]);
2328 pl.SetPoint(1, endPoint[0], endPoint[1], endPoint[2]);
2338 if (trackAssnVec.isValid()) {
2339 std::vector<const recob::Track*> trackVec(trackAssnVec.at(pfPart.key()));
2341 if (!trackVec.empty()) {
2342 for (
const auto&
track : trackVec)
2348 if (pcAxisAssnVec.isValid() && recoOpt->fDraw3DPCAAxes) {
2349 std::vector<const recob::PCAxis*> pcaVec(pcAxisAssnVec.at(pfPart.key()));
2351 if (!pcaVec.empty()) {
2355 int lineWidth[2] = {2, 1};
2356 int lineStyle[2] = {1, 13};
2357 int lineColor[2] = {colorIdx, 18};
2359 int markStyle[2] = {kFullDotLarge, kFullDotLarge};
2360 double markSize[2] = {0.5, 0.2};
2363 if (!isCosmic) lineColor[1] = colorIdx;
2367 if (pcaVec.size() > 1 && pcaVec.front()->getID() > pcaVec.back()->getID())
2368 std::reverse(pcaVec.begin(), pcaVec.end());
2370 for (
const auto& pca : pcaVec) {
2372 const double* avePosition = pca->getAvePosition();
2376 TPolyMarker3D& pmrk =
2377 view->AddPolyMarker3D(7, lineColor[pcaIdx], markStyle[pcaIdx], markSize[pcaIdx]);
2379 pmrk.SetPoint(pmrkIdx++, avePosition[0], avePosition[1], avePosition[2]);
2382 for (
int dimIdx = 0; dimIdx < 3; dimIdx++) {
2384 TPolyLine3D& pl = view->AddPolyLine3D(
2385 numPoints, lineColor[pcaIdx], lineWidth[pcaIdx], lineStyle[pcaIdx]);
2388 double eigenValue = pca->getEigenValues()[dimIdx];
2391 if (eigenValue > 0) {
2393 eigenValue = 3. * sqrt(eigenValue);
2396 const std::vector<double>& eigenVector = pca->getEigenVectors()[dimIdx];
2399 double xl = avePosition[0] - 0.5 * eigenValue * eigenVector[0];
2400 double yl = avePosition[1] - 0.5 * eigenValue * eigenVector[1];
2401 double zl = avePosition[2] - 0.5 * eigenValue * eigenVector[2];
2403 pl.SetPoint(0, xl, yl, zl);
2404 pmrk.SetPoint(pmrkIdx++, xl, yl, zl);
2407 double xu = avePosition[0] + 0.5 * eigenValue * eigenVector[0];
2408 double yu = avePosition[1] + 0.5 * eigenValue * eigenVector[1];
2409 double zu = avePosition[2] + 0.5 * eigenValue * eigenVector[2];
2411 pl.SetPoint(1, xu, yu, zu);
2412 pmrk.SetPoint(pmrkIdx++, xu, yu, zu);
2417 if (recoOpt->fBestPCAAxisOnly)
break;
2425 if (pfPart->NumDaughters() > 0) {
2432 for (
const auto& daughterIdx : pfPart->Daughters()) {
2455 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
2457 if (recoOpt->fDrawEdges < 1)
return;
2460 for (
size_t imod = 0; imod < recoOpt->fEdgeLabels.size(); ++imod) {
2461 art::InputTag
const which = recoOpt->fEdgeLabels[imod];
2464 std::vector<art::Ptr<recob::Edge>> edgeVec;
2465 this->
GetEdges(evt, which, edgeVec);
2467 mf::LogDebug(
"RecoBaseDrawer")
2468 <<
"RecoBaseDrawer: number Edges to draw: " << edgeVec.size() << std::endl;
2470 if (!edgeVec.empty()) {
2472 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
2478 TPolyMarker3D& pm = view->AddPolyMarker3D(
2479 spacePointVec.size(), colorIdx, kFullDotMedium, 0.5);
2481 for (
const auto& spacePoint : spacePointVec) {
2482 TVector3 spPosition(spacePoint->XYZ()[0], spacePoint->XYZ()[1], spacePoint->XYZ()[2]);
2484 pm.SetNextPoint(spPosition[0], spPosition[1], spPosition[2]);
2488 for (
const auto& edge : edgeVec) {
2489 art::Ptr<recob::SpacePoint> firstSP = spacePointVec.at(edge->FirstPointID());
2490 art::Ptr<recob::SpacePoint> secondSP = spacePointVec.at(edge->SecondPointID());
2492 if (firstSP->ID() != edge->FirstPointID() || secondSP->ID() != edge->SecondPointID()) {
2493 mf::LogDebug(
"RecoBaseDrawer")
2494 <<
"Edge: Space point index mismatch, first: " << firstSP->ID() <<
", "
2495 << edge->FirstPointID() <<
", second: " << secondSP->ID() <<
", "
2496 << edge->SecondPointID() << std::endl;
2500 TVector3 startPoint(firstSP->XYZ()[0], firstSP->XYZ()[1], firstSP->XYZ()[2]);
2501 TVector3 endPoint(secondSP->XYZ()[0], secondSP->XYZ()[1], secondSP->XYZ()[2]);
2502 TVector3 lineVec(endPoint - startPoint);
2504 double length = lineVec.Mag();
2516 TPolyMarker3D& fakeLine = view->AddPolyMarker3D(10, 5, kFullDotMedium, 1.0);
2520 for (
int idx = 1; idx <= 10; idx++) {
2521 TVector3 plotPoint = startPoint + 0.1 * double(idx) * length * lineVec;
2523 fakeLine.SetNextPoint(plotPoint[0], plotPoint[1], plotPoint[2]);
2530 for (
size_t imod = 0; imod < recoOpt->fExtremePointLabels.size(); ++imod) {
2531 art::InputTag
const which = recoOpt->fExtremePointLabels[imod];
2534 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
2537 mf::LogDebug(
"RecoBaseDrawer")
2538 <<
"RecoBaseDrawer: number Extreme points to draw: " << spacePointVec.size() << std::endl;
2540 if (!spacePointVec.empty()) {
2542 int colorIdx(kYellow);
2544 TPolyMarker3D& pm = view->AddPolyMarker3D(
2545 spacePointVec.size(), colorIdx, kFullDotLarge, 1.0);
2547 for (
const auto& spacePoint : spacePointVec) {
2548 TVector3 spPosition(spacePoint->XYZ()[0], spacePoint->XYZ()[1], spacePoint->XYZ()[2]);
2550 pm.SetNextPoint(spPosition[0], spPosition[1], spPosition[2]);
2562 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
2563 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
2565 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
2573 if (recoOpt->fDrawTracks > 2) {
2574 for (
size_t imod = 0; imod < recoOpt->fTrackLabels.size(); ++imod) {
2575 art::InputTag which = recoOpt->fTrackLabels[imod];
2576 art::View<recob::Track> trackView;
2578 if (!trackView.isValid())
2581 art::PtrVector<recob::Track> trackVec;
2583 trackView.fill(trackVec);
2585 art::InputTag
const cosmicTagLabel(
2586 recoOpt->fCosmicTagLabels.size() > imod ? recoOpt->fCosmicTagLabels[imod] :
"");
2587 art::FindMany<anab::CosmicTag> cosmicTagAssnVec(trackVec, evt, cosmicTagLabel);
2589 for (
const auto&
track : trackVec) {
2591 int marker = kFullDotLarge;
2597 if (cosmicTagAssnVec.isValid()) {
2598 std::vector<const anab::CosmicTag*> tkCosmicTagVec = cosmicTagAssnVec.at(
track.key());
2600 if (!tkCosmicTagVec.empty()) {
2620 if (recoOpt->fDrawShowers != 0) {
2621 for (
size_t imod = 0; imod < recoOpt->fShowerLabels.size(); ++imod) {
2622 art::InputTag which = recoOpt->fShowerLabels[imod];
2623 art::View<recob::Shower>
shower;
2626 for (
size_t s = 0;
s < shower.vals().size(); ++
s) {
2628 int color = pshower->
ID();
2646 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
2648 if (recoOpt->fDrawTrackSpacePoints) {
2652 const art::Event*
evt = evdb::EventHolder::Instance()->GetEvent();
2655 auto handles = evt->getMany<std::vector<recob::Track>>();
2657 for (
auto ih : handles) {
2658 const art::Handle<std::vector<recob::Track>> handle = ih;
2660 if (handle.isValid()) {
2661 const std::string& which = handle.provenance()->moduleLabel();
2662 art::FindManyP<recob::SpacePoint> fmsp(handle, *evt, which);
2664 if (fmsp.isValid() && fmsp.size() > 0) {
2665 int n = handle->size();
2666 float spSize = 0.5 *
size;
2668 for (
int i = 0; i <
n; ++i) {
2669 art::Ptr<recob::Track>
p(handle, i);
2670 if (&*p == &track) {
2671 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
2680 if (recoOpt->fDrawTrackTrajectoryPoints) {
2684 int lineSize =
size;
2686 if (lineSize < 1) lineSize = 1;
2690 TPolyMarker3D& pmStart = view->AddPolyMarker3D(1, 0, marker, 2. * size);
2693 pmStart.SetPoint(0, firstPos.X(), firstPos.Y(), firstPos.Z());
2696 TPolyMarker3D& pm = view->AddPolyMarker3D(track.
CountValidPoints(), color, 1, 3);
2698 for (
int p = 0;
p < np; ++
p) {
2702 pm.SetPoint(
p, pos.X(), pos.Y(), pos.Z());
2706 TPolyLine3D& pl = view->AddPolyLine3D(track.
CountValidPoints(), color, lineSize, 7);
2708 for (
int p = 0;
p < np; ++
p) {
2713 pl.SetPoint(
p, pos.X(), pos.Y(), pos.Z());
2716 if (recoOpt->fDrawTrackTrajectoryPoints > 4) {
2722 for (
int p = 1;
p < np; ++
p) {
2725 TPolyLine3D& pl = view->AddPolyLine3D(2, (color + 1) %
evd::kNCOLS, size, 7);
2728 auto deltaPos = nextPos - startPos;
2729 double arcLen = deltaPos.Dot(
2732 if (arcLen < 0.) arcLen = 3.;
2734 auto endPoint = startPos + arcLen * startDir;
2736 pl.SetPoint(0, startPos.X(), startPos.Y(), startPos.Z());
2737 pl.SetPoint(1, endPoint.X(), endPoint.Y(), endPoint.Z());
2757 const art::Event*
evt = evdb::EventHolder::Instance()->GetEvent();
2760 auto handles = evt->getMany<std::vector<recob::Shower>>();
2762 bool noSpts =
false;
2764 for (
auto ih : handles) {
2765 const art::Handle<std::vector<recob::Shower>> handle = ih;
2767 if (handle.isValid()) {
2769 const std::string& which = handle.provenance()->moduleLabel();
2770 art::FindManyP<recob::SpacePoint> fmsp(handle, *evt, which);
2772 int n = handle->size();
2773 for (
int i = 0; i <
n; ++i) {
2774 art::Ptr<recob::Shower>
p(handle, i);
2775 if (&*p == &shower) {
2777 std::vector<art::Ptr<recob::SpacePoint>> spts;
2792 std::cout <<
"No space points associated with the shower. Drawing a cone instead\n";
2794 auto& dedx = shower.
dEdx();
2795 if (!dedx.empty()) {
2797 for (
auto& dedxInPln : dedx)
2798 dedxAve += dedxInPln;
2799 dedxAve /= (double)dedx.size();
2803 if (dedxAve > 3 && dedxAve < 5) color = kGreen;
2809 TPolyLine3D& pl = view->AddPolyLine3D(coneRim.size(), color, 2, 0);
2810 for (
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
2811 auto& pt = coneRim[ipt];
2812 pl.SetPoint(ipt, pt[0], pt[1], pt[2]);
2815 for (
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
2816 TPolyLine3D& panel = view->AddPolyLine3D(2, color, 2, 0);
2817 panel.SetPoint(0, startPos.X(), startPos.Y(), startPos.Z());
2818 panel.SetPoint(1, coneRim[ipt][0], coneRim[ipt][1], coneRim[ipt][2]);
2827 std::vector<std::array<double, 3>>
2834 r.RotateX(axisDir.X());
2835 r.RotateY(axisDir.Y());
2836 r.RotateZ(axisDir.Z());
2837 constexpr
unsigned short nRimPts = 16;
2838 std::vector<std::array<double, 3>> rimPts(nRimPts + 1);
2839 for (
unsigned short iang = 0; iang < nRimPts; ++iang) {
2840 double rimAngle = iang * 2 * M_PI / (float)nRimPts;
2841 TVector3 rim = {0, 0, 1};
2842 rim.SetX(radius * cos(rimAngle));
2843 rim.SetY(radius * sin(rimAngle));
2847 for (
unsigned short ixyz = 0; ixyz < 3; ++ixyz)
2848 rimPts[iang][ixyz] = rim[ixyz];
2851 rimPts[nRimPts] = rimPts[0];
2859 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
2860 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
2862 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
2864 if (recoOpt->fDrawVertices != 0) {
2866 for (
size_t imod = 0; imod < recoOpt->fVertexLabels.size(); ++imod) {
2867 art::InputTag
const which = recoOpt->fVertexLabels[imod];
2869 art::PtrVector<recob::Vertex>
vertex;
2872 art::FindManyP<recob::Track> fmt(vertex, evt, which);
2873 art::FindManyP<recob::Shower> fms(vertex, evt, which);
2875 for (
size_t v = 0; v < vertex.size(); ++v) {
2877 if (fmt.isValid()) {
2878 std::vector<art::Ptr<recob::Track>>
tracks = fmt.at(v);
2881 for (
size_t t = 0; t < tracks.size(); ++t)
2882 this->
DrawTrack3D(*(tracks[t]), view, vertex[v]->ID());
2885 if (fms.isValid()) {
2886 std::vector<art::Ptr<recob::Shower>> showers = fms.at(v);
2888 for (
size_t s = 0;
s < showers.size(); ++
s)
2892 double xyz[3] = {0.};
2893 vertex[v]->XYZ(xyz);
2896 pm.SetPoint(0, xyz[0], xyz[1], xyz[2]);
2909 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
2910 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
2912 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
2913 if (recoOpt->fDrawEvents != 0) {
2915 for (
size_t imod = 0; imod < recoOpt->fEventLabels.size(); ++imod) {
2916 art::InputTag
const which = recoOpt->fEventLabels[imod];
2918 art::PtrVector<recob::Event> event;
2921 if (event.size() < 1)
continue;
2923 art::FindManyP<recob::Vertex> fmvp(event, evt, which);
2924 art::FindMany<recob::Vertex> fmv(event, evt, which);
2926 for (
size_t e = 0;
e <
event.size(); ++
e) {
2929 std::vector<art::Ptr<recob::Vertex>>
vertex = fmvp.at(
e);
2931 if (vertex.size() < 1)
continue;
2933 art::FindManyP<recob::Track> fmt(vertex, evt, recoOpt->fVertexLabels[0]);
2934 art::FindManyP<recob::Shower> fms(vertex, evt, recoOpt->fVertexLabels[0]);
2936 for (
size_t v = 0; v < vertex.size(); ++v) {
2940 std::vector<art::Ptr<recob::Track>>
tracks = fmt.at(v);
2941 std::vector<art::Ptr<recob::Shower>> showers = fms.at(v);
2944 for (
size_t t = 0; t < tracks.size(); ++t)
2947 for (
size_t s = 0;
s < showers.size(); ++
s)
2952 double xyz[3] = {0.};
2953 std::vector<const recob::Vertex*> vts = fmv.at(
e);
2955 event[
e]->PrimaryVertex(vts)->XYZ(xyz);
2958 pm.SetPoint(0, xyz[0], xyz[1], xyz[2]);
2970 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
2971 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
2973 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
2974 if (recoOpt->fDrawSlices < 1)
return;
2975 if (recoOpt->fDrawSliceSpacePoints < 1)
return;
2976 for (
size_t imod = 0; imod < recoOpt->fSliceLabels.size(); ++imod) {
2977 art::InputTag
const which = recoOpt->fSliceLabels[imod];
2978 art::PtrVector<recob::Slice>
slices;
2980 if (slices.size() < 1)
continue;
2981 art::FindManyP<recob::SpacePoint> fmsp(slices, evt, which);
2982 for (
size_t isl = 0; isl < slices.size(); ++isl) {
2983 int slcID =
std::abs(slices[isl]->ID());
2985 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(isl);
2998 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
2999 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
3000 art::ServiceHandle<geo::Geometry const> geo;
3002 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
3003 if (recoOpt->fDrawOpFlashes == 0)
return;
3009 for (
size_t i = 0; i < geo->NTPC(); ++i) {
3010 double local[3] = {0., 0., 0.};
3011 double world[3] = {0., 0., 0.};
3014 if (minx > world[0] - geo->DetHalfWidth(i)) minx = world[0] - geo->DetHalfWidth(i);
3015 if (maxx < world[0] + geo->DetHalfWidth(i)) maxx = world[0] + geo->DetHalfWidth(i);
3018 for (
size_t imod = 0; imod < recoOpt->fOpFlashLabels.size(); ++imod) {
3019 const art::InputTag which = recoOpt->fOpFlashLabels[imod];
3021 art::PtrVector<recob::OpFlash> opflashes;
3024 if (opflashes.size() < 1)
continue;
3026 int NFlashes = opflashes.size();
3029 for (
int iof = 0; iof < NFlashes; ++iof) {
3031 if (opflashes[iof]->TotalPE() < recoOpt->fFlashMinPE)
continue;
3032 if (opflashes[iof]->Time() < recoOpt->fFlashTMin)
continue;
3033 if (opflashes[iof]->Time() > recoOpt->fFlashTMax)
continue;
3035 double YCentre = opflashes[iof]->YCenter();
3036 double YHalfWidth = opflashes[iof]->YWidth();
3037 double ZCentre = opflashes[iof]->ZCenter();
3038 double ZHalfWidth = opflashes[iof]->ZWidth();
3043 TBox& b1 = view->AddBox(YCentre - YHalfWidth, minx, YCentre + YHalfWidth, maxx);
3044 b1.SetFillStyle(3004 + (iof % 3));
3045 b1.SetFillColor(Colour);
3051 TLine& line = view->AddLine(ZCentre - ZHalfWidth, xflash, ZCentre + ZHalfWidth, xflash);
3052 line.SetLineWidth(2);
3053 line.SetLineStyle(2);
3054 line.SetLineColor(Colour);
3057 TBox& b1 = view->AddBox(
3058 ZCentre - ZHalfWidth, YCentre - YHalfWidth, ZCentre + ZHalfWidth, YCentre + YHalfWidth);
3059 b1.SetFillStyle(3004 + (iof % 3));
3060 b1.SetFillColor(Colour);
3061 view->AddMarker(ZCentre, YCentre, Colour, 4, 1.5);
3074 for (
size_t v = 0; v < vertex.size(); ++v) {
3076 double xyz[3] = {0.};
3077 vertex[v]->XYZ(xyz);
3082 TMarker& strt = view->AddMarker(xyz[1], xyz[0], color, marker, 1.0);
3083 strt.SetMarkerColor(color);
3086 TMarker& strt = view->AddMarker(xyz[2], xyz[0], color, marker, 1.0);
3087 strt.SetMarkerColor(color);
3090 TMarker& strt = view->AddMarker(xyz[2], xyz[1], color, marker, 1.0);
3091 strt.SetMarkerColor(color);
3098 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
3099 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
3100 art::ServiceHandle<geo::Geometry const> geo;
3102 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
3103 if (recoOpt->fDrawVertices == 0)
return;
3105 for (
size_t imod = 0; imod < recoOpt->fVertexLabels.size(); ++imod) {
3106 art::InputTag
const which = recoOpt->fVertexLabels[imod];
3108 art::PtrVector<recob::Vertex>
vertex;
3128 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
3129 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
3131 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
3133 std::vector<art::InputTag>
labels;
3134 if (recoOpt->fDrawSpacePoints != 0) {
3135 for (
size_t imod = 0; imod < recoOpt->fSpacePointLabels.size(); ++imod)
3136 labels.push_back(recoOpt->fSpacePointLabels[imod]);
3139 for (
size_t imod = 0; imod < labels.size(); ++imod) {
3140 art::InputTag
const which = labels[imod];
3142 std::vector<art::Ptr<recob::SpacePoint>> spts;
3159 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
3160 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
3162 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
3163 if (recoOpt->fDrawPFParticles < 1)
return;
3166 for (
size_t imod = 0; imod < recoOpt->fPFParticleLabels.size(); ++imod) {
3167 art::InputTag
const which = recoOpt->fPFParticleLabels[imod];
3170 art::PtrVector<recob::PFParticle> pfParticleVec;
3174 if (pfParticleVec.size() < 1)
continue;
3177 art::FindMany<recob::SpacePoint> spacePointAssnVec(pfParticleVec, evt, which);
3180 if (!spacePointAssnVec.isValid())
continue;
3183 art::FindMany<recob::PCAxis> pcAxisAssnVec(pfParticleVec, evt, which);
3185 if (!pcAxisAssnVec.isValid())
continue;
3188 for (
size_t idx = 0; idx < pfParticleVec.size(); idx++) {
3190 const art::Ptr<recob::PFParticle> pfParticle(pfParticleVec.at(idx));
3194 if (!pfParticle->IsPrimary())
continue;
3198 pfParticle, pfParticleVec, spacePointAssnVec, pcAxisAssnVec, 0, proj, view);
3207 const art::PtrVector<recob::PFParticle>& pfParticleVec,
3208 const art::FindMany<recob::SpacePoint>& spacePointAssnVec,
3209 const art::FindMany<recob::PCAxis>& pcAxisAssnVec,
3214 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
3217 const std::vector<const recob::SpacePoint*>& hitsVec(spacePointAssnVec.at(pfPart->Self()));
3224 if (!hitsVec.empty()) {
3225 std::vector<const recob::SpacePoint*> hitPosVec;
3226 std::vector<const recob::SpacePoint*> skeletonPosVec;
3227 std::vector<const recob::SpacePoint*> skelEdgePosVec;
3228 std::vector<const recob::SpacePoint*> edgePosVec;
3229 std::vector<const recob::SpacePoint*> seedPosVec;
3230 std::vector<const recob::SpacePoint*> pairPosVec;
3232 for (
const auto& spacePoint : hitsVec) {
3233 if (spacePoint->Chisq() > 0.)
3234 hitPosVec.push_back(spacePoint);
3235 else if (spacePoint->Chisq() == -1.)
3236 skeletonPosVec.push_back(spacePoint);
3237 else if (spacePoint->Chisq() == -3.)
3238 skelEdgePosVec.push_back(spacePoint);
3239 else if (spacePoint->Chisq() == -4.)
3240 seedPosVec.push_back(spacePoint);
3241 else if (spacePoint->Chisq() > -10.)
3242 edgePosVec.push_back(spacePoint);
3244 pairPosVec.push_back(spacePoint);
3249 if (!recoOpt->fSkeletonOnly) {
3250 TPolyMarker& pm1 = view->AddPolyMarker(hitPosVec.size(), colorIdx, kFullDotMedium, 1);
3251 for (
const auto* spacePoint : hitPosVec) {
3252 const double* pos = spacePoint->XYZ();
3255 pm1.SetPoint(hitIdx++, pos[0], pos[1]);
3257 pm1.SetPoint(hitIdx++, pos[2], pos[0]);
3259 pm1.SetPoint(hitIdx++, pos[2], pos[1]);
3264 TPolyMarker& pm2 = view->AddPolyMarker(edgePosVec.size(), 28, kFullDotMedium, 1);
3265 for (
const auto* spacePoint : edgePosVec) {
3266 const double* pos = spacePoint->XYZ();
3269 pm2.SetPoint(hitIdx++, pos[0], pos[1]);
3271 pm2.SetPoint(hitIdx++, pos[2], pos[0]);
3273 pm2.SetPoint(hitIdx++, pos[2], pos[1]);
3278 TPolyMarker& pm3 = view->AddPolyMarker(pairPosVec.size(), 2, kFullDotMedium, 1);
3279 for (
const auto* spacePoint : pairPosVec) {
3280 const double* pos = spacePoint->XYZ();
3283 pm3.SetPoint(hitIdx++, pos[0], pos[1]);
3285 pm3.SetPoint(hitIdx++, pos[2], pos[0]);
3287 pm3.SetPoint(hitIdx++, pos[2], pos[1]);
3293 TPolyMarker& pm4 = view->AddPolyMarker(skeletonPosVec.size(), 1, kFullDotMedium, 1);
3294 for (
const auto* spacePoint : skeletonPosVec) {
3295 const double* pos = spacePoint->XYZ();
3298 pm4.SetPoint(hitIdx++, pos[0], pos[1]);
3300 pm4.SetPoint(hitIdx++, pos[2], pos[0]);
3302 pm4.SetPoint(hitIdx++, pos[2], pos[1]);
3307 TPolyMarker& pm5 = view->AddPolyMarker(skelEdgePosVec.size(), 3, kFullDotMedium, 1);
3308 for (
const auto* spacePoint : skelEdgePosVec) {
3309 const double* pos = spacePoint->XYZ();
3312 pm5.SetPoint(hitIdx++, pos[0], pos[1]);
3314 pm5.SetPoint(hitIdx++, pos[2], pos[0]);
3316 pm5.SetPoint(hitIdx++, pos[2], pos[1]);
3321 TPolyMarker& pm6 = view->AddPolyMarker(seedPosVec.size(), 6, kFullDotMedium, 1);
3322 for (
const auto* spacePoint : seedPosVec) {
3323 const double* pos = spacePoint->XYZ();
3326 pm6.SetPoint(hitIdx++, pos[0], pos[1]);
3328 pm6.SetPoint(hitIdx++, pos[2], pos[0]);
3330 pm6.SetPoint(hitIdx++, pos[2], pos[1]);
3335 if (pcAxisAssnVec.isValid()) {
3336 std::vector<const recob::PCAxis*> pcaVec(pcAxisAssnVec.at(pfPart->Self()));
3338 if (!pcaVec.empty()) {
3341 int lineWidth[2] = {3, 1};
3342 int lineStyle[2] = {1, 13};
3343 int lineColor[2] = {colorIdx, 18};
3344 int markStyle[2] = {4, 4};
3349 if (pcaVec.size() > 1 && pcaVec.front()->getID() > pcaVec.back()->getID())
3350 std::reverse(pcaVec.begin(), pcaVec.end());
3352 for (
const auto& pca : pcaVec) {
3354 const double* avePosition = pca->getAvePosition();
3358 TPolyMarker& pmrk = view->AddPolyMarker(7, lineColor[pcaIdx], markStyle[pcaIdx], 1);
3361 pmrk.SetPoint(pmrkIdx++, avePosition[0], avePosition[1]);
3363 pmrk.SetPoint(pmrkIdx++, avePosition[2], avePosition[0]);
3365 pmrk.SetPoint(pmrkIdx++, avePosition[2], avePosition[1]);
3368 for (
int dimIdx = 0; dimIdx < 3; dimIdx++) {
3371 view->AddPolyLine(numPoints, lineColor[pcaIdx], lineWidth[pcaIdx], lineStyle[pcaIdx]);
3374 double eigenValue = pca->getEigenValues()[dimIdx];
3377 if (eigenValue > 0) {
3379 eigenValue = 3. * sqrt(eigenValue);
3382 const std::vector<double>& eigenVector = pca->getEigenVectors()[dimIdx];
3385 double xl = avePosition[0] - 0.5 * eigenValue * eigenVector[0];
3386 double yl = avePosition[1] - 0.5 * eigenValue * eigenVector[1];
3387 double zl = avePosition[2] - 0.5 * eigenValue * eigenVector[2];
3390 pl.SetPoint(0, xl, yl);
3391 pmrk.SetPoint(pmrkIdx++, xl, yl);
3394 pl.SetPoint(0, zl, xl);
3395 pmrk.SetPoint(pmrkIdx++, zl, xl);
3398 pl.SetPoint(0, zl, yl);
3399 pmrk.SetPoint(pmrkIdx++, zl, yl);
3403 double xu = avePosition[0] + 0.5 * eigenValue * eigenVector[0];
3404 double yu = avePosition[1] + 0.5 * eigenValue * eigenVector[1];
3405 double zu = avePosition[2] + 0.5 * eigenValue * eigenVector[2];
3408 pl.SetPoint(1, xu, yu);
3409 pmrk.SetPoint(pmrkIdx++, xu, yu);
3412 pl.SetPoint(1, zu, xu);
3413 pmrk.SetPoint(pmrkIdx++, zu, xu);
3416 pl.SetPoint(1, zu, yu);
3417 pmrk.SetPoint(pmrkIdx++, zu, yu);
3423 if (recoOpt->fBestPCAAxisOnly)
break;
3431 if (pfPart->NumDaughters() > 0) {
3434 for (
const auto& daughterIdx : pfPart->Daughters()) {
3455 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
3456 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
3458 if (rawOpt->fDrawRawDataOrCalibWires < 1)
return;
3466 if (recoOpt->fDrawTracks != 0) {
3467 for (
size_t imod = 0; imod < recoOpt->fTrackLabels.size(); ++imod) {
3468 art::InputTag which = recoOpt->fTrackLabels[imod];
3469 art::View<recob::Track>
track;
3472 for (
size_t t = 0; t < track.vals().size(); ++t) {
3474 int color = ptrack->
ID() & 65535;
3485 if (recoOpt->fDrawShowers != 0) {
3486 for (
size_t imod = 0; imod < recoOpt->fShowerLabels.size(); ++imod) {
3487 art::InputTag which = recoOpt->fShowerLabels[imod];
3488 art::View<recob::Shower>
shower;
3491 for (
size_t s = 0;
s < shower.vals().size(); ++
s) {
3493 int color = pshower->
ID();
3513 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
3521 std::map<int, std::vector<art::Ptr<recob::SpacePoint>>> spmap;
3523 for (
auto& pspt : spts) {
3534 if (recoOpt->fColorSpacePointsByChisq) {
3535 spcolor = 100 - 2.5 * pspt->Chisq();
3536 if (spcolor < 51) spcolor = 51;
3537 if (spcolor > 100) spcolor = 100;
3539 spmap[spcolor].push_back(pspt);
3546 for (
auto icolor : spmap) {
3547 int spcolor = icolor.first;
3548 std::vector<art::Ptr<recob::SpacePoint>>& psps = icolor.second;
3552 TPolyMarker& pm = view->AddPolyMarker(psps.size(), spcolor, kFullCircle, msize);
3553 for (
size_t s = 0;
s < psps.size(); ++
s) {
3555 const double* xyz = spt.
XYZ();
3557 case evd::kXY: pm.SetPoint(
s, xyz[0], xyz[1]);
break;
3558 case evd::kXZ: pm.SetPoint(
s, xyz[2], xyz[0]);
break;
3559 case evd::kYZ: pm.SetPoint(
s, xyz[2], xyz[1]);
break;
3561 throw cet::exception(
"RecoBaseDrawer")
3562 << __func__ <<
": unknown projection #" << ((int)proj) <<
"\n";
3580 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
3582 if (recoOpt->fDrawTrackSpacePoints) {
3588 const art::Event*
evt = evdb::EventHolder::Instance()->GetEvent();
3591 auto handles = evt->getMany<std::vector<recob::Track>>();
3592 for (
auto ih : handles) {
3593 const art::Handle<std::vector<recob::Track>> handle = ih;
3594 if (handle.isValid()) {
3595 const std::string& which = handle.provenance()->moduleLabel();
3596 art::FindManyP<recob::SpacePoint> fmsp(handle, *evt, which);
3598 int n = handle->size();
3599 for (
int i = 0; i <
n; ++i) {
3600 art::Ptr<recob::Track>
p(handle, i);
3601 if (&*p == &track) {
3602 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
3609 if (recoOpt->fDrawTrackTrajectoryPoints) {
3620 TPolyLine& pl = view->AddPolyLine(vp,
evd::kColor[color % evd::kNCOLS], 2, 0);
3621 for (
int p = 0;
p < np; ++
p) {
3626 pm.SetPoint(
p, pos.X(), pos.Y());
3627 pl.SetPoint(
p, pos.X(), pos.Y());
3630 pm.SetPoint(
p, pos.Z(), pos.X());
3631 pl.SetPoint(
p, pos.Z(), pos.X());
3634 pm.SetPoint(
p, pos.Z(), pos.Y());
3635 pl.SetPoint(
p, pos.Z(), pos.Y());
3638 throw cet::exception(
"RecoBaseDrawer")
3639 << __func__ <<
": unknown projection #" << ((int)proj) <<
"\n";
3643 if (recoOpt->fDrawTracks > 1) {
3648 char const* txt = s.c_str();
3649 double x = track.
End().X();
3650 double y = track.
End().Y();
3651 double z = track.
End().Z();
3653 TText& trkID = view->AddText(x, y, txt);
3654 trkID.SetTextColor(
evd::kColor[tid % evd::kNCOLS]);
3655 trkID.SetTextSize(0.03);
3658 TText& trkID = view->AddText(z, x, txt);
3659 trkID.SetTextColor(
evd::kColor[tid % evd::kNCOLS]);
3660 trkID.SetTextSize(0.03);
3663 TText& trkID = view->AddText(z, y, txt);
3664 trkID.SetTextColor(
evd::kColor[tid % evd::kNCOLS]);
3665 trkID.SetTextSize(0.03);
3685 const art::Event*
evt = evdb::EventHolder::Instance()->GetEvent();
3688 auto handles = evt->getMany<std::vector<recob::Shower>>();
3689 for (
auto ih : handles) {
3690 const art::Handle<std::vector<recob::Shower>> handle = ih;
3691 if (handle.isValid()) {
3692 const std::string& which = handle.provenance()->moduleLabel();
3693 art::FindManyP<recob::SpacePoint> fmsp(handle, *evt, which);
3694 if (!fmsp.isValid())
continue;
3695 int n = handle->size();
3696 for (
int i = 0; i <
n; ++i) {
3697 art::Ptr<recob::Shower>
p(handle, i);
3698 if (&*p == &shower) {
3701 view->AddMarker(p->ShowerStart().X(),
3702 p->ShowerStart().Y(),
3708 view->AddMarker(p->ShowerStart().Z(),
3709 p->ShowerStart().X(),
3715 view->AddMarker(p->ShowerStart().Z(),
3716 p->ShowerStart().Y(),
3722 throw cet::exception(
"RecoBaseDrawer")
3723 << __func__ <<
": unknown projection #" << ((int)proj) <<
"\n";
3726 if (fmsp.isValid()) {
3727 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
3741 const art::InputTag& which,
3742 art::PtrVector<recob::Wire>& wires)
3746 art::Handle<std::vector<recob::Wire>> wcol;
3747 art::PtrVector<recob::Wire> temp;
3750 evt.getByLabel(which, wcol);
3752 for (
unsigned int i = 0; i < wcol->size(); ++i) {
3753 art::Ptr<recob::Wire>
w(wcol, i);
3758 catch (cet::exception&
e) {
3759 writeErrMsg(
"GetWires", e);
3762 return wires.size();
3768 const art::InputTag& which,
3769 std::vector<const recob::Hit*>& hits,
3772 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
3773 art::ServiceHandle<geo::Geometry const> geo;
3777 std::vector<const recob::Hit*> temp;
3780 evt.getView(which, temp);
3781 for (
const auto&
hit : temp) {
3785 const std::vector<geo::WireID>& wireIDs = geo->ChannelToWire(
hit->Channel());
3788 for (
const auto& wireID : wireIDs) {
3789 if (wireID.Plane == plane && wireID.TPC == rawOpt->fTPC &&
3790 wireID.Cryostat == rawOpt->fCryostat)
3791 hits.push_back(
hit);
3795 catch (cet::exception&
e) {
3796 writeErrMsg(
"GetHits", e);
3805 const art::InputTag& which,
3806 art::PtrVector<recob::Slice>&
slices)
3809 art::PtrVector<recob::Slice> temp;
3811 art::Handle<std::vector<recob::Slice>> slcCol;
3814 evt.getByLabel(which, slcCol);
3815 temp.reserve(slcCol->size());
3816 for (
unsigned int i = 0; i < slcCol->size(); ++i) {
3817 art::Ptr<recob::Slice> slc(slcCol, i);
3818 temp.push_back(slc);
3822 catch (cet::exception&
e) {
3823 writeErrMsg(
"GetSlices", e);
3826 return slices.size();
3832 const art::InputTag& which,
3833 art::PtrVector<recob::Cluster>& clust)
3836 art::PtrVector<recob::Cluster> temp;
3838 art::Handle<std::vector<recob::Cluster>> clcol;
3841 evt.getByLabel(which, clcol);
3842 temp.reserve(clcol->size());
3843 for (
unsigned int i = 0; i < clcol->size(); ++i) {
3844 art::Ptr<recob::Cluster> cl(clcol, i);
3849 catch (cet::exception&
e) {
3850 writeErrMsg(
"GetClusters", e);
3853 return clust.size();
3859 const art::InputTag& which,
3860 art::PtrVector<recob::PFParticle>& clust)
3863 art::PtrVector<recob::PFParticle> temp;
3865 art::Handle<std::vector<recob::PFParticle>> clcol;
3868 evt.getByLabel(which, clcol);
3869 for (
unsigned int i = 0; i < clcol->size(); ++i) {
3870 art::Ptr<recob::PFParticle> cl(clcol, i);
3875 catch (cet::exception&
e) {
3876 writeErrMsg(
"GetPFParticles", e);
3879 return clust.size();
3885 const art::InputTag& which,
3886 art::PtrVector<recob::EndPoint2D>& ep2d)
3889 art::PtrVector<recob::EndPoint2D> temp;
3891 art::Handle<std::vector<recob::EndPoint2D>> epcol;
3894 evt.getByLabel(which, epcol);
3895 for (
unsigned int i = 0; i < epcol->size(); ++i) {
3896 art::Ptr<recob::EndPoint2D> ep(epcol, i);
3901 catch (cet::exception&
e) {
3902 writeErrMsg(
"GetEndPoint2D", e);
3912 const art::InputTag& which,
3913 art::PtrVector<recob::OpFlash>& opflashes)
3916 art::PtrVector<recob::OpFlash> temp;
3918 art::Handle<std::vector<recob::OpFlash>> opflashcol;
3921 evt.getByLabel(which, opflashcol);
3922 for (
unsigned int i = 0; i < opflashcol->size(); ++i) {
3923 art::Ptr<recob::OpFlash> opf(opflashcol, i);
3924 temp.push_back(opf);
3926 temp.swap(opflashes);
3928 catch (cet::exception&
e) {
3929 writeErrMsg(
"GetOpFlashes", e);
3932 return opflashes.size();
3939 const art::InputTag& which,
3940 art::PtrVector<recob::Seed>&
seeds)
3943 art::PtrVector<recob::Seed> temp;
3945 art::Handle<std::vector<recob::Seed>> seedcol;
3948 evt.getByLabel(which, seedcol);
3949 for (
unsigned int i = 0; i < seedcol->size(); ++i) {
3950 art::Ptr<recob::Seed> sd(seedcol, i);
3955 catch (cet::exception&
e) {
3956 writeErrMsg(
"GetSeeds", e);
3959 return seeds.size();
3965 const art::InputTag& which,
3969 art::Handle<std::vector<recob::SpacePoint>> spcol;
3970 if (evt.getByLabel(which, spcol)) art::fill_ptr_vector(spts, spcol);
3978 const art::InputTag& which,
3983 art::Handle<std::vector<recob::Edge>> edgeCol;
3985 evt.getByLabel(which, edgeCol);
3987 for (
unsigned int i = 0; i < edgeCol->size(); ++i)
3988 edges.emplace_back(edgeCol, i);
3990 return edges.size();
3996 const art::InputTag& which,
3997 art::View<recob::Track>&
track)
4000 evt.getView(which, track);
4002 catch (cet::exception&
e) {
4003 writeErrMsg(
"GetTracks", e);
4006 return track.vals().size();
4012 const art::InputTag& which,
4013 art::View<recob::Shower>&
shower)
4016 evt.getView(which, shower);
4018 catch (cet::exception&
e) {
4019 writeErrMsg(
"GetShowers", e);
4022 return shower.vals().size();
4028 const art::InputTag& which,
4029 art::PtrVector<recob::Vertex>&
vertex)
4032 art::PtrVector<recob::Vertex> temp;
4034 art::Handle<std::vector<recob::Vertex>> vcol;
4037 evt.getByLabel(which, vcol);
4038 for (
size_t i = 0; i < vcol->size(); ++i) {
4039 art::Ptr<recob::Vertex> v(vcol, i);
4044 catch (cet::exception&
e) {
4045 writeErrMsg(
"GetVertices", e);
4048 return vertex.size();
4054 const art::InputTag& which,
4055 art::PtrVector<recob::Event>& event)
4058 art::PtrVector<recob::Event> temp;
4060 art::Handle<std::vector<recob::Event>> ecol;
4063 evt.getByLabel(which, ecol);
4064 for (
size_t i = 0; i < ecol->size(); ++i) {
4065 art::Ptr<recob::Event>
e(ecol, i);
4070 catch (cet::exception&
e) {
4071 writeErrMsg(
"GetEvents", e);
4074 return event.size();
4080 const art::InputTag& which,
4081 unsigned int cryostat,
4085 std::vector<const recob::Hit*> temp;
4086 int NumberOfHitsBeforeThisPlane = 0;
4090 for (
size_t t = 0; t < temp.size(); ++t) {
4091 if (temp[t]->
WireID().Cryostat == cryostat && temp[t]->WireID().TPC == tpc &&
4092 temp[t]->WireID().Plane == plane)
4094 NumberOfHitsBeforeThisPlane++;
4096 return NumberOfHitsBeforeThisPlane;
4106 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
4107 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
4108 art::ServiceHandle<geo::Geometry const> geo;
4110 float minSig(std::numeric_limits<float>::max());
4111 float maxSig(std::numeric_limits<float>::lowest());
4112 bool setLimits(
false);
4115 if (rawOpt->fDrawRawDataOrCalibWires == 0)
return;
4117 for (
size_t imod = 0; imod < recoOpt->fWireLabels.size(); ++imod) {
4118 art::InputTag
const which = recoOpt->fWireLabels[imod];
4120 art::PtrVector<recob::Wire> wires;
4123 for (
size_t i = 0; i < wires.size(); ++i) {
4125 std::vector<geo::WireID> wireids = geo->ChannelToWire(wires[i]->Channel());
4127 bool goodWID =
false;
4128 for (
auto const& wid : wireids) {
4130 if (wid.Plane == plane && wid.Wire == wire && wid.TPC == rawOpt->fTPC &&
4131 wid.Cryostat == rawOpt->fCryostat)
4134 if (!goodWID)
continue;
4136 std::vector<float> wirSig = wires[i]->Signal();
4137 for (
unsigned int ii = 0; ii < wirSig.size(); ++ii) {
4140 minSig = std::min(minSig, wirSig[ii]);
4141 maxSig = std::max(maxSig, wirSig[ii]);
4149 histo->SetMaximum(1.2 * maxSig);
4150 histo->SetMinimum(1.2 * minSig);
4160 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
4161 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
4162 art::ServiceHandle<geo::Geometry const> geo;
4165 if (rawOpt->fDrawRawDataOrCalibWires == 0)
return;
4167 for (
size_t imod = 0; imod < recoOpt->fWireLabels.size(); ++imod) {
4168 art::InputTag
const which = recoOpt->fWireLabels[imod];
4170 art::PtrVector<recob::Wire> wires;
4173 for (
unsigned int i = 0; i < wires.size(); ++i) {
4175 std::vector<geo::WireID> wireids = geo->ChannelToWire(wires[i]->Channel());
4177 bool goodWID =
false;
4178 for (
auto const& wid : wireids) {
4180 if (wid.Plane == plane && wid.TPC == rawOpt->fTPC && wid.Cryostat == rawOpt->fCryostat)
4183 if (!goodWID)
continue;
4184 std::vector<float> wirSig = wires[i]->Signal();
4185 for (
unsigned int ii = 0; ii < wirSig.size(); ++ii)
4186 histo->Fill(wirSig[ii]);
4204 std::vector<double>& htau1,
4205 std::vector<double>& htau2,
4206 std::vector<double>& hitamplitudes,
4207 std::vector<double>& hpeaktimes,
4208 std::vector<int>& hstartT,
4209 std::vector<int>& hendT,
4210 std::vector<int>& hNMultiHit,
4211 std::vector<int>& hLocalHitIndex)
4213 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
4214 art::ServiceHandle<evd::RecoDrawingOptions const> recoOpt;
4215 art::ServiceHandle<geo::Geometry const> geo;
4218 if (rawOpt->fDrawRawDataOrCalibWires == 0)
return;
4220 for (
size_t imod = 0; imod < recoOpt->fWireLabels.size(); ++imod) {
4221 art::InputTag
const which = recoOpt->fWireLabels[imod];
4223 art::PtrVector<recob::Wire> wires;
4226 for (
size_t i = 0; i < wires.size(); ++i) {
4228 std::vector<geo::WireID> wireids = geo->ChannelToWire(wires[i]->Channel());
4230 bool goodWID =
false;
4231 for (
auto const& wid : wireids) {
4232 if (wid.Plane == plane && wid.Wire == wire && wid.TPC == rawOpt->fTPC &&
4233 wid.Cryostat == rawOpt->fCryostat)
4237 if (!goodWID)
continue;
4239 std::vector<float> wirSig = wires[i]->Signal();
4240 for (
unsigned int ii = 0; ii < wirSig.size(); ++ii)
4241 histo->Fill(1. * ii, wirSig[ii]);
4246 for (
size_t imod = 0; imod < recoOpt->fHitLabels.size(); ++imod) {
4247 art::InputTag
const which = recoOpt->fHitLabels[imod];
4249 std::vector<const recob::Hit*> hits;
4250 this->
GetHits(evt, which, hits, plane);
4253 const auto& fitParams = hitResults->vectors();
4255 int FitParamsOffset =
CountHits(evt, which, rawOpt->fCryostat, rawOpt->fTPC, plane);
4257 for (
size_t i = 0; i < hits.size(); ++i) {
4259 if (hits[i]->
WireID().Wire != wire)
continue;
4261 hpeaktimes.push_back(fitParams[FitParamsOffset + i][0]);
4262 htau1.push_back(fitParams[FitParamsOffset + i][1]);
4263 htau2.push_back(fitParams[FitParamsOffset + i][2]);
4264 hitamplitudes.push_back(fitParams[FitParamsOffset + i][3]);
4265 hstartT.push_back(hits[i]->
StartTick());
4266 hendT.push_back(hits[i]->EndTick());
4267 hNMultiHit.push_back(hits[i]->Multiplicity());
4268 hLocalHitIndex.push_back(hits[i]->LocalIndex());
ISpacePointDrawerPtr fSpacePointDrawer
void SpacePointOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
void DrawShowerOrtho(const recob::Shower &shower, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
void SpacePoint3D(const art::Event &evt, evdb::View3D *view)
process_name opflash particleana ie ie ie z
int GetTracks(const art::Event &evt, const art::InputTag &which, art::View< recob::Track > &track)
std::vector< double > fRawCharge
Sum of Raw Charge.
void FillTQHisto(const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo)
void PFParticleOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
An object to define a "edge" which is used to connect space points in a triangulation algorithm...
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)
BEGIN_PROLOG true icarus_rawdigitfilter FilterTools FilterPlane1 Plane
bool has_length() const
Returns whether the shower has a valid length.
ISpacePointDrawerPtr fAllSpacePointDrawer
ClusterModuleLabel join with tracks
Encapsulate the construction of a single cyostat.
process_name opflash particleana ie x
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
void Prong3D(const art::Event &evt, evdb::View3D *view)
float SpacePointChiSq(const std::vector< art::Ptr< recob::Hit >> &) 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.
int GetSpacePoints(const art::Event &evt, const art::InputTag &which, std::vector< art::Ptr< recob::SpacePoint >> &spts)
double GetXTicksOffset(int p, int t, int c) const
void SeedOrtho(const art::Event &evt, evd::OrthoProj_t proj, evdb::View2D *view)
const TVector3 & Direction() const
Declaration of signal hit object.
Point_t const & LocationAtPoint(size_t i) const
bool has_open_angle() const
Returns whether the shower has a valid opening angle.
const std::vector< double > & dEdx() const
The data type to uniquely identify a Plane.
Geometry information for a single TPC.
void Vertex3D(const art::Event &evt, evdb::View3D *view)
bool HasValidPoint(size_t i) const
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.
Vector_t VertexDirection() const
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)
std::size_t size(FixedBins< T, C > const &) noexcept
void DrawShower3D(const recob::Shower &shower, int color, evdb::View3D *view)
WireID_t Wire
Index of the wire within its plane.
process_name use argoneut_mc_hitfinder track
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)
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker see the discussion of warn common echo in *Note Linker such as a global int variable echo as opposed to a large global array echo echo I echo The symbol is an indirect reference to another symbol This echo is a GNU extension to the a out object file format which is echo rarely used echo echo N echo The symbol is a debugging symbol echo echo R echo The symbol is in a read only data section echo echo S echo The symbol is in an uninitialized data section for small echo objects echo echo T echo The symbol is in the the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo W echo The symbol is a weak symbol that has not been specifically echo tagged as a weak object symbol When a weak defined symbol echo is linked with a normal defined the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo echo The symbol is a stabs symbol in an a out object file In echo this the next values printed are the stabs other echo the stabs desc and the stab type Stabs symbols are echo used to hold debugging information For more echo see *Note or object file format specific echo echo For Mac OS X
int GetEvents(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Event > &event)
void Prong2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
Offers proxy::Tracks and proxy::Track class for recob::Track access.
std::vector< double > fConvertedCharge
Sum of Charge Converted using Birks' formula.
void Slice2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
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)
The color scales used by the event display.
unsigned int CountValidPoints() const
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
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)
Collection of exceptions for Geometry system.
void Seed2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
process_name opflash particleana ie ie y
int GetEndPoint2D(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::EndPoint2D > &ep2d)
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
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)
enum geo::_plane_sigtype SigType_t
void PFParticle3D(const art::Event &evt, evdb::View3D *view)
void Draw2DSlopeEndPoints(double xStart, double yStart, double xEnd, double yEnd, double slope, int color, evdb::View2D *view)
Point_t const & Vertex() const
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
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)
const Double32_t * XYZ() 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)
Class providing information about the quality of channels.
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
std::vector< int > fWireMin
lowest wire in interesting region for each plane
Declaration of cluster object.
Class to aid in the rendering of RecoBase objects.
static const int kColor[kNCOLS]
Provides recob::Track data product.
void GetChargeSum(int plane, double &charge, double &convcharge)
std::vector< TCSlice > slices
Encapsulate the geometry of a wire.
double ConvertTicksToX(double ticks, int p, int t, int c) const
std::vector< TrajPoint > seeds
void DrawTrack3D(const recob::Track &track, evdb::View3D *view, int color, int marker=1, float size=2.)
Place to keep constants for event display.
Encapsulate the construction of a single detector plane.
Represents the Event implemented as a self balancing binary search tree.
Contains all timing reference information for the detector.
std::string to_string(WindowPattern const &pattern)
then echo File list $list not found else cat $list while read file do echo $file sed s
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 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)
void Wire2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
Interface for experiment-specific channel quality info provider.
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.
const TVector3 & ShowerStart() const
Point_t const & End() const
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
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)
void OpFlashOrtho(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evd::OrthoProj_t proj, evdb::View2D *view)
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)
Interface for experiment-specific service for channel quality info.
void DrawTrackOrtho(const recob::Track &track, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
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.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
std::vector< int > fTimeMax
highest time in interesting region for each plane
void LocalToWorld(const double *tpc, double *world) const
Transform point from local TPC frame to world frame.
int GetVertices(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Vertex > &vertex)
physics associatedGroupsWithLeft p1
art framework interface to geometry description
BEGIN_PROLOG could also be cout
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)
int GetEdges(const art::Event &evt, const art::InputTag &which, std::vector< art::Ptr< recob::Edge >> &edges)
Encapsulate the construction of a single detector plane.
std::vector< int > fTimeMin
lowest time in interesting region for each plane