LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
evd::TWireProjPad Class Reference

A drawing pad for time vs wire. More...

#include "TWireProjPad.h"

Inheritance diagram for evd::TWireProjPad:
evd::DrawingPad

Classes

struct  DrawOptions_t
 

Public Member Functions

 TWireProjPad (const char *nm, const char *ti, double x1, double y1, double x2, double y2, unsigned int plane)
 
 ~TWireProjPad ()
 
void Draw (const char *opt=0)
 
void GetWireRange (int *i1, int *i2) const
 
void SetWireRange (int i1, int i2)
 
void SetZoomRange (int i1, int i2, int y1, int y2)
 
DrawOptions_t const & GetDrawOptions () const
 Return the current draw options. More...
 
void SetDrawOptions (DrawOptions_t const &opt)
 Receive the full set of draw options. More...
 
void SetZoomToRoI (bool bZoomToRoI)
 Sets the draw option about zooming to the region of interest. More...
 
void SetZoomFromView ()
 Sets the zoom parameters from the current histogram view. More...
 
void SaveHitList (double i1, double i2, double y1, double y2, double distance, const char *zoom_opt, bool good_plane=true)
 
double SaveSeedList (std::vector< util::PxLine > seedlines, double distance)
 
void ClearHitList ()
 
void SelectOneHit (double x, double y, const char *zoom_opt)
 
unsigned int GetPlane () const
 
void ClearandUpdatePad ()
 
void UpdatePad ()
 
void DrawLinesinView (std::vector< util::PxLine > lines, bool deleting=false, const char *zoom_opt=0)
 
void ShowFull (int override=0)
 
double UpdateSeedCurve (std::vector< recob::Seed > SeedVec, int plane)
 
evdb::View2DView () const
 
std::vector< double > const & GetCurrentZoom () const
 
TPad * Pad ()
 
HeaderDrawerHeaderDraw ()
 
evd_tool::IExperimentDrawerGeometryDraw ()
 
SimulationDrawerSimulationDraw ()
 
RawDataDrawerRawDataDraw ()
 
RecoBaseDrawerRecoBaseDraw ()
 
AnalysisBaseDrawerAnalysisBaseDraw ()
 
HitSelectorHitSelectorGet ()
 

Protected Types

using IExperimentDrawerPtr = std::unique_ptr< evd_tool::IExperimentDrawer >
 

Protected Attributes

TPad * fPad
 The ROOT graphics pad. More...
 
HeaderDrawerfHeaderDraw
 Drawer for event header info. More...
 
IExperimentDrawerPtr fGeometryDraw
 Drawer for detector geometry. More...
 
SimulationDrawerfSimulationDraw
 Drawer for simulation objects. More...
 
RawDataDrawerfRawDataDraw
 Drawer for raw data. More...
 
RecoBaseDrawerfRecoBaseDraw
 Drawer for recobase objects. More...
 
AnalysisBaseDrawerfAnalysisBaseDraw
 Drawer for analysisbase objects. More...
 

Private Attributes

std::vector< double > fCurrentZoom
 
DrawOptions_t fDrawOpts
 set of current draw options More...
 
unsigned int fPlane
 Which plane in the detector. More...
 
TH1F * fHisto
 Histogram to draw object on. More...
 
evdb::View2DfView
 Collection of graphics objects to render. More...
 
double fXLo
 Low value of x axis. More...
 
double fXHi
 High value of x axis. More...
 
double fYLo
 Low value of y axis. More...
 
double fYHi
 High value of y axis. More...
 
int fOri
 Orientation of the axes - see RawDrawingOptions for values. More...
 

Detailed Description

A drawing pad for time vs wire.

Definition at line 32 of file TWireProjPad.h.

Member Typedef Documentation

using evd::DrawingPad::IExperimentDrawerPtr = std::unique_ptr<evd_tool::IExperimentDrawer>
protectedinherited

Definition at line 51 of file DrawingPad.h.

Constructor & Destructor Documentation

evd::TWireProjPad::TWireProjPad ( const char *  nm,
const char *  ti,
double  x1,
double  x2,
double  y1,
double  y2,
unsigned int  plane 
)

Create a pad showing a single X-Z or Y-Z projection of the detector

Parameters
nm: Name of the pad
ti: Title of the pad
x1: Location of left edge of pad (0-1)
x2: Location of right edge of pad (0-1)
y1: Location of bottom edge of pad (0-1)
y2: Location of top edge of pad (0-1)
plane: plane number of view

Definition at line 109 of file TWireProjPad.cxx.

References evd::RawDrawingOptions::CurrentTPC(), evd::RawDrawingOptions::fAxisOrientation, fCurrentZoom, fHisto, fOri, evd::DrawingPad::fPad, fPlane, fView, fXHi, fXLo, fYHi, fYLo, geo::kCollection, max, min, geo::GeometryCore::Nplanes(), geo::GeometryCore::Nwires(), evd::DrawingPad::Pad(), evd::DrawingPad::RawDataDraw(), SetZoomRange(), geo::GeometryCore::SignalType(), evd::RawDataDrawer::StartTick(), and evd::RawDataDrawer::TotalClockTicks().

