LArSoft  v10_04_05
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 42 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, Get, geo::kCollection, evd::DrawingPad::Pad(), evd::DrawingPad::RawDataDraw(), SetZoomRange(), evd::RawDataDrawer::StartTick(), and evd::RawDataDrawer::TotalClockTicks().

113  : DrawingPad(nm, ti, x1, x2, y1, y2), fPlane(plane)
114  {
115  fCurrentZoom.resize(4);
116 
117  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout const>()->Get();
118  Pad()->cd();
119 
120  Pad()->SetLeftMargin(0.070);
121  Pad()->SetRightMargin(0.010);
122 
123  // how many planes in the detector and
124  // which plane is this one?
125 
126  unsigned int planes = wireReadoutGeom.Nplanes();
127  Pad()->SetTopMargin(0.005);
128  Pad()->SetBottomMargin(0.110);
129 
130  // there has to be a better way of doing this that does
131  // not have a case for each number of planes in a detector
132  if (planes == 2 && fPlane > 0) {
133  Pad()->SetTopMargin(0.110);
134  Pad()->SetBottomMargin(0.005);
135  }
136  else if (planes > 2) {
137  if (fPlane == 1) {
138  Pad()->SetTopMargin(0.055);
139  Pad()->SetBottomMargin(0.055);
140  }
141  else if (fPlane == 2) {
142  Pad()->SetTopMargin(0.110);
143  Pad()->SetBottomMargin(0.005);
144  }
145  }
146 
147  TString planeNo = "fTWirePlane";
148  planeNo += fPlane;
149 
150  // picking the information from the current TPC
152  auto const signalType = wireReadoutGeom.SignalType({rawopt->CurrentTPC(), fPlane});
153  TString xtitle = ";Induction Wire;t (tdc)";
154  if (signalType == geo::kCollection) xtitle = ";Collection Wire;t (tdc)";
155 
156  unsigned int const nWires = wireReadoutGeom.Nwires({rawopt->CurrentTPC(), fPlane});
157  unsigned int const nTicks = RawDataDraw()->TotalClockTicks();
158 
159  fXLo = -0.005 * (nWires - 1);
160  fXHi = 1.005 * (nWires - 1);
161  fYLo = 0.990 * (unsigned int)(RawDataDraw()->StartTick());
162  fYHi = 1.005 * std::min((unsigned int)(RawDataDraw()->StartTick() + nTicks), nTicks);
163 
164  fOri = rawopt->fAxisOrientation;
165  if (fOri > 0) {
166  fYLo = -0.005 * (nWires - 1);
167  fYHi = 1.005 * (nWires - 1);
168  fYLo = 0.990 * (unsigned int)(RawDataDraw()->StartTick());
169  fYHi = 1.005 * std::min((unsigned int)(RawDataDraw()->StartTick() + nTicks), nTicks);
170  fXLo = -0.005 * nTicks;
171  fXHi = 1.010 * nTicks;
172  xtitle = ";t (tdc);InductionWire";
173  if (signalType == geo::kCollection) xtitle = ";t (tdc);Collection Wire";
174  }
175 
176  // make the range of the histogram be the biggest extent
177  // in both directions and then use SetRangeUser() to shrink it down
178  // that will allow us to change the axes on the fly
179  double min = std::min(fXLo, fYLo);
180  double max = std::max(fXHi, fYHi);
181 
182  fHisto = new TH1F(*(fPad->DrawFrame(min, min, max, max)));
183 
184  fHisto->SetTitleOffset(0.5, "Y");
185  fHisto->SetTitleOffset(0.75, "X");
187  fHisto->GetYaxis()->SetLabelSize(0.05);
188  fHisto->GetYaxis()->CenterTitle();
189  fHisto->GetXaxis()->SetLabelSize(0.05);
190  fHisto->GetXaxis()->CenterTitle();
191  fHisto->Draw("AB");
192 
193  fView = new evdb::View2D();
194  }
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
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
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:30
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
double TotalClockTicks() const
Definition: RawDataDrawer.h:78
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:77
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:44
Float_t x2[n_points_geant4]
Definition: compare.C:26
std::vector< double > fCurrentZoom
Definition: TWireProjPad.h:89
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:148
evd::TWireProjPad::~TWireProjPad ( )

Definition at line 197 of file TWireProjPad.cxx.

References fHisto, and fView.

