Classes | Public Member Functions | Private Attributes | List of all members
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)
 
evdb::View2D * View () const
 
std::vector< double > const & GetCurrentZoom () const
 
- Public Member Functions inherited from evd::DrawingPad
 DrawingPad (const char *nm, const char *ti, double x1, double y1, double y2, double x2)
 
 ~DrawingPad ()
 
TPad * Pad ()
 
HeaderDrawerHeaderDraw ()
 
evd_tool::IExperimentDrawerGeometryDraw ()
 
SimulationDrawerSimulationDraw ()
 
RawDataDrawerRawDataDraw ()
 
RecoBaseDrawerRecoBaseDraw ()
 
AnalysisBaseDrawerAnalysisBaseDraw ()
 
HitSelectorHitSelectorGet ()
 

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::View2D * fView
 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...
 

Additional Inherited Members

- Protected Types inherited from evd::DrawingPad
using IExperimentDrawerPtr = std::unique_ptr< evd_tool::IExperimentDrawer >
 
- Protected Attributes inherited from evd::DrawingPad
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...
 

Detailed Description

A drawing pad for time vs wire.

Definition at line 26 of file TWireProjPad.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 106 of file TWireProjPad.cxx.

113  : DrawingPad(nm, ti, x1, x2, y1, y2), fPlane(plane)
114  {
115  fCurrentZoom.resize(4);
116 
118 
119  this->Pad()->cd();
120 
121  this->Pad()->SetLeftMargin(0.070);
122  this->Pad()->SetRightMargin(0.010);
123 
124  // how many planes in the detector and
125  // which plane is this one?
126 
127  unsigned int planes = geo->Nplanes();
128  this->Pad()->SetTopMargin(0.005);
129  this->Pad()->SetBottomMargin(0.110);
130 
131  // there has to be a better way of doing this that does
132  // not have a case for each number of planes in a detector
133  if (planes == 2 && fPlane > 0) {
134  this->Pad()->SetTopMargin(0.110);
135  this->Pad()->SetBottomMargin(0.005);
136  }
137  else if (planes > 2) {
138  if (fPlane == 1) {
139  this->Pad()->SetTopMargin(0.055);
140  this->Pad()->SetBottomMargin(0.055);
141  }
142  else if (fPlane == 2) {
143  this->Pad()->SetTopMargin(0.110);
144  this->Pad()->SetBottomMargin(0.005);
145  }
146  }
147 
148  TString planeNo = "fTWirePlane";
149  planeNo += fPlane;
150 
151  // picking the information from the current TPC
153  auto const signalType = geo->SignalType({rawopt->CurrentTPC(), fPlane});
154  TString xtitle = ";Induction Wire;t (tdc)";
155  if (signalType == geo::kCollection) xtitle = ";Collection Wire;t (tdc)";
156 
157  unsigned int const nWires = geo->Nwires(fPlane);
158  unsigned int const nTicks = RawDataDraw()->TotalClockTicks();
159 
160  fXLo = -0.005 * (nWires - 1);
161  fXHi = 1.005 * (nWires - 1);
162  fYLo = 0.990 * (unsigned int)(this->RawDataDraw()->StartTick());
163  fYHi = 1.005 * std::min((unsigned int)(this->RawDataDraw()->StartTick() + nTicks), nTicks);
164 
165  fOri = rawopt->fAxisOrientation;
166  if (fOri > 0) {
167  fYLo = -0.005 * (nWires - 1);
168  fYHi = 1.005 * (nWires - 1);
169  fYLo = 0.990 * (unsigned int)(this->RawDataDraw()->StartTick());
170  fYHi = 1.005 * std::min((unsigned int)(this->RawDataDraw()->StartTick() + nTicks), nTicks);
171  fXLo = -0.005 * nTicks;
172  fXHi = 1.010 * nTicks;
173  xtitle = ";t (tdc);InductionWire";
174  if (signalType == geo::kCollection) xtitle = ";t (tdc);Collection Wire";
175  }
176 
177  // make the range of the histogram be the biggest extent
178  // in both directions and then use SetRangeUser() to shrink it down
179  // that will allow us to change the axes on the fly
180  double min = std::min(fXLo, fYLo);
181  double max = std::max(fXHi, fYHi);
182 
183  fHisto = new TH1F(*(fPad->DrawFrame(min, min, max, max)));
184 
185  fHisto->SetTitleOffset(0.5, "Y");
186  fHisto->SetTitleOffset(0.75, "X");
188  fHisto->GetYaxis()->SetLabelSize(0.05);
189  fHisto->GetYaxis()->CenterTitle();
190  fHisto->GetXaxis()->SetLabelSize(0.05);
191  fHisto->GetXaxis()->CenterTitle();
192  fHisto->Draw("AB");
193 
194  fView = new evdb::View2D();
195  }
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:84
double fXLo
Low value of x axis.
Definition: TWireProjPad.h:88
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.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:106
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:92
double fXHi
High value of x axis.
Definition: TWireProjPad.h:89
TPad * Pad()
Definition: DrawingPad.h:37
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
double TotalClockTicks() const
Definition: RawDataDrawer.h:82
double fYLo
Low value of y axis.
Definition: TWireProjPad.h:90
static int max(int a, int b)
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:85
double StartTick() const
Definition: RawDataDrawer.h:77
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
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:52
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:80
LArSoft geometry interface.
Definition: ChannelGeo.h:16
double fYHi
High value of y axis.
Definition: TWireProjPad.h:91
DrawingPad(const char *nm, const char *ti, double x1, double y1, double y2, double x2)
Definition: DrawingPad.cxx:36
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:86
Signal from collection planes.
Definition: geo_types.h:146
evd::TWireProjPad::~TWireProjPad ( )

