RecoBaseDrawer.cxx
Go to the documentation of this file.
1 /// \file RecoBaseDrawer.cxx
2 /// \brief Class to aid in the rendering of RecoBase objects
3 /// \author messier@indiana.edu
4 /// \version $Id: RecoBaseDrawer.cxx,v 1.37 2012-08-09 23:38:31 bckhouse Exp $
5 ///
7 
8 #include <cmath>
9 #include <map>
10 #include "TBox.h"
11 #include "TH1.h"
12 #include "TLine.h"
13 #include "TMarker.h"
14 #include "TPolyMarker.h"
15 #include "TPolyLine.h"
16 #include "TPolyLine3D.h"
17 
22 
27 
31 #include "Geometry/Geometry.h"
33 #include "RecoBase/CellHit.h"
34 #include "RecoBase/Cluster.h"
35 #include "RecoBase/HoughResult.h"
36 #include "RecoBase/Prong.h"
37 #include "RecoBase/Track.h"
38 #include "RecoBase/Vertex.h"
39 #include "Utilities/func/MathUtil.h"
40 
41 namespace evd
42 {
43  //....................................................................
45  {
46  }
47 
48  //......................................................................
49 
51  {
52 
53  }
54 
55  //......................................................................
56 
57  ///
58  /// Render CellHit objects on a 2D viewing canvas
59  ///
60  /// @param evt : Event handle to get data objects from
61  /// @param which : Which collection of object to render
62  /// @param xzview : Pointer to X-Z view to draw on
63  /// @param yzview : Pointer to Y-Z view to draw on
64  ///
66  evdb::View2D* xzview,
67  evdb::View2D* yzview)
68  {
70 
72  return;
73 
75 
78 
79  std::vector<const rb::Cluster*> slicesToNavigate = nav->SlicesToNavigate(evt);
80  std::vector<const rb::CellHit*> unfiltHits;
81  for(int i=0, n = slicesToNavigate.size(); i < n; ++i ){
82  for( int c = 0, nc = slicesToNavigate[i]->NCell(); c < nc; ++c)
83  unfiltHits.push_back( slicesToNavigate[i]->Cell(c).get());
84  }
85 
86  //std::cout << recoopt->fCellHitModules.size() << " modules found with cell hits." << std::endl;
87 
88  for (unsigned int imod=0; imod<recoopt->fCellHitModules.size(); ++imod) {
89  const std::string& which = recoopt->fCellHitModules[imod].c_str();
90  const std::string& instance = recoopt->fCellHitInstances[imod];
91 
92  std::vector<const rb::CellHit*> cellhits;
93  nav->GetProducts(evt, which, instance, cellhits);
94 
95  // Display all hits on the two 2D views provided
96  for (unsigned int i=0; i<cellhits.size(); ++i) {
97  const rb::CellHit* h = cellhits[i];
98  evdb::View2D* v = 0;
99 
100  // Select which view to draw this cell hit on
101  if (h->View() == geo::kX) v = xzview;
102  if (h->View() == geo::kY) v = yzview;
103  if (v==0) continue;
104 
105  // Try to get the "best" charge measurement, ie. the one last in
106  // the calibration chain
107  float q = h->PE();
108  float t = (h->TNS())/1000.0; // thisto is binned in usec
109 
110  // Render cell hits as markers with size and color encoding time
111  // and charge
112  double dz = geo->Plane(h->Plane())->Cell(h->Cell())->HalfD();
113  double dv = geo->Plane(h->Plane())->Cell(h->Cell())->HalfW();
114  double zpos=0;
115  double vpos=0;
116 
117  double xyz[3];
118  geo->Plane(h->Plane())->Cell(h->Cell())->GetCenter(xyz);
119  zpos = xyz[2];
120  if (h->View() == geo::kX) vpos = xyz[0];
121  else vpos = xyz[1];
122 
123  double sf = this->ScaleFactor(t, q);
124  //double q0 = 400.0;
125  int c = 1;
127  switch (rawopt->fColor) {
129  c = colors->Scale("CalQ").GetColor(q);
130  break;
132  c = colors->Scale("CalT").GetColor(t);
133  //sf = sqrt(q/q0);
134  //if (sf>1.0) sf = 1.0;
135  break;
136  default:
137  c = 1;
138  }
139  c = this->DimOutOfTime(t, t, c);
140  if(nav->DimHits() == true) c = this->DimFiltered( h, unfiltHits, c );
141 
142  TBox& b1 = v->AddBox(zpos-sf*dz, vpos-sf*dv, zpos+sf*dz, vpos+sf*dv);
143  b1.SetFillStyle(1001);
144  b1.SetFillColor(c);
145  b1.SetBit(kCannotPick);
146  }
147  } // loop on imod folders
148  }
149 
150  //......................................................................
151 
152  ///
153  /// Render CellHit objects on a 3D viewing canvas
154  ///
155  /// @param evt : Event handle to get data objects from
156  /// @param which : Which collection of object to render
157  /// @param view : Pointer to 3D viewer
158  ///
161  {
163  if (rawopt->fWhichHits!=evd::RawDrawingOptions::kCAL_HITS) return;
165 
168 
169  for (unsigned int imod=0; imod<drawopt->fCellHitModules.size(); ++imod) {
170  const char* which = drawopt->fCellHitModules[imod].c_str();
171  const std::string& instance = drawopt->fCellHitInstances[imod];
172 
173  std::vector<const rb::CellHit*> cellhits;
174  nav->GetProducts(evt, which, instance, cellhits);
175 
176  // Display all hits on the two 2D views provided
177  for (unsigned int i=0; i<cellhits.size(); ++i) {
178  const rb::CellHit* h = cellhits[i];
179 
180  // Try to get the "best" charge measurement, ie. the one last in
181  // the calibration chain
182  float q=h->PE();
183  // if (h->IsA()==rb::RecoHit::Class()) {
184  // q = ((rb::RecoHit*)h)->GeV(); // or MIP or PECorr()
185  // }
186 
187  float t=h->TNS();
188  // if (h->IsA()==rb::RecoHit::Class()) {
189  // t = ((rb::RecoHit*)h)->T();
190  // }
191 
192  // Render cell hits as markers with size and color encoding time
193  // and charge
194  static evdb::ColorScale tscale(0.0,30.0);
195  int c = tscale(t);
196  double q0 = 1.0;
197  double sz = 0.3*sqrt(q/q0);
198 
199  c = this->DimOutOfTime(t,t,c);
200 
201  TPolyLine3D& p = view->AddPolyLine3D(5,c,1,2);
202  double x1, x2, y1, z1, z2;
203  // double y2; // i get set but am not used
204 
205  double xyz[3];
206  geo->Plane(h->Plane())->Cell(h->Cell())->GetCenter(xyz);
207 
208  // if (h->IsA()==rb::RecoHit::Class()) {
209  // z1 = ((rb::RecoHit*)h)->Z();
210  // if (h->View() == geo::kX) {
211  // x1 = ((rb::RecoHit*)h)->V();
212  // y1 = xyz[1];
213  // }
214  // else {
215  // y1 = ((rb::RecoHit*)h)->V();
216  // x1 = xyz[1];
217  // }
218  // }
219  // else {
220  z1 = xyz[2];
221  if (h->View() == geo::kX) {
222  x1 = xyz[0];
223  y1 = xyz[1];
224  }
225  else {
226  x1 = xyz[1];
227  y1 = xyz[0];
228  }
229  // }
230 
231  x2 = x1+sz;
232  //y2 = y1+sz; // i am not used anywhere
233  z2 = z1+sz;
234  x1 -= sz;
235  y1 -= sz;
236  z1 -= sz;
237 
238  p.SetPoint(0,x1-sz,y1,z1);
239  p.SetPoint(1,x1+sz,y1,z1);
240  p.SetPoint(2,x2,y1,z2);
241  p.SetPoint(1,x1,y1,z2);
242  p.SetPoint(0,x1,y1,z1);
243 
244  } // loop on i cell hits
245  } // loop on imod folders
246  }
247 
248  double RecoBaseDrawer::ScaleFactor(double /*t*/,double q)
249 {
251 
252  double sf = drawopt->fScaleFactor;
253  double q0 = 3.0;
255  {
256  sf *= 0.3*sqrt(q/q0);
257  }
258  return sf;
259 }
260 
261  //......................................................................
262  void RecoBaseDrawer::DrawCluster2D(std::vector<const rb::Cluster*>& clusts,
263  evdb::View2D* xzview,
264  evdb::View2D* yzview,
265  std::vector<int>& clustIndex)
266  {
269 
270  bool drawAsMarkers = false;
271  bool drawAsBoxes = false;
272  bool drawAsHulls = false;
274  drawAsMarkers = true;
275  }
277  drawAsBoxes = true;
278  }
280  drawAsHulls = true;
281  }
282 
283 
284  for (unsigned int iClust=0; iClust<clusts.size(); ++iClust) {
285  const rb::Cluster* c = clusts[iClust];
286 
287  std::vector< int > clustIndex;
288  bool drawThisCluster = clustIndex.empty();
289 
290  // if the indices have been provided, check whether or
291  // not this cluster should be drawn
292  for(int index = 0; index < (int)clustIndex.size(); index++){
293  if( clustIndex[index] == -1 || clustIndex[index] == (int)iClust)
294  drawThisCluster = true;
295  }
296 
297  // Start color index further down for 2D prongs
298  unsigned int coloridx = 0;
299  if(c->Is2D()) coloridx = 5;
300 
301  // Don't render "noise" clusters or clusters you don't want to draw
302  if (c->IsNoise() || !drawThisCluster ) continue;
303 
304  if (drawAsMarkers) {
305  // draw cluster with unique marker
306  int color = this->GetClusterColor(iClust+coloridx);
307  color = this->DimOutOfTime(c->MinTNS(),c->MaxTNS(),color);
308 
309  if(xzview){
310  TPolyMarker& pm = xzview->AddPolyMarker(c->NXCell(),
311  color,
312  kFullCircle, 0.8);
313  for(unsigned int hitIdx = 0; hitIdx < c->NXCell(); ++hitIdx){
314  const art::Ptr<rb::CellHit>& h = c->XCell(hitIdx);
315  double xyz[3];
316  geo->Plane(h->Plane())->Cell(h->Cell())->GetCenter(xyz);
317  pm.SetPoint(hitIdx, xyz[2], xyz[0]);
318  }
319  } // end if xzview
320  if(yzview){
321  TPolyMarker& pm = yzview->AddPolyMarker(c->NYCell(),
322  color,
323  kFullCircle, 0.8);
324  for(unsigned int hitIdx = 0; hitIdx < c->NYCell(); ++hitIdx){
325  const art::Ptr<rb::CellHit>& h = c->YCell(hitIdx);
326  double xyz[3];
327  geo->Plane(h->Plane())->Cell(h->Cell())->GetCenter(xyz);
328  pm.SetPoint(hitIdx, xyz[2], xyz[1]);
329  }
330  } // end if yzview
331  }
332 
333  if(drawAsBoxes || drawAsHulls){
334  std::vector<double> xzZpts, xzXpts;
335  std::vector<double> yzZpts, yzYpts;
336 
337  if (drawAsBoxes) {
338  this->GetClusterOutlines(c, geo::kX, xzXpts, xzZpts);
339  this->GetClusterOutlines(c, geo::kY, yzYpts, yzZpts);
340  }
341  else if (drawAsHulls) {
342  this->GetClusterOutlinesConvexHull(c, geo::kX, xzXpts, xzZpts);
343  this->GetClusterOutlinesConvexHull(c, geo::kY, yzYpts, yzZpts);
344  }
345 
346  bool isX = !xzZpts.empty();
347  bool isY = !yzZpts.empty();
348  int lcolor = this->GetClusterColor(iClust);
349  int fcolor = (isX && isY) ? lcolor : 17; // fill color
350  int width = 1; // line width
351  int style = 1; // 1=solid line style
352 
353  lcolor = this->DimOutOfTime(c->MinTNS(), c->MaxTNS(), lcolor);
354  fcolor = this->DimOutOfTime(c->MinTNS(), c->MaxTNS(), fcolor);
355 
356  if (isX && xzview) {
357  TPolyLine& p1 = xzview->AddPolyLine(xzZpts.size(),
358  lcolor,
359  width,
360  style);
361  TPolyLine& p2 = xzview->AddPolyLine(xzZpts.size(),
362  lcolor,
363  width,
364  style);
365  p1.SetOption("f");
366  p1.SetFillStyle(3003);
367  p1.SetFillColor(fcolor);
368  for (unsigned int i=0; i<xzZpts.size(); ++i) {
369  p1.SetPoint(i, xzZpts[i], xzXpts[i]);
370  p2.SetPoint(i, xzZpts[i], xzXpts[i]);
371  } // loop on i points in ZX view
372  } // if we have a cluster in the ZX view
373  if (isY && yzview) {
374  TPolyLine& p1 = yzview->AddPolyLine(yzZpts.size(),
375  lcolor,
376  width,
377  style);
378  TPolyLine& p2 = yzview->AddPolyLine(yzZpts.size(),
379  lcolor,
380  width,
381  style);
382  p1.SetOption("f");
383  p1.SetFillStyle(3003);
384  p1.SetFillColor(fcolor);
385  for (unsigned int i=0; i<yzZpts.size(); ++i) {
386  p1.SetPoint(i, yzZpts[i], yzYpts[i]);
387  p2.SetPoint(i, yzZpts[i], yzYpts[i]);
388  } // loop on i points in ZY view
389  } // if we have a cluster in the ZY view
390  }
391  } // loop on iClust clusters
392  }
393 
394  //......................................................................
395 
397  evdb::View2D* xzview,
398  evdb::View2D* yzview)
399  {
401  if(drawopt->fClusterStyle == 0) return;
402 
404 
405  for (unsigned int imod=0; imod<drawopt->fClusterModules.size(); ++imod) {
406  const std::string& which = drawopt->fClusterModules[imod];
407  const std::string& instance = drawopt->fClusterInstances[imod];
408 
409  std::vector<const rb::Cluster*> clust;
410  nav->GetProducts(evt, which, instance, clust);
411 
412  DrawCluster2D(clust, xzview, yzview, drawopt->fClusterIndex[imod]);
413 
414  } // loop on imod folders
415  }
416 
417  //......................................................................
418 
420  evdb::View3D* /*view*/)
421  {
422 
423  }
424 
425  //......................................................................
426 
428  evdb::View2D* xzview,
429  evdb::View2D* yzview)
430  {
432  if(drawopt->fOfflineChanOpt == evd::RecoDrawingOptions::kOFF) return;
433 
436 
437  for(unsigned int imod = 0; imod < drawopt->fOfflineChanModules.size(); ++imod){
438  const char* which = drawopt->fOfflineChanModules[imod].c_str();
439  const std::string& instance = drawopt->fOfflineChanInstances[imod];
440 
441  std::vector<const geo::OfflineChan*> chans;
442  nav->GetProducts(evt, which, instance, chans);
443  for(unsigned int chanIdx = 0; chanIdx < chans.size(); ++chanIdx){
444  const geo::OfflineChan* c = chans[chanIdx];
445 
446  const geo::View_t view = geom->Plane(c->Plane())->View();
447 
448  evdb::View2D* viewobj = (view == geo::kX) ? xzview : yzview;
449  if(!viewobj) continue;
450 
451  double xyz[3];
452  geom->Plane(c->Plane())->Cell(c->Cell())->GetCenter(xyz);
453 
454  int color = GetClusterColor(imod);
455  // color = this->DimOutOfTime(c->MinTNS(), c->MaxTNS(), color);
456 
457  viewobj->AddMarker(xyz[2], xyz[view],
458  color,
459  kFullCircle, 0.8);
460  } // end for chanIdx
461  } // end for imod
462  }
463 
464  //......................................................................
465 
466  ///
467  /// Make a set of points which outline a cluster
468  ///
469  /// @param c : Reco base cluster to outline
470  /// @param view : Detector view to consider
471  /// @param vzXpts : X or Y coordinates of points in XZ or YZ view that outline cluster
472  /// @param vzZpts : Z coordinates of points in XZ ir YZ view that outline cluster
473  ///
475  int viewint,
476  std::vector<double>& vzVpts,
477  std::vector<double>& vzZpts)
478  {
480 
481  geo::View_t view = geo::View_t(viewint);
482 
483  const int ncell = c->NCell(view);
484  if(ncell == 0) return;
485 
486  // Map plane numbers to highest and lowest cells in the plane
487  std::map<int,int> celllo, cellhi;
488  // On first pass, initialize
489  for (int j=0; j<ncell; ++j) {
490  const int plane = c->Cell(view, j)->Plane();
491  const int cell = c->Cell(view, j)->Cell();
492  celllo[plane] = cell;
493  cellhi[plane] = cell;
494  }
495  // Finalize on second pass
496  for (int j=0; j<ncell; ++j) {
497  const int plane = c->Cell(view, j)->Plane();
498  const int cell = c->Cell(view, j)->Cell();
499  if (cell < celllo[plane]) celllo[plane] = cell;
500  if (cell > cellhi[plane]) cellhi[plane] = cell;
501  }
502 
503  // Loop over planes and low cells to make lines along bottom
504  // edge. Work from upstream edge to downstream edge
505  std::map<int,int>::iterator itr (celllo.begin());
506  std::map<int,int>::iterator itrEnd(celllo.end());
507  for (; itr!=itrEnd; ++itr) {
508  const int plane = itr->first;
509  const int cell = itr->second;
510  double pos[3], dpos[3];
511  geo->CellInfo(plane, cell, &view, pos, dpos);
512 
513  vzZpts.push_back(pos[2]-dpos[2]);
514  vzVpts.push_back(pos[view]-dpos[view]);
515 
516  vzZpts.push_back(pos[2]+dpos[2]);
517  vzVpts.push_back(pos[view]-dpos[view]);
518  }
519 
520  // Loop over planes and high cells to make lines along top
521  // edge. Work from downstream edge toward upstream edge
522  std::map<int,int>::reverse_iterator ritr (cellhi.rbegin());
523  std::map<int,int>::reverse_iterator ritrEnd(cellhi.rend());
524  for (; ritr!=ritrEnd; ++ritr) {
525  const int plane = ritr->first;
526  const int cell = ritr->second;
527  double pos[3], dpos[3];
528  geo->CellInfo(plane, cell, &view, pos, dpos);
529 
530  vzZpts.push_back(pos[2]+dpos[2]);
531  vzVpts.push_back(pos[view]+dpos[view]);
532 
533  vzZpts.push_back(pos[2]-dpos[2]);
534  vzVpts.push_back(pos[view]+dpos[view]);
535  }
536 
537  // Add link to starting point to close the box
538  vzZpts.push_back(vzZpts[0]);
539  vzVpts.push_back(vzVpts[0]);
540  }
541 
542  //......................................................................
543 
544  void RecoBaseDrawer::
546  int viewint,
547  std::vector<double>& vzVpts,
548  std::vector<double>& vzZpts) const
549  {
550  // This is the "wrapping-paper" algorithm
551 
552  const geo::View_t view = geo::View_t(viewint);
553 
554  std::vector<double> vs;
555  std::vector<double> zs;
556 
558 
559  for(unsigned int cellIdx = 0; cellIdx < c->NCell(view); ++cellIdx){
560  const art::Ptr<rb::CellHit>& chit = c->Cell(view, cellIdx);
561  const geo::CellGeo* geocell = geom->Plane(chit->Plane())->Cell(chit->Cell());
562  double xyz[3];
563  geocell->GetCenter(xyz);
564  const double v0 = xyz[view];
565  const double z0 = xyz[2];
566  const double dv = geocell->HalfW();
567  const double dz = geocell->HalfD();
568  vs.push_back(v0-dv); zs.push_back(z0-dz);
569  vs.push_back(v0-dv); zs.push_back(z0+dz);
570  vs.push_back(v0+dv); zs.push_back(z0+dz);
571  vs.push_back(v0+dv); zs.push_back(z0-dz);
572  } // end for cellIdx
573 
574  const unsigned int N = vs.size();
575  if(N == 0) return;
576 
577  unsigned int minIdx = 0;
578 
579  double minz = +1e10;
580  for(unsigned int n = 0; n < N; ++n){
581  if(zs[n] < minz){
582  minz = zs[n];
583  minIdx = n;
584  }
585  } // end for n
586 
587  vzVpts.push_back(vs[minIdx]);
588  vzZpts.push_back(zs[minIdx]);
589 
590  // The way the "wrapping-paper" is pointing. We're working clockwise from the far left.
591  double dv = 1;
592  double dz = 0;
593  unsigned int curIdx = minIdx;
594 
595  while(true){
596  const double curV = vs[curIdx];
597  const double curZ = zs[curIdx];
598 
599  double bestDot = -2;
600  int bestIdx = -1;
601  for(unsigned int n = 0; n < N; ++n){
602  if(n == curIdx) continue;
603 
604  const double ourdV = vs[n]-curV;
605  const double ourdZ = zs[n]-curZ;
606  const double dot = (ourdV*dv+ourdZ*dz)/util::pythag(ourdV, ourdZ);;
607  // Need to give the starting point a little bit of an advantage,
608  // otherwise we can miss it out and end up in an infinite loop.
609  if(dot > bestDot+((bestIdx == int(minIdx)) ? 1e-6 : 0) ||
610  (dot > bestDot-1e-3 && n == minIdx)){
611  bestDot = dot;
612  bestIdx = n;
613  }
614  } // end for n
615 
616  assert(bestIdx >= 0);
617 
618  vzVpts.push_back(vs[bestIdx]);
619  vzZpts.push_back(zs[bestIdx]);
620 
621  dv = vs[bestIdx]-vs[curIdx];
622  dz = zs[bestIdx]-zs[curIdx];
623  const double mag = util::pythag(dv, dz);
624  dv /= mag;
625  dz /= mag;
626  curIdx = bestIdx;
627 
628  if(curIdx == minIdx) break;
629  }
630 
631  /*
632  double area = 0;
633  for(unsigned int n = 1; n < vzZpts.size()-2; ++n){
634  const double xprod = (vzZpts[n+1]-vzZpts[0])*(vzVpts[n]-vzVpts[0])-(vzVpts[n+1]-vzVpts[0])*(vzZpts[n]-vzZpts[0]);
635  assert(xprod > -1e-6);
636  area += xprod/2;
637  }
638  */
639  }
640 
641  //......................................................................
642 
643  void RecoBaseDrawer::
644  DrawHoughResults2D(std::vector<const rb::HoughResult*>& htr,
645  evdb::View2D* xzv,
646  evdb::View2D* yzv)
647  {
652 
653  bool colorByIndex =
655 
656  for (unsigned int i=0; i<htr.size(); ++i) {
657  double tave = 0.5*(htr[i]->fTNSlo+htr[i]->fTNShi)/1000.0;
658  int c = colors->Scale("RawT").GetColor(tave);
659 
660  for (unsigned int j=0; j<htr[i]->fPeak.size(); ++j) {
661  if (colorByIndex) c = this->GetClusterColor(j);
662  c = this->DimOutOfTime(htr[i]->fTNSlo, htr[i]->fTNShi, c);
663 
664  //
665  // Extract line segment parameters and intersect with detector sides
666  //
667  double m, b;
668  htr[i]->SlopeIcept(j, &m, &b);
669 
670  double x1=0, x2=0;
671  if (htr[i]->fView == geo::kX) {
672  x1 = geom->DetHalfWidth();
673  x2 = -geom->DetHalfWidth();
674  }
675  else {
676  x1 = geom->DetHalfHeight();
677  x2 = -geom->DetHalfHeight();
678  }
679 
680  double z1, z2;
681  z1 = (x1-b)/m;
682  z2 = (x2-b)/m;
683 
684  if (z1<0.0) { z1 = 0.0; x1 = m*z1+b;}
685  if (z1>geom->DetLength()) { z1 = geom->DetLength(); x1 = m*z1+b;}
686  if (z2<0.0) { z2 = 0.0; x2 = m*z2+b;}
687  if (z2>geom->DetLength()) { z2 = geom->DetLength(); x2 = m*z2+b;}
688 
689  if (xzv && htr[i]->fView==geo::kX) {
690  TLine& l = xzv->AddLine(z1, x1, z2, x2);
691  l.SetLineColor(c);
692  l.SetLineStyle(1);
693  }
694 
695  if (yzv && htr[i]->fView==geo::kY) {
696  TLine& l = yzv->AddLine(z1, x1, z2, x2);
697  l.SetLineColor(c);
698  l.SetLineStyle(1);
699  }
700  }
701  }
702  }
703 
704  //......................................................................
705 
706  void RecoBaseDrawer::DrawVertices2D(std::vector<const rb::Vertex*>& vert,
707  evdb::View2D* xzview,
708  evdb::View2D* yzview,
709  std::vector< int >& vertexIndex)
710  {
711 
714 
715  const int mstyle = 28; //set marker style (cross)
716  const double msize = 2.0; //set marker size
717 
718  for (unsigned int i=0; i<vert.size(); ++i) {
719 
720  bool drawThisVertex = false;
721  if( vertexIndex.empty() )
722  drawThisVertex = true;
723 
724  for(int index = 0; index < (int)vertexIndex.size(); index++){
725  if( vertexIndex[index] == -1 || vertexIndex[index] == (int)i)
726  drawThisVertex = true;
727  }
728 
729  if(!drawThisVertex) continue;
730 
731  const double x = vert[i]->GetX();
732  const double y = vert[i]->GetY();
733  const double z = vert[i]->GetZ();
734  const double t = vert[i]->GetT();
735 
736  int col = GetClusterColor(i+6);// Start this color at i=6
737  col = this->DimOutOfTime(t, t, col);
738 
739  if (xzview) xzview->AddMarker(z,x,col,mstyle,msize);
740  if (yzview) yzview->AddMarker(z,y,col,mstyle,msize);
741  }
742  }
743 
744  //......................................................................
745 
746  void RecoBaseDrawer::DrawProng2D(std::vector<const rb::Prong*>& prong,
747  evdb::View2D* xzview,
748  evdb::View2D* yzview,
749  std::vector< int >& prongIndex)
750  {
754 
755  // Render prongs at 5 meters by default
756  double ds_default = 500.0;
757 
758  for (unsigned int i=0; i<prong.size(); ++i) {
759 
760 
761  bool drawThisProng = false;
762  if( prongIndex.empty() )
763  drawThisProng = true;
764 
765  for(int index = 0; index < (int)prongIndex.size(); index++){
766  if( prongIndex[index] == -1 || prongIndex[index] == (int)i)
767  drawThisProng = true;
768  }
769 
770  if (xzview && prong[i]->View() != geo::kY && drawThisProng) {
771  const double x0 = prong[i]->Start().X();
772  const double z0 = prong[i]->Start().Z();
773  const double dx = prong[i]->Dir().X();
774  const double dz = prong[i]->Dir().Z();
775  double ds = prong[i]->TotalLength();
776  if (ds==0.0) ds = ds_default;
777 
778  int color = this->GetClusterColor(i);
779  color =
780  this->DimOutOfTime(prong[i]->MinTNS(), prong[i]->MaxTNS(),color);
781 
782  TLine& pzx = xzview->AddLine(z0, x0, z0+ds*dz, x0+ds*dx);
783  pzx.SetLineColor(color);
784  pzx.SetLineWidth(2);
785  pzx.SetLineStyle(2);
786  }
787  if (yzview && prong[i]->View() != geo::kX && drawThisProng) {
788  const double y0 = prong[i]->Start().Y();
789  const double z0 = prong[i]->Start().Z();
790  const double dy = prong[i]->Dir().Y();
791  const double dz = prong[i]->Dir().Z();
792  double ds = prong[i]->TotalLength();
793  if (ds==0.0) ds = ds_default;
794 
795  int color = this->GetClusterColor(i);
796  color = this->DimOutOfTime(prong[i]->MinTNS(),
797  prong[i]->MaxTNS(),
798  color);
799 
800  TLine& pzy = yzview->AddLine(z0, y0, z0+ds*dz, y0+ds*dy);
801  pzy.SetLineColor(color);
802  pzy.SetLineWidth(2);
803  pzy.SetLineStyle(2);
804  }
805  }
806  }
807 
808  //......................................................................
809 
810  void RecoBaseDrawer::DrawTrack2D(std::vector<const rb::Track*>& trks,
811  evdb::View2D* xzview,
812  evdb::View2D* yzview,
813  std::vector< int >& trackIndex)
814  {
817 
818  bool orthoHits =
820 
821  const size_t trkMax = trks.size();
822  for(size_t trkIdx = 0; trkIdx < trkMax; ++trkIdx){
823  const rb::Track* trk = trks[trkIdx];
824 
825  bool drawThisTrack = false;
826  if( trackIndex.empty() )
827  drawThisTrack = true;
828 
829  for(int index = 0; index < (int)trackIndex.size(); index++){
830  if( trackIndex[index] == -1 || trackIndex[index] == (int)trkIdx)
831  drawThisTrack = true;
832  }
833 
834  if(trk->NTrajectoryPoints() < 2 || !drawThisTrack ) continue;
835 
836  int col = GetClusterColor(trkIdx);
837  col = this->DimOutOfTime(trk->MinTNS(), trk->MaxTNS(), col);
838 
839  TPolyLine* px = 0;
840  TPolyLine* py = 0;
841  if(xzview && trk->View() != geo::kY)
842  px = &xzview->AddPolyLine(trk->NTrajectoryPoints(), col, 2, 2);
843  if(yzview && trk->View() != geo::kX)
844  py = &yzview->AddPolyLine(trk->NTrajectoryPoints(), col, 2, 2);
845 
846  for(size_t n = 0; n < trk->NTrajectoryPoints(); ++n){
847  const double x = trk->TrajectoryPoint(n).X();
848  const double y = trk->TrajectoryPoint(n).Y();
849  const double z = trk->TrajectoryPoint(n).Z();
850 
851  if(px) px->SetPoint(n, z, x);
852  if(py) py->SetPoint(n, z, y);
853  } // end for n
854 
855  if (orthoHits) {
856  const unsigned int cellMax = trk->NCell();
857  for(unsigned int cellIdx = 0; cellIdx < cellMax; ++cellIdx){
858  art::Ptr<rb::CellHit> chit = trk->Cell(cellIdx);
859 
860  const double w = trk->W(chit.get());
861 
862  double xyz[3];
863  geom->Plane(chit->Plane())->Cell(chit->Cell())->GetCenter(xyz);
864  const double z = xyz[2];
865 
866  if(chit->View() == geo::kX && yzview){
867  yzview->AddMarker(z, w, col, kFullCircle, .75);
868  }
869  if(chit->View() == geo::kY && xzview){
870  xzview->AddMarker(z, w, col, kFullCircle, .75);
871  }
872  } // end for cellIdx
873  } // end if
874  } // end for trkIdx
875  }
876 
877  //......................................................................
878 
879  void RecoBaseDrawer::DrawProng3D(std::vector<const rb::Prong*>& prong,
881  std::vector< int >& prongIndex)
882  {
883 
884  for (unsigned int i=0; i<prong.size(); ++i) {
885 
886 
887  bool drawThisProng = false;
888  if( prongIndex.empty() )
889  drawThisProng = true;
890 
891  for(int index = 0; index < (int)prongIndex.size(); index++){
892  if( prongIndex[index] == -1 || prongIndex[index] == (int)i)
893  drawThisProng = true;
894  }
895 
896  if(!drawThisProng )
897  continue;
898 
899  int color = this->GetClusterColor(i);
900  color = this->DimOutOfTime(prong[i]->MinTNS(),
901  prong[i]->MaxTNS(),
902  color);
903 
904  TPolyLine3D& p = view->AddPolyLine3D(2,color,1,1);
905 
906  const double x0 = prong[i]->Start().X();
907  const double y0 = prong[i]->Start().Y();
908  const double z0 = prong[i]->Start().Z();
909 
910  const double dx = prong[i]->Dir().X();
911  const double dy = prong[i]->Dir().Y();
912  const double dz = prong[i]->Dir().Z();
913 
914  p.SetPoint(0, x0, y0, z0);
915  // Prong line is always 5 m long
916  p.SetPoint(1, x0+500*dx, y0+500*dy, z0+500*dz);
917  }
918 
919  }
920 
921  //......................................................................
922 
923  void RecoBaseDrawer::DrawTrack3D(std::vector<const rb::Track*>& track,
925  std::vector< int >& trackIndex)
926  {
927 
928  for(unsigned int i = 0; i < track.size(); ++i){
929 
930  bool drawThisTrack = false;
931  if( trackIndex.empty() )
932  drawThisTrack = true;
933 
934  for(int index = 0; index < (int)trackIndex.size(); index++){
935  if( trackIndex[index] == -1 || trackIndex[index] == (int)i)
936  drawThisTrack = true;
937  }
938 
939  if(track[i]->NTrajectoryPoints() < 2 || !drawThisTrack) continue;
940 
941  int color = this->GetClusterColor(i);
942  color = this->DimOutOfTime(track[i]->MinTNS(),
943  track[i]->MaxTNS(),
944  color);
945  TPolyLine3D& p = view->AddPolyLine3D(2,color,1,1);
946  for(unsigned int n = 0; n < track[i]->NTrajectoryPoints(); ++n){
947  const double x = track[i]->TrajectoryPoint(n).X();
948  const double y = track[i]->TrajectoryPoint(n).Y();
949  const double z = track[i]->TrajectoryPoint(n).Z();
950 
951  p.SetPoint(n, x , y , z);
952  }
953  }
954  }
955 
956  //......................................................................
957 
959  evdb::View2D* xzview,
960  evdb::View2D* yzview)
961  {
963 
964  if(drawopt->fVertexOpt == evd::RecoDrawingOptions::kOFF) return;
965 
967 
968  unsigned int imod;
969  for (imod=0; imod<drawopt->fVertexModules.size(); ++imod) {
970  std::string const& which = drawopt->fVertexModules[imod];
971  std::string const& instance = drawopt->fVertexInstances[imod];
972 
973  std::vector<const rb::Vertex*> vert;
974  nav->GetProducts(evt, which, instance, vert);
975  std::vector<int> vertexIndex;
976  if( drawopt->fVertexIndex.size() > imod )
977  vertexIndex = drawopt->fVertexIndex[imod];
978 
979  this->DrawVertices2D(vert, xzview, yzview, vertexIndex);
980  }
981  }
982 
983  //......................................................................
985  evdb::View2D* xzview,
986  evdb::View2D* yzview)
987  {
990  unsigned int imod;
991 
992  if(drawopt->fHoughOpt == evd::RecoDrawingOptions::kOFF) return;
993 
994  for (imod=0; imod<drawopt->fHoughResultModules.size(); ++imod) {
995  std::string const& which = drawopt->fHoughResultModules[imod];
996  std::string const& instance = drawopt->fHoughResultInstances[imod];
997 
998  std::vector<const rb::HoughResult*> htr;
999  nav->GetProducts(evt, which, instance, htr);
1000  this->DrawHoughResults2D(htr, xzview, yzview);
1001  }
1002  }
1003 
1004  //......................................................................
1005 
1007  evdb::View2D* xzview,
1008  evdb::View2D* yzview)
1009  {
1012 
1013  bool drawProng =(drawopt->fProngOpt != 0);
1014  bool drawShowers=(drawopt->fShowerOpt != evd::RecoDrawingOptions::kOFF);
1015 
1016  if (drawProng || drawShowers) {
1017  for (unsigned int imod=0; imod<drawopt->fProngModules.size(); ++imod) {
1018  std::string const& which = drawopt->fProngModules[imod];
1019  std::string const& instance = drawopt->fProngInstances[imod];
1020 
1021  std::vector<const rb::Prong*> prongs;
1022  nav->GetProducts(evt, which, instance, prongs);
1023  std::vector<int> prongIndex;
1024  if( drawopt->fProngIndex.size() > imod )
1025  prongIndex = drawopt->fProngIndex[imod];
1026 
1028  std::vector<const rb::Cluster*> clusts(prongs.begin(), prongs.end());
1029  DrawCluster2D(clusts, xzview, yzview, prongIndex);
1030  }
1031 
1033  DrawProng2D(prongs, xzview, yzview, prongIndex);
1034  }
1035  }
1036  }
1037  }
1038 
1039  //......................................................................
1040 
1042  evdb::View2D* xzview,
1043  evdb::View2D* yzview)
1044  {
1047 
1048  if(drawopt->fTrackOpt == 0) return;
1049 
1050  for(unsigned int imod = 0; imod < drawopt->fTrackModules.size(); ++imod){
1051  const std::string& which = drawopt->fTrackModules[imod];
1052  const std::string& instance = drawopt->fTrackInstances[imod];
1053 
1054  std::string whichMichel;
1055  for(unsigned int jmod = 0; jmod < drawopt->fClusterModules.size(); ++jmod){
1056  const std::string& clustLabel = drawopt->fClusterModules[jmod];
1057  bool foundMichel = clustLabel.find("michel") != std::string::npos;
1058  bool foundTrack = clustLabel.find(which) != std::string::npos;
1059 
1060  if(foundMichel && foundTrack) whichMichel = clustLabel;
1061  }
1062 
1063  std::vector<const rb::Track*> tracks;
1064  if(whichMichel.empty())
1065  nav->GetProducts(evt, which, instance, tracks);
1066  else
1067  nav->GetProducts(evt, which, whichMichel, instance, tracks);
1068 
1069  std::vector<int> trackIndex;
1070  if(drawopt->fTrackIndex.size() > imod)
1071  trackIndex = drawopt->fTrackIndex[imod];
1072 
1074  std::vector<const rb::Cluster*> clusts(tracks.begin(), tracks.end());
1075  DrawCluster2D(clusts, xzview, yzview, trackIndex);
1076  }
1077 
1079  std::vector<const rb::Prong*> prongs(tracks.begin(), tracks.end());
1080  DrawProng2D(prongs, xzview, yzview, trackIndex);
1081  }
1082 
1084  DrawTrack2D(tracks, xzview, yzview, trackIndex);
1085  }
1086  }
1087  }
1088 
1089  //......................................................................
1090 
1092  evdb::View3D* view)
1093  {
1096 
1097  bool drawProng =(drawopt->fProngOpt != 0);
1098  bool drawShowers=(drawopt->fShowerOpt != evd::RecoDrawingOptions::kOFF);
1099  bool drawTracks =(drawopt->fTrackOpt != 0);
1100 
1101  if (drawProng || drawShowers) {
1102  for (unsigned int imod=0; imod<drawopt->fProngModules.size(); ++imod) {
1103  std::string const& which = drawopt->fProngModules[imod];
1104  std::string const& instance = drawopt->fProngInstances[imod];
1105 
1106  std::vector<const rb::Prong*> prong;
1107  nav->GetProducts(evt, which, instance, prong);
1108 
1109  std::vector<int> prongIndex;
1110  if( drawopt->fProngIndex.size() > imod )
1111  prongIndex = drawopt->fProngIndex[imod];
1112 
1113  DrawProng3D(prong, view, prongIndex);
1114  }
1115  }
1116 
1117  if (drawTracks) {
1118  for (unsigned int imod=0; imod<drawopt->fTrackModules.size(); ++imod) {
1119  std::string const& whichTrack = drawopt->fTrackModules[imod];
1120  std::string whichMichel = "";
1121  std::string const& instance = drawopt->fTrackInstances[imod];
1122 
1123  for (int jmod=0; jmod< (int)drawopt->fClusterModules.size(); ++jmod){
1124 
1125  std::string const& clustLabel = drawopt->fClusterModules[jmod];
1126  std::size_t foundMichel = clustLabel.find("michel");
1127  std::size_t foundTrack = clustLabel.find(whichTrack);
1128 
1129  if( foundMichel!=std::string::npos &&
1130  foundTrack!=std::string::npos)
1131  whichMichel = clustLabel;
1132  }
1133 
1134 
1135  std::vector<const rb::Track*> track;
1136  if(whichMichel=="")
1137  nav->GetProducts(evt, whichTrack, instance, track);
1138  else
1139  nav->GetProducts(evt, whichTrack, whichMichel, instance, track);
1140 
1141  std::vector<int> trackIndex;
1142  if( drawopt->fTrackIndex.size() > imod )
1143  trackIndex = drawopt->fTrackIndex[imod];
1144 
1145  DrawTrack3D(track, view, trackIndex);
1146  }
1147  }
1148  }
1149 
1150  //......................................................................
1151 
1152  int RecoBaseDrawer::GetClusterColor(unsigned int idx) const
1153  {
1155  bool isBonW = (colors->Foreground(0) == kBlack);
1156 
1157  // Background dependent shades
1158  const int kNCol = 12;
1159  const int kCols[kNCol] ={
1160  (isBonW) ? kRed-4 : kAzure+6,
1161  (isBonW) ? kGreen-3 : kPink+1,
1162  (isBonW) ? kBlue-7 : kGreen-9,
1163  (isBonW) ? kOrange+1 : kOrange+1,
1164  (isBonW) ? kViolet-1 : kViolet-5,
1165  (isBonW) ? kTeal+1 : kTeal+1,
1166  (isBonW) ? kOrange-3 : kYellow-9,
1167  (isBonW) ? kCyan+1 : kCyan+1,
1168  (isBonW) ? kMagenta+1 : kRed-7,
1169  (isBonW) ? kSpring+1 : kSpring+10,
1170  (isBonW) ? kAzure+1 : kAzure+6,
1171  (isBonW) ? kPink+1 : kPink+1
1172  };
1173  return kCols[idx%kNCol];
1174  }
1175 
1176  //......................................................................
1177 
1178  int RecoBaseDrawer::DimOutOfTime(double t1, double t2, int c)
1179  {
1180  static const double ns2usec = 1e-3;
1181  t1 *= ns2usec;
1182  t2 *= ns2usec;
1183 
1185  const evdb::ColorScale& cs = colors->Scale("RawT");
1186  if (cs.InBounds(t1) && cs.InBounds(t2)) return c;
1187 
1188  return -1;
1189  }
1190 
1191  //......................................................................
1192 
1194  std::vector<const rb::CellHit*> unfilt,
1195  int c)
1196  {
1197  if (std::find(unfilt.begin(),unfilt.end(),chit)==unfilt.end()) {
1198  return -1;
1199  };
1200  return c;
1201  }
1202 
1203  //......................................................................
1204 
1206  TH1F* thisto,
1207  TH1F* qhisto)
1208  {
1211 
1212  for (unsigned int imod=0; imod<drawopt->fCellHitModules.size(); ++imod) {
1213  std::string const& which = drawopt->fCellHitModules[imod].c_str();
1214  std::string const& instance = drawopt->fCellHitInstances[imod].c_str();
1215 
1216  std::vector<const rb::CellHit*> cellhits;
1217  nav->GetProducts(evt, which, instance, cellhits);
1218 
1219  for (unsigned int i=0; i<cellhits.size(); ++i) {
1220  const rb::CellHit* h = cellhits[i];
1221 
1222  // best available charge, time
1223  float q=h->PE();
1224  // if (h->IsA()==rb::RecoHit::Class()) {
1225  // q = ((rb::RecoHit*)h)->PECorr(); // or GeV or MIP?
1226  // }
1227  float t=(h->TNS())/1000.0; // thisto is binned in usec
1228  // if (h->IsA()==rb::RecoHit::Class()) {
1229  // t = ((rb::RecoHit*)h)->T();
1230  // }
1231 
1232  if (thisto!=0) thisto->Fill(t);
1233  if (qhisto!=0) qhisto->Fill(q);
1234  }
1235  }
1236 
1237  }
1238 
1239 } // end namespace evd
1240 ////////////////////////////////////////////////////////////////////////
virtual geo::View_t View() const
kXorY for 3D clusters.
Definition: Cluster.h:99
float TNS() const
Definition: CellHit.h:46
size_t NTrajectoryPoints() const
Definition: Track.h:83
void FillTQHisto(art::Event const &evt, TH1F *thisto, TH1F *qhisto)
std::vector< std::string > fClusterModules
Module labels for Clusters.
double HalfD() const
Definition: CellGeo.cxx:205
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
void GetCenter(double *xyz, double localz=0.0) const
Definition: CellGeo.cxx:159
TVector3 TrajectoryPoint(unsigned int i) const
The ith point on the trajectory, a 3-vector in cm.
Definition: Track.cxx:158
art::Ptr< rb::CellHit > XCell(unsigned int xIdx) const
Get the ith cell in the x-view.
Definition: Cluster.cxx:157
void DrawHoughResults2D(std::vector< const rb::HoughResult * > &htr, evdb::View2D *xzview, evdb::View2D *yzview)
static const int kORTHO_HITS
Float_t y1[n_points_granero]
Definition: compare.C:5
virtual double W(const rb::CellHit *chit) const
Estimate the unmeasured coordinate of chit.
Definition: Track.cxx:281
std::vector< std::string > fVertexInstances
productInstance labels for Vertexes
TPolyLine & AddPolyLine(int n, int c, int w, int s)
Definition: View2D.cxx:210
void DrawCluster2D(std::vector< const rb::Cluster * > &clusts, evdb::View2D *xzview, evdb::View2D *yzview, std::vector< int > &clustIndex)
bool Is2D() const
Definition: Cluster.h:96
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
unsigned short Plane() const
Definition: CellHit.h:39
Float_t x1[n_points_granero]
Definition: compare.C:5
geo::View_t View() const
Definition: CellHit.h:41
static const int kCLUSTERS_AS_HULLS
TLine & AddLine(double x1, double y1, double x2, double y2)
Definition: View2D.cxx:187
const char * p
Definition: xmltok.h:285
T sqrt(T number)
Definition: d0nt_math.hpp:156
static const int kAS_CLUSTER
std::vector< std::string > fCellHitModules
Module labels for CellHits.
Define a color scale for displaying numeric data.
Vertical planes which measure X.
Definition: PlaneGeo.h:28
Definition: event.h:19
double HalfW() const
Definition: CellGeo.cxx:191
A collection of associated CellHits.
Definition: Cluster.h:47
double DetLength() const
bool InBounds(double x) const
Definition: ColorScale.cxx:113
static const int kAS_PRONG
double ScaleFactor(double, double)
A collection of drawable 2-D objects.
static const int kSCALE_HITS_BY_CHARGE
int GetColor(double x) const
Definition: ColorScale.cxx:126
A rb::Prong with full reconstructed trajectory.
Definition: Track.h:20
const PlaneGeo * Plane(unsigned int i) const
size_t GetProducts(const art::Event &evt, const std::string &which, const std::string &instance, std::vector< const T * > &prods)
std::vector< std::string > fVertexModules
Module labels for Vertices.
void Cluster3D(art::Event const &evt, evdb::View3D *view)
std::vector< std::string > fClusterInstances
productInstance labels for Clusters
void CellHit3D(art::Event const &evt, evdb::View3D *view)
void DrawProng2D(std::vector< const rb::Prong * > &prong, evdb::View2D *xzview, evdb::View2D *yzview, std::vector< int > &prongIndex)
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
void Vertex2D(art::Event const &evt, evdb::View2D *xzview, evdb::View2D *yzview)
void DrawTrack2D(std::vector< const rb::Track * > &track, evdb::View2D *xzview, evdb::View2D *yzview, std::vector< int > &trackIndex)
void CellInfo(unsigned int ip, unsigned int ic, View_t *view=0, double *pos=0, double *dpos=0) const
void Prong2D(art::Event const &evt, evdb::View2D *xzview, evdb::View2D *yzview)
void Cluster2D(art::Event const &evt, evdb::View2D *xzview, evdb::View2D *yzview)
static const int kCLUSTERS_AS_BOXES
unsigned short Cell() const
Definition: CellHit.h:40
Track finder for cosmic rays.
TPolyLine3D & AddPolyLine3D(int n, int c, int w, int s)
Definition: View3D.cxx:105
static const int kCOLOR_BY_TIME
TBox & AddBox(double x1, double y1, double x2, double y2)
Definition: View2D.cxx:263
double MinTNS() const
Definition: Cluster.cxx:482
std::vector< std::string > fHoughResultModules
Module labels for HoughResults.
static const int kCLUSTERS_AS_MARKERS
int colors[6]
Definition: tools.h:1
double dy[NP][NC]
double dx[NP][NC]
nova event display
double dz[NP][NC]
static const int kCAL_HITS
void Prong3D(art::Event const &evt, evdb::View3D *view)
bool DimHits() const
Build an association between a numerical range and a ROOT color index for use in, eg...
Definition: ColorScale.h:44
art::Ptr< rb::CellHit > YCell(unsigned int yIdx) const
Get the ith cell in the y-view.
Definition: Cluster.cxx:165
Int_t col[ntarg]
Definition: Style.C:29
std::vector< std::string > fTrackModules
Module labels for Tracks.
std::vector< std::string > fCellHitInstances
productInstance labels for CellHits
ColorScale & Scale(const std::string &nm)
TPolyMarker & AddPolyMarker(int n, int c, int st, double sz)
Definition: View2D.cxx:157
void HoughResult2D(art::Event const &evt, evdb::View2D *xzview, evdb::View2D *yzview)
int evt
std::vector< std::string > fOfflineChanInstances
productInstance labels for OfflineChans
int DimFiltered(const rb::CellHit *chit, std::vector< const rb::CellHit * > unfiltered, int c)
void Track2D(const art::Event &evt, evdb::View2D *xzview, evdb::View2D *yzview)
float PE() const
Definition: CellHit.h:42
std::vector< std::string > fProngInstances
productInstance labels for Prongs
void OfflineChans2D(const art::Event &evt, evdb::View2D *xzview, evdb::View2D *yzview)
Global drawing options that apply to all displays.
void DrawProng3D(std::vector< const rb::Prong * > &prong, evdb::View3D *view, std::vector< int > &prongIndex)
const double j
Definition: BetheBloch.cxx:29
int DimOutOfTime(double t1, double t2, int c)
static const int kCOLOR_BY_CHARGE
double DetHalfHeight() const
void GetClusterOutlines(const rb::Cluster *c, int view, std::vector< double > &vzVpts, std::vector< double > &vzZpts)
double t2
Vertex location in position and time.
void DrawTrack3D(std::vector< const rb::Track * > &track, evdb::View3D *view, std::vector< int > &trackIndex)
Definition: View.py:1
Class to aid in the rendering of RecoBase objects.
z
Definition: test.py:28
A very simple service to remember what detector we&#39;re working in.
double MaxTNS() const
Definition: Cluster.cxx:528
unsigned short Plane() const
Definition: OfflineChan.h:31
unsigned int NYCell() const
Number of cells in the y-view.
Definition: Cluster.h:108
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
double dot(const std::vector< double > &x, const std::vector< double > &y)
Definition: dot.hpp:10
std::vector< std::vector< int > > fClusterIndex
int Foreground(int i=0)
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
unsigned short Cell() const
Definition: OfflineChan.h:32
std::vector< std::string > fProngModules
Module labels for Prongs.
double DetHalfWidth() const
Data resulting from a Hough transform on the cell hit positions.
T const * get() const
Definition: Ptr.h:321
double pythag(double x, double y)
2D Euclidean distance
Definition: MathUtil.h:29
const int cellMax
std::vector< std::string > fOfflineChanModules
Module labels for OfflineChans.
void GetClusterOutlinesConvexHull(const rb::Cluster *c, int viewint, std::vector< double > &vzVpts, std::vector< double > &vzZpts) const
std::vector< std::vector< int > > fVertexIndex
A (plane, cell) pair.
Definition: OfflineChan.h:17
unsigned int NXCell() const
Number of cells in the x-view.
Definition: Cluster.h:106
void geom(int which=0)
Definition: geom.C:163
const hit & b
Definition: hits.cxx:21
std::vector< std::string > fTrackInstances
productInstance labels for Tracks
assert(nhit_max >=nhit_nbins)
static const int kAS_TRACK
Global drawing options that apply to all displays.
A collection of 3D drawable objects.
std::vector< std::vector< int > > fTrackIndex
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
static const int kHOUGH_COLORS
Float_t e
Definition: plot.C:35
Encapsulate the cell geometry.
Definition: CellGeo.h:25
int GetClusterColor(unsigned int idx) const
Helper for AttenCurve.
Definition: Path.h:10
Float_t track
Definition: plot.C:35
TMarker & AddMarker(double x, double y, int c, int st, double sz)
Definition: View2D.cxx:124
Float_t w
Definition: plot.C:20
void CellHit2D(art::Event const &evt, evdb::View2D *xzview, evdb::View2D *yzview)
Encapsulate the geometry of one entire detector (near, far, ndos)
std::vector< const rb::Cluster * > SlicesToNavigate(const art::Event &evt)
std::vector< std::string > fHoughResultInstances
productInstance labels for HoughResults
void DrawVertices2D(std::vector< const rb::Vertex * > &vert, evdb::View2D *xzview, evdb::View2D *yzview, std::vector< int > &vertexIndex)
std::vector< std::vector< int > > fProngIndex