114  : DrawingPad(nm, ti, x1, x2, y1, y2)
115  , fPlane(plane)
116  {
117 
118  fCurrentZoom.resize(4);
119 
121 
122  // this->Pad()->SetBit(kCannotPick); // workaround for issue #16169
123  // this->Pad()->SetBit(TPad::kCannotMove);
124  this->Pad()->cd();
125 
126  this->Pad()->SetLeftMargin (0.070);
127  this->Pad()->SetRightMargin (0.010);
128 
129  // how many planes in the detector and
130  // which plane is this one?
131 
132  unsigned int planes = geo->Nplanes();
133  this->Pad()->SetTopMargin (0.005);
134  this->Pad()->SetBottomMargin(0.110);
135 
136  // there has to be a better way of doing this that does
137  // not have a case for each number of planes in a detector
138  if(planes == 2 && fPlane > 0){
139  this->Pad()->SetTopMargin (0.110);
140  this->Pad()->SetBottomMargin(0.005);
141  }
142  else if(planes > 2){
143  if(fPlane == 1){
144  this->Pad()->SetTopMargin (0.055);
145  this->Pad()->SetBottomMargin(0.055);
146  }
147  else if(fPlane == 2){
148  this->Pad()->SetTopMargin (0.110);
149  this->Pad()->SetBottomMargin(0.005);
150  }
151  }
152 
153  TString planeNo = "fTWirePlane";
154  planeNo += fPlane;
155 
156  // picking the information from the current TPC
158  auto const signalType = geo->SignalType({ rawopt->CurrentTPC(), fPlane });
159  TString xtitle = ";Induction Wire;t (tdc)";
160  if(signalType == geo::kCollection) xtitle = ";Collection Wire;t (tdc)";
161 
162  unsigned int const nWires = geo->Nwires(fPlane);
163  unsigned int const nTicks = RawDataDraw()->TotalClockTicks();
164 
165  fXLo = -0.005 * (nWires - 1);
166  fXHi = 1.005 * (nWires - 1);
167  fYLo = 0.990*(unsigned int)(this->RawDataDraw()->StartTick());
168  fYHi = 1.005*std::min((unsigned int)(this->RawDataDraw()->StartTick()+nTicks), nTicks);
169 
170  fOri = rawopt->fAxisOrientation;
171  if(fOri > 0){
172  fYLo = -0.005 * (nWires - 1);
173  fYHi = 1.005 * (nWires - 1);
174  fYLo = 0.990*(unsigned int)(this->RawDataDraw()->StartTick());
175  fYHi = 1.005*std::min((unsigned int)(this->RawDataDraw()->StartTick()+nTicks), nTicks);
176  fXLo = -0.005 * nTicks;
177  fXHi = 1.010 * nTicks;
178  xtitle = ";t (tdc);InductionWire";
179  if(signalType == geo::kCollection) xtitle = ";t (tdc);Collection Wire";
180  }
181 
182  // make the range of the histogram be the biggest extent
183  // in both directions and then use SetRangeUser() to shrink it down
184  // that will allow us to change the axes on the fly
185  double min = std::min(fXLo, fYLo);
186  double max = std::max(fXHi, fYHi);
187 
188  fHisto = new TH1F(*(fPad->DrawFrame(min, min, max, max)));
189 
190  fHisto->SetTitleOffset(0.5,"Y");
191  fHisto->SetTitleOffset(0.75,"X");
193  fHisto->GetYaxis()->SetLabelSize(0.05);
194  fHisto->GetYaxis()->CenterTitle();
195  fHisto->GetXaxis()->SetLabelSize(0.05);
196  fHisto->GetXaxis()->CenterTitle();
197  fHisto->Draw("AB");
198 
199  fView = new evdb::View2D();
200  }
Float_t y1[n_points_granero]
Definition: compare.C:5
Float_t x1[n_points_granero]
Definition: compare.C:5
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
double fXLo
Low value of x axis.
Definition: TWireProjPad.h:95
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
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.
Float_t y2[n_points_geant4]
Definition: compare.C:26
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
Int_t max
Definition: plot.C:27
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:109
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:99
double fXHi
High value of x axis.
Definition: TWireProjPad.h:96
TPad * Pad()
Definition: DrawingPad.h:37
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
double TotalClockTicks() const
Definition: RawDataDrawer.h:85
double fYLo
Low value of y axis.
Definition: TWireProjPad.h:97
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:92
double StartTick() const
Definition: RawDataDrawer.h:84
Int_t min
Definition: plot.C:26
void SetZoomRange(int i1, int i2, int y1, int y2)
int fAxisOrientation
0 = TDC values on y-axis, wire number on x-axis, 1 = swapped
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:53
Float_t x2[n_points_geant4]
Definition: compare.C:26
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:87
Namespace collecting geometry-related classes utilities.
double fYHi
High value of y axis.
Definition: TWireProjPad.h:98
DrawingPad(const char *nm, const char *ti, double x1, double y1, double y2, double x2)
Definition: DrawingPad.cxx:39
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:93
Signal from collection planes.
Definition: geo_types.h:93
evd::TWireProjPad::~TWireProjPad ( )

Definition at line 203 of file TWireProjPad.cxx.

References fHisto, and fView.

204  {
205  if (fHisto) { delete fHisto; fHisto = 0; }
206  if (fView) { delete fView; fView = 0; }
207  }
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:92
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:93

Member Function Documentation

AnalysisBaseDrawer * evd::DrawingPad::AnalysisBaseDraw ( )
inherited

Provide access to the drawer for AnalysisBase classes

Definition at line 132 of file DrawingPad.cxx.

References evd::DrawingPad::fAnalysisBaseDraw.

Referenced by evd::CalorPad::Draw().

133  {
134  if (fAnalysisBaseDraw==0) fAnalysisBaseDraw = new AnalysisBaseDrawer();
135  return fAnalysisBaseDraw;
136  }
AnalysisBaseDrawer * fAnalysisBaseDraw
Drawer for analysisbase objects.
Definition: DrawingPad.h:60
void evd::TWireProjPad::ClearandUpdatePad ( )