Definition at line 198 of file TWireProjPad.cxx.

199  {
200  if (fHisto) {
201  delete fHisto;
202  fHisto = 0;
203  }
204  if (fView) {
205  delete fView;
206  fView = 0;
207  }
208  }
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:85
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:86

Member Function Documentation

void evd::TWireProjPad::ClearandUpdatePad ( )

Definition at line 449 of file TWireProjPad.cxx.

450  {
451  fPad->Clear();
452  this->UpdatePad();
453 
454  return;
455  }
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
void evd::TWireProjPad::ClearHitList ( )

Definition at line 298 of file TWireProjPad.cxx.

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

Definition at line 212 of file TWireProjPad.cxx.

213  {
214  // DumpPadsInCanvas(fPad, "TWireProjPad", "Draw()");
215  MF_LOG_DEBUG("TWireProjPad") << "Started to draw plane " << fPlane;
216 
217  ///\todo: Why is kSelectedColor hard coded?
218  int kSelectedColor = 4;
219  fView->Clear();
220 
221  // grab the singleton holding the art::Event
222  art::Event const* evtPtr = evdb::EventHolder::Instance()->GetEvent();
223  if (evtPtr) {
224  auto const& evt = *evtPtr;
225  auto const clockData =
227  auto const detProp =
230 
232 
233  // the 2D pads have too much detail to be rendered on screen;
234  // to act smarter, RawDataDrawer needs to know the range being plotted
236  this->RawDataDraw()->RawDigit2D(
237  evt, detProp, fView, fPlane, GetDrawOptions().bZoom2DdrawToRoI);
238 
239  this->RecoBaseDraw()->Wire2D(evt, fView, fPlane);
240  this->RecoBaseDraw()->Hit2D(evt, detProp, fView, fPlane);
241 
242  if (recoOpt->fUseHitSelector)
243  this->RecoBaseDraw()->Hit2D(
244  this->HitSelectorGet()->GetSelectedHits(fPlane), kSelectedColor, fView, true);
245 
246  this->RecoBaseDraw()->Slice2D(evt, detProp, fView, fPlane);
247  this->RecoBaseDraw()->Cluster2D(evt, clockData, detProp, fView, fPlane);
248  this->RecoBaseDraw()->EndPoint2D(evt, fView, fPlane);
249  this->RecoBaseDraw()->Prong2D(evt, clockData, detProp, fView, fPlane);
250  this->RecoBaseDraw()->Vertex2D(evt, detProp, fView, fPlane);
251  this->RecoBaseDraw()->Seed2D(evt, detProp, fView, fPlane);
252  this->RecoBaseDraw()->OpFlash2D(evt, clockData, detProp, fView, fPlane);
253  this->RecoBaseDraw()->Event2D(evt, fView, fPlane);
254  this->RecoBaseDraw()->DrawTrackVertexAssns2D(evt, clockData, detProp, fView, fPlane);
255 
256  UpdatePad();
257  } // if (evt)
258 
260 
261  // check if we need to swap the axis ranges
263  if (fOri != rawopt->fAxisOrientation) {
264  fOri = rawopt->fAxisOrientation;
265  double max = fXHi;
266  double min = fXLo;
267  fXHi = fYHi;
268  fXLo = fYLo;
269  fYHi = max;
270  fYLo = min;
271 
273 
274  TString xtitle = fHisto->GetXaxis()->GetTitle();
275  fHisto->GetXaxis()->SetTitle(fHisto->GetYaxis()->GetTitle());
276  fHisto->GetYaxis()->SetTitle(xtitle);
277  }
278 
279  if (fPlane > 0)
280  fHisto->Draw("X+");
281  else
282  fHisto->Draw("");
283 
284  // Check if we should zoom the displays;
285  // if there is no event, we have no clue about the region of interest
286  // and therefore we don't touch anything
287  if (opt == 0 && evtPtr) { this->ShowFull(); }
288 
289  MF_LOG_DEBUG("TWireProjPad") << "Started rendering plane " << fPlane;
290 
291  fView->Draw();
292 
293  MF_LOG_DEBUG("TWireProjPad") << "Drawing of plane " << fPlane << " completed";
294  }
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:84
opt
Definition: train.py:196
void ShowFull(int override=0)
double fXLo
Low value of x axis.
Definition: TWireProjPad.h:88
void RawDigit2D(art::Event const &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane, bool bZoomToRoI=false)
Draws raw digit content in 2D wire plane representation.
void Prong2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
void Slice2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
void Cluster2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
void DrawTrackVertexAssns2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
std::vector< double > const & GetCurrentZoom() const
Definition: TWireProjPad.h:72
void Seed2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:106
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:92
double fXHi
High value of x axis.
Definition: TWireProjPad.h:89
DrawOptions_t const & GetDrawOptions() const
Return the current draw options.
Definition: TWireProjPad.h:44
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:117
int Hit2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
double fYLo
Low value of y axis.
Definition: TWireProjPad.h:90
static int max(int a, int b)
SimulationDrawer * SimulationDraw()
Definition: DrawingPad.cxx:96
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:85
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
void SetZoomRange(int i1, int i2, int y1, int y2)
void EndPoint2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void Wire2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
#define MF_LOG_DEBUG(id)
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:141
int fAxisOrientation
0 = TDC values on y-axis, wire number on x-axis, 1 = swapped
void OpFlash2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
void MCTruthVectors2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void Event2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
TCEvent evt
Definition: DataStructs.cxx:7
void Vertex2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
double fYHi
High value of y axis.
Definition: TWireProjPad.h:91
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:86
void ExtractRange(TVirtualPad *pPad, std::vector< double > const *zoom=nullptr)
Fills the viewport information from the specified pad.
void evd::TWireProjPad::DrawLinesinView ( std::vector< util::PxLine lines,
bool  deleting = false,
const char *  zoom_opt = 0 
)