198  {
199  if (fHisto) {
200  delete fHisto;
201  fHisto = 0;
202  }
203  if (fView) {
204  delete fView;
205  fView = 0;
206  }
207  }
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:50
void evd::TWireProjPad::ClearandUpdatePad ( )

Definition at line 436 of file TWireProjPad.cxx.

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

Referenced by Draw().

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

Definition at line 294 of file TWireProjPad.cxx.

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

295  {
297  if (recoOpt->fUseHitSelector) {
299  Draw();
300  }
301  }
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 210 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().

211  {
212  // DumpPadsInCanvas(fPad, "TWireProjPad", "Draw()");
213  MF_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
220  art::Event const* evtPtr = evdb::EventHolder::Instance()->GetEvent();
221  if (evtPtr) {
222  auto const& evt = *evtPtr;
223  auto const clockData =
225  auto const detProp =
228 
230 
231  // the 2D pads have too much detail to be rendered on screen;
232  // to act smarter, RawDataDrawer needs to know the range being plotted
234  RawDataDraw()->RawDigit2D(evt, detProp, fView, fPlane, GetDrawOptions().bZoom2DdrawToRoI);
235 
237  RecoBaseDraw()->Hit2D(evt, detProp, fView, fPlane);
238 
239  if (recoOpt->fUseHitSelector)
240  RecoBaseDraw()->Hit2D(
241  HitSelectorGet()->GetSelectedHits(fPlane), kSelectedColor, fView, true);
242 
243  RecoBaseDraw()->Slice2D(evt, detProp, fView, fPlane);
244  RecoBaseDraw()->Cluster2D(evt, clockData, detProp, fView, fPlane);
246  RecoBaseDraw()->Prong2D(evt, clockData, detProp, fView, fPlane);
247  RecoBaseDraw()->Vertex2D(evt, detProp, fView, fPlane);
248  RecoBaseDraw()->Seed2D(evt, detProp, fView, fPlane);
249  RecoBaseDraw()->OpFlash2D(evt, clockData, detProp, fView, fPlane);
251  RecoBaseDraw()->DrawTrackVertexAssns2D(evt, clockData, detProp, fView, fPlane);
252 
253  UpdatePad();
254  } // if (evt)
255 
257 
258  // check if we need to swap the axis ranges
260  if (fOri != rawopt->fAxisOrientation) {
261  fOri = rawopt->fAxisOrientation;
262  double max = fXHi;
263  double min = fXLo;
264  fXHi = fYHi;
265  fXLo = fYLo;
266  fYHi = max;
267  fYLo = min;
268 
270 
271  TString xtitle = fHisto->GetXaxis()->GetTitle();
272  fHisto->GetXaxis()->SetTitle(fHisto->GetYaxis()->GetTitle());
273  fHisto->GetYaxis()->SetTitle(xtitle);
274  }
275 
276  if (fPlane > 0)
277  fHisto->Draw("X+");
278  else
279  fHisto->Draw("");
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 && evtPtr) { ShowFull(); }
285 
286  MF_LOG_DEBUG("TWireProjPad") << "Started rendering plane " << fPlane;
287 
288  fView->Draw();
289 
290  MF_LOG_DEBUG("TWireProjPad") << "Drawing of plane " << fPlane << " completed";
291  }
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:44
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 457 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().

460  {
461  fPad->cd();
462  if (deleting) {
463  fPad->Clear();
464  Draw(zoom_opt);
465  }
466  else {
467  fView->Clear();
468  fView->Draw();
469  }
470 
471  mf::LogVerbatim("TWireProjPad") << "Drawing " << lines.size() << " lines";
472 
473  for (size_t is = 0; is < lines.size(); ++is) {
474  if (fPlane != lines[is].plane) continue;
475 
476  TLine& l = fView->AddLine(lines[is].w0, lines[is].t0, lines[is].w1, lines[is].t1);
477 
478  fView->Draw();
479  evd::Style::FromPDG(l, 11);
480  }
481 
482  fView->Draw();
483  UpdatePad();
484  fView->Draw();
485 
486  return;
487  }
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:44
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:46
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 331 of file TWireProjPad.cxx.

References fHisto, and fOri.

332  {
333  if (fOri < 1) {
334  *i1 = fHisto->GetXaxis()->GetFirst();
335  *i2 = fHisto->GetXaxis()->GetLast();
336  }
337  else {
338  *i1 = fHisto->GetYaxis()->GetFirst();
339  *i2 = fHisto->GetYaxis()->GetLast();
340  }
341  }
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:45
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:48
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:49
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 387 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().