Definition at line 490 of file TWireProjPad.cxx.

References evd::DrawingPad::fPad, and UpdatePad().

Referenced by Draw().

491  {
492  fPad->Clear();
493  this->UpdatePad();
494 
495  return;
496  }
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:53
void evd::TWireProjPad::ClearHitList ( )

Definition at line 298 of file TWireProjPad.cxx.

References evd::HitSelector::ClearHitList(), Draw(), fPlane, evd::RecoDrawingOptions::fUseHitSelector, and evd::DrawingPad::HitSelectorGet().

299  {
301  if(recoOpt->fUseHitSelector){
303  this->Draw();
304  }
305 
306  return;
307  }
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
void Draw(const char *opt=0)
void ClearHitList(unsigned int plane)
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:144
void evd::TWireProjPad::Draw ( const char *  opt = 0)
Todo:
: Why is kSelectedColor hard coded?

Definition at line 210 of file TWireProjPad.cxx.

References evdb::View2D::Clear(), ClearandUpdatePad(), evdb::View2D::Draw(), evd::RawDrawingOptions::fAxisOrientation, fHisto, fOri, evd::DrawingPad::fPad, fPlane, evd::RecoDrawingOptions::fUseHitSelector, fView, fXHi, fXLo, fYHi, fYLo, GetCurrentZoom(), GetDrawOptions(), evdb::EventHolder::GetEvent(), evd::RecoBaseDrawer::Hit2D(), evd::DrawingPad::HitSelectorGet(), evdb::EventHolder::Instance(), LOG_DEBUG, max, evd::SimulationDrawer::MCTruthVectors2D(), min, evd::DrawingPad::RawDataDraw(), evd::DrawingPad::RecoBaseDraw(), SetZoomRange(), ShowFull(), evd::DrawingPad::SimulationDraw(), and UpdatePad().

Referenced by ClearHitList(), evd::TWQProjectionView::Draw(), DrawLinesinView(), SaveHitList(), and SelectOneHit().

211  {
212  // DumpPadsInCanvas(fPad, "TWireProjPad", "Draw()");
213  LOG_DEBUG("TWireProjPad") << "Started to draw plane " << fPlane;
214 
216  int kSelectedColor = 4;
217  fView->Clear();
218 
219  // grab the singleton holding the art::Event
221  if(evt){
223 
224  this->SimulationDraw()->MCTruthVectors2D(*evt, fView, fPlane);
225 
226  // the 2D pads have too much detail to be rendered on screen;
227  // to act smarter, RawDataDrawer needs to know the range being plotted
228  this->RawDataDraw()-> ExtractRange (fPad, &GetCurrentZoom());
229  this->RawDataDraw()-> RawDigit2D
230  (*evt, fView, fPlane, GetDrawOptions().bZoom2DdrawToRoI);
231 
232  this->RecoBaseDraw()-> Wire2D (*evt, fView, fPlane);
233  this->RecoBaseDraw()-> Hit2D (*evt, fView, fPlane);
234 
235  if(recoOpt->fUseHitSelector)
236  this->RecoBaseDraw()->Hit2D(this->HitSelectorGet()->GetSelectedHits(fPlane),
237  kSelectedColor,
238  fView);
239 
240  this->RecoBaseDraw()-> Cluster2D (*evt, fView, fPlane);
241  this->RecoBaseDraw()-> EndPoint2D (*evt, fView, fPlane);
242  this->RecoBaseDraw()-> Prong2D (*evt, fView, fPlane);
243  this->RecoBaseDraw()-> Vertex2D (*evt, fView, fPlane);
244  this->RecoBaseDraw()-> Seed2D (*evt, fView, fPlane);
245  this->RecoBaseDraw()-> BezierTrack2D (*evt, fView, fPlane);
246  this->RecoBaseDraw()-> OpFlash2D (*evt, fView, fPlane);
247  this->RecoBaseDraw()-> Event2D (*evt, fView, fPlane);
248  this->RecoBaseDraw()-> DrawTrackVertexAssns2D(*evt, fView, fPlane);
249 
250  // DumpPadsInCanvas(fPad, "TWireProjPad", "Before UpdatePad()");
251  UpdatePad();
252  } // if (evt)
253 
254  // DumpPadsInCanvas(fPad, "TWireProjPad", "Before ClearandUpdatePad()");
256 
257  // DumpPadsInCanvas(fPad, "TWireProjPad", "After ClearandUpdatePad()");
258 
259  // check if we need to swap the axis ranges
261  if(fOri != rawopt->fAxisOrientation){
262  fOri = rawopt->fAxisOrientation;
263  double max = fXHi;
264  double min = fXLo;
265  fXHi = fYHi;
266  fXLo = fYLo;
267  fYHi = max;
268  fYLo = min;
269 
271 
272  TString xtitle = fHisto->GetXaxis()->GetTitle();
273  fHisto->GetXaxis()->SetTitle(fHisto->GetYaxis()->GetTitle());
274  fHisto->GetYaxis()->SetTitle(xtitle);
275  }
276 
277  if (fPlane > 0) fHisto->Draw("X+");
278  else fHisto->Draw("");
279 
280 
281  // Check if we should zoom the displays;
282  // if there is no event, we have no clue about the region of interest
283  // and therefore we don't touch anything
284  if (opt==0 && evt) {
285  // if (drawopt->fAutoZoom) this->AutoZoom();
286  // else this->ShowFull();
287  this->ShowFull();
288  }
289 
290  LOG_DEBUG("TWireProjPad") << "Started rendering plane " << fPlane;
291 
292  fView->Draw();
293 
294  LOG_DEBUG("TWireProjPad") << "Drawing of plane " << fPlane << " completed";
295  }
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
void ShowFull(int override=0)
double fXLo
Low value of x axis.
Definition: TWireProjPad.h:95
void Clear()
Definition: View2D.cxx:109
std::vector< double > const & GetCurrentZoom() const
Definition: TWireProjPad.h:79
Int_t max
Definition: plot.C:27
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:109
void Draw()
Definition: View2D.cxx:89
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:99
static EventHolder * Instance()
Definition: EventHolder.cxx:15
double fXHi
High value of x axis.
Definition: TWireProjPad.h:96
DrawOptions_t const & GetDrawOptions() const
Return the current draw options.
Definition: TWireProjPad.h:50
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:120
int Hit2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
double fYLo
Low value of y axis.
Definition: TWireProjPad.h:97
SimulationDrawer * SimulationDraw()
Definition: DrawingPad.cxx:99
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:92
Int_t min
Definition: plot.C:26
void SetZoomRange(int i1, int i2, int y1, int y2)
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:144
int fAxisOrientation
0 = TDC values on y-axis, wire number on x-axis, 1 = swapped
#define LOG_DEBUG(id)
void MCTruthVectors2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:53
double fYHi
High value of y axis.
Definition: TWireProjPad.h:98
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:93
void evd::TWireProjPad::DrawLinesinView ( std::vector< util::PxLine lines,
bool  deleting = false,
const char *  zoom_opt = 0 
)

