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);
554 for(
size_t imod = 0; imod < recoOpt->
fOpFlashLabels.size(); ++imod) {
560 if(opflashes.
size() < 1)
continue;
562 int NFlashes = opflashes.
size();
565 LOG_VERBATIM(
"RecoBaseDrawer") <<
"Total "<<NFlashes<<
" flashes.";
568 for (
size_t iof = 0; iof < opflashes.
size(); ++iof) {
569 if (opflashes[iof]->TotalPE() < recoOpt->
fFlashMinPE)
continue;
570 if (opflashes[iof]->Time() < recoOpt->
fFlashTMin)
continue;
571 if (opflashes[iof]->Time() > recoOpt->
fFlashTMax)
continue;
574 << opflashes[iof]->Time()
576 << opflashes[iof]->YCenter()
578 << opflashes[iof]->ZCenter()
580 << opflashes[iof]->TotalPE();
584 float wire0 = FLT_MAX;
585 float wire1 = FLT_MIN;
587 std::vector<TVector3> points;
588 points.push_back(TVector3(0, opflashes[iof]->YCenter()-opflashes[iof]->YWidth(), opflashes[iof]->ZCenter()-opflashes[iof]->ZWidth()));
589 points.push_back(TVector3(0, opflashes[iof]->YCenter()-opflashes[iof]->YWidth(), opflashes[iof]->ZCenter()+opflashes[iof]->ZWidth()));
590 points.push_back(TVector3(0, opflashes[iof]->YCenter()+opflashes[iof]->YWidth(), opflashes[iof]->ZCenter()-opflashes[iof]->ZWidth()));
591 points.push_back(TVector3(0, opflashes[iof]->YCenter()+opflashes[iof]->YWidth(), opflashes[iof]->ZCenter()+opflashes[iof]->ZWidth()));
592 for (
size_t i = 0; i<points.size(); ++i){
600 if (wireID.
Wire < wire0) wire0 = wireID.
Wire;
601 if (wireID.
Wire > wire1) wire1 = wireID.
Wire;
604 TLine& line = view->
AddLine(flashtick, wire0, flashtick, wire1);
605 line.SetLineWidth(2);
606 line.SetLineStyle(2);
607 line.SetLineColor(Color);
610 TLine& line = view->
AddLine(wire0, flashtick, wire1, flashtick);
611 line.SetLineWidth(2);
612 line.SetLineStyle(2);
613 line.SetLineColor(Color);
635 for(
size_t imod = 0; imod < recoOpt->
fSeedLabels.size(); ++imod) {
641 if(seeds.
size() < 1)
continue;
644 for (
size_t isd = 0; isd < seeds.
size(); ++isd) {
647 double SeedPointErr[3];
648 double SeedDirErr[3];
652 seeds[isd]->GetPoint( SeedPoint, SeedPointErr);
653 seeds[isd]->GetDirection( SeedDir, SeedDirErr);
655 SeedEnd1[0] = SeedPoint[0] + SeedDir[0];
656 SeedEnd1[1] = SeedPoint[1] + SeedDir[1];
657 SeedEnd1[2] = SeedPoint[2] + SeedDir[2];
659 SeedEnd2[0] = SeedPoint[0] - SeedDir[0] ;
660 SeedEnd2[1] = SeedPoint[1] - SeedDir[1] ;
661 SeedEnd2[2] = SeedPoint[2] - SeedDir[2] ;
666 unsigned int wirepoint = 0;
667 unsigned int wireend1 = 0;
668 unsigned int wireend2 = 0;
673 wirepoint = atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
679 wireend1 = atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
685 wireend2 = atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
688 double x = wirepoint;
690 double x1 = wireend1;
692 double x2 = wireend2;
704 TMarker& strt = view->
AddMarker(x, y, color, 4, 1.5);
705 TLine& line = view->
AddLine(x1, y1, x2, y2);
706 strt.SetMarkerColor(color);
707 line.SetLineColor(color);
708 line.SetLineWidth(2.0);
737 for (
size_t ibtb = 0; ibtb < btrackbase.
size(); ++ibtb) {
741 std::vector<std::vector<double> > ProjPtUVWs(3);
742 std::vector<std::vector<double> > ProjTimes(3);
744 double projpt[3], ticks[3];
747 for(
int i = 0; i != N; ++i){
749 BTrack.GetProjectedPointUVWT(
float(i)/N,projpt,ticks,c,t );
750 for(
size_t n = 0;
n != 3; ++
n){
751 ProjPtUVWs[
n].push_back(projpt[
n]);
752 ProjTimes[
n].push_back(ticks[n]);
762 for(
size_t i = 0; i != ProjPtUVWs[plane].size(); ++i){
763 double x = ProjPtUVWs[plane][i];
764 double y = ProjTimes[plane][i];
766 y = ProjPtUVWs[plane][i];
767 x = ProjTimes[plane][i];
797 for (
size_t ibtb = 0; ibtb < btrackbase.
size(); ++ibtb) {
802 for(
int i = 0; i != N; ++i){
803 BTrack.GetTrackPoint(
float(i)/N,xyzpt );
808 pl.SetPoint(i,x,y,z);
814 for(
size_t ivtx = 0; ivtx < btrackvertices.
size(); ++ivtx){
816 btrackvertices.
at(ivtx)->XYZ(xyz);
817 pmrk.SetPoint(ivtx, xyz[0], xyz[1], xyz[2]);
845 static bool first =
true;
847 std::cout<<
"DrawClusters: 0 = none, 1 = cluster hits, 2 = unique marker, 3 = cluster hits with connecting lines.\n";
848 std::cout<<
" 4 = with cluster ID with PFParticle color match if it exists or black if no association exists.\n";
849 std::cout<<
" color scheme: By cluster ID in each plane or by PFParticle ID (Self) if a PFParticle - Cluster association exists.\n";
853 for(
size_t imod = 0; imod < recoOpt->
fClusterLabels.size(); ++imod)
860 if(clust.
size() < 1)
continue;
866 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
870 if (spacePointVec.size() > 0)
875 if (spHitAssnVec.isValid())
878 std::vector<const recob::Hit*> freeHitVec;
881 for(
const auto& spacePointPtr : spacePointVec)
883 if (spacePointPtr->Chisq() < -99.)
886 const std::vector<art::Ptr<recob::Hit>>& hitVec = spHitAssnVec.at(spacePointPtr.key());
888 for(
const auto&
hit : hitVec)
890 if(
hit->WireID().Plane != plane)
continue;
892 freeHitVec.push_back(
hit.get());
898 this->
Hit2D(freeHitVec, kGray, view,
false);
906 for (
size_t ic = 0; ic < clust.
size(); ++ic)
910 if (clust[ic]->
Plane().
Plane != plane)
continue;
913 int clusterIdx(std::abs(clust[ic]->ID()));
915 bool pfpAssociation =
false;
916 float cosmicscore = FLT_MIN;
920 std::vector<art::Ptr<recob::PFParticle>> pfplist = fmc.at(ic);
924 clusterIdx = pfplist[0]->Self();
926 pfpAssociation =
true;
933 std::vector<art::Ptr<anab::CosmicTag>> ctlist = fmct.at(0);
937 cosmicscore = ctlist[0]->CosmicScore();
944 std::vector<const recob::Hit*>
hits = fmh.at(ic);
954 if (this->
Hit2D(hits, color, view, drawConnectingLines) < 1)
continue;
957 this->
Hit2D(hits, view, cosmicscore);
964 char const* txt = s.c_str();
965 double wire = clust[ic]->StartWire();
966 double tick = 20 + clust[ic]->StartTick();
967 TText& clID = view->
AddText(wire, tick, txt);
969 clID.SetTextColor(color);
971 clID.SetTextColor(kBlack);
978 std::vector<double> tpts, wpts;
996 p1.SetFillStyle(3003);
997 p1.SetFillColor(fcolor);
998 for (
size_t i = 0; i < wpts.size(); ++i) {
1000 p1.SetPoint(i, wpts[i], tpts[i]);
1001 p2.SetPoint(i, wpts[i], tpts[i]);
1004 p1.SetPoint(i, tpts[i], wpts[i]);
1005 p2.SetPoint(i, tpts[i], wpts[i]);
1015 double wirePitch = geo->
WirePitch(gview);
1026 clust[ic]->StartWire(), clust[ic]->StartTick(),
1027 clust[ic]->EndWire(), clust[ic]->EndTick(),
1028 std::tan((clust[ic]->StartAngle() + clust[ic]->EndAngle())/2.)*wirePitch/driftvelocity/timetick,
1055 double slope1 = slope;
1062 if(std::abs(slope) > 0.) slope1 = 1./slope;
1066 double deltaX = 0.5 * (x2 -
x1);
1067 double xm = x1 + deltaX;
1068 double ym = y1 + deltaX * slope;
1070 TMarker& strt = view->
AddMarker(xm, ym, color, kFullCircle, 1.0);
1071 strt.SetMarkerColor(color);
1074 double stublen = 2.*deltaX;
1075 TLine& l = view->
AddLine(x1, y1, x1+stublen, y1 + slope1*stublen);
1076 l.SetLineColor(color);
1096 double slope1 = slope;
1102 if(std::abs(slope) > 0.) slope1 = 1./slope;
1106 TMarker& strt = view->
AddMarker(x1, y1, color, kFullStar, 2.0);
1107 strt.SetMarkerColor(color);
1110 double stublen = 300.0;
1111 TLine& l = view->
AddLine(x1, y1, x1+stublen, y1 + slope1*stublen);
1112 l.SetLineColor(color);
1134 double cosx1 = cosx;
1135 double cosy1 = cosy;
1145 TMarker& strt = view->
AddMarker(x1, y1, color, kFullStar, 2.0);
1146 strt.SetMarkerColor(color);
1149 double stublen = 300.0;
1150 TLine& l = view->
AddLine(x1, y1, x1+stublen*cosx1, y1 + stublen*cosy1);
1151 l.SetLineColor(color);
1168 std::vector<double>& wpts,
1169 std::vector<double>& tpts,
1175 std::map<unsigned int, double> wlo, whi;
1177 for(
size_t j = 0; j < hits.size(); ++j){
1179 if(hits[j]->WireID().Plane != plane ||
1180 hits[j]->WireID().TPC != rawOpt->
fTPC ||
1181 hits[j]->WireID().Cryostat != rawOpt->
fCryostat)
continue;
1183 wlo[hits[j]->WireID().Wire] = hits[j]->PeakTime();
1184 whi[hits[j]->WireID().Wire] = hits[j]->PeakTime();
1190 for (
size_t j = 0; j < hits.size(); ++j) {
1191 t = hits[j]->PeakTime();
1193 if (t < wlo[hits[j]->WireID().Wire]) wlo[hits[j]->WireID().Wire] = t;
1194 if (t > whi[hits[j]->WireID().Wire]) whi[hits[j]->WireID().Wire] = t;
1201 for (; itr != itrEnd; ++itr) {
1202 unsigned int w = itr->first;
1205 wpts.push_back(1.*w-0.1); tpts.push_back(t-0.1);
1206 wpts.push_back(1.*w+0.1); 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); tpts.push_back(t+0.1);
1218 wpts.push_back(1.*w-0.1); tpts.push_back(t+0.1);
1222 wpts.push_back(wpts[0]); tpts.push_back(tpts[0]);
1231 TVector3
const& startPos,
1232 TVector3
const& startDir,
1242 unsigned int t = rawOpt->
fTPC;
1250 if(cscore<0.6) color = kMagenta;
1253 else if (cscore<-10000){
1259 this->
Hit2D(hits, color, view,
false, lineWidth);
1261 this->
Hit2D(hits, color, view,
false, lineWidth);
1264 double wire0 = geo->
WireCoordinate(startPos.Y(),startPos.Z(),plane,t,c);
1266 double tick1 = detprop->
ConvertXToTicks((startPos+startDir).
X(),plane,t,c);
1268 (startPos+startDir).
Z(),plane,t,c);
1272 double ds = sqrt(pow(tick0-tick1,2)+pow(wire0-wire1,2));
1275 cost = (tick1-tick0)/ds;
1276 cosw = (wire1-wire0)/ds;
1297 unsigned int t = rawOpt->
fTPC;
1300 this->
Hit2D(hits, color, view,
true, lineWidth);
1302 const auto& startPos = track->
Vertex();
1306 double local[3] = {0.};
1307 double world[3] = {0.};
1309 world[1] = startPos.Y();
1310 world[2] = startPos.Z();
1319 wire = 1.*atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
1324 double wirePitch = geo->
WirePitch(hits[0]->View());
1333 double rotang = 3.1416-thetawire;
1334 double yprime = std::cos(rotang)*startDir[1]
1335 +std::sin(rotang)*startDir[2];
1336 double dTdW = startDir[0]*wirePitch/driftvelocity/timetick/yprime;
1345 for(
size_t idx = 0; idx < nTrackHits; idx++)
1351 world[1] = hitPos.Y();
1352 world[2] = hitPos.Z();
1356 double wireHit = 0.;
1358 wireHit = 1.*geo->
NearestWire(world, plane, t, c);
1361 wireHit = 1.*atoi(e.explain_self().substr(e.explain_self().find(
"#")+1,5).c_str());
1364 pl.SetPoint(vidx++,wireHit,tickHit);
1379 auto const* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
1390 unsigned int tpc = rawOpt->
fTPC;
1395 for(
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod)
1402 if(track.
vals().size() < 1)
continue;
1409 auto tracksProxy = proxy::getCollection<proxy::Tracks>(evt, which);
1413 for(
size_t t = 0; t < track.
vals().size(); ++t)
1416 if (track.
vals().at(t)->NumberTrajectoryPoints() == 0)
1418 std::cout <<
"***** Track with no trajectory points ********" << std::endl;
1425 double x = track.
vals().at(t)->End()(0);
1426 double y = track.
vals().at(t)->End()(1);
1427 double z = track.
vals().at(t)->End()(2);
1428 double tick = 30 + detprop->ConvertXToTicks(x, plane, tpc, cstat);
1430 tid = track.
vals().at(t)->ID()&65535;
1432 char const* txt = s.c_str();
1433 TText& trkID = view->
AddText(wire, tick, txt);
1435 trkID.SetTextSize(0.1);
1439 if( cosmicTrackTags.isValid() ){
1440 if( cosmicTrackTags.at(t).size() > 0 ) {
1446 std::vector<const recob::Hit*>
hits;
1447 if (track.
vals().at(t)->NumberTrajectoryPoints() == fmh.at(t).size()) {
1448 auto tp = tracksProxy[t];
1449 for (
auto point: tp.points()) {
1450 if (!point.isPointValid())
continue;
1451 hits.push_back(point.hit());
1458 while(itr < hits.end()){
1459 if((*itr)->View() != gview) hits.erase(itr);
1470 if(Score<0.6) color = kMagenta;
1473 else if (Score<-10000){
1485 static bool first =
true;
1488 std::cout<<
"DrawShower options: \n";
1489 std::cout<<
" 1 = Hits in shower color-coded by the shower ID\n";
1490 std::cout<<
" 2 = Same as 1 + shower axis and circle representing the shower cone\n";
1491 std::cout<<
" Black cone = shower start dE/dx < 1 MeV/cm (< 1/2 MIP)\n";
1492 std::cout<<
" Blue cone = shower start dE/dx < 3 MeV/cm (~1 MIP)\n";
1493 std::cout<<
" Green cone = shower start 3 MeV/cm < dE/dx < 5 MeV/cm (~2 MIP)\n";
1494 std::cout<<
" Red cone = shower start 5 MeV/cm < dE/dx (>2 MIP)\n";
1497 for(
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod){
1502 if(shower.
vals().size() < 1)
continue;
1508 for(
size_t s = 0;
s < shower.
vals().size(); ++
s){
1510 std::vector<const recob::Hit*>
hits = fmh.at(
s);
1513 while(itr < hits.end()){
1514 if((*itr)->View() != gview) hits.erase(itr);
1520 if(!shower.
vals().at(
s)->has_length())
continue;
1521 if(!shower.
vals().at(
s)->has_open_angle())
continue;
1523 TVector3 startPos = shower.
vals().at(
s)->ShowerStart();
1524 TVector3
dir = shower.
vals().at(
s)->Direction();
1525 double length = shower.
vals().at(
s)->Length();
1526 double openAngle = shower.
vals().at(
s)->OpenAngle();
1529 TVector3 endPos = startPos + length *
dir;
1531 double swire = geo->
WireCoordinate(startPos.Y(),startPos.Z(), plane, tpc, cstat);
1532 double stick = detprop->ConvertXToTicks(startPos.X(), plane, tpc, cstat);
1533 double ewire = geo->
WireCoordinate(endPos.Y(),endPos.Z(), plane, tpc, cstat);
1534 double etick = detprop->ConvertXToTicks(endPos.X(), plane, tpc, cstat);
1535 TLine& coneLine = view->
AddLine(swire, stick, ewire, etick);
1537 std::vector<double> dedxVec = shower.
vals().at(
s)->dEdx();
1541 if(plane < dedxVec.size()) {
1542 if(dedxVec[plane] > 1 && dedxVec[plane] < 3) {
1545 }
else if(dedxVec[plane] < 5) {
1553 coneLine.SetLineColor(color);
1556 double radius = length * openAngle;
1557 auto coneRim =
Circle3D(endPos, dir, radius);
1560 for(
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
1561 double wire = geo->
WireCoordinate(coneRim[ipt][1], coneRim[ipt][2], plane, tpc, cstat);
1562 double tick = detprop->ConvertXToTicks(coneRim[ipt][0], plane, tpc, cstat);
1563 pline.SetPoint(ipt, wire, tick);
1568 shower.
vals().at(
s)->ShowerStart(),
1569 shower.
vals().at(
s)->Direction(),
1570 shower.
vals().at(
s)->ID(),
1599 unsigned int tpc = rawOpt->
fTPC;
1609 if(trackCol.
vals().size() < 1)
continue;
1620 if (vertexTrackAssnsHandle->size() < 1)
continue;
1627 auto tracksProxy = proxy::getCollection<proxy::Tracks>(evt, which);
1633 std::cout <<
"==> Neutrino Candidate drawing for tagger " << recoOpt->
fTrkVtxFilterLabels[imod] << std::endl;
1636 for(
const auto& vertexTrackAssn : *vertexTrackAssnsHandle)
1641 if (vertex->
ID() != lastVtxIdx)
1653 TMarker& strt = view->
AddMarker(wire, time, color, 24, 3.0);
1654 strt.SetMarkerColor(color);
1656 std::cout <<
" --> Drawing vertex id: " << vertex->
ID() << std::endl;
1659 lastVtxIdx = vertex->
ID();
1664 double x = track->
End()(0);
1665 double y = track->
End()(1);
1666 double z = track->
End()(2);
1670 tid = track->
ID()&65535;
1672 std::cout <<
" --> Drawing Track id: " << tid << std::endl;
1675 char const* txt = s.c_str();
1677 TText& trkID = view->
AddText(wire, tick, txt);
1678 trkID.SetTextColor(color);
1679 trkID.SetTextSize(0.1);
1681 float cosmicScore = -999;
1682 if( cosmicTrackTags.isValid() ){
1683 if( cosmicTrackTags.at(track.
key()).size() > 0 ) {
1689 std::vector<const recob::Hit*>
hits;
1691 auto tp = tracksProxy[track.
key()];
1692 for (
auto point: tp.points()) {
1693 if (!point.isPointValid())
continue;
1694 hits.push_back(point.hit());
1697 hits = fmh.at(track.
key());
1701 while(itr < hits.end()){
1702 if((*itr)->View() != gview) hits.erase(itr);
1711 if(cosmicScore<0.6) color = kMagenta;
1714 else if (cosmicScore<-10000){
1741 static bool first =
true;
1744 std::cout<<
"DrawVertices: Open circles color coded across all planes. Set DrawVertices > 1 to display the vertex ID\n";
1748 for(
size_t imod = 0; imod < recoOpt->
fVertexLabels.size(); ++imod) {
1754 if(vertex.
size() < 1)
continue;
1756 for(
size_t v = 0; v < vertex.
size(); ++v){
1759 vertex[v]->XYZ(xyz);
1763 TMarker& strt = view->
AddMarker(wire, time, color, 24, 1.0);
1764 strt.SetMarkerColor(color);
1769 char const* txt = s.c_str();
1770 TText& vtxID = view->
AddText(wire, time+10, txt);
1771 vtxID.SetTextColor(color);
1772 vtxID.SetTextSize(0.07);
1794 for (
unsigned int imod = 0; imod < recoOpt->
fEventLabels.size(); ++imod) {
1800 if(event.
size() < 1)
continue;
1804 for(
size_t e = 0;
e <
event.size(); ++
e){
1805 std::vector<const recob::Hit*>
hits;
1811 while(itr < hits.end()){
1812 if((*itr)->View() != gview) hits.erase(itr);
1831 std::vector<art::InputTag> labels;
1833 for(
size_t imod = 0; imod < recoOpt->
fSeedLabels.size(); ++imod)
1836 for(
size_t imod = 0; imod < labels.size(); ++imod) {
1844 if(seeds.
size() < 1)
continue;
1848 for(
size_t iseed = 0; iseed != seeds.
size(); ++iseed){
1849 double pt[3], pterr[3],
dir[3], direrr[3];
1850 seeds.
at(iseed)->GetPoint(pt, pterr);
1851 seeds.
at(iseed)->GetDirection(dir, direrr);
1853 double end1[3], end2[3];
1854 for(
int i = 0; i != 3; ++i){
1855 end1[i] = pt[i] + dir[i] ;
1856 end2[i] = pt[i] - dir[i] ;
1861 pmrk.SetPoint(iseed, pt[0], pt[1], pt[2]);
1862 pline.SetPoint(0, end1[0], end1[1], end1[2]);
1863 pline.SetPoint(1, end2[0], end2[1], end2[2]);
1878 std::vector<art::InputTag> labels;
1880 for(
size_t imod = 0; imod < recoOpt->
fSeedLabels.size(); ++imod)
1883 for(
size_t imod = 0; imod < labels.size(); ++imod) {
1891 for(
size_t iseed = 0; iseed != seeds.
size(); ++iseed){
1892 double pt[3], pterr[3],
dir[3], direrr[3];
1893 seeds.
at(iseed)->GetPoint(pt, pterr);
1894 seeds.
at(iseed)->GetDirection(dir, direrr);
1896 double end1[3], end2[3];
1897 for(
int i = 0; i != 3; ++i){
1898 end1[i] = pt[i] + dir[i] ;
1899 end2[i] = pt[i] - dir[i] ;
1903 TMarker& strt = view->
AddMarker(pt[1], pt[0], color, 4, 1.5);
1904 TLine& line = view->
AddLine(end1[1], end1[0], end2[1], end2[0]);
1907 line.SetLineWidth(2.0);
1910 TMarker& strt = view->
AddMarker(pt[2], pt[0], color, 4, 1.5);
1911 TLine& line = view->
AddLine(end1[2], end1[0], end2[2], end2[0]);
1914 line.SetLineWidth(2.0);
1918 throw cet::exception(
"RecoBaseDrawer:SeedOrtho") <<
"projection is not YZ as expected\n";
1920 TMarker& strt = view->
AddMarker(pt[2], pt[1], color, 4, 1.5);
1921 TLine& line = view->
AddLine(end1[2], end1[1], end2[2], end2[1]);
1924 line.SetLineWidth(2.0);
1939 std::vector<art::InputTag> labels;
1946 for(
size_t imod = 0; imod < labels.size(); ++imod)
1950 std::vector<art::Ptr<recob::SpacePoint>> spts;
1952 int color = 10*imod + 11;
1989 mf::LogDebug(
"RecoBaseDrawer") <<
"RecoBaseDrawer: number PFParticles to draw: " << pfParticleVec.
size() << std::endl;
1992 if (pfParticleVec.
size() < 1)
continue;
1995 std::vector<art::Ptr<recob::SpacePoint>> spacePointVec;
2003 if (spacePointVec.size() < 1)
continue;
2012 if (!spacePointAssnVec.isValid())
continue;
2029 for(
size_t idx = 0; idx < pfParticleVec.
size(); idx++)
2036 if (!pfParticle->IsPrimary())
continue;
2039 DrawPFParticle3D(pfParticle, pfParticleVec, spacePointVec, edgeAssnsVec, spacePointAssnVec, spHitAssnVec, pfTrackAssns, pcAxisAssnVec, pfCosmicAssns, 0, view);
2062 const std::vector<art::Ptr<recob::SpacePoint>>& hitsVec(spacePointAssnVec.at(pfPart->
Self()));
2066 bool isCosmic(
false);
2072 std::vector<const anab::CosmicTag*> pfCosmicTagVec = cosmicTagAssnVec.at(pfPart.
key());
2074 if (!pfCosmicTagVec.empty())
2078 if (cosmicTag->
CosmicScore() > 0.6) isCosmic =
true;
2084 if (isCosmic) colorIdx = 12;
2086 if (!hitsVec.empty())
2088 using HitPosition = std::array<double,3>;
2089 std::map<int,std::vector<HitPosition>> colorToHitMap;
2091 for(
const auto& spacePoint : hitsVec)
2093 const double* pos = spacePoint->XYZ();
2095 const std::vector<art::Ptr<recob::Hit>>& hitVec = spHitAssnVec.at(spacePoint.key());
2097 bool storeHit(
false);
2098 int chargeColorIdx(0);
2099 double spacePointChiSq(spacePoint->Chisq());
2103 double pulseHeights[] = {0.,0.,0.};
2105 for(
const auto&
hit : hitVec)
2108 pulseHeights[
hit->WireID().Plane] =
hit->PeakAmplitude();
2121 else if (spacePointChiSq > -2.)
2126 else if (spacePointChiSq > -3.)
2128 if (chargeColorIdx < 0) chargeColorIdx = !isCosmic ? 3 : colorIdx + 3;
2131 else if (spacePointChiSq > -4.)
2133 if (chargeColorIdx < 0) chargeColorIdx = !isCosmic ? 0 : colorIdx + 3;
2136 else if (spacePoint->Chisq() > -5.)
2138 if (chargeColorIdx < 0) chargeColorIdx = !isCosmic ? 5 : colorIdx + 3;
2143 chargeColorIdx = 15;
2147 if (chargeColorIdx < 0) chargeColorIdx = 0;
2150 if (storeHit) colorToHitMap[chargeColorIdx].push_back(HitPosition()={{pos[0],pos[1],pos[2]}});
2153 size_t nHitsDrawn(0);
2155 for(
auto& hitPair : colorToHitMap)
2158 TPolyMarker3D& pm = view->
AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.3);
2159 for (
const auto&
hit : hitPair.second) pm.SetNextPoint(
hit[0],
hit[1],
hit[2]);
2160 nHitsDrawn += hitPair.second.size();
2165 if (edgeAssnsVec.isValid())
2167 const std::vector<art::Ptr<recob::Edge>>& edgeVec(edgeAssnsVec.at(pfPart->
Self()));
2169 if (!edgeVec.empty())
2171 std::cout <<
"************ found edge with " << edgeVec.size() <<
" entries *************" << std::endl;
2172 TPolyMarker3D& pm = view->
AddPolyMarker3D(2*edgeVec.size(), colorIdx, kFullDotLarge, 0.5);
2174 for (
const auto& edge : edgeVec)
2179 if (firstSP->
ID() != edge->FirstPointID() || secondSP->
ID() != edge->SecondPointID())
2181 std::cout <<
"Space point index mismatch, first: " << firstSP->
ID() <<
", " << edge->FirstPointID() <<
", second: " << secondSP->
ID() <<
", " << edge->SecondPointID() << std::endl;
2187 TVector3 startPoint(firstSP->
XYZ()[0],firstSP->
XYZ()[1],firstSP->
XYZ()[2]);
2188 TVector3 endPoint(secondSP->
XYZ()[0],secondSP->
XYZ()[1],secondSP->
XYZ()[2]);
2189 TVector3 lineVec(endPoint - startPoint);
2191 pm.SetNextPoint(startPoint[0],startPoint[1],startPoint[2]);
2192 pm.SetNextPoint(endPoint[0], endPoint[1], endPoint[2]);
2194 double length = lineVec.Mag();
2198 std::cout <<
"Edge length is zero, index 1: " << edge->FirstPointID() <<
", index 2: " << edge->SecondPointID() << std::endl;
2202 double minLen =
std::max(2.01,length);
2204 if (minLen > length)
2208 startPoint += -0.5 * (minLen - length) * lineVec;
2209 endPoint += 0.5 * (minLen - length) * lineVec;
2212 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;
2217 pl.SetPoint(0, startPoint[0], startPoint[1], startPoint[2]);
2218 pl.SetPoint(1, endPoint[0], endPoint[1], endPoint[2]);
2224 if (trackAssnVec.isValid())
2226 std::vector<const recob::Track*> trackVec(trackAssnVec.at(pfPart.
key()));
2228 if (!trackVec.empty())
2235 if (pcAxisAssnVec.isValid())
2237 std::vector<const recob::PCAxis*> pcaVec(pcAxisAssnVec.at(pfPart.
key()));
2239 if (!pcaVec.empty())
2244 int lineWidth[2] = { 2, 1};
2245 int lineStyle[2] = { 1, 13};
2246 int lineColor[2] = {colorIdx, 18};
2248 int markStyle[2] = {kFullDotLarge, kFullDotLarge};
2249 double markSize[2] = { 0.5, 0.2};
2252 if (!isCosmic) lineColor[1] = colorIdx;
2256 if (pcaVec.size() > 1 && pcaVec.front()->getID() > pcaVec.back()->getID()) std::reverse(pcaVec.begin(), pcaVec.end());
2258 for(
const auto& pca : pcaVec)
2261 const double* avePosition = pca->getAvePosition();
2265 TPolyMarker3D& pmrk = view->
AddPolyMarker3D(7, lineColor[pcaIdx], markStyle[pcaIdx], markSize[pcaIdx]);
2267 pmrk.SetPoint(pmrkIdx++, avePosition[0], avePosition[1], avePosition[2]);
2270 for(
int dimIdx = 0; dimIdx < 3; dimIdx++)
2273 TPolyLine3D& pl = view->
AddPolyLine3D(numPoints, lineColor[pcaIdx], lineWidth[pcaIdx], lineStyle[pcaIdx]);
2276 double eigenValue = pca->getEigenValues()[dimIdx];
2282 eigenValue = 3.*sqrt(eigenValue);
2285 const std::vector<double>& eigenVector = pca->getEigenVectors()[dimIdx];
2288 double xl = avePosition[0] - 0.5 * eigenValue * eigenVector[0];
2289 double yl = avePosition[1] - 0.5 * eigenValue * eigenVector[1];
2290 double zl = avePosition[2] - 0.5 * eigenValue * eigenVector[2];
2292 pl.SetPoint(0, xl, yl, zl);
2293 pmrk.SetPoint(pmrkIdx++, xl, yl, zl);
2296 double xu = avePosition[0] + 0.5 * eigenValue * eigenVector[0];
2297 double yu = avePosition[1] + 0.5 * eigenValue * eigenVector[1];
2298 double zu = avePosition[2] + 0.5 * eigenValue * eigenVector[2];
2300 pl.SetPoint(1, xu, yu, zu);
2301 pmrk.SetPoint(pmrkIdx++, xu, yu, zu);
2318 for(
const auto& daughterIdx : pfPart->
Daughters())
2320 DrawPFParticle3D(pfParticleVec.
at(daughterIdx), pfParticleVec, spacePointVec, edgeAssnsVec, spacePointAssnVec, spHitAssnVec, trackAssnVec, pcAxisAssnVec, cosmicTagAssnVec, depth, view);
2343 for(
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
2347 if(!trackView.
isValid())
continue;
2351 trackView.
fill(trackVec);
2356 for(
const auto&
track : trackVec)
2359 int marker = kFullDotLarge;
2365 if (cosmicTagAssnVec.isValid())
2367 std::vector<const anab::CosmicTag*> tkCosmicTagVec = cosmicTagAssnVec.at(
track.key());
2369 if (!tkCosmicTagVec.empty())
2392 for(
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod) {
2397 for(
size_t s = 0;
s < shower.
vals().size(); ++
s) {
2425 std::map<int, std::vector<const recob::SpacePoint*> > spmap;
2426 int spcolor =
color;
2428 for(
auto &pspt : spts) {
2439 if (pspt->Chisq() < -100.) spcolor = 10;
2443 spcolor = 100 - 2.5 * pspt->Chisq();
2445 if(spcolor < 51) spcolor = 51;
2446 if(spcolor > 100) spcolor = 100;
2448 else if (pspt->Chisq() < -1.) spcolor += 6;
2450 spmap[spcolor].push_back(&*pspt);
2457 for(
auto const icolor : spmap)
2459 int spcolor = icolor.first;
2460 const std::vector<const recob::SpacePoint*>& psps = icolor.second;
2464 TPolyMarker3D& pm = view->
AddPolyMarker3D(psps.size(), spcolor, marker, size);
2466 for(
size_t s = 0;
s < psps.size(); ++
s)
2470 const double *xyz = spt.
XYZ();
2471 pm.SetPoint(
s, xyz[0], xyz[1], xyz[2]);
2494 std::vector<art::Handle<std::vector<recob::Track> > > handles;
2497 for(
auto ih : handles)
2503 const std::string& which = handle.
provenance()->moduleLabel();
2506 if (fmsp.isValid() && fmsp.size() > 0)
2508 int n = handle->size();
2509 float spSize = 0.5 * size;
2511 for(
int i=0; i<
n; ++i)
2516 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
2530 int lineSize = size;
2532 if (lineSize < 1) lineSize = 1;
2536 TPolyMarker3D& pmStart = view->
AddPolyMarker3D(1, 0, marker, 2.*size);
2539 pmStart.SetPoint(0, firstPos.X(), firstPos.Y(), firstPos.Z());
2544 for(
int p = 0; p < np; ++p)
2549 pm.SetPoint(p, pos.X(), pos.Y(), pos.Z());
2555 for(
int p = 0; p < np; ++p)
2561 pl.SetPoint(p, pos.X(), pos.Y(), pos.Z());
2571 for(
int p = 1; p < np; ++p)
2578 auto deltaPos = nextPos - startPos;
2579 double arcLen = deltaPos.Dot(startDir);
2581 if (arcLen < 0.) arcLen = 3.;
2583 auto endPoint = startPos + arcLen * startDir;
2585 pl.SetPoint(0, startPos.X(), startPos.Y(), startPos.Z());
2586 pl.SetPoint(1, endPoint.X(), endPoint.Y(), endPoint.Z());
2608 std::vector<art::Handle<std::vector<recob::Shower> > > handles;
2611 bool noSpts =
false;
2613 for(
auto ih : handles) {
2618 const std::string& which = handle.
provenance()->moduleLabel();
2621 int n = handle->size();
2622 for(
int i=0; i<
n; ++i) {
2624 if(&*p == &shower) {
2626 std::vector<art::Ptr<recob::SpacePoint>> spts;
2641 std::cout<<
"No space points associated with the shower. Drawing a cone instead\n";
2643 auto& dedx = shower.
dEdx();
2646 for(
auto& dedxInPln : dedx) dedxAve += dedxInPln;
2647 dedxAve /= (double)dedx.size();
2651 if(dedxAve > 3 && dedxAve < 5) color = kGreen;
2658 for(
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
2659 auto&
pt = coneRim[ipt];
2660 pl.SetPoint(ipt,
pt[0],
pt[1],
pt[2]);
2663 for(
unsigned short ipt = 0; ipt < coneRim.size(); ++ipt) {
2665 panel.SetPoint(0, startPos.X(), startPos.Y(), startPos.Z());
2666 panel.SetPoint(1, coneRim[ipt][0], coneRim[ipt][1], coneRim[ipt][2]);
2681 r.RotateX(axisDir.X());
2682 r.RotateY(axisDir.Y());
2683 r.RotateZ(axisDir.Z());
2684 constexpr
unsigned short nRimPts = 16;
2685 std::vector<std::array<double, 3>> rimPts(nRimPts + 1);
2686 for(
unsigned short iang = 0; iang < nRimPts; ++iang) {
2687 double rimAngle = iang * 2 * M_PI / (float)nRimPts;
2688 TVector3 rim = {0, 0, 1};
2689 rim.SetX(radius * cos(rimAngle));
2690 rim.SetY(radius * sin(rimAngle));
2694 for(
unsigned short ixyz = 0; ixyz < 3; ++ixyz) rimPts[iang][ixyz] = rim[ixyz];
2697 rimPts[nRimPts] = rimPts[0];
2712 for (
size_t imod = 0; imod < recoOpt->
fVertexLabels.size(); ++imod) {
2721 for(
size_t v = 0; v < vertex.
size(); ++v){
2724 std::vector< art::Ptr<recob::Track> > tracks = fmt.at(v);
2727 for(
size_t t = 0; t < tracks.size(); ++t)
2728 this->
DrawTrack3D(*(tracks[t]), view, vertex[v]->ID());
2733 std::vector< art::Ptr<recob::Shower> > showers = fms.at(v);
2735 for(
size_t s = 0;
s < showers.size(); ++
s)
2740 double xyz[3] = {0.};
2741 vertex[v]->XYZ(xyz);
2743 pm.SetPoint(0, xyz[0], xyz[1], xyz[2]);
2763 for (
size_t imod = 0; imod < recoOpt->
fEventLabels.size(); ++imod) {
2769 if(event.
size() < 1)
continue;
2774 for(
size_t e = 0;
e <
event.size(); ++
e){
2777 std::vector< art::Ptr<recob::Vertex> >
vertex = fmvp.at(
e);
2779 if(vertex.size() < 1)
continue;
2784 for(
size_t v = 0; v < vertex.size(); ++v){
2788 std::vector< art::Ptr<recob::Track> > tracks = fmt.at(v);
2789 std::vector< art::Ptr<recob::Shower> > showers = fms.at(v);
2792 for(
size_t t = 0; t < tracks.size(); ++t)
2795 for(
size_t s = 0;
s < showers.size(); ++
s)
2800 double xyz[3] = {0.};
2801 std::vector<const recob::Vertex*> vts = fmv.at(
e);
2803 event[
e]->PrimaryVertex(vts)->XYZ(xyz);
2805 pm.SetPoint(0, xyz[0], xyz[1], xyz[2]);
2829 for (
size_t i = 0; i<geo->
NTPC(); ++i){
2830 double local[3] = {0.,0.,0.};
2831 double world[3] = {0.,0.,0.};
2840 for(
size_t imod = 0; imod < recoOpt->
fOpFlashLabels.size(); ++imod) {
2846 if(opflashes.
size() < 1)
continue;
2848 int NFlashes = opflashes.
size();
2851 for (
int iof = 0; iof < NFlashes; ++iof) {
2853 if (opflashes[iof]->TotalPE() < recoOpt->
fFlashMinPE)
continue;
2854 if (opflashes[iof]->Time() < recoOpt->
fFlashTMin)
continue;
2855 if (opflashes[iof]->Time() > recoOpt->
fFlashTMax)
continue;
2857 double YCentre = opflashes[iof]->YCenter();
2858 double YHalfWidth = opflashes[iof]->YWidth();
2859 double ZCentre = opflashes[iof]->ZCenter();
2860 double ZHalfWidth = opflashes[iof]->ZWidth();
2865 TBox& b1 = view->
AddBox(YCentre-YHalfWidth, minx, YCentre+YHalfWidth, maxx);
2866 b1.SetFillStyle(3004+(iof%3));
2867 b1.SetFillColor(Colour);
2878 TLine& line = view->
AddLine(ZCentre-ZHalfWidth, xflash, ZCentre+ZHalfWidth, xflash);
2879 line.SetLineWidth(2);
2880 line.SetLineStyle(2);
2881 line.SetLineColor(Colour);
2884 TBox& b1 = view->
AddBox(ZCentre-ZHalfWidth, YCentre-YHalfWidth, ZCentre+ZHalfWidth, YCentre+YHalfWidth);
2885 b1.SetFillStyle(3004+(iof%3));
2886 b1.SetFillColor(Colour);
2887 view->
AddMarker(ZCentre, YCentre, Colour, 4, 1.5);
2897 for(
size_t v = 0; v < vertex.
size(); ++v){
2899 double xyz[3] = {0.};
2900 vertex[v]->XYZ(xyz);
2905 TMarker& strt = view->
AddMarker(xyz[1], xyz[0], color, marker, 1.0);
2906 strt.SetMarkerColor(color);
2909 TMarker& strt = view->
AddMarker(xyz[2], xyz[0], color, marker, 1.0);
2910 strt.SetMarkerColor(color);
2913 TMarker& strt = view->
AddMarker(xyz[2], xyz[1], color, marker, 1.0);
2914 strt.SetMarkerColor(color);
2928 for(
size_t imod = 0; imod < recoOpt->
fVertexLabels.size(); ++imod) {
2955 std::vector<art::InputTag> labels;
2961 for(
size_t imod = 0; imod < labels.size(); ++imod) {
2964 std::vector<art::Ptr<recob::SpacePoint>> spts;
2996 if (pfParticleVec.
size() < 1)
continue;
3002 if (!spacePointAssnVec.isValid())
continue;
3007 if (!pcAxisAssnVec.isValid())
continue;
3010 for(
size_t idx = 0; idx < pfParticleVec.
size(); idx++)
3017 if (!pfParticle->IsPrimary())
continue;
3020 DrawPFParticleOrtho(pfParticle, pfParticleVec, spacePointAssnVec, pcAxisAssnVec, 0, proj, view);
3038 const std::vector<const recob::SpacePoint*>& hitsVec(spacePointAssnVec.at(pfPart->
Self()));
3045 if (!hitsVec.empty())
3047 std::vector<const recob::SpacePoint*> hitPosVec;
3048 std::vector<const recob::SpacePoint*> skeletonPosVec;
3049 std::vector<const recob::SpacePoint*> skelEdgePosVec;
3050 std::vector<const recob::SpacePoint*> edgePosVec;
3051 std::vector<const recob::SpacePoint*> seedPosVec;
3052 std::vector<const recob::SpacePoint*> pairPosVec;
3054 for(
const auto& spacePoint : hitsVec)
3056 if (spacePoint->Chisq() > 0.) hitPosVec.push_back(spacePoint);
3057 else if (spacePoint->Chisq() == -1.) skeletonPosVec.push_back(spacePoint);
3058 else if (spacePoint->Chisq() == -3.) skelEdgePosVec.push_back(spacePoint);
3059 else if (spacePoint->Chisq() == -4.) seedPosVec.push_back(spacePoint);
3060 else if (spacePoint->Chisq() > -10.) edgePosVec.push_back(spacePoint);
3061 else pairPosVec.push_back(spacePoint);
3068 TPolyMarker& pm1 = view->
AddPolyMarker(hitPosVec.size(), colorIdx, kFullDotMedium, 1);
3069 for(
const auto* spacePoint : hitPosVec)
3071 const double* pos = spacePoint->XYZ();
3074 pm1.SetPoint(hitIdx++, pos[0], pos[1]);
3076 pm1.SetPoint(hitIdx++, pos[2], pos[0]);
3078 pm1.SetPoint(hitIdx++, pos[2], pos[1]);
3083 TPolyMarker& pm2 = view->
AddPolyMarker(edgePosVec.size(), 28, kFullDotMedium, 1);
3084 for(
const auto* spacePoint : edgePosVec)
3086 const double* pos = spacePoint->XYZ();
3089 pm2.SetPoint(hitIdx++, pos[0], pos[1]);
3091 pm2.SetPoint(hitIdx++, pos[2], pos[0]);
3093 pm2.SetPoint(hitIdx++, pos[2], pos[1]);
3098 TPolyMarker& pm3 = view->
AddPolyMarker(pairPosVec.size(), 2, kFullDotMedium, 1);
3099 for(
const auto* spacePoint : pairPosVec)
3101 const double* pos = spacePoint->XYZ();
3104 pm3.SetPoint(hitIdx++, pos[0], pos[1]);
3106 pm3.SetPoint(hitIdx++, pos[2], pos[0]);
3108 pm3.SetPoint(hitIdx++, pos[2], pos[1]);
3114 TPolyMarker& pm4 = view->
AddPolyMarker(skeletonPosVec.size(), 1, kFullDotMedium, 1);
3115 for(
const auto* spacePoint : skeletonPosVec)
3117 const double* pos = spacePoint->XYZ();
3120 pm4.SetPoint(hitIdx++, pos[0], pos[1]);
3122 pm4.SetPoint(hitIdx++, pos[2], pos[0]);
3124 pm4.SetPoint(hitIdx++, pos[2], pos[1]);
3129 TPolyMarker& pm5 = view->
AddPolyMarker(skelEdgePosVec.size(), 3, kFullDotMedium, 1);
3130 for(
const auto* spacePoint : skelEdgePosVec)
3132 const double* pos = spacePoint->XYZ();
3135 pm5.SetPoint(hitIdx++, pos[0], pos[1]);
3137 pm5.SetPoint(hitIdx++, pos[2], pos[0]);
3139 pm5.SetPoint(hitIdx++, pos[2], pos[1]);
3144 TPolyMarker& pm6 = view->
AddPolyMarker(seedPosVec.size(), 6, kFullDotMedium, 1);
3145 for(
const auto* spacePoint : seedPosVec)
3147 const double* pos = spacePoint->XYZ();
3150 pm6.SetPoint(hitIdx++, pos[0], pos[1]);
3152 pm6.SetPoint(hitIdx++, pos[2], pos[0]);
3154 pm6.SetPoint(hitIdx++, pos[2], pos[1]);
3159 if (pcAxisAssnVec.isValid())
3161 std::vector<const recob::PCAxis*> pcaVec(pcAxisAssnVec.at(pfPart->
Self()));
3163 if (!pcaVec.empty())
3167 int lineWidth[2] = { 3, 1};
3168 int lineStyle[2] = { 1, 13};
3169 int lineColor[2] = {colorIdx, 18};
3170 int markStyle[2] = { 4, 4};
3175 if (pcaVec.size() > 1 && pcaVec.front()->getID() > pcaVec.back()->getID()) std::reverse(pcaVec.begin(), pcaVec.end());
3177 for(
const auto& pca : pcaVec)
3180 const double* avePosition = pca->getAvePosition();
3184 TPolyMarker& pmrk = view->
AddPolyMarker(7, lineColor[pcaIdx], markStyle[pcaIdx], 1);
3187 pmrk.SetPoint(pmrkIdx++, avePosition[0], avePosition[1]);
3189 pmrk.SetPoint(pmrkIdx++, avePosition[2], avePosition[0]);
3191 pmrk.SetPoint(pmrkIdx++, avePosition[2], avePosition[1]);
3194 for(
int dimIdx = 0; dimIdx < 3; dimIdx++)
3197 TPolyLine& pl = view->
AddPolyLine(numPoints, lineColor[pcaIdx], lineWidth[pcaIdx], lineStyle[pcaIdx]);
3200 double eigenValue = pca->getEigenValues()[dimIdx];
3206 eigenValue = 3.*sqrt(eigenValue);
3209 const std::vector<double>& eigenVector = pca->getEigenVectors()[dimIdx];
3212 double xl = avePosition[0] - 0.5 * eigenValue * eigenVector[0];
3213 double yl = avePosition[1] - 0.5 * eigenValue * eigenVector[1];
3214 double zl = avePosition[2] - 0.5 * eigenValue * eigenVector[2];
3218 pl.SetPoint(0, xl, yl);
3219 pmrk.SetPoint(pmrkIdx++, xl, yl);
3223 pl.SetPoint(0, zl, xl);
3224 pmrk.SetPoint(pmrkIdx++, zl, xl);
3228 pl.SetPoint(0, zl, yl);
3229 pmrk.SetPoint(pmrkIdx++, zl, yl);
3233 double xu = avePosition[0] + 0.5 * eigenValue * eigenVector[0];
3234 double yu = avePosition[1] + 0.5 * eigenValue * eigenVector[1];
3235 double zu = avePosition[2] + 0.5 * eigenValue * eigenVector[2];
3239 pl.SetPoint(1, xu, yu);
3240 pmrk.SetPoint(pmrkIdx++, xu, yu);
3244 pl.SetPoint(1, zu, xu);
3245 pmrk.SetPoint(pmrkIdx++, zu, xu);
3249 pl.SetPoint(1, zu, yu);
3250 pmrk.SetPoint(pmrkIdx++, zu, yu);
3268 for(
const auto& daughterIdx : pfPart->
Daughters())
3295 for(
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
3300 for(
size_t t = 0; t < track.
vals().size(); ++t) {
3302 int color = ptrack->
ID()&65535;
3314 for(
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod) {
3319 for(
size_t s = 0;
s < shower.
vals().size(); ++
s) {
3349 std::map<int, std::vector<art::Ptr<recob::SpacePoint>> > spmap;
3351 for(
auto& pspt : spts){
3363 spcolor = 100 - 2.5 * pspt->Chisq();
3369 spmap[spcolor].push_back(pspt);
3376 for(
auto icolor : spmap) {
3377 int spcolor = icolor.first;
3378 std::vector<art::Ptr<recob::SpacePoint>>& psps = icolor.second;
3383 kFullCircle, msize);
3384 for(
size_t s = 0;
s < psps.size(); ++
s){
3386 const double *xyz = spt.
XYZ();
3389 pm.SetPoint(
s, xyz[0], xyz[1]);
3392 pm.SetPoint(
s, xyz[2], xyz[0]);
3395 pm.SetPoint(
s, xyz[2], xyz[1]);
3399 <<
": unknown projection #" << ((int) proj) <<
"\n";
3425 std::vector<art::Handle<std::vector<recob::Track> > > handles;
3427 for(
auto ih : handles) {
3430 const std::string& which = handle.
provenance()->moduleLabel();
3433 int n = handle->size();
3434 for(
int i=0; i<
n; ++i) {
3437 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
3456 for(
int p = 0; p < np; ++p){
3461 pm.SetPoint(p, pos.X(), pos.Y());
3462 pl.SetPoint(p, pos.X(), pos.Y());
3465 pm.SetPoint(p, pos.Z(), pos.X());
3466 pl.SetPoint(p, pos.Z(), pos.X());
3469 pm.SetPoint(p, pos.Z(), pos.Y());
3470 pl.SetPoint(p, pos.Z(), pos.Y());
3474 <<
": unknown projection #" << ((int) proj) <<
"\n";
3479 int tid = track.
ID()&65535;
3481 char const* txt = s.c_str();
3482 double x = track.
End()(0);
3483 double y = track.
End()(1);
3484 double z = track.
End()(2);
3486 TText& trkID = view->
AddText(x, y, txt);
3488 trkID.SetTextSize(0.03);
3490 TText& trkID = view->
AddText(z, x, txt);
3492 trkID.SetTextSize(0.03);
3494 TText& trkID = view->
AddText(z, y, txt);
3496 trkID.SetTextSize(0.03);
3516 std::vector<art::Handle<std::vector<recob::Shower> > > handles;
3518 for(
auto ih : handles) {
3521 const std::string& which = handle.
provenance()->moduleLabel();
3523 if (!fmsp.isValid())
continue;
3524 int n = handle->size();
3525 for(
int i=0; i<
n; ++i) {
3527 if(&*p == &shower) {
3540 <<
": unknown projection #" << ((int) proj) <<
"\n";
3543 if (fmsp.isValid()){
3544 std::vector<art::Ptr<recob::SpacePoint>> spts = fmsp.at(i);
3568 for(
unsigned int i = 0; i < wcol->size(); ++i){
3575 writeErrMsg(
"GetWires", e);
3578 return wires.
size();
3584 std::vector<const recob::Hit*>&
hits,
3591 std::vector<const recob::Hit*> temp;
3595 for(
size_t t = 0; t < temp.size(); ++t){
3597 if( temp[t]->WireID().Plane == plane &&
3598 temp[t]->WireID().TPC == rawOpt->
fTPC &&
3599 temp[t]->WireID().Cryostat == rawOpt->
fCryostat) hits.push_back(temp[t]);
3603 writeErrMsg(
"GetHits", e);
3622 for(
unsigned int i = 0; i < clcol->size(); ++i){
3629 writeErrMsg(
"GetClusters", e);
3632 return clust.
size();
3648 for(
unsigned int i = 0; i < clcol->size(); ++i)
3656 writeErrMsg(
"GetPFParticles", e);
3659 return clust.
size();
3674 for(
unsigned int i = 0; i < epcol->size(); ++i){
3681 writeErrMsg(
"GetEndPoint2D", e);
3700 for(
unsigned int i = 0; i < opflashcol->size(); ++i){
3704 temp.
swap(opflashes);
3707 writeErrMsg(
"GetOpFlashes", e);
3710 return opflashes.
size();
3726 for(
unsigned int i = 0; i < seedcol->size(); ++i){
3733 writeErrMsg(
"GetSeeds", e);
3736 return seeds.
size();
3752 for(
unsigned int i = 0; i < btbcol->size(); ++i){
3759 writeErrMsg(
"GetBezierTracks", e);
3791 temp.
reserve(edgeCol->size());
3792 for(
unsigned int i = 0; i < edgeCol->size(); ++i)
3801 writeErrMsg(
"GetEdges", e);
3804 return edges.
size();
3816 writeErrMsg(
"GetTracks", e);
3819 return track.
vals().size();
3831 writeErrMsg(
"GetShowers", e);
3834 return shower.
vals().size();
3849 for(
size_t i = 0; i < vcol->size(); ++i){
3856 writeErrMsg(
"GetVertices", e);
3859 return vertex.
size();
3874 for(
size_t i = 0; i < ecol->size(); ++i){
3881 writeErrMsg(
"GetEvents", e);
3884 return event.size();
3890 unsigned int cryostat,
3894 std::vector<const recob::Hit*> temp;
3895 int NumberOfHitsBeforeThisPlane=0;
3897 for(
size_t t = 0; t < temp.size(); ++t){
3898 if( temp[t]->WireID().Cryostat == cryostat&& temp[t]->WireID().TPC == tpc && temp[t]->WireID().Plane == plane )
break;
3899 NumberOfHitsBeforeThisPlane++;
3901 return NumberOfHitsBeforeThisPlane;
3918 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod)
3925 for (
size_t i = 0; i < wires.
size(); ++i)
3928 std::vector<geo::WireID> wireids = geo->
ChannelToWire(wires[i]->Channel());
3930 bool goodWID =
false;
3931 for(
auto const& wid : wireids )
3934 if(wid.Plane == plane &&
3936 wid.TPC == rawOpt->
fTPC &&
3937 wid.Cryostat == rawOpt->
fCryostat) goodWID =
true;
3939 if(!goodWID)
continue;
3941 std::vector<float> wirSig = wires[i]->Signal();
3942 for(
unsigned int ii = 0; ii < wirSig.size(); ++ii)
3943 histo->Fill(1.*ii, wirSig[ii]);
3947 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod)
3951 std::vector<const recob::Hit*>
hits;
3952 this->
GetHits(evt, which, hits, plane);
3958 for (
size_t i = 0; i < hits.size(); ++i)
3961 if(hits[i]->WireID().Wire != wire)
continue;
3964 if (hits[i]->EndTick() > lastEndTick)
3966 if (!roiHitParamsVec.empty()) hitParamsVec.push_back(roiHitParamsVec);
3967 roiHitParamsVec.clear();
3972 hitParams.hitCenter = hits[i]->PeakTime();
3973 hitParams.hitSigma = hits[i]->RMS();
3974 hitParams.hitHeight = hits[i]->PeakAmplitude();
3975 hitParams.hitStart = hits[i]->StartTick();
3976 hitParams.hitEnd = hits[i]->EndTick();
3978 roiHitParamsVec.emplace_back(hitParams);
3980 lastEndTick = hits[i]->EndTick();
3984 if (!roiHitParamsVec.empty()) hitParamsVec.push_back(roiHitParamsVec);
4003 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod) {
4009 for (
unsigned int i=0; i<wires.
size(); ++i) {
4011 std::vector<geo::WireID> wireids = geo->
ChannelToWire(wires[i]->Channel());
4013 bool goodWID =
false;
4014 for(
auto const& wid : wireids ){
4016 if(wid.Plane == plane &&
4017 wid.TPC == rawOpt->
fTPC &&
4018 wid.Cryostat == rawOpt->
fCryostat) goodWID =
true;
4020 if(!goodWID)
continue;
4021 std::vector<float> wirSig = wires[i]->Signal();
4022 for(
unsigned int ii = 0; ii < wirSig.size(); ++ii)
4023 histo->Fill(wirSig[ii]);
4040 std::vector<double>& htau1,
4041 std::vector<double>& htau2,
4042 std::vector<double>& hitamplitudes,
4043 std::vector<double>& hpeaktimes,
4044 std::vector<int>& hstartT,
4045 std::vector<int>& hendT,
4046 std::vector<int>& hNMultiHit)
4055 for (
size_t imod = 0; imod < recoOpt->
fWireLabels.size(); ++imod) {
4061 for (
size_t i = 0; i < wires.
size(); ++i) {
4063 std::vector<geo::WireID> wireids = geo->
ChannelToWire(wires[i]->Channel());
4065 bool goodWID =
false;
4066 for(
auto const& wid : wireids ){
4067 if(wid.Plane == plane &&
4069 wid.TPC == rawOpt->
fTPC &&
4070 wid.Cryostat == rawOpt->
fCryostat) goodWID =
true;
4073 if(!goodWID)
continue;
4075 std::vector<float> wirSig = wires[i]->Signal();
4076 for(
unsigned int ii = 0; ii < wirSig.size(); ++ii)
4077 histo->Fill(1.*ii, wirSig[ii]);
4083 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
4086 std::vector<const recob::Hit*>
hits;
4087 this->
GetHits(evt, which, hits, plane);
4090 const auto & fitParams = hitResults->vectors();
4094 for (
size_t i = 0; i < hits.size(); ++i){
4096 if(hits[i]->WireID().Wire != wire)
continue;
4098 hpeaktimes.push_back(fitParams[FitParamsOffset+i][0]);
4099 htau1.push_back(fitParams[FitParamsOffset+i][1]);
4100 htau2.push_back(fitParams[FitParamsOffset+i][2]);
4101 hitamplitudes.push_back(fitParams[FitParamsOffset+i][3]);
4102 hstartT.push_back(hits[i]->StartTick());
4103 hendT.push_back(hits[i]->EndTick());
4104 hNMultiHit.push_back(hits[i]->Multiplicity());
4118 return (amplitude * exp(0.4*(x-peaktime)/tau1) / ( 1 + exp(0.4*(x-peaktime)/tau2) ) );
4125 std::vector<double> tau1,
4126 std::vector<double> tau2,
4127 std::vector<double> amplitude,
4128 std::vector<double> peaktime)
4132 for(
int i = HitNumber; i < HitNumber+NHits; i++)
4134 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 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)
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)
TVector3 LocationAtPoint(unsigned int p) const
Covariance matrices are either set or not.
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)
TVector3 VertexDirection() const
Covariance matrices are either set or not.
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?
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.
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.
TVector3 DirectionAtPoint(unsigned int p) const
Covariance matrices are either set or not.
void fill(PtrVector< T > &pv) const
int GetEvents(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Event > &event)
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
void push_back(Ptr< U > const &p)
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
Offers proxy::Tracks and proxy::Track class for recob::Track access.
static EventHolder * Instance()
void PFParticle3D(const art::Event &evt, evdb::View3D *view)
std::vector< art::InputTag > fPFParticleLabels
module labels that produced PFParticles
std::vector< art::InputTag > 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)
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
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 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.
Provides recob::Track data product.
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)
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
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)
const double * XYZ() const
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)
TVector3 Vertex() const
Covariance matrices are either set or not.
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
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.
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)
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.
TVector3 End() const
Covariance matrices are either set or not.
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)
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