Definition at line 472 of file TWireProjPad.cxx.

475  {
476  fPad->cd();
477  if (deleting) {
478  fPad->Clear();
479  this->Draw(zoom_opt);
480  }
481  else {
482  fView->Clear();
483  fView->Draw();
484  }
485 
486  mf::LogVerbatim("TWireProjPad") << "Drawing " << lines.size() << " lines";
487 
488  for (size_t is = 0; is < lines.size(); ++is) {
489  if (fPlane != lines[is].plane) continue;
490 
491  TLine& l = fView->AddLine(lines[is].w0, lines[is].t0, lines[is].w1, lines[is].t1);
492 
493  fView->Draw();
494  evd::Style::FromPDG(l, 11);
495  }
496 
497  fView->Draw();
498  UpdatePad();
499  fView->Draw();
500 
501  return;
502  }
code to link reconstructed objects back to the MC truth information
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:84
void Draw(const char *opt=0)
static void FromPDG(TLine &line, int pdgcode)
Definition: Style.cxx:139
static QStrList * l
Definition: config.cpp:1044
static const char * zoom_opt
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:86
std::vector<double> const& evd::TWireProjPad::GetCurrentZoom ( ) const
inline

Definition at line 72 of file TWireProjPad.h.

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

Return the current draw options.

Definition at line 44 of file TWireProjPad.h.

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