Definition at line 510 of file TWireProjPad.cxx.

References evdb::View2D::AddLine(), evdb::View2D::Clear(), detinfo::DetectorProperties::ConvertTicksToX(), detinfo::DetectorProperties::ConvertXToTicks(), evdb::View2D::Draw(), Draw(), evd::EvdLayoutOptions::fMakeSeeds, evd::DrawingPad::fPad, fPlane, evd::Style::FromPDG(), fView, util::PxLine::plane, util::PxLine::t0, t1, util::PxLine::t1, and UpdatePad().

513  {
514 
516  detinfo::DetectorProperties const* det = lar::providerFrom<detinfo::DetectorPropertiesService>();
517 
518  fPad->cd();
519  if(deleting) {
520  fPad->Clear();
521  this->Draw(zoom_opt);
522  }
523  else {
524  fView->Clear();
525  fView->Draw();
526  }
527 
528  mf::LogVerbatim("TWireProjPad") << "Drawing " << lines.size() <<" lines";
529 
530  for(size_t is = 0; is < lines.size(); ++is){
531  if(fPlane!=lines[is].plane)
532  continue;
533 
534  TLine& l = fView->AddLine(lines[is].w0,lines[is].t0,lines[is].w1,lines[is].t1);
535 
536  fView->Draw();
537  evd::Style::FromPDG(l,11);
538 
539  // In Seed mode, colour of "sealed" seeds to green
540  if(evdlayoutopt->fMakeSeeds){
541  if( ( (lines.size()%3)==0 ) ||
542  ( is < ( lines.size()-(lines.size()%3) ) )) {
543  l.SetLineColor(kGreen);
544  }
545  else
546  l.SetLineColor(kRed);
547  }
548  }
549 
550  // Seed mode guide lines
551 
552  if(evdlayoutopt->fMakeSeeds){
553  TLine &lg1 = fView->AddLine(0,0,0,0);
554  fView->Draw();
555  TLine &lg0 = fView->AddLine(0,0,0,0);
556  fView->Draw();
557  lg1.SetLineStyle(kDashed);
558  lg0.SetLineStyle(kDashed);
559  lg0.SetLineWidth(1);
560  lg1.SetLineWidth(1);
561  lg0.SetLineColor(kGray);
562  lg1.SetLineColor(kGray);
563  lg0.SetBit(kCannotPick);
564  lg1.SetBit(kCannotPick);
565 
566  if((lines.size()%3)==1){
567  mf::LogVerbatim("TWireProjPad") << "adding guide lines";
568  util::PxLine TopLine = lines.at(lines.size()-1);
569  lg0.SetX1(1);
570  lg0.SetX2(5000);
571 
572  double TopT0 = det->ConvertXToTicks(det->ConvertTicksToX(TopLine.t0,TopLine.plane,0,0),fPlane,0,0);
573  double TopT1 = det->ConvertXToTicks(det->ConvertTicksToX(TopLine.t1,TopLine.plane,0,0),fPlane,0,0);
574 
575  lg0.SetY1(TopT0);
576  lg0.SetY2(TopT0);
577 
578  lg1.SetX1(1);
579  lg1.SetX2(5000);
580 
581  lg1.SetY1(TopT1);
582  lg1.SetY2(TopT1);
583 
584 
585  }
586  }
587  fView->Draw();
588  UpdatePad();
589  fView->Draw();
590 
591  return;
592  }
code to link reconstructed objects back to the MC truth information
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
double t1
defined to be the ending t-position (of line or seed depending)
Definition: PxUtils.h:72
TTree * t1
Definition: plottest35.C:26
TLine & AddLine(double x1, double y1, double x2, double y2)
Definition: View2D.cxx:187
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
void Draw(const char *opt=0)
static void FromPDG(TLine &line, int pdgcode)
Definition: Style.cxx:138
void Clear()
Definition: View2D.cxx:109
virtual double ConvertXToTicks(double X, int p, int t, int c) const =0
int fMakeSeeds
Draw two lines to make clusters if clicked.
void Draw()
Definition: View2D.cxx:89
virtual double ConvertTicksToX(double ticks, int p, int t, int c) const =0
static const char * zoom_opt
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:53
unsigned int plane
Definition: PxUtils.h:73
double t0
defined to be the vertex t-position
Definition: PxUtils.h:70
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:93
evd_tool::IExperimentDrawer * evd::DrawingPad::GeometryDraw ( )
inherited

