LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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)
 
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 27 of file TWireProjPad.h.

Member Typedef Documentation

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

Definition at line 43 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 106 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, geo::GeometryCore::Nplanes(), geo::GeometryCore::Nwires(), evd::DrawingPad::Pad(), evd::DrawingPad::RawDataDraw(), SetZoomRange(), geo::GeometryCore::SignalType(), evd::RawDataDrawer::StartTick(), and evd::RawDataDrawer::TotalClockTicks().

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({rawopt->CurrentTPC(), 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  }
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:92
double fXLo
Low value of x axis.
Definition: TWireProjPad.h:96
Float_t y2[n_points_geant4]
Definition: compare.C:26
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:121
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:100
double fXHi
High value of x axis.
Definition: TWireProjPad.h:97
TPad * Pad()
Definition: DrawingPad.h:31
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
double TotalClockTicks() const
Definition: RawDataDrawer.h:84
double fYLo
Low value of y axis.
Definition: TWireProjPad.h:98
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:93
double StartTick() const
Definition: RawDataDrawer.h:83
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
void SetZoomRange(int i1, int i2, int y1, int y2)
unsigned int Nwires(PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
int fAxisOrientation
0 = TDC values on y-axis, wire number on x-axis, 1 = swapped
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Definition: GeometryCore.h:977
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:45
Float_t x2[n_points_geant4]
Definition: compare.C:26
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:89
Namespace collecting geometry-related classes utilities.
double fYHi
High value of y axis.
Definition: TWireProjPad.h:99
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:94
Signal from collection planes.
Definition: geo_types.h:152
evd::TWireProjPad::~TWireProjPad ( )

Definition at line 198 of file TWireProjPad.cxx.

References fHisto, and fView.

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:93
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:94

Member Function Documentation

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

Provide access to the drawer for AnalysisBase classes

Definition at line 143 of file DrawingPad.cxx.

References evd::DrawingPad::fAnalysisBaseDraw.

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

144  {
145  if (fAnalysisBaseDraw == 0) fAnalysisBaseDraw = new AnalysisBaseDrawer();
146  return fAnalysisBaseDraw;
147  }
AnalysisBaseDrawer * fAnalysisBaseDraw
Drawer for analysisbase objects.
Definition: DrawingPad.h:51
void evd::TWireProjPad::ClearandUpdatePad ( )

Definition at line 438 of file TWireProjPad.cxx.

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

Referenced by Draw().

439  {
440  fPad->Clear();
441  this->UpdatePad();
442 
443  return;
444  }
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:45
void evd::TWireProjPad::ClearHitList ( )

Definition at line 296 of file TWireProjPad.cxx.

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

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

Definition at line 211 of file TWireProjPad.cxx.

References evdb::View2D::Clear(), ClearandUpdatePad(), evd::RecoBaseDrawer::Cluster2D(), evdb::View2D::Draw(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), evd::RecoBaseDrawer::EndPoint2D(), evd::RecoBaseDrawer::Event2D(), tca::evt, evd::RawDataDrawer::ExtractRange(), 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(), evd::SimulationDrawer::MCTruthVectors2D(), MF_LOG_DEBUG, evd::RecoBaseDrawer::OpFlash2D(), evd::RecoBaseDrawer::Prong2D(), evd::DrawingPad::RawDataDraw(), evd::RawDataDrawer::RawDigit2D(), evd::DrawingPad::RecoBaseDraw(), evd::RecoBaseDrawer::Seed2D(), SetZoomRange(), ShowFull(), evd::DrawingPad::SimulationDraw(), evd::RecoBaseDrawer::Slice2D(), UpdatePad(), evd::RecoBaseDrawer::Vertex2D(), and evd::RecoBaseDrawer::Wire2D().

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

212  {
213  // DumpPadsInCanvas(fPad, "TWireProjPad", "Draw()");
214  MF_LOG_DEBUG("TWireProjPad") << "Started to draw plane " << fPlane;
215 
217  int kSelectedColor = 4;
218  fView->Clear();
219 
220  // grab the singleton holding the art::Event
221  art::Event const* evtPtr = evdb::EventHolder::Instance()->GetEvent();
222  if (evtPtr) {
223  auto const& evt = *evtPtr;
224  auto const clockData =
226  auto const detProp =
229 
231 
232  // the 2D pads have too much detail to be rendered on screen;
233  // to act smarter, RawDataDrawer needs to know the range being plotted
235  this->RawDataDraw()->RawDigit2D(
236  evt, detProp, fView, fPlane, GetDrawOptions().bZoom2DdrawToRoI);
237 
238  this->RecoBaseDraw()->Wire2D(evt, fView, fPlane);
239  this->RecoBaseDraw()->Hit2D(evt, detProp, fView, fPlane);
240 
241  if (recoOpt->fUseHitSelector)
242  this->RecoBaseDraw()->Hit2D(
243  this->HitSelectorGet()->GetSelectedHits(fPlane), kSelectedColor, fView, true);
244 
245  this->RecoBaseDraw()->Slice2D(evt, detProp, fView, fPlane);
246  this->RecoBaseDraw()->Cluster2D(evt, clockData, detProp, fView, fPlane);
247  this->RecoBaseDraw()->EndPoint2D(evt, fView, fPlane);
248  this->RecoBaseDraw()->Prong2D(evt, clockData, detProp, fView, fPlane);
249  this->RecoBaseDraw()->Vertex2D(evt, detProp, fView, fPlane);
250  this->RecoBaseDraw()->Seed2D(evt, detProp, fView, fPlane);
251  this->RecoBaseDraw()->OpFlash2D(evt, clockData, detProp, fView, fPlane);
252  this->RecoBaseDraw()->Event2D(evt, fView, fPlane);
253  this->RecoBaseDraw()->DrawTrackVertexAssns2D(evt, clockData, detProp, fView, fPlane);
254 
255  UpdatePad();
256  } // if (evt)
257 
259 
260  // check if we need to swap the axis ranges
262  if (fOri != rawopt->fAxisOrientation) {
263  fOri = rawopt->fAxisOrientation;
264  double max = fXHi;
265  double min = fXLo;
266  fXHi = fYHi;
267  fXLo = fYLo;
268  fYHi = max;
269  fYLo = min;
270 
272 
273  TString xtitle = fHisto->GetXaxis()->GetTitle();
274  fHisto->GetXaxis()->SetTitle(fHisto->GetYaxis()->GetTitle());
275  fHisto->GetYaxis()->SetTitle(xtitle);
276  }
277 
278  if (fPlane > 0)
279  fHisto->Draw("X+");
280  else
281  fHisto->Draw("");
282 
283  // Check if we should zoom the displays;
284  // if there is no event, we have no clue about the region of interest
285  // and therefore we don't touch anything
286  if (opt == 0 && evtPtr) { this->ShowFull(); }
287 
288  MF_LOG_DEBUG("TWireProjPad") << "Started rendering plane " << fPlane;
289 
290  fView->Draw();
291 
292  MF_LOG_DEBUG("TWireProjPad") << "Drawing of plane " << fPlane << " completed";
293  }
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:92
void ShowFull(int override=0)
double fXLo
Low value of x axis.
Definition: TWireProjPad.h:96
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 Clear()
Definition: View2D.cxx:109
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:83
void Seed2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:121
void Draw()
Definition: View2D.cxx:89
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:100
static EventHolder * Instance()
Definition: EventHolder.cxx:15
double fXHi
High value of x axis.
Definition: TWireProjPad.h:97
DrawOptions_t const & GetDrawOptions() const
Return the current draw options.
Definition: TWireProjPad.h:48
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:132
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:98
SimulationDrawer * SimulationDraw()
Definition: DrawingPad.cxx:112
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:93
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:155
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:45
TCEvent evt
Definition: DataStructs.cxx:8
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:99
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:94
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 459 of file TWireProjPad.cxx.

References evdb::View2D::AddLine(), evdb::View2D::Clear(), evdb::View2D::Draw(), Draw(), evd::DrawingPad::fPad, fPlane, evd::Style::FromPDG(), fView, t1, and UpdatePad().

462  {
463  fPad->cd();
464  if (deleting) {
465  fPad->Clear();
466  this->Draw(zoom_opt);
467  }
468  else {
469  fView->Clear();
470  fView->Draw();
471  }
472 
473  mf::LogVerbatim("TWireProjPad") << "Drawing " << lines.size() << " lines";
474 
475  for (size_t is = 0; is < lines.size(); ++is) {
476  if (fPlane != lines[is].plane) continue;
477 
478  TLine& l = fView->AddLine(lines[is].w0, lines[is].t0, lines[is].w1, lines[is].t1);
479 
480  fView->Draw();
481  evd::Style::FromPDG(l, 11);
482  }
483 
484  fView->Draw();
485  UpdatePad();
486  fView->Draw();
487 
488  return;
489  }
code to link reconstructed objects back to the MC truth information
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
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:92
void Draw(const char *opt=0)
static void FromPDG(TLine &line, int pdgcode)
Definition: Style.cxx:131
void Clear()
Definition: View2D.cxx:109
void Draw()
Definition: View2D.cxx:89
static const char * zoom_opt
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:45
evdb::View2D * fView
Collection of graphics objects to render.
Definition: TWireProjPad.h:94
evd_tool::IExperimentDrawer * evd::DrawingPad::GeometryDraw ( )
inherited

Provide access to the drawer for the detector geometry

Definition at line 97 of file DrawingPad.cxx.

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

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

98  {
99  if (fGeometryDraw == 0) {
101  const fhicl::ParameterSet& pset = layoutOptions->fParameterSet;
102 
103  fGeometryDraw = art::make_tool<evd_tool::IExperimentDrawer>(
104  pset.get<fhicl::ParameterSet>("Experiment3DDrawer"));
105  }
106  return fGeometryDraw.get();
107  }
IExperimentDrawerPtr fGeometryDraw
Drawer for detector geometry.
Definition: DrawingPad.h:47
T get(std::string const &key) const
Definition: ParameterSet.h:314
fhicl::ParameterSet const & fParameterSet
std::vector<double> const& evd::TWireProjPad::GetCurrentZoom ( ) const
inline

Definition at line 83 of file TWireProjPad.h.

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

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

Return the current draw options.

Definition at line 48 of file TWireProjPad.h.

Referenced by Draw(), and ShowFull().

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

Definition at line 71 of file TWireProjPad.h.

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

Definition at line 333 of file TWireProjPad.cxx.

References fHisto, and fOri.

334  {
335  if (fOri < 1) {
336  *i1 = fHisto->GetXaxis()->GetFirst();
337  *i2 = fHisto->GetXaxis()->GetLast();
338  }
339  else {
340  *i1 = fHisto->GetYaxis()->GetFirst();
341  *i2 = fHisto->GetYaxis()->GetLast();
342  }
343  }
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:100
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:93
HeaderDrawer * evd::DrawingPad::HeaderDraw ( )
inherited

Provide access to the drawer for the detector geometry

Definition at line 88 of file DrawingPad.cxx.

References evd::DrawingPad::fHeaderDraw.

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

89  {
90  if (fHeaderDraw == 0) fHeaderDraw = new HeaderDrawer();
91  return fHeaderDraw;
92  }
HeaderDrawer * fHeaderDraw
Drawer for event header info.
Definition: DrawingPad.h:46
HitSelector * evd::DrawingPad::HitSelectorGet ( )
inherited

Provide access to the HitSelector

Definition at line 155 of file DrawingPad.cxx.

References evd::gTheHitSelector.

Referenced by ClearHitList(), Draw(), SaveHitList(), SaveSeedList(), and SelectOneHit().

156  {
157  if (gTheHitSelector == 0) gTheHitSelector = new HitSelector();
158  return gTheHitSelector;
159  }
HitSelector * gTheHitSelector
Definition: DrawingPad.cxx:25
RawDataDrawer * evd::DrawingPad::RawDataDraw ( )
inherited

Provide access to the drawer for the RawData classes

Definition at line 121 of file DrawingPad.cxx.

References evd::DrawingPad::fRawDataDraw.

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

122  {
123  if (fRawDataDraw == 0) fRawDataDraw = new RawDataDrawer();
124  return fRawDataDraw;
125  }
RawDataDrawer * fRawDataDraw
Drawer for raw data.
Definition: DrawingPad.h:49
RecoBaseDrawer * evd::DrawingPad::RecoBaseDraw ( )
inherited

Provide access to the drawer for RecoBase classes

Definition at line 132 of file DrawingPad.cxx.

References evd::DrawingPad::fRecoBaseDraw.

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

133  {
134  if (fRecoBaseDraw == 0) fRecoBaseDraw = new RecoBaseDrawer();
135  return fRecoBaseDraw;
136  }
RecoBaseDrawer * fRecoBaseDraw
Drawer for recobase objects.
Definition: DrawingPad.h:50
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 389 of file TWireProjPad.cxx.

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

396  {
397  const art::Event* evtPtr = evdb::EventHolder::Instance()->GetEvent();
398  if (evtPtr) {
399  auto const& evt = *evtPtr;
401  if (recoopt->fUseHitSelector) {
402  this->HitSelectorGet()->SaveHits(evt, fPlane, i1, i2, y1, y2, distance, good_plane);
403  this->Draw(zoom_opt);
404  }
405  }
406  }
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
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:85
Float_t y1[n_points_granero]
Definition: compare.C:5
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:92
void Draw(const char *opt=0)
Float_t y2[n_points_geant4]
Definition: compare.C:26
static EventHolder * Instance()
Definition: EventHolder.cxx:15
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:155
static const char * zoom_opt
TCEvent evt
Definition: DataStructs.cxx:8
double evd::TWireProjPad::SaveSeedList ( std::vector< util::PxLine seedlines,
double  distance 
)

Definition at line 411 of file TWireProjPad.cxx.

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

412  {
413  double KineticEnergy = util::kBogusD;
415  if (evt) {
417  if (recoopt->fUseHitSelector)
418  KineticEnergy = this->HitSelectorGet()->SaveSeedLines(*evt, seedlines, distance);
419  }
420  return KineticEnergy;
421  }
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
static EventHolder * Instance()
Definition: EventHolder.cxx:15
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:155
double SaveSeedLines(const art::Event &evt, std::vector< util::PxLine > seedline, double distance)
Definition: HitSelector.cxx:48
constexpr double kBogusD
obviously bogus double value
TCEvent evt
Definition: DataStructs.cxx:8
void evd::TWireProjPad::SelectOneHit ( double  x,
double  y,
const char *  zoom_opt 
)

Definition at line 424 of file TWireProjPad.cxx.

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

425  {
426 
428  if (evt) {
430  if (recoopt->fUseHitSelector) {
431  this->HitSelectorGet()->ChangeHit(*evt, fPlane, x, y);
432  this->Draw(zoom_opt);
433  }
434  }
435  }
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:92
Float_t y
Definition: compare.C:6
void Draw(const char *opt=0)
static EventHolder * Instance()
Definition: EventHolder.cxx:15
void ChangeHit(const art::Event &evt, unsigned int plane, double x, double y)
HitSelector * HitSelectorGet()
Definition: DrawingPad.cxx:155
static const char * zoom_opt
TCEvent evt
Definition: DataStructs.cxx:8
void evd::TWireProjPad::SetDrawOptions ( DrawOptions_t const &  opt)
inline

Receive the full set of draw options.

Definition at line 50 of file TWireProjPad.h.

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

Definition at line 348 of file TWireProjPad.cxx.

References fCurrentZoom, fHisto, and fOri.

349  {
350  if (fOri < 1) { fHisto->GetXaxis()->SetRange(i1, i2); }
351  else {
352  fHisto->GetYaxis()->SetRange(i1, i2);
353  }
354  fCurrentZoom[0] = i1;
355  fCurrentZoom[1] = i2;
356  }
int fOri
Orientation of the axes - see RawDrawingOptions for values.
Definition: TWireProjPad.h:100
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:93
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:89
void evd::TWireProjPad::SetZoomFromView ( )

Sets the zoom parameters from the current histogram view.

Definition at line 377 of file TWireProjPad.cxx.

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

378  {
379  TAxis const& xaxis = *(fHisto->GetXaxis());
380  fCurrentZoom[0] = xaxis.GetBinLowEdge(xaxis.GetFirst());
381  fCurrentZoom[1] = xaxis.GetBinUpEdge(xaxis.GetLast());
382  fCurrentZoom[2] = fHisto->GetMinimum();
383  fCurrentZoom[3] = fHisto->GetMaximum();
384  MF_LOG_DEBUG("TWireProjPad") << "Zoom set to wires (" << fCurrentZoom[0] << "; "
385  << fCurrentZoom[1] << " ), tick (" << fCurrentZoom[2] << "; "
386  << fCurrentZoom[3] << ") for plane #" << fPlane;
387  } // TWireProjPad::SetZoomFromView()
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:92
TGaxis * xaxis
Definition: plot_hist.C:61
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:93
#define MF_LOG_DEBUG(id)
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:89
void evd::TWireProjPad::SetZoomRange ( int  i1,
int  i2,
int  y1,
int  y2 
)

Definition at line 361 of file TWireProjPad.cxx.

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

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

362  {
363  MF_LOG_DEBUG("TWireProjPad") << "SetZoomRange(" << i1 << ", " << i2 << ", " << y1 << ", " << y2
364  << ") on plane #" << fPlane;
365 
366  fHisto->GetXaxis()->SetRangeUser(i1, i2);
367  fHisto->GetYaxis()->SetRangeUser(y1, y2);
368  fCurrentZoom[0] = i1;
369  fCurrentZoom[1] = i2;
370  fCurrentZoom[2] = y1;
371  fCurrentZoom[3] = y2;
372  }
Float_t y1[n_points_granero]
Definition: compare.C:5
unsigned int fPlane
Which plane in the detector.
Definition: TWireProjPad.h:92
Float_t y2[n_points_geant4]
Definition: compare.C:26
TH1F * fHisto
Histogram to draw object on.
Definition: TWireProjPad.h:93
#define MF_LOG_DEBUG(id)
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:89
void evd::TWireProjPad::SetZoomToRoI ( bool  bZoomToRoI)
inline

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

Definition at line 53 of file TWireProjPad.h.

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

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

Definition at line 308 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(), and SetZoomRange().

Referenced by Draw().

309  {
310  // x values are wire numbers, y values are ticks of the clock
311  int xmin = fXLo;
312  int xmax = fXHi;
313  int ymax = fYHi;
314  int ymin = fYLo;
315 
318 
319  if (GetDrawOptions().bZoom2DdrawToRoI && !override) {
320  int test = 0;
321  if (rawopt->fDrawRawDataOrCalibWires == 0)
322  test = RawDataDraw()->GetRegionOfInterest((int)fPlane, xmin, xmax, ymin, ymax);
323  else
324  test = RecoBaseDraw()->GetRegionOfInterest((int)fPlane, xmin, xmax, ymin, ymax);
325 
326  if (test != 0) return;
327  }
328 
329  SetZoomRange(xmin, xmax, ymin, ymax);
330  }
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:92
double fXLo
Low value of x axis.
Definition: TWireProjPad.h:96
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:121
double fXHi
High value of x axis.
Definition: TWireProjPad.h:97
DrawOptions_t const & GetDrawOptions() const
Return the current draw options.
Definition: TWireProjPad.h:48
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:132
double fYLo
Low value of y axis.
Definition: TWireProjPad.h:98
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:99
SimulationDrawer * evd::DrawingPad::SimulationDraw ( )
inherited

Provide access to the drawer for the Simulation classes

Definition at line 112 of file DrawingPad.cxx.

References evd::DrawingPad::fSimulationDraw.

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

113  {
114  if (fSimulationDraw == 0) fSimulationDraw = new SimulationDrawer();
115  return fSimulationDraw;
116  }
SimulationDrawer * fSimulationDraw
Drawer for simulation objects.
Definition: DrawingPad.h:48
void evd::TWireProjPad::UpdatePad ( )

Definition at line 447 of file TWireProjPad.cxx.

References evd::DrawingPad::fPad.

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

448  {
449  fPad->cd();
450  fPad->Modified();
451  fPad->Update();
452  fPad->GetFrame()->SetBit(TPad::kCannotMove, true);
453  fPad->SetBit(TPad::kCannotMove, true);
454 
455  return;
456  }
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:45
evdb::View2D* evd::TWireProjPad::View ( ) const
inline

Definition at line 81 of file TWireProjPad.h.

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

Member Data Documentation

AnalysisBaseDrawer* evd::DrawingPad::fAnalysisBaseDraw
protectedinherited

Drawer for analysisbase objects.

Definition at line 51 of file DrawingPad.h.

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

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

Definition at line 89 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 90 of file TWireProjPad.h.

IExperimentDrawerPtr evd::DrawingPad::fGeometryDraw
protectedinherited

Drawer for detector geometry.

Definition at line 47 of file DrawingPad.h.

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

HeaderDrawer* evd::DrawingPad::fHeaderDraw
protectedinherited

Drawer for event header info.

Definition at line 46 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 93 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 100 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 92 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 49 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 50 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 48 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 94 of file TWireProjPad.h.

Referenced by Draw(), DrawLinesinView(), TWireProjPad(), and ~TWireProjPad().

double evd::TWireProjPad::fXHi
private

High value of x axis.

Definition at line 97 of file TWireProjPad.h.

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

double evd::TWireProjPad::fXLo
private

Low value of x axis.

Definition at line 96 of file TWireProjPad.h.

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

double evd::TWireProjPad::fYHi
private

High value of y axis.

Definition at line 99 of file TWireProjPad.h.

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

double evd::TWireProjPad::fYLo
private

Low value of y axis.

Definition at line 98 of file TWireProjPad.h.

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


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