Definition at line 62 of file TWireProjPad.h.

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

Definition at line 337 of file TWireProjPad.cxx.

338  {
339  if (fOri < 1) {
340  *i1 = fHisto->GetXaxis()->GetFirst();
341  *i2 = fHisto->GetXaxis()->GetLast();
342  }
343  else {
344  *i1 = fHisto->GetYaxis()->GetFirst();
345  *i2 = fHisto->GetYaxis()->GetLast();
346  }
347  }
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:92
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:85
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 397 of file TWireProjPad.cxx.

404  {
405  const art::Event* evtPtr = evdb::EventHolder::Instance()->GetEvent();
406  if (evtPtr) {
407  auto const& evt = *evtPtr;
409  if (recoopt->fUseHitSelector) {
410  this->HitSelectorGet()->SaveHits(evt, fPlane, i1, i2, y1, y2, distance, good_plane);
411  this->Draw(zoom_opt);
412  }
413  }
414  }
void SaveHits(const art::Event &evt, unsigned int plane, double x, double y, double x1, double y1, double distance, bool good_plane=true)
Definition: HitSelector.cxx:88
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:84
void Draw(const char *opt=0)
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:141
static const char * zoom_opt
TCEvent evt
Definition: DataStructs.cxx:7
double evd::TWireProjPad::SaveSeedList ( std::vector< util::PxLine seedlines,
double  distance 
)

Definition at line 420 of file TWireProjPad.cxx.

421  {
422  double KineticEnergy = util::kBogusD;
423  const art::Event* evt = evdb::EventHolder::Instance()->GetEvent();
424  if (evt) {
426  if (recoopt->fUseHitSelector)
427  KineticEnergy = this->HitSelectorGet()->SaveSeedLines(*evt, seedlines, distance);
428  }
429  return KineticEnergy;
430  }
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:141
double SaveSeedLines(const art::Event &evt, std::vector< util::PxLine > seedline, double distance)
Definition: HitSelector.cxx:50
constexpr double kBogusD
obviously bogus double value
TCEvent evt
Definition: DataStructs.cxx:7
void evd::TWireProjPad::SelectOneHit ( double  x,
double  y,
const char *  zoom_opt 
)

Definition at line 434 of file TWireProjPad.cxx.

435  {
436 
437  const art::Event* evt = evdb::EventHolder::Instance()->GetEvent();
438  if (evt) {
440  if (recoopt->fUseHitSelector) {
441  this->HitSelectorGet()->ChangeHit(*evt, fPlane, x, y);
442  this->Draw(zoom_opt);
443  }
444  }
445  }
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:84
void Draw(const char *opt=0)
void ChangeHit(const art::Event &evt, unsigned int plane, double x, double y)
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:141
static const char * zoom_opt
list x
Definition: train.py:276
TCEvent evt
Definition: DataStructs.cxx:7
void evd::TWireProjPad::SetDrawOptions ( DrawOptions_t const &  opt)
inline

Receive the full set of draw options.

Definition at line 46 of file TWireProjPad.h.

46 { fDrawOpts = opt; }
opt
Definition: train.py:196
DrawOptions_t fDrawOpts
set of current draw options
Definition: TWireProjPad.h:81
void evd::TWireProjPad::SetWireRange ( int  i1,
int  i2 
)

Definition at line 353 of file TWireProjPad.cxx.

354  {
355  if (fOri < 1) { fHisto->GetXaxis()->SetRange(i1, i2); }
356  else {
357  fHisto->GetYaxis()->SetRange(i1, i2);
358  }
359  fCurrentZoom[0] = i1;
360  fCurrentZoom[1] = i2;
361  }
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:92
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:85
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:80
void evd::TWireProjPad::SetZoomFromView ( )

Sets the zoom parameters from the current histogram view.

Definition at line 384 of file TWireProjPad.cxx.

385  {
386  TAxis const& xaxis = *(fHisto->GetXaxis());
387  fCurrentZoom[0] = xaxis.GetBinLowEdge(xaxis.GetFirst());
388  fCurrentZoom[1] = xaxis.GetBinUpEdge(xaxis.GetLast());
389  fCurrentZoom[2] = fHisto->GetMinimum();
390  fCurrentZoom[3] = fHisto->GetMaximum();
391  MF_LOG_DEBUG("TWireProjPad") << "Zoom set to wires (" << fCurrentZoom[0] << "; "
392  << fCurrentZoom[1] << " ), tick (" << fCurrentZoom[2] << "; "
393  << fCurrentZoom[3] << ") for plane #" << fPlane;
394  } // TWireProjPad::SetZoomFromView()
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:84
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:85
#define MF_LOG_DEBUG(id)
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:80
void evd::TWireProjPad::SetZoomRange ( int  i1,
int  i2,
int  y1,
int  y2 
)

Definition at line 367 of file TWireProjPad.cxx.

368  {
369  MF_LOG_DEBUG("TWireProjPad") << "SetZoomRange(" << i1 << ", " << i2 << ", " << y1 << ", " << y2
370  << ") on plane #" << fPlane;
371 
372  fHisto->GetXaxis()->SetRangeUser(i1, i2);
373  fHisto->GetYaxis()->SetRangeUser(y1, y2);
374  fCurrentZoom[0] = i1;
375  fCurrentZoom[1] = i2;
376  fCurrentZoom[2] = y1;
377  fCurrentZoom[3] = y2;
378  }
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:84
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:85
#define MF_LOG_DEBUG(id)
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:80
void evd::TWireProjPad::SetZoomToRoI ( bool  bZoomToRoI)
inline

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

Definition at line 49 of file TWireProjPad.h.

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

Definition at line 311 of file TWireProjPad.cxx.

312  {
313  // x values are wire numbers, y values are ticks of the clock
314  int xmin = fXLo;
315  int xmax = fXHi;
316  int ymax = fYHi;
317  int ymin = fYLo;
318 
321 
322  if (GetDrawOptions().bZoom2DdrawToRoI && !override) {
323  int test = 0;
324  if (rawopt->fDrawRawDataOrCalibWires == 0)
325  test = RawDataDraw()->GetRegionOfInterest((int)fPlane, xmin, xmax, ymin, ymax);
326  else
327  test = RecoBaseDraw()->GetRegionOfInterest((int)fPlane, xmin, xmax, ymin, ymax);
328 
329  if (test != 0) return;
330  }
331 
332  SetZoomRange(xmin, xmax, ymin, ymax);
333  }
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:84
double fXLo
Low value of x axis.
Definition: TWireProjPad.h:88
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:106
double fXHi
High value of x axis.
Definition: TWireProjPad.h:89
DrawOptions_t const & GetDrawOptions() const
Return the current draw options.
Definition: TWireProjPad.h:44
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:117
double fYLo
Low value of y axis.
Definition: TWireProjPad.h:90
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:91
void evd::TWireProjPad::UpdatePad ( )

Definition at line 459 of file TWireProjPad.cxx.

460  {
461  fPad->cd();
462  fPad->Modified();
463  fPad->Update();
464  fPad->GetFrame()->SetBit(TPad::kCannotMove, true);
465  fPad->SetBit(TPad::kCannotMove, true);
466 
467  return;
468  }
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:52
evdb::View2D* evd::TWireProjPad::View ( ) const
inline

Definition at line 70 of file TWireProjPad.h.

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

Member Data Documentation

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

Definition at line 80 of file TWireProjPad.h.

DrawOptions_t evd::TWireProjPad::fDrawOpts
private

set of current draw options

Definition at line 81 of file TWireProjPad.h.

TH1F* evd::TWireProjPad::fHisto
private

Histogram to draw object on.

Definition at line 85 of file TWireProjPad.h.

int evd::TWireProjPad::fOri
private

Orientation of the axes - see RawDrawingOptions for values.

Definition at line 92 of file TWireProjPad.h.

unsigned int evd::TWireProjPad::fPlane
private

Which plane in the detector.

Definition at line 84 of file TWireProjPad.h.

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

Collection of graphics objects to render.

Definition at line 86 of file TWireProjPad.h.

double evd::TWireProjPad::fXHi
private

High value of x axis.

Definition at line 89 of file TWireProjPad.h.

double evd::TWireProjPad::fXLo
private

Low value of x axis.

Definition at line 88 of file TWireProjPad.h.

double evd::TWireProjPad::fYHi
private

High value of y axis.

Definition at line 91 of file TWireProjPad.h.

double evd::TWireProjPad::fYLo
private

Low value of y axis.

Definition at line 90 of file TWireProjPad.h.


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