Provide access to the drawer for the detector geometry

Definition at line 84 of file DrawingPad.cxx.

References evd::DrawingPad::fGeometryDraw, evd::EvdLayoutOptions::fParameterSet, and fhicl::ParameterSet::get().

Referenced by evd::Display3DPad::Draw().

85  {
86  if (fGeometryDraw==0)
87  {
89  const fhicl::ParameterSet& pset = layoutOptions->fParameterSet;
90 
91  fGeometryDraw = art::make_tool<evd_tool::IExperimentDrawer>(pset.get<fhicl::ParameterSet>("Experiment3DDrawer"));
92  }
93  return fGeometryDraw.get();
94  }
IExperimentDrawerPtr fGeometryDraw
Drawer for detector geometry.
Definition: DrawingPad.h:56
const fhicl::ParameterSet & fParameterSet
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::vector<double> const& evd::TWireProjPad::GetCurrentZoom ( ) const
inline

Definition at line 79 of file TWireProjPad.h.

Referenced by Draw(), and evd::TWQProjectionView::Draw().

79 {return fCurrentZoom;}
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:87
DrawOptions_t const& evd::TWireProjPad::GetDrawOptions ( ) const
inline

Return the current draw options.

Definition at line 50 of file TWireProjPad.h.

Referenced by Draw(), and ShowFull().

50 { return fDrawOpts; }
DrawOptions_t fDrawOpts
set of current draw options
Definition: TWireProjPad.h:88
unsigned int evd::TWireProjPad::GetPlane ( ) const
inline

Definition at line 68 of file TWireProjPad.h.

68 { return fPlane; }
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
void evd::TWireProjPad::GetWireRange ( int *  i1,
int *  i2 
) const

Definition at line 373 of file TWireProjPad.cxx.

References fHisto, and fOri.

374  {
375  if(fOri < 1){
376  *i1 = fHisto->GetXaxis()->GetFirst();
377  *i2 = fHisto->GetXaxis()->GetLast();
378  }
379  else{
380  *i1 = fHisto->GetYaxis()->GetFirst();
381  *i2 = fHisto->GetYaxis()->GetLast();
382  }
383 
384  return;
385  }
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:99
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:92
HeaderDrawer * evd::DrawingPad::HeaderDraw ( )
inherited

Provide access to the drawer for the detector geometry

Definition at line 75 of file DrawingPad.cxx.

References evd::DrawingPad::fHeaderDraw.

Referenced by evd::HeaderPad::Draw().

76  {
77  if (fHeaderDraw==0) fHeaderDraw = new HeaderDrawer();
78  return fHeaderDraw;
79  }
HeaderDrawer * fHeaderDraw
Drawer for event header info.
Definition: DrawingPad.h:54
HitSelector * evd::DrawingPad::HitSelectorGet ( )
inherited

Provide access to the HitSelector

Definition at line 144 of file DrawingPad.cxx.

References evd::gTheHitSelector.

Referenced by ClearHitList(), evd::CalorPad::Draw(), Draw(), SaveHitList(), SaveSeedList(), SelectOneHit(), and evd::Display3DPad::UpdateSeedCurve().

145  {
146  if (gTheHitSelector==0) gTheHitSelector = new HitSelector();
147  return gTheHitSelector;
148  }
HitSelector * gTheHitSelector
Definition: DrawingPad.cxx:28
RawDataDrawer * evd::DrawingPad::RawDataDraw ( )
inherited

Provide access to the drawer for the RawData classes

Definition at line 109 of file DrawingPad.cxx.

References evd::DrawingPad::fRawDataDraw.

Referenced by evd::TQPad::BookHistogram(), evd::TQPad::Draw(), Draw(), ShowFull(), and TWireProjPad().

110  {
111  if (fRawDataDraw==0) fRawDataDraw = new RawDataDrawer();
112  return fRawDataDraw;
113  }
RawDataDrawer * fRawDataDraw
Drawer for raw data.
Definition: DrawingPad.h:58
RecoBaseDrawer * evd::DrawingPad::RecoBaseDraw ( )
inherited

Provide access to the drawer for RecoBase classes

Definition at line 120 of file DrawingPad.cxx.

References evd::DrawingPad::fRecoBaseDraw.

Referenced by evd::TQPad::Draw(), evd::Display3DPad::Draw(), Draw(), evd::Ortho3DPad::Draw(), and ShowFull().

121  {
122  if (fRecoBaseDraw==0) fRecoBaseDraw = new RecoBaseDrawer();
123  return fRecoBaseDraw;
124 
125  }
RecoBaseDrawer * fRecoBaseDraw
Drawer for recobase objects.
Definition: DrawingPad.h:59
void evd::TWireProjPad::SaveHitList ( double  i1,
double  i2,
double  y1,
double  y2,
double  distance,
const char *  zoom_opt,
bool  good_plane = true 
)

Definition at line 435 of file TWireProjPad.cxx.

References Draw(), fPlane, evd::RecoDrawingOptions::fUseHitSelector, fView, evdb::EventHolder::GetEvent(), evd::DrawingPad::HitSelectorGet(), evdb::EventHolder::Instance(), and evd::HitSelector::SaveHits().