394  {
395  const art::Event* evtPtr = evdb::EventHolder::Instance()->GetEvent();
396  if (evtPtr) {
397  auto const& evt = *evtPtr;
399  if (recoopt->fUseHitSelector) {
400  HitSelectorGet()->SaveHits(evt, fPlane, i1, i2, y1, y2, distance, good_plane);
401  Draw(zoom_opt);
402  }
403  }
404  }
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:86
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 409 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().

410  {
411  double KineticEnergy = util::kBogusD;
413  if (evt) {
415  if (recoopt->fUseHitSelector)
416  KineticEnergy = HitSelectorGet()->SaveSeedLines(*evt, seedlines, distance);
417  }
418  return KineticEnergy;
419  }
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:49
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 422 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().

423  {
424 
426  if (evt) {
428  if (recoopt->fUseHitSelector) {
429  HitSelectorGet()->ChangeHit(*evt, fPlane, x, y);
430  Draw(zoom_opt);
431  }
432  }
433  }
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 346 of file TWireProjPad.cxx.

References fCurrentZoom, fHisto, and fOri.

347  {
348  if (fOri < 1) { fHisto->GetXaxis()->SetRange(i1, i2); }
349  else {
350  fHisto->GetYaxis()->SetRange(i1, i2);
351  }
352  fCurrentZoom[0] = i1;
353  fCurrentZoom[1] = i2;
354  }
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 375 of file TWireProjPad.cxx.

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

376  {
377  TAxis const& xaxis = *(fHisto->GetXaxis());
378  fCurrentZoom[0] = xaxis.GetBinLowEdge(xaxis.GetFirst());
379  fCurrentZoom[1] = xaxis.GetBinUpEdge(xaxis.GetLast());
380  fCurrentZoom[2] = fHisto->GetMinimum();
381  fCurrentZoom[3] = fHisto->GetMaximum();
382  MF_LOG_DEBUG("TWireProjPad") << "Zoom set to wires (" << fCurrentZoom[0] << "; "
383  << fCurrentZoom[1] << " ), tick (" << fCurrentZoom[2] << "; "
384  << fCurrentZoom[3] << ") for plane #" << fPlane;
385  } // 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 359 of file TWireProjPad.cxx.

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

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

360  {
361  MF_LOG_DEBUG("TWireProjPad") << "SetZoomRange(" << i1 << ", " << i2 << ", " << y1 << ", " << y2
362  << ") on plane #" << fPlane;
363 
364  fHisto->GetXaxis()->SetRangeUser(i1, i2);
365  fHisto->GetYaxis()->SetRangeUser(y1, y2);
366  fCurrentZoom[0] = i1;
367  fCurrentZoom[1] = i2;
368  fCurrentZoom[2] = y1;
369  fCurrentZoom[3] = y2;
370  }
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 306 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().

307  {
308  // x values are wire numbers, y values are ticks of the clock
309  int xmin = fXLo;
310  int xmax = fXHi;
311  int ymax = fYHi;
312  int ymin = fYLo;
313 
316 
317  if (GetDrawOptions().bZoom2DdrawToRoI && !override) {
318  int test = 0;
319  if (rawopt->fDrawRawDataOrCalibWires == 0)
320  test = RawDataDraw()->GetRegionOfInterest((int)fPlane, xmin, xmax, ymin, ymax);
321  else
322  test = RecoBaseDraw()->GetRegionOfInterest((int)fPlane, xmin, xmax, ymin, ymax);
323 
324  if (test != 0) return;
325  }
326 
327  SetZoomRange(xmin, xmax, ymin, ymax);
328  }
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:47
void evd::TWireProjPad::UpdatePad ( )

Definition at line 445 of file TWireProjPad.cxx.

References evd::DrawingPad::fPad.

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

446  {
447  fPad->cd();
448  fPad->Modified();
449  fPad->Update();
450  fPad->GetFrame()->SetBit(TPad::kCannotMove, true);
451  fPad->SetBit(TPad::kCannotMove, true);
452 
453  return;
454  }
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:44
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 50 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 46 of file DrawingPad.h.

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

HeaderDrawer* evd::DrawingPad::fHeaderDraw
protectedinherited

Drawer for event header info.

Definition at line 45 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 48 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 49 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 47 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: