13 #include "TPolyLine.h" 14 #include "TPolyLine3D.h" 15 #include "TPolyMarker.h" 16 #include "TPolyMarker3D.h" 20 #include "TRotation.h" 47 #include "larevt/CalibrationDBI/Interface/ChannelStatusService.h" 48 #include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h" 58 #include "cetlib_except/exception.h" 71 void writeErrMsg(
const char* fcn,
75 <<
" failed with message:\n" 96 for(
size_t t = 0; t < geo->
NTPC(); ++t)
98 unsigned int nplanes = geo->
Nplanes(t);
105 for(
size_t p = 0; p < geo->
Nplanes(t); ++p){
132 lariov::ChannelStatusProvider
const& channelStatus
145 for(
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod) {
151 if(wires.
size() < 1)
return;
153 for(
size_t i = 0; i < wires.
size(); ++i) {
155 uint32_t channel = wires[i]->Channel();
157 if (!rawOpt->
fSeeBadChannels && channelStatus.IsBad(channel))
continue;
159 std::vector<geo::WireID> wireids = geo->
ChannelToWire(channel);
163 for (
auto const& wid : wireids){
164 if (wid.planeID() != pid)
continue;
166 double wire = 1.*wid.Wire;
169 std::vector<float> wirSig = wires[i]->Signal();
170 if(wirSig.size() == 0)
continue;
173 while( itr != wirSig.end() ){
177 while(ticksUsed < ticksPerPoint && itr != wirSig.end()){
179 adcsum += (1.*(*itr));
184 double adc = adcsum/ticksPerPoint;
185 double tdc = tdcsum/ticksPerPoint;
187 if(TMath::Abs(adc) < rawOpt->
fMinSignal)
continue;
188 if(tdc > rawOpt->
fTicks)
continue;
197 if (sf>1.0) sf = 1.0;
200 if(wire < minw) minw = wire;
201 if(wire > maxw) maxw = wire;
202 if(tdc < mint) mint = tdc;
203 if(tdc > maxt) maxt = tdc;
206 TBox& b1 = view->
AddBox(wire-sf*0.5,
207 tdc-sf*0.5*ticksPerPoint,
209 tdc+sf*0.5*ticksPerPoint);
210 b1.SetFillStyle(1001);
212 b1.SetBit(kCannotPick);
215 TBox& b1 = view->
AddBox(tdc-sf*0.5*ticksPerPoint,
217 tdc+sf*0.5*ticksPerPoint,
219 b1.SetFillStyle(1001);
221 b1.SetBit(kCannotPick);
234 double startTick(50.);
235 double endTick((rawOpt->
fTicks - 50.) * ticksPerPoint);
237 for(
size_t wireNo = 0; wireNo < geo->
Nwires(pid); wireNo++)
243 double wire = 1.*wireNo;
244 TLine& line = view->
AddLine(wire, startTick, wire, endTick);
245 line.SetLineColor(kGray);
246 line.SetLineWidth(1.0);
247 line.SetBit(kCannotPick);
274 if (recoOpt->
fDrawHits == 0)
return nHitsDrawn;
280 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
283 std::vector<const recob::Hit*>
hits;
284 this->
GetHits(evt, which, hits, plane);
287 for(
auto itr : hits){
289 if(itr->WireID().TPC != rawOpt->
fTPC ||
290 itr->WireID().Cryostat != rawOpt->
fCryostat)
continue;
294 fRawCharge[itr->WireID().Plane] += itr->PeakAmplitude();
299 nHitsDrawn = this->
Hit2D(hits, kBlack, view);
318 bool drawConnectingLines,
326 unsigned int wold = 0;
334 for(
unsigned int c = 0; c < hits.size(); ++c)
338 if(hits[c]->WireID().TPC != rawOpt->
fTPC ||
339 hits[c]->WireID().Cryostat != rawOpt->
fCryostat)
continue;
341 if (std::isnan(hits[c]->PeakTime()) || std::isnan(hits[c]->Integral()))
343 std::cout <<
"====>> Found hit with a NAN, channel: " << hits[c]->Channel() <<
", start/end: " << hits[c]->StartTick() <<
"/" << hits[c]->EndTick() <<
", chisquare: " << hits[c]->GoodnessOfFit() << std::endl;
346 if (hits[c]->PeakTime() > rawOpt->
fTicks)
continue;
348 w = hits[c]->WireID().Wire;
352 float time = hits[c]->PeakTime();
353 float rms = 0.5 * hits[c]->RMS();
356 TBox& b1 = view->
AddBox(w-0.5, time-rms, w+0.5, time+rms);
357 if(drawConnectingLines && c > 0) {
358 TLine& l = view->
AddLine(w, time, wold, timeold);
359 l.SetLineColor(color);
360 l.SetBit(kCannotPick);
363 b1.SetBit(kCannotPick);
364 b1.SetLineColor(color);
365 b1.SetLineWidth(lineWidth);
369 TBox& b1 = view->
AddBox(time-rms, w-0.5, time+rms, w+0.5);
370 if(drawConnectingLines && c > 0) {
371 TLine& l = view->
AddLine(time, w, timeold, wold);
372 l.SetLineColor(color);
373 l.SetBit(kCannotPick);
376 b1.SetBit(kCannotPick);
377 b1.SetLineColor(color);
378 b1.SetLineWidth(lineWidth);
398 unsigned int wold(0);
402 for(
unsigned int c = 0; c < hits.size(); ++c)
406 if(hits[c]->WireID().TPC != rawOpt->
fTPC ||
407 hits[c]->WireID().Cryostat != rawOpt->
fCryostat)
continue;
409 w = hits[c]->WireID().Wire;
413 float time = hits[c]->PeakTime();
419 TLine& l = view->
AddLine(w, time+100, wold, timeold+100);
422 if (cosmicscore>0.5) l.SetLineColor(kMagenta);
423 l.SetBit(kCannotPick);
430 TLine& l = view->
AddLine(time+20, w, timeold+20, wold);
432 if (cosmicscore>0.5) l.SetLineStyle(2);
433 l.SetBit(kCannotPick);
455 if((
unsigned int)plane >
fWireMin.size()){
458 <<
" is larger than those available ";
468 minw = (minw-30<0) ? 0 : minw-30;
469 mint = (mint-10<0) ? 0 : mint-10;
471 int fTicks = rawOpt->
fTicks;
473 maxw = (maxw+10 > (int)geo->
Nwires(plane)) ? geo->
Nwires(plane) : maxw+10;
474 maxt = (maxt+10 > fTicks) ? fTicks : maxt+10;
510 for (
size_t iep = 0; iep < ep2d.
size(); ++iep) {
512 if(ep2d[iep]->View() != gview)
continue;
521 double x = ep2d[iep]->WireID().Wire;
522 double y = ep2d[iep]->DriftTime();
525 x = ep2d[iep]->DriftTime();
526 y = ep2d[iep]->WireID().Wire;
529 TMarker& strt = view->
AddMarker(x, y, color, 30, 2.0);
530 strt.SetMarkerColor(color);
534 char const* txt = s.c_str();
535 TText& vtxID = view->
AddText(x, y+20, txt);
536 vtxID.SetTextColor(color);
537 vtxID.SetTextSize(0.05);
562 for(
size_t imod = 0; imod < recoOpt->
fOpFlashLabels.size(); ++imod) {
568 if(opflashes.
size() < 1)
continue;
570 int NFlashes = opflashes.
size();
573 LOG_VERBATIM(
"RecoBaseDrawer") <<
"Total "<<NFlashes<<
" flashes.";
576 for (
size_t iof = 0; iof < opflashes.
size(); ++iof) {
577 if (opflashes[iof]->TotalPE() < recoOpt->
fFlashMinPE)
continue;
578 if (opflashes[iof]->Time() < recoOpt->
fFlashTMin)
continue;
579 if (opflashes[iof]->Time() > recoOpt->
fFlashTMax)
continue;
582 << opflashes[iof]->Time()
584 << opflashes[iof]->YCenter()
586 << opflashes[iof]->ZCenter()
588 << opflashes[iof]->TotalPE();
592 float wire0 = FLT_MAX;
593 float wire1 = FLT_MIN;
595 std::vector<TVector3> points;
596 points.push_back(TVector3(0, opflashes[iof]->YCenter()-opflashes[iof]->YWidth(), opflashes[iof]->ZCenter()-opflashes[iof]->ZWidth()));
597 points.push_back(TVector3(0, opflashes[iof]->YCenter()-opflashes[iof]->YWidth(), opflashes[iof]->ZCenter()+opflashes[iof]->ZWidth()));
598 points.push_back(TVector3(0, opflashes[iof]->YCenter()+opflashes[iof]->YWidth(), opflashes[iof]->ZCenter()-opflashes[iof]->ZWidth()));
599 points.push_back(TVector3(0, opflashes[iof]->YCenter()+opflashes[iof]->YWidth(), opflashes[iof]->ZCenter()+opflashes[iof]->ZWidth()));
600 for (
size_t i = 0; i<points.size(); ++i){
608 if (wireID.
Wire < wire0) wire0 = wireID.
Wire;
609 if (wireID.
Wire > wire1) wire1 = wireID.
Wire;
612 TLine& line = view->
AddLine(flashtick, wire0, flashtick, wire1);
613 line.SetLineWidth(2);
614 line.SetLineStyle(2);
615 line.SetLineColor(Color);
618 TLine& line = view->
AddLine(wire0, flashtick, wire1, flashtick);
619 line.SetLineWidth(2);
620 line.SetLineStyle(2);
621 line.SetLineColor(Color);
643 for(
size_t imod = 0; imod < recoOpt->
fSeedLabels.size(); ++imod) {
649 if(seeds.
size() < 1)
continue;
652 for (
size_t isd = 0; isd < seeds.
size(); ++isd) {
655 double SeedPointErr[3];
656 double SeedDirErr[3];
660 seeds[isd]->GetPoint( SeedPoint, SeedPointErr);
661 seeds[isd]->GetDirection( SeedDir, SeedDirErr);
663 SeedEnd1[0] = SeedPoint[0] + SeedDir[0];
664 SeedEnd1[1] = SeedPoint[1] + SeedDir[1];
665 SeedEnd1[2] = SeedPoint[2] + SeedDir[2];
667 SeedEnd2[0] = SeedPoint[0] - SeedDir[0] ;
668 SeedEnd2[1] = SeedPoint[1] - SeedDir[1] ;
669 SeedEnd2[2] = SeedPoint[2] - SeedDir[2] ;
674 unsigned int wirepoint = 0;
675 unsigned int wireend1 = 0;
676 unsigned int wireend2 = 0;
681 wirepoint = atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
687 wireend1 = atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
693 wireend2 = atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
696 double x = wirepoint;
698 double x1 = wireend1;
700 double x2 = wireend2;
712 TMarker& strt = view->
AddMarker(x, y, color, 4, 1.5);
713 TLine& line = view->
AddLine(x1, y1, x2, y2);
714 strt.SetMarkerColor(color);
715 line.SetLineColor(color);
716 line.SetLineWidth(2.0);
745 for (
size_t ibtb = 0; ibtb < btrackbase.
size(); ++ibtb) {
749 std::vector<std::vector<double> > ProjPtUVWs(3);
750 std::vector<std::vector<double> > ProjTimes(3);
752 double projpt[3], ticks[3];
755 for(
int i = 0; i != N; ++i){
757 BTrack.GetProjectedPointUVWT(
float(i)/N,projpt,ticks,c,t );
758 for(
size_t n = 0;
n != 3; ++
n){
759 ProjPtUVWs[
n].push_back(projpt[
n]);
760 ProjTimes[
n].push_back(ticks[n]);
770 for(
size_t i = 0; i != ProjPtUVWs[plane].size(); ++i){
771 double x = ProjPtUVWs[plane][i];
772 double y = ProjTimes[plane][i];
774 y = ProjPtUVWs[plane][i];
775 x = ProjTimes[plane][i];
805 for (
size_t ibtb = 0; ibtb < btrackbase.
size(); ++ibtb) {
810 for(
int i = 0; i != N; ++i){
811 BTrack.GetTrackPoint(
float(i)/N,xyzpt );
816 pl.SetPoint(i,x,y,z);
822 for(
size_t ivtx = 0; ivtx < btrackvertices.
size(); ++ivtx){
824 btrackvertices.
at(ivtx)->XYZ(xyz);
825 pmrk.SetPoint(ivtx, xyz[0], xyz[1], xyz[2]);
843 static bool first =
true;
845 std::cout<<
"******** DrawSlices: 0 = none, 1 = color coded, 2 = color coded + ID at slice center\n";
846 std::cout<<
" 3 = open circle at slice center with size proportional to the AspectRatio. Closed circles";
847 std::cout<<
" at the slice ends with connecting dotted lines\n";
851 unsigned int t = rawOpt->
fTPC;
853 for(
size_t imod = 0; imod < recoOpt->
fSliceLabels.size(); ++imod) {
857 if(slices.
size() < 1)
continue;
859 for(
size_t isl = 0; isl < slices.
size(); ++isl) {
860 int slcID(std::abs(slices[isl]->ID()));
864 std::vector<const recob::Hit*>
hits = fmh.at(isl);
865 std::vector<const recob::Hit*> hits_on_plane;
866 for (
auto hit : hits){
867 if (
hit->WireID().Plane == plane){
868 hits_on_plane.push_back(
hit);
871 if (this->
Hit2D(hits_on_plane, color, view,
false) < 1)
continue;
873 double tick = detprop->
ConvertXToTicks(slices[isl]->Center().
X(), plane, t, c);
874 double wire = geo->
WireCoordinate(slices[isl]->Center().
Y(),slices[isl]->Center().
Z(),plane,t,c);
876 char const* txt = s.c_str();
877 TText& slcID = view->
AddText(wire, tick, txt);
878 slcID.SetTextSize(0.05);
879 slcID.SetTextColor(color);
883 double tick = detprop->
ConvertXToTicks(slices[isl]->Center().
X(), plane, t, c);
884 double wire = geo->
WireCoordinate(slices[isl]->Center().
Y(),slices[isl]->Center().
Z(),plane,t,c);
885 float markerSize = 1;
887 markerSize = 1 / slices[isl]->AspectRatio();
888 if(markerSize > 3) markerSize = 3;
890 TMarker& ctr = view->
AddMarker(wire, tick, color, 24, markerSize);
891 ctr.SetMarkerColor(color);
893 TPolyLine& pline = view->
AddPolyLine(2, color, 2, 3);
895 wire = geo->
WireCoordinate(slices[isl]->End0Pos().
Y(),slices[isl]->End0Pos().
Z(),plane,t,c);
896 TMarker& end0 = view->
AddMarker(wire, tick, color, 20, 1.0);
897 end0.SetMarkerColor(color);
898 pline.SetPoint(0, wire, tick);
900 wire = geo->
WireCoordinate(slices[isl]->End1Pos().
Y(),slices[isl]->End1Pos().
Z(),plane,t,c);
901 TMarker& end1 = view->
AddMarker(wire, tick, color, 20, 1.0);
902 end1.SetMarkerColor(color);
903 pline.SetPoint(1, wire, tick);
933 static bool first =
true;
935 std::cout<<
"******** DrawClusters: 0 = none, 1 = cluster hits, 2 = unique marker, 3 = cluster hits with connecting lines.\n";
936 std::cout<<
" 4 = with T<cluster or trajectory ID> P<PFParticle ID> color-matched. Unmatched cluster IDs shown in black.\n";
937 std::cout<<
" Color scheme: By cluster ID in each plane or by PFParticle ID (Self) if a PFParticle - Cluster association exists.\n";
941 for(
size_t imod = 0; imod < recoOpt->
fClusterLabels.size(); ++imod)
948 if(clust.
size() < 1)
continue;
954 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
958 if (spacePointVec.size() > 0)
963 if (spHitAssnVec.isValid())
966 std::vector<const recob::Hit*> freeHitVec;
969 for(
const auto& spacePointPtr : spacePointVec)
971 if (spacePointPtr->Chisq() < -99.)
974 const std::vector<art::Ptr<recob::Hit>>& hitVec = spHitAssnVec.at(spacePointPtr.key());
976 for(
const auto&
hit : hitVec)
978 if(
hit->WireID().Plane != plane)
continue;
980 freeHitVec.push_back(
hit.get());
986 this->
Hit2D(freeHitVec, kGray, view,
false);
994 for (
size_t ic = 0; ic < clust.
size(); ++ic)
998 if (clust[ic]->
Plane().
Plane != plane)
continue;
1001 int clusterIdx(std::abs(clust[ic]->ID()));
1003 bool pfpAssociation =
false;
1004 int pfpIndex = INT_MAX;
1005 float cosmicscore = FLT_MIN;
1009 std::vector<art::Ptr<recob::PFParticle>> pfplist = fmc.at(ic);
1011 if(!pfplist.empty())
1013 clusterIdx = pfplist[0]->Self();
1015 pfpAssociation =
true;
1016 pfpIndex = pfplist[0]->Self();
1023 std::vector<art::Ptr<anab::CosmicTag>> ctlist = fmct.at(0);
1024 if (!ctlist.empty())
1027 cosmicscore = ctlist[0]->CosmicScore();
1034 std::vector<const recob::Hit*>
hits = fmh.at(ic);
1044 if (this->
Hit2D(hits, color, view, drawConnectingLines) < 1)
continue;
1047 this->
Hit2D(hits, view, cosmicscore);
1057 if(pfpIndex != INT_MAX) s = s +
" P" +
std::to_string(pfpIndex + 1);
1058 char const* txt = s.c_str();
1059 double wire = 0.5 * (clust[ic]->StartWire() + clust[ic]->EndWire());
1060 double tick = 20 + 0.5 * (clust[ic]->StartTick() + clust[ic]->EndTick());
1061 TText& clID = view->
AddText(wire, tick, txt);
1062 clID.SetTextSize(0.05);
1063 if(pfpAssociation) {
1064 clID.SetTextColor(color);
1066 clID.SetTextColor(kBlack);
1073 std::vector<double> tpts, wpts;
1091 p1.SetFillStyle(3003);
1092 p1.SetFillColor(fcolor);
1093 for (
size_t i = 0; i < wpts.size(); ++i) {
1095 p1.SetPoint(i, wpts[i], tpts[i]);
1096 p2.SetPoint(i, wpts[i], tpts[i]);
1099 p1.SetPoint(i, tpts[i], wpts[i]);
1100 p2.SetPoint(i, tpts[i], wpts[i]);
1110 double wirePitch = geo->
WirePitch(gview);
1121 clust[ic]->StartWire(), clust[ic]->StartTick(),
1122 clust[ic]->EndWire(), clust[ic]->EndTick(),
1123 std::tan((clust[ic]->StartAngle() + clust[ic]->EndAngle())/2.)*wirePitch/driftvelocity/timetick,
1150 double slope1 = slope;
1157 if(std::abs(slope) > 0.) slope1 = 1./slope;
1161 double deltaX = 0.5 * (x2 -
x1);
1162 double xm = x1 + deltaX;
1163 double ym = y1 + deltaX * slope;
1165 TMarker& strt = view->
AddMarker(xm, ym, color, kFullCircle, 1.0);
1166 strt.SetMarkerColor(color);
1169 double stublen = 2.*deltaX;
1170 TLine& l = view->
AddLine(x1, y1, x1+stublen, y1 + slope1*stublen);
1171 l.SetLineColor(color);
1191 double slope1 = slope;
1197 if(std::abs(slope) > 0.) slope1 = 1./slope;
1201 TMarker& strt = view->
AddMarker(x1, y1, color, kFullStar, 2.0);
1202 strt.SetMarkerColor(color);
1205 double stublen = 300.0;
1206 TLine& l = view->
AddLine(x1, y1, x1+stublen, y1 + slope1*stublen);
1207 l.SetLineColor(color);
1229 double cosx1 = cosx;
1230 double cosy1 = cosy;
1240 TMarker& strt = view->
AddMarker(x1, y1, color, kFullStar, 2.0);
1241 strt.SetMarkerColor(color);
1244 double stublen = 300.0;
1245 TLine& l = view->
AddLine(x1, y1, x1+stublen*cosx1, y1 + stublen*cosy1);
1246 l.SetLineColor(color);
1263 std::vector<double>& wpts,
1264 std::vector<double>& tpts,
1270 std::map<unsigned int, double> wlo, whi;
1272 for(
size_t j = 0; j < hits.size(); ++j){
1274 if(hits[j]->WireID().Plane != plane ||
1275 hits[j]->WireID().TPC != rawOpt->
fTPC ||
1276 hits[j]->WireID().Cryostat != rawOpt->
fCryostat)
continue;
1278 wlo[hits[j]->WireID().Wire] = hits[j]->PeakTime();
1279 whi[hits[j]->WireID().Wire] = hits[j]->PeakTime();
1285 for (
size_t j = 0; j < hits.size(); ++j) {
1286 t = hits[j]->PeakTime();
1288 if (t < wlo[hits[j]->WireID().Wire]) wlo[hits[j]->WireID().Wire] = t;
1289 if (t > whi[hits[j]->WireID().Wire]) whi[hits[j]->WireID().Wire] = t;
1296 for (; itr != itrEnd; ++itr) {
1297 unsigned int w = itr->first;
1300 wpts.push_back(1.*w-0.1); tpts.push_back(t-0.1);
1301 wpts.push_back(1.*w+0.1); tpts.push_back(t-0.1);
1306 std::map<unsigned int, double>::reverse_iterator ritr (whi.rbegin());
1307 std::map<unsigned int, double>::reverse_iterator ritrEnd(whi.rend());
1308 for (; ritr != ritrEnd; ++ritr) {
1309 unsigned int w = ritr->first;
1312 wpts.push_back(1.*w+0.1); tpts.push_back(t+0.1);
1313 wpts.push_back(1.*w-0.1); tpts.push_back(t+0.1);
1317 wpts.push_back(wpts[0]); tpts.push_back(tpts[0]);
1326 TVector3
const& startPos,
1327 TVector3
const& startDir,
1337 unsigned int t = rawOpt->
fTPC;
1345 if(cscore<0.6) color = kMagenta;
1348 else if (cscore<-10000){
1354 this->
Hit2D(hits, color, view,
false, lineWidth);
1356 this->
Hit2D(hits, color, view,
false, lineWidth);
1359 double wire0 = geo->
WireCoordinate(startPos.Y(),startPos.Z(),plane,t,c);
1361 double tick1 = detprop->
ConvertXToTicks((startPos+startDir).
X(),plane,t,c);
1363 (startPos+startDir).
Z(),plane,t,c);
1367 double ds = sqrt(pow(tick0-tick1,2)+pow(wire0-wire1,2));
1370 cost = (tick1-tick0)/ds;
1371 cosw = (wire1-wire0)/ds;
1392 unsigned int t = rawOpt->
fTPC;
1395 this->
Hit2D(hits, color, view,
true, lineWidth);
1397 const auto& startPos = track->
Vertex();
1401 double local[3] = {0.};
1402 double world[3] = {0.};
1404 world[1] = startPos.Y();
1405 world[2] = startPos.Z();
1414 wire = 1.*atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
1419 double wirePitch = geo->
WirePitch(hits[0]->View());
1428 double rotang = 3.1416-thetawire;
1429 double yprime = std::cos(rotang)*startDir.Y()
1430 +std::sin(rotang)*startDir.Z();
1431 double dTdW = startDir.X()*wirePitch/driftvelocity/timetick/yprime;
1440 for(
size_t idx = 0; idx < nTrackHits; idx++)
1446 world[1] = hitPos.Y();
1447 world[2] = hitPos.Z();
1451 double wireHit = 0.;
1453 wireHit = 1.*geo->
NearestWire(world, plane, t, c);
1456 wireHit = 1.*atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
1459 pl.SetPoint(vidx++,wireHit,tickHit);
1474 auto const* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
1485 unsigned int tpc = rawOpt->
fTPC;
1490 for(
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod)
1497 if(track.
vals().size() < 1)
continue;
1504 auto tracksProxy = proxy::getCollection<proxy::Tracks>(
evt, which);
1508 for(
size_t t = 0; t < track.
vals().size(); ++t)
1511 if (track.
vals().at(t)->NumberTrajectoryPoints() == 0)
1513 std::cout <<
"***** Track with no trajectory points ********" << std::endl;
1520 double x = track.
vals().at(t)->End().X();
1521 double y = track.
vals().at(t)->End().Y();
1522 double z = track.
vals().at(t)->End().Z();
1523 double tick = 30 + detprop->ConvertXToTicks(x, plane, tpc, cstat);
1525 tid = track.
vals().at(t)->ID()&65535;
1527 char const* txt = s.c_str();
1528 TText& trkID = view->
AddText(wire, tick, txt);
1530 trkID.SetTextSize(0.1);
1534 if( cosmicTrackTags.isValid() ){
1535 if( cosmicTrackTags.at(t).size() > 0 ) {
1541 std::vector<const recob::Hit*>
hits;
1542 if (track.
vals().at(t)->NumberTrajectoryPoints() == fmh.at(t).size()) {
1543 auto tp = tracksProxy[t];
1544 for (
auto point: tp.points()) {
1545 if (!point.isPointValid())
continue;
1546 hits.push_back(point.hit());
1553 while(itr < hits.end()){
1554 if((*itr)->View() != gview) hits.erase(itr);
1565 if(Score<0.6) color = kMagenta;
1568 else if (Score<-10000){
1580 static bool first =
true;
1583 std::cout<<
"DrawShower options: \n";
1584 std::cout<<
" 1 = Hits in shower color-coded by the shower ID\n";
1585 std::cout<<
" 2 = Same as 1 + shower axis and circle representing the shower cone\n";
1586 std::cout<<
" Black cone = shower start dE/dx < 1 MeV/cm (< 1/2 MIP)\n";
1587 std::cout<<
" Blue cone = shower start dE/dx < 3 MeV/cm (~1 MIP)\n";
1588 std::cout<<
" Green cone = shower start 3 MeV/cm < dE/dx < 5 MeV/cm (~2 MIP)\n";
1589 std::cout<<
" Red cone = shower start 5 MeV/cm < dE/dx (>2 MIP)\n";
1592 for(
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod){
1597 if(shower.
vals().size() < 1)
continue;
1603 for(
size_t s = 0;
s < shower.
vals().size(); ++
s){
1605 std::vector<const recob::Hit*>
hits = fmh.at(
s);
1608 while(itr < hits.end()){
1609 if((*itr)->View() != gview) hits.erase(itr);
1615 if(!shower.
vals().at(
s)->has_length())
continue;
1616 if(!shower.
vals().at(
s)->has_open_angle())
continue;
1618 TVector3 startPos = shower.
vals().at(
s)->ShowerStart();
1619 TVector3
dir = shower.
vals().at(
s)->Direction();
1620 double length = shower.
vals().at(
s)->Length();
1621 double openAngle = shower.
vals().at(
s)->OpenAngle();
1624 TVector3 endPos = startPos + length *
dir;
1626 double swire = geo->
WireCoordinate(startPos.Y(),startPos.Z(), plane, tpc, cstat);
1627 double stick = detprop->ConvertXToTicks(startPos.X(), plane, tpc, cstat);
1628 double ewire = geo->
WireCoordinate(endPos.Y(),endPos.Z(), plane, tpc, cstat);
1629 double etick = detprop->ConvertXToTicks(endPos.X(), plane, tpc, cstat);
1630 TLine& coneLine = view->
AddLine(swire, stick, ewire, etick);
1632 std::vector<double> dedxVec = shower.
vals().at(
s)->dEdx();
1636 if(plane < dedxVec.size()) {
1637 if(dedxVec[plane] > 1 && dedxVec[plane] < 3) {
1640 }
else if(dedxVec[plane] < 5) {
1648 coneLine.SetLineColor(color);
1651 double radius = length * openAngle;
1652 auto coneRim =
Circle3D(endPos, dir, radius);
1655 for(
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
1656 double wire = geo->
WireCoordinate(coneRim[ipt][1], coneRim[ipt][2], plane, tpc, cstat);
1657 double tick = detprop->ConvertXToTicks(coneRim[ipt][0], plane, tpc, cstat);
1658 pline.SetPoint(ipt, wire, tick);
1663 shower.
vals().at(
s)->ShowerStart(),
1664 shower.
vals().at(
s)->Direction(),
1665 shower.
vals().at(
s)->ID(),
1694 unsigned int tpc = rawOpt->
fTPC;
1704 if(trackCol.
vals().size() < 1)
continue;
1715 if (vertexTrackAssnsHandle->size() < 1)
continue;
1722 auto tracksProxy = proxy::getCollection<proxy::Tracks>(
evt, which);
1728 std::cout <<
"==> Neutrino Candidate drawing for tagger " << recoOpt->
fTrkVtxFilterLabels[imod] << std::endl;
1731 for(
const auto& vertexTrackAssn : *vertexTrackAssnsHandle)
1736 if (vertex->
ID() != lastVtxIdx)
1748 TMarker& strt = view->
AddMarker(wire, time, color, 24, 3.0);
1749 strt.SetMarkerColor(color);
1751 std::cout <<
" --> Drawing vertex id: " << vertex->
ID() << std::endl;
1754 lastVtxIdx = vertex->
ID();
1759 double x = track->
End().X();
1760 double y = track->
End().Y();
1761 double z = track->
End().Z();
1765 tid = track->
ID()&65535;
1767 std::cout <<
" --> Drawing Track id: " << tid << std::endl;
1770 char const* txt = s.c_str();
1772 TText& trkID = view->
AddText(wire, tick, txt);
1773 trkID.SetTextColor(color);
1774 trkID.SetTextSize(0.1);
1776 float cosmicScore = -999;
1777 if( cosmicTrackTags.isValid() ){
1778 if( cosmicTrackTags.at(track.
key()).size() > 0 ) {
1784 std::vector<const recob::Hit*>
hits;
1786 auto tp = tracksProxy[track.
key()];
1787 for (
auto point: tp.points()) {
1788 if (!point.isPointValid())
continue;
1789 hits.push_back(point.hit());
1792 hits = fmh.at(track.
key());
1796 while(itr < hits.end()){
1797 if((*itr)->View() != gview) hits.erase(itr);
1806 if(cosmicScore<0.6) color = kMagenta;
1809 else if (cosmicScore<-10000){
1836 static bool first =
true;
1839 std::cout<<
"******** DrawVertices: Open circles color coded across all planes. Set DrawVertices > 1 to display the vertex ID\n";
1843 for(
size_t imod = 0; imod < recoOpt->
fVertexLabels.size(); ++imod) {
1849 if(vertex.
size() < 1)
continue;
1851 double local[3] = {0.,0.,0.};
1852 double world[3] = {0.,0.,0.};
1855 double minxyz[3], maxxyz[3];
1863 for(
size_t v = 0; v < vertex.
size(); ++v){
1866 vertex[v]->XYZ(xyz);
1867 if(xyz[0] < minxyz[0] || xyz[0] > maxxyz[0])
continue;
1868 if(xyz[1] < minxyz[1] || xyz[1] > maxxyz[1])
continue;
1869 if(xyz[2] < minxyz[2] || xyz[2] > maxxyz[2])
continue;
1874 TMarker& strt = view->
AddMarker(wire, time, color, 24, 1.0);
1875 strt.SetMarkerColor(color);
1880 char const* txt = s.c_str();
1881 TText& vtxID = view->
AddText(wire, time+30, txt);
1882 vtxID.SetTextColor(color);
1883 vtxID.SetTextSize(0.05);
1905 for (
unsigned int imod = 0; imod < recoOpt->
fEventLabels.size(); ++imod) {
1911 if(event.
size() < 1)
continue;
1915 for(
size_t e = 0;
e <
event.size(); ++
e){
1916 std::vector<const recob::Hit*>
hits;
1922 while(itr < hits.end()){
1923 if((*itr)->View() != gview) hits.erase(itr);
1942 std::vector<art::InputTag> labels;
1944 for(
size_t imod = 0; imod < recoOpt->
fSeedLabels.size(); ++imod)
1947 for(
size_t imod = 0; imod < labels.size(); ++imod) {
1955 if(seeds.
size() < 1)
continue;
1959 for(
size_t iseed = 0; iseed != seeds.
size(); ++iseed){
1960 double pt[3], pterr[3],
dir[3], direrr[3];
1961 seeds.
at(iseed)->GetPoint(pt, pterr);
1962 seeds.
at(iseed)->GetDirection(dir, direrr);
1964 double end1[3], end2[3];
1965 for(
int i = 0; i != 3; ++i){
1966 end1[i] = pt[i] + dir[i] ;
1967 end2[i] = pt[i] - dir[i] ;
1972 pmrk.SetPoint(iseed, pt[0], pt[1], pt[2]);
1973 pline.SetPoint(0, end1[0], end1[1], end1[2]);
1974 pline.SetPoint(1, end2[0], end2[1], end2[2]);
1989 std::vector<art::InputTag> labels;
1991 for(
size_t imod = 0; imod < recoOpt->
fSeedLabels.size(); ++imod)
1994 for(
size_t imod = 0; imod < labels.size(); ++imod) {
2002 for(
size_t iseed = 0; iseed != seeds.
size(); ++iseed){
2003 double pt[3], pterr[3],
dir[3], direrr[3];
2004 seeds.
at(iseed)->GetPoint(pt, pterr);
2005 seeds.
at(iseed)->GetDirection(dir, direrr);
2007 double end1[3], end2[3];
2008 for(
int i = 0; i != 3; ++i){
2009 end1[i] = pt[i] + dir[i] ;
2010 end2[i] = pt[i] - dir[i] ;
2014 TMarker& strt = view->
AddMarker(pt[1], pt[0], color, 4, 1.5);
2015 TLine& line = view->
AddLine(end1[1], end1[0], end2[1], end2[0]);
2018 line.SetLineWidth(2.0);
2021 TMarker& strt = view->
AddMarker(pt[2], pt[0], color, 4, 1.5);
2022 TLine& line = view->
AddLine(end1[2], end1[0], end2[2], end2[0]);
2025 line.SetLineWidth(2.0);
2029 throw cet::exception(
"RecoBaseDrawer:SeedOrtho") <<
"projection is not YZ as expected\n";
2031 TMarker& strt = view->
AddMarker(pt[2], pt[1], color, 4, 1.5);
2032 TLine& line = view->
AddLine(end1[2], end1[1], end2[2], end2[1]);
2035 line.SetLineWidth(2.0);
2050 std::vector<art::InputTag> labels;
2057 for(
size_t imod = 0; imod < labels.size(); ++imod)
2061 std::vector<art::Ptr<recob::SpacePoint>> spts;
2063 int color = 10*imod + 11;
2100 mf::LogDebug(
"RecoBaseDrawer") <<
"RecoBaseDrawer: number PFParticles to draw: " << pfParticleVec.
size() << std::endl;
2103 if (pfParticleVec.
size() < 1)
continue;
2106 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
2114 if (spacePointVec.size() < 1)
continue;
2123 if (!spacePointAssnVec.isValid())
continue;
2140 for(
size_t idx = 0; idx < pfParticleVec.
size(); idx++)
2147 if (!pfParticle->IsPrimary())
continue;
2150 DrawPFParticle3D(pfParticle, pfParticleVec, spacePointVec, edgeAssnsVec, spacePointAssnVec, spHitAssnVec, pfTrackAssns, pcAxisAssnVec, pfCosmicAssns, 0, view);
2173 const std::vector<art::Ptr<recob::SpacePoint>>& hitsVec(spacePointAssnVec.at(pfPart->
Self()));
2177 bool isCosmic(
false);
2183 std::vector<const anab::CosmicTag*> pfCosmicTagVec = cosmicTagAssnVec.at(pfPart.
key());
2185 if (!pfCosmicTagVec.empty())
2189 if (cosmicTag->
CosmicScore() > 0.6) isCosmic =
true;
2195 if (isCosmic) colorIdx = 12;
2197 if (!hitsVec.empty())
2199 using HitPosition = std::array<double,3>;
2200 std::map<int,std::vector<HitPosition>> colorToHitMap;
2202 for(
const auto& spacePoint : hitsVec)
2204 const double* pos = spacePoint->XYZ();
2206 const std::vector<art::Ptr<recob::Hit>>& hitVec = spHitAssnVec.at(spacePoint.key());
2208 bool storeHit(
false);
2209 int chargeColorIdx(0);
2210 double spacePointChiSq(spacePoint->Chisq());
2214 double pulseHeights[] = {0.,0.,0.};
2216 for(
const auto&
hit : hitVec)
2219 pulseHeights[
hit->WireID().Plane] =
hit->PeakAmplitude();
2232 else if (spacePointChiSq > -2.)
2237 else if (spacePointChiSq > -3.)
2239 if (chargeColorIdx < 0) chargeColorIdx = !isCosmic ? 3 : colorIdx + 3;
2242 else if (spacePointChiSq > -4.)
2244 if (chargeColorIdx < 0) chargeColorIdx = !isCosmic ? 0 : colorIdx + 3;
2247 else if (spacePoint->Chisq() > -5.)
2249 if (chargeColorIdx < 0) chargeColorIdx = !isCosmic ? 5 : colorIdx + 3;
2254 chargeColorIdx = 15;
2258 if (chargeColorIdx < 0) chargeColorIdx = 0;
2261 if (storeHit) colorToHitMap[chargeColorIdx].push_back(HitPosition()={{pos[0],pos[1],pos[2]}});
2264 size_t nHitsDrawn(0);
2266 for(
auto& hitPair : colorToHitMap)
2269 TPolyMarker3D& pm = view->
AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.3);
2270 for (
const auto&
hit : hitPair.second) pm.SetNextPoint(
hit[0],
hit[1],
hit[2]);
2271 nHitsDrawn += hitPair.second.size();
2276 if (edgeAssnsVec.isValid())
2278 const std::vector<art::Ptr<recob::Edge>>& edgeVec(edgeAssnsVec.at(pfPart->
Self()));
2280 if (!edgeVec.empty())
2282 std::cout <<
"************ found edge with " << edgeVec.size() <<
" entries *************" << std::endl;
2283 TPolyMarker3D& pm = view->
AddPolyMarker3D(2*edgeVec.size(), colorIdx, kFullDotLarge, 0.5);
2285 for (
const auto& edge : edgeVec)
2290 if (firstSP->
ID() != edge->FirstPointID() || secondSP->
ID() != edge->SecondPointID())
2292 std::cout <<
"Space point index mismatch, first: " << firstSP->
ID() <<
", " << edge->FirstPointID() <<
", second: " << secondSP->
ID() <<
", " << edge->SecondPointID() << std::endl;
2298 TVector3 startPoint(firstSP->
XYZ()[0],firstSP->
XYZ()[1],firstSP->
XYZ()[2]);
2299 TVector3 endPoint(secondSP->
XYZ()[0],secondSP->
XYZ()[1],secondSP->
XYZ()[2]);
2300 TVector3 lineVec(endPoint - startPoint);
2302 pm.SetNextPoint(startPoint[0],startPoint[1],startPoint[2]);
2303 pm.SetNextPoint(endPoint[0], endPoint[1], endPoint[2]);
2305 double length = lineVec.Mag();
2309 std::cout <<
"Edge length is zero, index 1: " << edge->FirstPointID() <<
", index 2: " << edge->SecondPointID() << std::endl;
2313 double minLen =
std::max(2.01,length);
2315 if (minLen > length)
2319 startPoint += -0.5 * (minLen - length) * lineVec;
2320 endPoint += 0.5 * (minLen - length) * lineVec;
2323 std::cout <<
" Drawing edge len: " << length <<
", from sp: " << firstSP->
ID() <<
" (" << startPoint[0] <<
"," << startPoint[1] <<
"," << startPoint[2] <<
")" <<
" to " << secondSP->
ID() <<
" (" << endPoint[0] <<
"," << endPoint[1] <<
"," << endPoint[2] <<
")" << std::endl;
2328 pl.SetPoint(0, startPoint[0], startPoint[1], startPoint[2]);
2329 pl.SetPoint(1, endPoint[0], endPoint[1], endPoint[2]);
2335 if (trackAssnVec.isValid())
2337 std::vector<const recob::Track*> trackVec(trackAssnVec.at(pfPart.
key()));
2339 if (!trackVec.empty())
2346 if (pcAxisAssnVec.isValid())
2348 std::vector<const recob::PCAxis*> pcaVec(pcAxisAssnVec.at(pfPart.
key()));
2350 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()) std::reverse(pcaVec.begin(), pcaVec.end());
2369 for(
const auto& pca : pcaVec)
2372 const double* avePosition = pca->getAvePosition();
2376 TPolyMarker3D& pmrk = view->
AddPolyMarker3D(7, lineColor[pcaIdx], markStyle[pcaIdx], markSize[pcaIdx]);
2378 pmrk.SetPoint(pmrkIdx++, avePosition[0], avePosition[1], avePosition[2]);
2381 for(
int dimIdx = 0; dimIdx < 3; dimIdx++)
2384 TPolyLine3D& pl = view->
AddPolyLine3D(numPoints, lineColor[pcaIdx], lineWidth[pcaIdx], lineStyle[pcaIdx]);
2387 double eigenValue = pca->getEigenValues()[dimIdx];
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);
2429 for(
const auto& daughterIdx : pfPart->
Daughters())
2431 DrawPFParticle3D(pfParticleVec.
at(daughterIdx), pfParticleVec, spacePointVec, edgeAssnsVec, spacePointAssnVec, spHitAssnVec, trackAssnVec, pcAxisAssnVec, cosmicTagAssnVec, depth, view);
2454 for(
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
2458 if(!trackView.
isValid())
continue;
2462 trackView.
fill(trackVec);
2467 for(
const auto&
track : trackVec)
2470 int marker = kFullDotLarge;
2476 if (cosmicTagAssnVec.isValid())
2478 std::vector<const anab::CosmicTag*> tkCosmicTagVec = cosmicTagAssnVec.at(
track.key());
2480 if (!tkCosmicTagVec.empty())
2503 for(
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod) {
2508 for(
size_t s = 0;
s < shower.
vals().size(); ++
s) {
2536 std::map<int, std::vector<const recob::SpacePoint*> > spmap;
2537 int spcolor =
color;
2539 for(
auto &pspt : spts) {
2550 if (pspt->Chisq() < -100.) spcolor = 10;
2554 spcolor = 100 - 2.5 * pspt->Chisq();
2556 if(spcolor < 51) spcolor = 51;
2557 if(spcolor > 100) spcolor = 100;
2559 else spcolor =
color;
2562 spmap[spcolor].push_back(&*pspt);
2569 for(
auto const icolor : spmap)
2571 int spcolor = icolor.first;
2572 const std::vector<const recob::SpacePoint*>& psps = icolor.second;
2576 TPolyMarker3D& pm = view->
AddPolyMarker3D(psps.size(), spcolor, marker, size);
2578 for(
size_t s = 0;
s < psps.size(); ++
s)
2582 const double *xyz = spt.
XYZ();
2583 pm.SetPoint(
s, xyz[0], xyz[1], xyz[2]);
2606 std::vector<art::Handle<std::vector<recob::Track> > > handles;
2609 for(
auto ih : handles)
2615 const std::string& which = handle.
provenance()->moduleLabel();
2618 if (fmsp.isValid() && fmsp.size() > 0)
2620 int n = handle->size();
2621 float spSize = 0.5 * size;
2623 for(
int i=0; i<
n; ++i)
2628 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
2642 int lineSize = size;
2644 if (lineSize < 1) lineSize = 1;
2648 TPolyMarker3D& pmStart = view->
AddPolyMarker3D(1, 0, marker, 2.*size);
2651 pmStart.SetPoint(0, firstPos.X(), firstPos.Y(), firstPos.Z());
2656 for(
int p = 0; p < np; ++p)
2661 pm.SetPoint(p, pos.X(), pos.Y(), pos.Z());
2667 for(
int p = 0; p < np; ++p)
2673 pl.SetPoint(p, pos.X(), pos.Y(), pos.Z());
2683 for(
int p = 1; p < np; ++p)
2690 auto deltaPos = nextPos - startPos;
2691 double arcLen = deltaPos.Dot(startDir);
2693 if (arcLen < 0.) arcLen = 3.;
2695 auto endPoint = startPos + arcLen * startDir;
2697 pl.SetPoint(0, startPos.X(), startPos.Y(), startPos.Z());
2698 pl.SetPoint(1, endPoint.X(), endPoint.Y(), endPoint.Z());
2720 std::vector<art::Handle<std::vector<recob::Shower> > > handles;
2723 bool noSpts =
false;
2725 for(
auto ih : handles) {
2730 const std::string& which = handle.
provenance()->moduleLabel();
2733 int n = handle->size();
2734 for(
int i=0; i<
n; ++i) {
2736 if(&*p == &shower) {
2738 std::vector<art::Ptr<recob::SpacePoint>> spts;
2753 std::cout<<
"No space points associated with the shower. Drawing a cone instead\n";
2755 auto& dedx = shower.
dEdx();
2758 for(
auto& dedxInPln : dedx) dedxAve += dedxInPln;
2759 dedxAve /= (double)dedx.size();
2763 if(dedxAve > 3 && dedxAve < 5) color = kGreen;
2770 for(
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
2771 auto&
pt = coneRim[ipt];
2772 pl.SetPoint(ipt,
pt[0],
pt[1],
pt[2]);
2775 for(
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
2777 panel.SetPoint(0, startPos.X(), startPos.Y(), startPos.Z());
2778 panel.SetPoint(1, coneRim[ipt][0], coneRim[ipt][1], coneRim[ipt][2]);
2793 r.RotateX(axisDir.X());
2794 r.RotateY(axisDir.Y());
2795 r.RotateZ(axisDir.Z());
2796 constexpr
unsigned short nRimPts = 16;
2797 std::vector<std::array<double, 3>> rimPts(nRimPts + 1);
2798 for(
unsigned short iang = 0; iang < nRimPts; ++iang) {
2799 double rimAngle = iang * 2 * M_PI / (float)nRimPts;
2800 TVector3 rim = {0, 0, 1};
2801 rim.SetX(radius * cos(rimAngle));
2802 rim.SetY(radius * sin(rimAngle));
2806 for(
unsigned short ixyz = 0; ixyz < 3; ++ixyz) rimPts[iang][ixyz] = rim[ixyz];
2809 rimPts[nRimPts] = rimPts[0];
2824 for (
size_t imod = 0; imod < recoOpt->
fVertexLabels.size(); ++imod) {
2833 for(
size_t v = 0; v < vertex.
size(); ++v){
2836 std::vector< art::Ptr<recob::Track> > tracks = fmt.at(v);
2839 for(
size_t t = 0; t < tracks.size(); ++t)
2840 this->
DrawTrack3D(*(tracks[t]), view, vertex[v]->ID());
2845 std::vector< art::Ptr<recob::Shower> > showers = fms.at(v);
2847 for(
size_t s = 0;
s < showers.size(); ++
s)
2852 double xyz[3] = {0.};
2853 vertex[v]->XYZ(xyz);
2855 pm.SetPoint(0, xyz[0], xyz[1], xyz[2]);
2875 for (
size_t imod = 0; imod < recoOpt->
fEventLabels.size(); ++imod) {
2881 if(event.
size() < 1)
continue;
2886 for(
size_t e = 0;
e <
event.size(); ++
e){
2889 std::vector< art::Ptr<recob::Vertex> >
vertex = fmvp.at(
e);
2891 if(vertex.size() < 1)
continue;
2896 for(
size_t v = 0; v < vertex.size(); ++v){
2900 std::vector< art::Ptr<recob::Track> > tracks = fmt.at(v);
2901 std::vector< art::Ptr<recob::Shower> > showers = fms.at(v);
2904 for(
size_t t = 0; t < tracks.size(); ++t)
2907 for(
size_t s = 0;
s < showers.size(); ++
s)
2912 double xyz[3] = {0.};
2913 std::vector<const recob::Vertex*> vts = fmv.at(
e);
2915 event[
e]->PrimaryVertex(vts)->XYZ(xyz);
2917 pm.SetPoint(0, xyz[0], xyz[1], xyz[2]);
2935 for(
size_t imod = 0; imod < recoOpt->
fSliceLabels.size(); ++imod) {
2939 if(slices.
size() < 1)
continue;
2941 for(
size_t isl = 0; isl < slices.
size(); ++isl) {
2942 int slcID = std::abs(slices[isl]->ID());
2944 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(isl);
2965 for (
size_t i = 0; i<geo->
NTPC(); ++i){
2966 double local[3] = {0.,0.,0.};
2967 double world[3] = {0.,0.,0.};
2976 for(
size_t imod = 0; imod < recoOpt->
fOpFlashLabels.size(); ++imod) {
2982 if(opflashes.
size() < 1)
continue;
2984 int NFlashes = opflashes.
size();
2987 for (
int iof = 0; iof < NFlashes; ++iof) {
2989 if (opflashes[iof]->TotalPE() < recoOpt->
fFlashMinPE)
continue;
2990 if (opflashes[iof]->Time() < recoOpt->
fFlashTMin)
continue;
2991 if (opflashes[iof]->Time() > recoOpt->
fFlashTMax)
continue;
2993 double YCentre = opflashes[iof]->YCenter();
2994 double YHalfWidth = opflashes[iof]->YWidth();
2995 double ZCentre = opflashes[iof]->ZCenter();
2996 double ZHalfWidth = opflashes[iof]->ZWidth();
3001 TBox& b1 = view->
AddBox(YCentre-YHalfWidth, minx, YCentre+YHalfWidth, maxx);
3002 b1.SetFillStyle(3004+(iof%3));
3003 b1.SetFillColor(Colour);
3014 TLine& line = view->
AddLine(ZCentre-ZHalfWidth, xflash, ZCentre+ZHalfWidth, xflash);
3015 line.SetLineWidth(2);
3016 line.SetLineStyle(2);
3017 line.SetLineColor(Colour);
3020 TBox& b1 = view->
AddBox(ZCentre-ZHalfWidth, YCentre-YHalfWidth, ZCentre+ZHalfWidth, YCentre+YHalfWidth);
3021 b1.SetFillStyle(3004+(iof%3));
3022 b1.SetFillColor(Colour);
3023 view->
AddMarker(ZCentre, YCentre, Colour, 4, 1.5);
3033 for(
size_t v = 0; v < vertex.
size(); ++v){
3035 double xyz[3] = {0.};
3036 vertex[v]->XYZ(xyz);
3041 TMarker& strt = view->
AddMarker(xyz[1], xyz[0], color, marker, 1.0);
3042 strt.SetMarkerColor(color);
3045 TMarker& strt = view->
AddMarker(xyz[2], xyz[0], color, marker, 1.0);
3046 strt.SetMarkerColor(color);
3049 TMarker& strt = view->
AddMarker(xyz[2], xyz[1], color, marker, 1.0);
3050 strt.SetMarkerColor(color);
3064 for(
size_t imod = 0; imod < recoOpt->
fVertexLabels.size(); ++imod) {
3091 std::vector<art::InputTag> labels;
3097 for(
size_t imod = 0; imod < labels.size(); ++imod) {
3100 std::vector<art::Ptr<recob::SpacePoint>> spts;
3132 if (pfParticleVec.
size() < 1)
continue;
3138 if (!spacePointAssnVec.isValid())
continue;
3143 if (!pcAxisAssnVec.isValid())
continue;
3146 for(
size_t idx = 0; idx < pfParticleVec.
size(); idx++)
3153 if (!pfParticle->IsPrimary())
continue;
3156 DrawPFParticleOrtho(pfParticle, pfParticleVec, spacePointAssnVec, pcAxisAssnVec, 0, proj, view);
3174 const std::vector<const recob::SpacePoint*>& hitsVec(spacePointAssnVec.at(pfPart->
Self()));
3181 if (!hitsVec.empty())
3183 std::vector<const recob::SpacePoint*> hitPosVec;
3184 std::vector<const recob::SpacePoint*> skeletonPosVec;
3185 std::vector<const recob::SpacePoint*> skelEdgePosVec;
3186 std::vector<const recob::SpacePoint*> edgePosVec;
3187 std::vector<const recob::SpacePoint*> seedPosVec;
3188 std::vector<const recob::SpacePoint*> pairPosVec;
3190 for(
const auto& spacePoint : hitsVec)
3192 if (spacePoint->Chisq() > 0.) hitPosVec.push_back(spacePoint);
3193 else if (spacePoint->Chisq() == -1.) skeletonPosVec.push_back(spacePoint);
3194 else if (spacePoint->Chisq() == -3.) skelEdgePosVec.push_back(spacePoint);
3195 else if (spacePoint->Chisq() == -4.) seedPosVec.push_back(spacePoint);
3196 else if (spacePoint->Chisq() > -10.) edgePosVec.push_back(spacePoint);
3197 else pairPosVec.push_back(spacePoint);
3204 TPolyMarker& pm1 = view->
AddPolyMarker(hitPosVec.size(), colorIdx, kFullDotMedium, 1);
3205 for(
const auto* spacePoint : hitPosVec)
3207 const double* pos = spacePoint->XYZ();
3210 pm1.SetPoint(hitIdx++, pos[0], pos[1]);
3212 pm1.SetPoint(hitIdx++, pos[2], pos[0]);
3214 pm1.SetPoint(hitIdx++, pos[2], pos[1]);
3219 TPolyMarker& pm2 = view->
AddPolyMarker(edgePosVec.size(), 28, kFullDotMedium, 1);
3220 for(
const auto* spacePoint : edgePosVec)
3222 const double* pos = spacePoint->XYZ();
3225 pm2.SetPoint(hitIdx++, pos[0], pos[1]);
3227 pm2.SetPoint(hitIdx++, pos[2], pos[0]);
3229 pm2.SetPoint(hitIdx++, pos[2], pos[1]);
3234 TPolyMarker& pm3 = view->
AddPolyMarker(pairPosVec.size(), 2, kFullDotMedium, 1);
3235 for(
const auto* spacePoint : pairPosVec)
3237 const double* pos = spacePoint->XYZ();
3240 pm3.SetPoint(hitIdx++, pos[0], pos[1]);
3242 pm3.SetPoint(hitIdx++, pos[2], pos[0]);
3244 pm3.SetPoint(hitIdx++, pos[2], pos[1]);
3250 TPolyMarker& pm4 = view->
AddPolyMarker(skeletonPosVec.size(), 1, kFullDotMedium, 1);
3251 for(
const auto* spacePoint : skeletonPosVec)
3253 const double* pos = spacePoint->XYZ();
3256 pm4.SetPoint(hitIdx++, pos[0], pos[1]);
3258 pm4.SetPoint(hitIdx++, pos[2], pos[0]);
3260 pm4.SetPoint(hitIdx++, pos[2], pos[1]);
3265 TPolyMarker& pm5 = view->
AddPolyMarker(skelEdgePosVec.size(), 3, kFullDotMedium, 1);
3266 for(
const auto* spacePoint : skelEdgePosVec)
3268 const double* pos = spacePoint->XYZ();
3271 pm5.SetPoint(hitIdx++, pos[0], pos[1]);
3273 pm5.SetPoint(hitIdx++, pos[2], pos[0]);
3275 pm5.SetPoint(hitIdx++, pos[2], pos[1]);
3280 TPolyMarker& pm6 = view->
AddPolyMarker(seedPosVec.size(), 6, kFullDotMedium, 1);
3281 for(
const auto* spacePoint : seedPosVec)
3283 const double* pos = spacePoint->XYZ();
3286 pm6.SetPoint(hitIdx++, pos[0], pos[1]);
3288 pm6.SetPoint(hitIdx++, pos[2], pos[0]);
3290 pm6.SetPoint(hitIdx++, pos[2], pos[1]);
3295 if (pcAxisAssnVec.isValid())
3297 std::vector<const recob::PCAxis*> pcaVec(pcAxisAssnVec.at(pfPart->
Self()));
3299 if (!pcaVec.empty())
3303 int lineWidth[2] = { 3, 1};
3304 int lineStyle[2] = { 1, 13};
3305 int lineColor[2] = {colorIdx, 18};
3306 int markStyle[2] = { 4, 4};
3311 if (pcaVec.size() > 1 && pcaVec.front()->getID() > pcaVec.back()->getID()) std::reverse(pcaVec.begin(), pcaVec.end());
3313 for(
const auto& pca : pcaVec)
3316 const double* avePosition = pca->getAvePosition();
3320 TPolyMarker& pmrk = view->
AddPolyMarker(7, lineColor[pcaIdx], markStyle[pcaIdx], 1);
3323 pmrk.SetPoint(pmrkIdx++, avePosition[0], avePosition[1]);
3325 pmrk.SetPoint(pmrkIdx++, avePosition[2], avePosition[0]);
3327 pmrk.SetPoint(pmrkIdx++, avePosition[2], avePosition[1]);
3330 for(
int dimIdx = 0; dimIdx < 3; dimIdx++)
3333 TPolyLine& pl = view->
AddPolyLine(numPoints, lineColor[pcaIdx], lineWidth[pcaIdx], lineStyle[pcaIdx]);
3336 double eigenValue = pca->getEigenValues()[dimIdx];
3342 eigenValue = 3.*sqrt(eigenValue);
3345 const std::vector<double>& eigenVector = pca->getEigenVectors()[dimIdx];
3348 double xl = avePosition[0] - 0.5 * eigenValue * eigenVector[0];
3349 double yl = avePosition[1] - 0.5 * eigenValue * eigenVector[1];
3350 double zl = avePosition[2] - 0.5 * eigenValue * eigenVector[2];
3354 pl.SetPoint(0, xl, yl);
3355 pmrk.SetPoint(pmrkIdx++, xl, yl);
3359 pl.SetPoint(0, zl, xl);
3360 pmrk.SetPoint(pmrkIdx++, zl, xl);
3364 pl.SetPoint(0, zl, yl);
3365 pmrk.SetPoint(pmrkIdx++, zl, yl);
3369 double xu = avePosition[0] + 0.5 * eigenValue * eigenVector[0];
3370 double yu = avePosition[1] + 0.5 * eigenValue * eigenVector[1];
3371 double zu = avePosition[2] + 0.5 * eigenValue * eigenVector[2];
3375 pl.SetPoint(1, xu, yu);
3376 pmrk.SetPoint(pmrkIdx++, xu, yu);
3380 pl.SetPoint(1, zu, xu);
3381 pmrk.SetPoint(pmrkIdx++, zu, xu);
3385 pl.SetPoint(1, zu, yu);
3386 pmrk.SetPoint(pmrkIdx++, zu, yu);
3404 for(
const auto& daughterIdx : pfPart->
Daughters())
3431 for(
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
3436 for(
size_t t = 0; t < track.
vals().size(); ++t) {
3438 int color = ptrack->
ID()&65535;
3450 for(
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod) {
3455 for(
size_t s = 0;
s < shower.
vals().size(); ++
s) {
3485 std::map<int, std::vector<art::Ptr<recob::SpacePoint>> > spmap;
3487 for(
auto& pspt : spts){
3499 spcolor = 100 - 2.5 * pspt->Chisq();
3505 spmap[spcolor].push_back(pspt);
3512 for(
auto icolor : spmap) {
3513 int spcolor = icolor.first;
3514 std::vector<art::Ptr<recob::SpacePoint>>& psps = icolor.second;
3519 kFullCircle, msize);
3520 for(
size_t s = 0;
s < psps.size(); ++
s){
3522 const double *xyz = spt.
XYZ();
3525 pm.SetPoint(
s, xyz[0], xyz[1]);
3528 pm.SetPoint(
s, xyz[2], xyz[0]);
3531 pm.SetPoint(
s, xyz[2], xyz[1]);
3535 <<
": unknown projection #" << ((int) proj) <<
"\n";
3561 std::vector<art::Handle<std::vector<recob::Track> > > handles;
3563 for(
auto ih : handles) {
3566 const std::string& which = handle.
provenance()->moduleLabel();
3569 int n = handle->size();
3570 for(
int i=0; i<
n; ++i) {
3573 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
3592 for(
int p = 0; p < np; ++p){
3597 pm.SetPoint(p, pos.X(), pos.Y());
3598 pl.SetPoint(p, pos.X(), pos.Y());
3601 pm.SetPoint(p, pos.Z(), pos.X());
3602 pl.SetPoint(p, pos.Z(), pos.X());
3605 pm.SetPoint(p, pos.Z(), pos.Y());
3606 pl.SetPoint(p, pos.Z(), pos.Y());
3610 <<
": unknown projection #" << ((int) proj) <<
"\n";
3615 int tid = track.
ID()&65535;
3617 char const* txt = s.c_str();
3618 double x = track.
End().X();
3619 double y = track.
End().Y();
3620 double z = track.
End().Z();
3622 TText& trkID = view->
AddText(x, y, txt);
3624 trkID.SetTextSize(0.03);
3626 TText& trkID = view->
AddText(z, x, txt);
3628 trkID.SetTextSize(0.03);
3630 TText& trkID = view->
AddText(z, y, txt);
3632 trkID.SetTextSize(0.03);
3652 std::vector<art::Handle<std::vector<recob::Shower> > > handles;
3654 for(
auto ih : handles) {
3657 const std::string& which = handle.
provenance()->moduleLabel();
3659 if (!fmsp.isValid())
continue;
3660 int n = handle->size();
3661 for(
int i=0; i<
n; ++i) {
3663 if(&*p == &shower) {
3676 <<
": unknown projection #" << ((int) proj) <<
"\n";
3679 if (fmsp.isValid()){
3680 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
3704 for(
unsigned int i = 0; i < wcol->size(); ++i){
3711 writeErrMsg(
"GetWires", e);
3714 return wires.
size();
3720 std::vector<const recob::Hit*>&
hits,
3727 std::vector<const recob::Hit*> temp;
3731 for(
size_t t = 0; t < temp.size(); ++t){
3733 if( temp[t]->WireID().Plane == plane &&
3734 temp[t]->WireID().TPC == rawOpt->
fTPC &&
3735 temp[t]->WireID().Cryostat == rawOpt->
fCryostat) hits.push_back(temp[t]);
3739 writeErrMsg(
"GetHits", e);
3757 for(
unsigned int i = 0; i < slcCol->size(); ++i){
3764 writeErrMsg(
"GetSlices", e);
3767 return slices.
size();
3783 for(
unsigned int i = 0; i < clcol->size(); ++i){
3790 writeErrMsg(
"GetClusters", e);
3793 return clust.
size();
3809 for(
unsigned int i = 0; i < clcol->size(); ++i)
3817 writeErrMsg(
"GetPFParticles", e);
3820 return clust.
size();
3835 for(
unsigned int i = 0; i < epcol->size(); ++i){
3842 writeErrMsg(
"GetEndPoint2D", e);
3861 for(
unsigned int i = 0; i < opflashcol->size(); ++i){
3865 temp.
swap(opflashes);
3868 writeErrMsg(
"GetOpFlashes", e);
3871 return opflashes.
size();
3887 for(
unsigned int i = 0; i < seedcol->size(); ++i){
3894 writeErrMsg(
"GetSeeds", e);
3897 return seeds.
size();
3913 for(
unsigned int i = 0; i < btbcol->size(); ++i){
3920 writeErrMsg(
"GetBezierTracks", e);
3952 temp.
reserve(edgeCol->size());
3953 for(
unsigned int i = 0; i < edgeCol->size(); ++i)
3962 writeErrMsg(
"GetEdges", e);
3965 return edges.
size();
3977 writeErrMsg(
"GetTracks", e);
3980 return track.
vals().size();
3992 writeErrMsg(
"GetShowers", e);
3995 return shower.
vals().size();
4010 for(
size_t i = 0; i < vcol->size(); ++i){
4017 writeErrMsg(
"GetVertices", e);
4020 return vertex.
size();
4035 for(
size_t i = 0; i < ecol->size(); ++i){
4042 writeErrMsg(
"GetEvents", e);
4045 return event.size();
4051 unsigned int cryostat,
4055 std::vector<const recob::Hit*> temp;
4056 int NumberOfHitsBeforeThisPlane=0;
4058 for(
size_t t = 0; t < temp.size(); ++t){
4059 if( temp[t]->WireID().Cryostat == cryostat&& temp[t]->WireID().TPC == tpc && temp[t]->WireID().Plane == plane )
break;
4060 NumberOfHitsBeforeThisPlane++;
4062 return NumberOfHitsBeforeThisPlane;
4079 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod)
4086 for (
size_t i = 0; i < wires.
size(); ++i)
4089 std::vector<geo::WireID> wireids = geo->
ChannelToWire(wires[i]->Channel());
4091 bool goodWID =
false;
4092 for(
auto const& wid : wireids )
4095 if(wid.Plane == plane &&
4097 wid.TPC == rawOpt->
fTPC &&
4098 wid.Cryostat == rawOpt->
fCryostat) goodWID =
true;
4100 if(!goodWID)
continue;
4102 std::vector<float> wirSig = wires[i]->Signal();
4103 for(
unsigned int ii = 0; ii < wirSig.size(); ++ii)
4104 histo->Fill(1.*ii, wirSig[ii]);
4108 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod)
4112 std::vector<const recob::Hit*>
hits;
4113 this->
GetHits(evt, which, hits, plane);
4119 for (
size_t i = 0; i < hits.size(); ++i)
4122 if(hits[i]->WireID().Wire != wire)
continue;
4125 if (std::abs(hits[i]->EndTick() - lastEndTick))
4127 if (!roiHitParamsVec.empty()) hitParamsVec.push_back(roiHitParamsVec);
4128 roiHitParamsVec.clear();
4133 hitParams.hitCenter = hits[i]->PeakTime();
4134 hitParams.hitSigma = hits[i]->RMS();
4135 hitParams.hitHeight = hits[i]->PeakAmplitude();
4136 hitParams.hitStart = hits[i]->StartTick();
4137 hitParams.hitEnd = hits[i]->EndTick();
4139 roiHitParamsVec.emplace_back(hitParams);
4141 lastEndTick = hits[i]->EndTick();
4145 if (!roiHitParamsVec.empty()) hitParamsVec.push_back(roiHitParamsVec);
4164 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod) {
4170 for (
unsigned int i=0; i<wires.
size(); ++i) {
4172 std::vector<geo::WireID> wireids = geo->
ChannelToWire(wires[i]->Channel());
4174 bool goodWID =
false;
4175 for(
auto const& wid : wireids ){
4177 if(wid.Plane == plane &&
4178 wid.TPC == rawOpt->
fTPC &&
4179 wid.Cryostat == rawOpt->
fCryostat) goodWID =
true;
4181 if(!goodWID)
continue;
4182 std::vector<float> wirSig = wires[i]->Signal();
4183 for(
unsigned int ii = 0; ii < wirSig.size(); ++ii)
4184 histo->Fill(wirSig[ii]);
4201 std::vector<double>& htau1,
4202 std::vector<double>& htau2,
4203 std::vector<double>& hitamplitudes,
4204 std::vector<double>& hpeaktimes,
4205 std::vector<int>& hstartT,
4206 std::vector<int>& hendT,
4207 std::vector<int>& hNMultiHit,
4208 std::vector<int>& hLocalHitIndex)
4217 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod) {
4223 for (
size_t i = 0; i < wires.
size(); ++i) {
4225 std::vector<geo::WireID> wireids = geo->
ChannelToWire(wires[i]->Channel());
4227 bool goodWID =
false;
4228 for(
auto const& wid : wireids ){
4229 if(wid.Plane == plane &&
4231 wid.TPC == rawOpt->
fTPC &&
4232 wid.Cryostat == rawOpt->
fCryostat) goodWID =
true;
4235 if(!goodWID)
continue;
4237 std::vector<float> wirSig = wires[i]->Signal();
4238 for(
unsigned int ii = 0; ii < wirSig.size(); ++ii)
4239 histo->Fill(1.*ii, wirSig[ii]);
4245 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
4248 std::vector<const recob::Hit*>
hits;
4249 this->
GetHits(evt, which, hits, plane);
4252 const auto & fitParams = hitResults->vectors();
4256 for (
size_t i = 0; i < hits.size(); ++i){
4258 if(hits[i]->WireID().Wire != wire)
continue;
4260 hpeaktimes.push_back(fitParams[FitParamsOffset+i][0]);
4261 htau1.push_back(fitParams[FitParamsOffset+i][1]);
4262 htau2.push_back(fitParams[FitParamsOffset+i][2]);
4263 hitamplitudes.push_back(fitParams[FitParamsOffset+i][3]);
4264 hstartT.push_back(hits[i]->StartTick());
4265 hendT.push_back(hits[i]->EndTick());
4266 hNMultiHit.push_back(hits[i]->Multiplicity());
4267 hLocalHitIndex.push_back(hits[i]->LocalIndex());
4281 return (amplitude * exp(0.4*(x-peaktime)/tau1) / ( 1 + exp(0.4*(x-peaktime)/tau2) ) );
4288 std::vector<double> tau1,
4289 std::vector<double> tau2,
4290 std::vector<double> amplitude,
4291 std::vector<double> peaktime)
4295 for(
int i = HitNumber; i < HitNumber+NHits; i++)
4297 x_sum += (amplitude[i] * exp(0.4*(x-peaktime[i])/tau1[i]) / ( 1 + exp(0.4*(x-peaktime[i])/tau2[i]) ) );
void OpFlashOrtho(const art::Event &evt, evd::OrthoProj_t proj, evdb::View2D *view)
int fDraw2DSlopeEndPoints
void SpacePointOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
void DrawShowerOrtho(const recob::Shower &shower, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
void SpacePoint3D(const art::Event &evt, evdb::View3D *view)
void reserve(size_type n)
int GetTracks(const art::Event &evt, const art::InputTag &which, art::View< recob::Track > &track)
std::vector< double > fRawCharge
Sum of Raw Charge.
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
const TVector3 & ShowerStart() const
int fScaleDigitsByCharge
scale the size of the digit by the charge
const art::Event * GetEvent() const
void PFParticleOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
std::vector< art::InputTag > fEndPoint2DLabels
module labels that produced end point 2d objects
std::vector< HitParams_t > ROIHitParamsVec
An object to define a "edge" which is used to connect space points in a triangulation algorithm...
unsigned int fTPC
TPC number to draw, typically set by TWQProjectionView.
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
std::vector< art::InputTag > fTrkVtxCosmicLabels
module labels that tagged track as CR (Track/Vertex module)
std::vector< art::InputTag > fOpFlashLabels
module labels that produced events
Encapsulate the construction of a single cyostat.
size_t Self() const
Returns the index of this particle.
Float_t y1[n_points_granero]
bool has_length() const
Returns whether the shower has a valid length.
TPolyLine & AddPolyLine(int n, int c, int w, int s)
void Prong3D(const art::Event &evt, evdb::View3D *view)
std::vector< art::InputTag > fTrackLabels
module labels that produced tracks
WireGeo const & Wire(unsigned int iwire) const
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
void swap(PtrVector &other)
int GetSpacePoints(const art::Event &evt, const art::InputTag &which, std::vector< art::Ptr< recob::SpacePoint >> &spts)
int fDrawRawDataOrCalibWires
0 for raw
Float_t x1[n_points_granero]
void SeedOrtho(const art::Event &evt, evd::OrthoProj_t proj, evdb::View2D *view)
TLine & AddLine(double x1, double y1, double x2, double y2)
Declaration of signal hit object.
std::vector< art::InputTag > fTrkVtxTrackLabels
module labels that produced tracks (Track/Vertex module)
virtual double BirksCorrection(double dQdX) const =0
dQ/dX in electrons/cm, returns dE/dX in MeV/cm.
void FillTQHisto(const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo, HitParamsVec &hitParamsVec)
int fColorSpacePointsByChisq
Generate space point colors by chisquare?
Point_t const & LocationAtPoint(size_t i) const
Access to track position at different points.
The data type to uniquely identify a Plane.
Geometry information for a single TPC.
int GetEdges(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Edge > &edges)
void Vertex3D(const art::Event &evt, evdb::View3D *view)
bool HasValidPoint(size_t i) const
Various functions related to the presence and the number of (valid) points.
void Event3D(const art::Event &evt, evdb::View3D *view)
static std::unique_ptr< FVectorReader > create(const art::Event &evt, const art::InputTag &tag)
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Vector_t VertexDirection() const
Access to track direction at different points.
void ProngOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
int GetClusters(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Cluster > &clust)
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
virtual double SamplingRate() const =0
Returns the period of the TPC readout electronics clock.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
void DrawShower3D(const recob::Shower &shower, int color, evdb::View3D *view)
A collection of drawable 2-D objects.
WireID_t Wire
Index of the wire within its plane.
int GetColor(double x) const
void Prong2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
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
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
void fill(PtrVector< T > &pv) const
int GetEvents(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Event > &event)
int fDrawSliceSpacePoints
double fFlashTMin
Minimal time for a flash to be displayed.
std::vector< ROIHitParamsVec > HitParamsVec
int fDrawTrackTrajectoryPoints
Singleton to hold the current art::Event for the event display.
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
std::vector< art::InputTag > fCosmicTagLabels
module labels that produced cosmic tags
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
std::vector< double > fConvertedCharge
Sum of Charge Converted using Birks' formula.
bool has_open_angle() const
Returns whether the shower has a valid opening angle.
Float_t y2[n_points_geant4]
virtual double ConvertXToTicks(double X, int p, int t, int c) const =0
double fFlashTMax
Maximum time for a flash to be displayed.
int GetBezierTracks(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Track > &btbs)
int TDCtick_t
Type representing a TDC tick.
void BezierTrack3D(const art::Event &evt, evdb::View3D *view)
The color scales used by the event display.
void Seed2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
unsigned int CountValidPoints() const
Various functions related to the presence and the number of (valid) points.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
TPolyLine3D & AddPolyLine3D(int n, int c, int w, int s)
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::vector< ELEMENT const * > &result) const
TBox & AddBox(double x1, double y1, double x2, double y2)
void Seed3D(const art::Event &evt, evdb::View3D *view)
int CountHits(const art::Event &evt, const art::InputTag &which, unsigned int cryostat, unsigned int tpc, unsigned int plane)
View_t View() const
Which coordinate does this plane measure.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
std::vector< art::InputTag > fWireLabels
module labels that produced wires
int GetEndPoint2D(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::EndPoint2D > &ep2d)
const std::vector< double > & dEdx() const
Provides recob::Track data product.
void push_back(Ptr< U > const &p)
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)
unsigned int fCryostat
Cryostat number to draw, typically set by TWQProjectionView.
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
Provenance const * provenance() const
static EventHolder * Instance()
void PFParticle3D(const art::Event &evt, evdb::View3D *view)
void Slice2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
std::vector< art::InputTag > fPFParticleLabels
module labels that produced PFParticles
std::vector< art::InputTag > fBezierTrackLabels
module labels that produced events
std::vector< art::InputTag > fVertexLabels
module labels that produced vertices
void DrawTrackVertexAssns2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void Draw2DSlopeEndPoints(double xStart, double yStart, double xEnd, double yEnd, double slope, int color, evdb::View2D *view)
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
TPolyMarker & AddPolyMarker(int n, int c, int st, double sz)
Point_t const & Vertex() const
Access to track position at different points.
const evdb::ColorScale & CalQ(geo::SigType_t st) const
TText & AddText(double x, double y, const char *text)
double fMinSignal
minimum ADC count to display a time bin
double fTicks
number of TDC ticks to display, ie # fTicks past fStartTick
void DrawSpacePoint3D(std::vector< art::Ptr< recob::SpacePoint >> &spts, evdb::View3D *view, int color, int marker=3, float size=1.)
int Hit2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void getManyByType(std::vector< Handle< PROD >> &results) 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)
geo::Length_t DetLength(geo::TPCID const &tpcid) const
Returns the length of the active volume of the specified TPC.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
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)
void OpFlash2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
const Double32_t * XYZ() const
std::vector< art::InputTag > fSliceLabels
module labels that produced slices
const TVector3 & Direction() const
int GetOpFlashes(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::OpFlash > &opflash)
int GetSeeds(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Seed > &seed)
int GetShowers(const art::Event &evt, const art::InputTag &which, art::View< recob::Shower > &shower)
reference at(size_type n)
double fFlashMinPE
Minimal PE for a flash to be displayed.
std::vector< int > fWireMin
lowest wire in interesting region for each plane
void BezierTrack2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
std::vector< art::InputTag > fSeedLabels
module labels that produced events
Declaration of cluster object.
Class to aid in the rendering of RecoBase objects.
static const int kColor[kNCOLS]
void Cluster2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void GetChargeSum(int plane, double &charge, double &convcharge)
std::vector< TCSlice > slices
Detector simulation of raw signals on wires.
Encapsulate the geometry of a wire.
double EvalExpoFit(double x, double tau1, double tau2, double amplitude, double peaktime)
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
std::vector< art::InputTag > fSpacePointLabels
module labels that produced space points
std::size_t color(std::string const &procname)
virtual double ConvertTicksToX(double ticks, int p, int t, int c) const =0
std::vector< TrajPoint > seeds
void DrawTrack3D(const recob::Track &track, evdb::View3D *view, int color, int marker=1, float size=2.)
bool fDrawTrackVertexAssns
void DrawProng2D(std::vector< const recob::Hit * > &hits, evdb::View2D *view, unsigned int plane, TVector3 const &startPos, TVector3 const &startDir, int id, float cscore=-5)
Place to keep constants for event display.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
int fDrawTrackSpacePoints
int fTicksPerPoint
number of ticks to include in one point
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::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)
Utility object to perform functions of association.
std::string to_string(Flag_t< Storage > const flag)
Convert a flag into a stream (shows its index).
Encapsulate the construction of a single detector plane.
bool fDraw3DSpacePointHeatMap
bool fSeeBadChannels
Allow "bad" channels to be viewed.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
void FillQHisto(const art::Event &evt, unsigned int plane, TH1F *histo)
int ID() const
Return vertex id.
int GetPFParticles(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::PFParticle > &pfpart)
void EndPoint2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
unsigned int Nwires() const
Number of wires in this plane.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void Wire2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
double EvalMultiExpoFit(double x, int HitNumber, int NHits, std::vector< double > tau1, std::vector< double > tau2, std::vector< double > amplitude, std::vector< double > peaktime)
int fAxisOrientation
0 = TDC values on y-axis, wire number on x-axis, 1 = swapped
Offers proxy::Tracks and proxy::Track class for recob::Track access.
void DrawPFParticleOrtho(const art::Ptr< recob::PFParticle > &pfPart, const art::PtrVector< recob::PFParticle > &pfParticleVec, const art::FindMany< recob::SpacePoint > &spacePointAssnsVec, const art::FindMany< recob::PCAxis > &pcAxisAssnVec, int depth, evd::OrthoProj_t proj, evdb::View2D *view)
Exception thrown on invalid wire number.
Point_t const & End() const
Access to track position at different points.
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
Declaration of basic channel signal object.
int GetRegionOfInterest(int plane, int &minw, int &maxw, int &mint, int &maxt)
Vector_t DirectionAtPoint(size_t i) const
Access to track direction at different points.
void Event2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
void GetClusterOutlines(std::vector< const recob::Hit * > &hits, std::vector< double > &tpts, std::vector< double > &wpts, unsigned int plane)
A collection of 3D drawable objects.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
#define LOG_VERBATIM(category)
std::vector< art::InputTag > fHitLabels
module labels that produced hits
std::vector< art::InputTag > fShowerLabels
module labels that produced showers
unsigned int ChannelID_t
Type representing the ID of a readout channel.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::vector< art::InputTag > fTrkVtxFilterLabels
module labels that filtered event (Track/Vertex module)
void DrawTrackOrtho(const recob::Track &track, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
Float_t x2[n_points_geant4]
static const int kColor2[kNCOLS]
geo::WireID suggestedWireID() const
Returns a better wire ID.
recob::tracking::Plane Plane
virtual double ElectronsToADC() const =0
Namespace collecting geometry-related classes utilities.
TMarker & AddMarker(double x, double y, int c, int st, double sz)
std::vector< int > fTimeMax
highest time in interesting region for each plane
void Vertex2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void DrawTrack2D(std::vector< const recob::Hit * > &hits, evdb::View2D *view, unsigned int plane, const recob::Track *track, int color, int lineWidth)
std::vector< art::InputTag > fClusterLabels
module labels that produced clusters
void LocalToWorld(const double *tpc, double *world) const
Transform point from local TPC frame to world frame.
std::vector< art::InputTag > fEventLabels
module labels that produced events
int GetVertices(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Vertex > &vertex)
void LocalToWorld(const double *plane, double *world) const
Transform point from local plane frame to world frame.
art framework interface to geometry description
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)
float AspectRatio(TCSlice &slc, std::vector< int > &tjids, CTP_t inCTP)
cet::coded_exception< error, detail::translate > exception
Event finding and building.
TPolyMarker3D & AddPolyMarker3D(int n, int c, int st, double sz)
Encapsulate the construction of a single detector plane.
Signal from collection planes.
std::vector< int > fTimeMin
lowest time in interesting region for each plane
struct HitParams_t{float hitCenter HitParams_t
virtual double GetXTicksOffset(int p, int t, int c) const =0