442  {
444  if(evt){
446  if(recoopt->fUseHitSelector){
447  this->HitSelectorGet()->SaveHits(*evt, fView, fPlane, i1, i2, y1, y2, distance, good_plane);
448  this->Draw(zoom_opt);
449  }
450  }
451 
452  return;
453  }
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
Float_t y1[n_points_granero]
Definition: compare.C:5
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
void Draw(const char *opt=0)
Float_t y2[n_points_geant4]
Definition: compare.C:26
void SaveHits(const art::Event &evt, evdb::View2D *view, unsigned int plane, double x, double y, double x1, double y1, double distance, bool good_plane=true)
static EventHolder * Instance()
Definition: EventHolder.cxx:15
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:144
static const char * zoom_opt
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:93
double evd::TWireProjPad::SaveSeedList ( std::vector< util::PxLine seedlines,
double  distance 
)

Definition at line 458 of file TWireProjPad.cxx.

References evd::RecoDrawingOptions::fUseHitSelector, fView, evdb::EventHolder::GetEvent(), evd::DrawingPad::HitSelectorGet(), evdb::EventHolder::Instance(), util::kBogusD, and evd::HitSelector::SaveSeedLines().

460  {
461  double KineticEnergy = util::kBogusD;
463  if(evt){
465  if(recoopt->fUseHitSelector)
466  KineticEnergy = this->HitSelectorGet()->SaveSeedLines(*evt, fView,seedlines, distance);
467  }
468  return KineticEnergy;
469  }
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
static EventHolder * Instance()
Definition: EventHolder.cxx:15
double SaveSeedLines(const art::Event &evt, evdb::View2D *view, std::vector< util::PxLine > seedline, double distance)
Definition: HitSelector.cxx:56
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:144
constexpr double kBogusD
obviously bogus double value
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:93
void evd::TWireProjPad::SelectOneHit ( double  x,
double  y,
const char *  zoom_opt 
)

Definition at line 472 of file TWireProjPad.cxx.

References evd::HitSelector::ChangeHit(), Draw(), fPlane, evd::RecoDrawingOptions::fUseHitSelector, fView, evdb::EventHolder::GetEvent(), evd::DrawingPad::HitSelectorGet(), and evdb::EventHolder::Instance().

475  {
476 
478  if(evt){
480  if(recoopt->fUseHitSelector){
481  this->HitSelectorGet()->ChangeHit(*evt, fView, fPlane,x,y);
482  this->Draw(zoom_opt);
483  }
484  }
485 
486  return;
487  }
Float_t x
Definition: compare.C:6
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
Float_t y
Definition: compare.C:6
void Draw(const char *opt=0)
static EventHolder * Instance()
Definition: EventHolder.cxx:15
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:144
static const char * zoom_opt
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:93
void ChangeHit(const art::Event &evt, evdb::View2D *view, unsigned int plane, double x, double y)
void evd::TWireProjPad::SetDrawOptions ( DrawOptions_t const &  opt)
inline

Receive the full set of draw options.

Definition at line 52 of file TWireProjPad.h.

52 { fDrawOpts = opt; }
DrawOptions_t fDrawOpts
set of current draw options
Definition: TWireProjPad.h:88
void evd::TWireProjPad::SetWireRange ( int  i1,
int  i2 
)

Definition at line 390 of file TWireProjPad.cxx.

References fCurrentZoom, fHisto, and fOri.

391  {
392  if(fOri < 1){
393  fHisto->GetXaxis()->SetRange(i1,i2);
394  }
395  else{
396  fHisto->GetYaxis()->SetRange(i1,i2);
397  }
398  fCurrentZoom[0] = i1;
399  fCurrentZoom[1] = i2;
400 
401  return;
402  }
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:99
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:92
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:87
void evd::TWireProjPad::SetZoomFromView ( )

Sets the zoom parameters from the current histogram view.

Definition at line 423 of file TWireProjPad.cxx.

References fCurrentZoom, fHisto, fPlane, LOG_DEBUG, and xaxis.

423  {
424  TAxis const& xaxis = *(fHisto->GetXaxis());
425  fCurrentZoom[0] = xaxis.GetBinLowEdge(xaxis.GetFirst());
426  fCurrentZoom[1] = xaxis.GetBinUpEdge(xaxis.GetLast());
427  fCurrentZoom[2] = fHisto->GetMinimum();
428  fCurrentZoom[3] = fHisto->GetMaximum();
429  LOG_DEBUG("TWireProjPad") << "Zoom set to wires ("
430  << fCurrentZoom[0] << "; " << fCurrentZoom[1] << " ), tick ("
431  << fCurrentZoom[2] << "; " << fCurrentZoom[3] << ") for plane #"
432  << fPlane;
433  } // TWireProjPad::SetZoomFromView()
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
TGaxis * xaxis
Definition: plot_hist.C:61
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:92
#define LOG_DEBUG(id)
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:87
void evd::TWireProjPad::SetZoomRange ( int  i1,
int  i2,
int  y1,
int  y2 
)

Definition at line 407 of file TWireProjPad.cxx.

References fCurrentZoom, fHisto, fPlane, LOG_DEBUG, y1, and y2.

Referenced by Draw(), ShowFull(), and TWireProjPad().

408  {
409  LOG_DEBUG("TWireProjPad")
410  << "SetZoomRange(" << i1 << ", " << i2 << ", " << y1 << ", " << y2
411  << ") on plane #" << fPlane;
412 
413  fHisto->GetXaxis()->SetRangeUser(i1,i2);
414  fHisto->GetYaxis()->SetRangeUser(y1,y2);
415  fCurrentZoom[0]=i1;
416  fCurrentZoom[1]=i2;
417  fCurrentZoom[2]=y1;
418  fCurrentZoom[3]=y2;
419  }
Float_t y1[n_points_granero]
Definition: compare.C:5
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
Float_t y2[n_points_geant4]
Definition: compare.C:26
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:92
#define LOG_DEBUG(id)
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:87
void evd::TWireProjPad::SetZoomToRoI ( bool  bZoomToRoI)
inline

Sets the draw option about zooming to the region of interest.

Definition at line 55 of file TWireProjPad.h.

References x, y, y1, y2, and evd::zoom_opt.

56  { fDrawOpts.bZoom2DdrawToRoI = bZoomToRoI; }
bool bZoom2DdrawToRoI
whether to force zoom to RoI or not
Definition: TWireProjPad.h:35
DrawOptions_t fDrawOpts
set of current draw options
Definition: TWireProjPad.h:88
void evd::TWireProjPad::ShowFull ( int  override = 0)

Automatically zoom the view to a size just larger than the events. Also ensures that the aspect ratio is the same for the XZ and YZ projections.

Definition at line 344 of file TWireProjPad.cxx.

References evd::RawDrawingOptions::fDrawRawDataOrCalibWires, fPlane, fXHi, fXLo, fYHi, fYLo, GetDrawOptions(), evd::RawDataDrawer::GetRegionOfInterest(), evd::RecoBaseDrawer::GetRegionOfInterest(), evd::DrawingPad::RawDataDraw(), evd::DrawingPad::RecoBaseDraw(), SetZoomRange(), and fhicl::has_insertion_operator_impl::test().

Referenced by Draw().

345  {
347 
348  // x values are wire numbers, y values are ticks of the clock
349  int xmin = fXLo;
350  int xmax = fXHi;
351  int ymax = fYHi;
352  int ymin = fYLo;
353 
356 
357  if(GetDrawOptions().bZoom2DdrawToRoI && !override){
358  int test=0;
359  if(rawopt->fDrawRawDataOrCalibWires == 0)
360  test=RawDataDraw()->GetRegionOfInterest((int)fPlane,xmin,xmax,ymin,ymax);
361  else
362  test=RecoBaseDraw()->GetRegionOfInterest((int)fPlane,xmin,xmax,ymin,ymax);
363 
364  if(test != 0) return;
365  }
366 
367  SetZoomRange(xmin, xmax, ymin, ymax);
368 
369  return;
370  }
int GetRegionOfInterest(int plane, int &minw, int &maxw, int &mint, int &maxt)
int fDrawRawDataOrCalibWires
0 for raw
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:91
double fXLo
Low value of x axis.
Definition: TWireProjPad.h:95
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:109
double fXHi
High value of x axis.
Definition: TWireProjPad.h:96
DrawOptions_t const & GetDrawOptions() const
Return the current draw options.
Definition: TWireProjPad.h:50
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:120
double fYLo
Low value of y axis.
Definition: TWireProjPad.h:97
void SetZoomRange(int i1, int i2, int y1, int y2)
int GetRegionOfInterest(int plane, int &minw, int &maxw, int &mint, int &maxt)
double fYHi
High value of y axis.
Definition: TWireProjPad.h:98
SimulationDrawer * evd::DrawingPad::SimulationDraw ( )
inherited

Provide access to the drawer for the Simulation classes

Definition at line 99 of file DrawingPad.cxx.

References evd::DrawingPad::fSimulationDraw.

Referenced by evd::MCBriefPad::Draw(), evd::Display3DPad::Draw(), Draw(), and evd::Ortho3DPad::Draw().

100  {
101  if (fSimulationDraw==0) fSimulationDraw = new SimulationDrawer();
102  return fSimulationDraw;
103 
104  }
SimulationDrawer * fSimulationDraw
Drawer for simulation objects.
Definition: DrawingPad.h:57
void evd::TWireProjPad::UpdatePad ( )

Definition at line 499 of file TWireProjPad.cxx.

References evd::DrawingPad::fPad.

Referenced by ClearandUpdatePad(), Draw(), DrawLinesinView(), and UpdateSeedCurve().

499  {
500  fPad->cd();
501  fPad->Modified();
502  fPad->Update();
503  fPad->GetFrame()->SetBit(TPad::kCannotMove,true);
504  fPad->SetBit(TPad::kCannotMove,true);
505 
506  return;
507  }
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:53
double evd::TWireProjPad::UpdateSeedCurve ( std::vector< recob::Seed SeedVec,
int  plane 
)

Definition at line 603 of file TWireProjPad.cxx.

References evdb::View2D::AddMarker(), evdb::View2D::AddPolyLine(), evdb::View2D::Draw(), fView, trkf::BezierTrack::GetLength(), trkf::BezierTrack::GetProjectedPointUVWT(), LOG_DEBUG, UpdatePad(), x, and y.

604  {
605  mf::LogVerbatim("TWireProjPad") <<"running updateseedcurve for plane " << plane;
606  fView->Draw();
607  UpdatePad();
608  int N=100;
609 
610  double ReturnVal=0;
611 
612  // For some reason, this line is needed to prevent lines being drawn twice
613  // TPolyLine& pldummy1 = fView->AddPolyLine(2,kBlue,1,0);
614  // pldummy1.SetPoint(0,0,0);
615  // pldummy1.SetPoint(1,0,0);
616 
617  int c=0; int t=0;
618  int LastGoodValue=0;
619  double ticks[3];
620  double projpt[3];
621 
622  if(SeedVec.size() > 1){
623  TPolyLine& pl = fView->AddPolyLine(N,kOrange+9,2,0);
624  fView->Draw();
625 
626  trkf::BezierTrack BTrack(SeedVec);
627 
628  for(int i = 0; i != N; ++i){
629  try{
630  BTrack.GetProjectedPointUVWT(float(i)/N,projpt,ticks,c,t );
631  LastGoodValue=i;
632  LOG_DEBUG("TWireProjPad") << i << " ";
633  }
634  catch(cet::exception excp){
635  BTrack.GetProjectedPointUVWT(float(LastGoodValue)/N, projpt, ticks, c, t);
636  }
637 
638  double x = projpt[plane];
639  double y = ticks[plane];
640  pl.SetPoint(i,x,y);
641 
642  if(LastGoodValue!=i){
643  TMarker& mrk = fView->AddMarker(x, y, 3, 34, 1.5);
644  mrk.SetMarkerColor(3);
645  }
646  }
647  ReturnVal = BTrack.GetLength();
648  }
649  else
650  ReturnVal=0;
651 
652  fView->Draw();
653  UpdatePad();
654 
655  return ReturnVal;
656  }
Float_t x
Definition: compare.C:6
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
TPolyLine & AddPolyLine(int n, int c, int w, int s)
Definition: View2D.cxx:210
Float_t y
Definition: compare.C:6
void Draw()
Definition: View2D.cxx:89
#define LOG_DEBUG(id)
TMarker & AddMarker(double x, double y, int c, int st, double sz)
Definition: View2D.cxx:124
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:93
evdb::View2D* evd::TWireProjPad::View ( ) const
inline

Definition at line 77 of file TWireProjPad.h.

77 { return fView; }
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:93

Member Data Documentation

AnalysisBaseDrawer* evd::DrawingPad::fAnalysisBaseDraw
protectedinherited

Drawer for analysisbase objects.

Definition at line 60 of file DrawingPad.h.

Referenced by evd::DrawingPad::AnalysisBaseDraw(), and evd::DrawingPad::~DrawingPad().

std::vector<double> evd::TWireProjPad::fCurrentZoom
private

Definition at line 87 of file TWireProjPad.h.

Referenced by SetWireRange(), SetZoomFromView(), SetZoomRange(), and TWireProjPad().

DrawOptions_t evd::TWireProjPad::fDrawOpts
private

set of current draw options

Definition at line 88 of file TWireProjPad.h.

IExperimentDrawerPtr evd::DrawingPad::fGeometryDraw
protectedinherited

Drawer for detector geometry.

Definition at line 56 of file DrawingPad.h.

Referenced by evd::DrawingPad::GeometryDraw().

HeaderDrawer* evd::DrawingPad::fHeaderDraw
protectedinherited

Drawer for event header info.

Definition at line 54 of file DrawingPad.h.

Referenced by evd::DrawingPad::HeaderDraw(), and evd::DrawingPad::~DrawingPad().

TH1F* evd::TWireProjPad::fHisto
private

Histogram to draw object on.

Definition at line 92 of file TWireProjPad.h.

Referenced by Draw(), GetWireRange(), SetWireRange(), SetZoomFromView(), SetZoomRange(), TWireProjPad(), and ~TWireProjPad().

int evd::TWireProjPad::fOri
private

Orientation of the axes - see RawDrawingOptions for values.

Definition at line 99 of file TWireProjPad.h.

Referenced by Draw(), GetWireRange(), SetWireRange(), and TWireProjPad().

unsigned int evd::TWireProjPad::fPlane
private

Which plane in the detector.

Definition at line 91 of file TWireProjPad.h.

Referenced by ClearHitList(), Draw(), DrawLinesinView(), SaveHitList(), SelectOneHit(), SetZoomFromView(), SetZoomRange(), ShowFull(), and TWireProjPad().

RawDataDrawer* evd::DrawingPad::fRawDataDraw
protectedinherited

Drawer for raw data.

Definition at line 58 of file DrawingPad.h.

Referenced by evd::DrawingPad::RawDataDraw(), and evd::DrawingPad::~DrawingPad().

RecoBaseDrawer* evd::DrawingPad::fRecoBaseDraw
protectedinherited

Drawer for recobase objects.

Definition at line 59 of file DrawingPad.h.

Referenced by evd::DrawingPad::RecoBaseDraw(), and evd::DrawingPad::~DrawingPad().

SimulationDrawer* evd::DrawingPad::fSimulationDraw
protectedinherited

Drawer for simulation objects.

Definition at line 57 of file DrawingPad.h.

Referenced by evd::DrawingPad::SimulationDraw(), and evd::DrawingPad::~DrawingPad().

evdb::View2D* evd::TWireProjPad::fView
private

Collection of graphics objects to render.

Definition at line 93 of file TWireProjPad.h.

Referenced by Draw(), DrawLinesinView(), SaveHitList(), SaveSeedList(), SelectOneHit(), TWireProjPad(), UpdateSeedCurve(), and ~TWireProjPad().

double evd::TWireProjPad::fXHi
private

High value of x axis.

Definition at line 96 of file TWireProjPad.h.

Referenced by Draw(), ShowFull(), and TWireProjPad().

double evd::TWireProjPad::fXLo
private

Low value of x axis.

Definition at line 95 of file TWireProjPad.h.

Referenced by Draw(), ShowFull(), and TWireProjPad().

double evd::TWireProjPad::fYHi
private

High value of y axis.

Definition at line 98 of file TWireProjPad.h.

Referenced by Draw(), ShowFull(), and TWireProjPad().

double evd::TWireProjPad::fYLo
private

Low value of y axis.

Definition at line 97 of file TWireProjPad.h.

Referenced by Draw(), ShowFull(), and TWireProjPad().


The documentation for this class was generated from the following files: