LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evd::TWQMultiTPCProjectionView Class Reference

#include "TWQMultiTPCProjection.h"

Inheritance diagram for evd::TWQMultiTPCProjectionView:
evdb::Canvas evdb::Printable

Public Member Functions

 TWQMultiTPCProjectionView (TGMainFrame *mf)
 
 ~TWQMultiTPCProjectionView ()
 
const char * Description () const
 
const char * PrintTag () const
 
void Draw (const char *opt="")
 
void ChangeWire (int plane)
 
void SetMouseZoomRegion (int plane)
 
void SelectPoint (int plane)
 
void SetPlaneWire ()
 
void SetPlane ()
 
void SetWire ()
 
void SetDistance ()
 
void SetThreshold ()
 
void SetGreyscale ()
 
void SetMCInfo ()
 
void SetRawCalib ()
 
void SetUpSideBar ()
 
void SetUpZoomButtons ()
 
void SetUpPositionFind ()
 
void SetZoom (int plane, int wirelow, int wirehi, int timelo, int timehi, bool StoreZoom=true)
 
void ZoomInterest (bool flag=true)
 
void ZoomBack ()
 
void SetZoomInterest ()
 
void PrintCharge ()
 
void DrawPads (const char *opt="")
 
void FindEndPoint ()
 
double FindLineLength (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp)
 
void ClearEndPoints ()
 
void ToggleEndPointMarkers ()
 
void RadioButtonsDispatch (int parameter)
 
virtual void Print (const char *f)
 
void Connect ()
 Make signal/slot connections. More...
 

Static Public Member Functions

static void MouseDispatch (int plane, void *wqpv)
 
static void AddToListOfPrintables (const char *name, evdb::Printable *p)
 
static void RemoveFromListOfPrintables (evdb::Printable *p)
 
static std::map< std::string, evdb::Printable * > & GetPrintables ()
 

Protected Attributes

TGCompositeFrame * fFrame
 Graphics frame. More...
 
TGLayoutHints * fLayout
 Layout hints for frame. More...
 
TRootEmbeddedCanvas * fEmbCanvas
 Embedded canvas. More...
 
TCanvas * fCanvas
 The ROOT drawing canvas. More...
 
unsigned short fXsize
 Size of the canvas;. More...
 
unsigned short fYsize
 Size of the canvas;. More...
 
float fAspectRatio
 fYsize/fXsize More...
 

Private Member Functions

int DrawLine (int plane, util::PxLine &pline)
 

Private Attributes

HeaderPadfHeaderPad
 Show header information. More...
 
TQPadfWireQ
 Histogram of charge vs time on selected wire. More...
 
MCBriefPadfMC
 Short summary of MC event. More...
 
std::vector< TQPad * > fPlaneQ
 charge on each plane More...
 
std::vector< TWireProjPad * > fPlanes
 time vs wire projection for each plane More...
 
TGCompositeFrame * fVFrame
 needed for the side frame More...
 
TGCompositeFrame * fMetaFrame
 needed for the side frame More...
 
TGLabel * fWireLabel
 
TGLabel * fDistanceLabel
 
TGLabel * fPlaneLabel
 
TGLabel * fThresLabel
 
TGLabel * fGreyLabel
 
TGNumberEntry * fWireEntry
 Wire number displayed. More...
 
TGNumberEntry * fPlaneEntry
 Plane number displayed. More...
 
TGNumberEntry * fThresEntry
 ADC threshold to display. More...
 
TGNumberEntry * fDistance
 Distance from line to find hits in cluster. More...
 
TGCheckButton * fGreyScale
 Display gray or color scale. More...
 
TGCheckButton * fMCOn
 Display MC truth information. More...
 
TGRadioButton * fRawDraw
 Draw Raw information only. More...
 
TGRadioButton * fCalibDraw
 Draw calibrated information only. More...
 
TGRadioButton * fRawCalibDraw
 Draw raw and calibrated information. More...
 
TGTextButton * fZoomInterest
 Zoom on iteresting region. More...
 
TGTextButton * fUnZoomInterest
 Unzoom on iteresting region. More...
 
TGTextButton * fZoomBack
 Unzoom on iteresting region. More...
 
TGCheckButton * fToggleAutoZoom
 Toggle the autozoom setting. More...
 
TGRadioButton * fToggleZoom
 Use zoom setting. More...
 
TGTextView * fAngleInfo
 
TGTextButton * fFindEndpoint
 Calculate XYZ position of two points in wire planes. More...
 
TGTextButton * fClearPPoints
 Clear current list of End Points. More...
 
TGCheckButton * fToggleShowMarkers
 Toggle the ShowEndPointMarkersSetting. More...
 
TGTextView * fXYZPosition
 Display the xyz position. More...
 
TGTextButton * fCalcAngle
 Calculate the 2D & 3D angles between lines. More...
 
TGTextButton * fClear
 Clears the selected points in an event. More...
 
std::deque< util::PxPointppoints
 list of points in each WireProjPad used for x,y,z finding More...
 
std::deque< util::PxLinepline
 list of lines in each WireProjPad used for calculating 2d and 3d angles More...
 
ZoomOptionsMultiTPC fZoomOpt
 
std::vector< ZoomOptionsMultiTPCfPrevZoomOpt
 

Detailed Description

Definition at line 56 of file TWQMultiTPCProjection.h.

Constructor & Destructor Documentation

evd::TWQMultiTPCProjectionView::TWQMultiTPCProjectionView ( TGMainFrame *  mf)

Definition at line 53 of file TWQMultiTPCProjection.cxx.

References evd::HeaderPad::Draw(), evd::MCBriefPad::Draw(), evd::TQPad::Draw(), fCalibDraw, evdb::Canvas::fCanvas, evd::RawDrawingOptions::fDrawRawDataOrCalibWires, evdb::Canvas::fEmbCanvas, evd::EvdLayoutOptions::fEnableMCTruthCheckBox, evdb::Canvas::fFrame, fGreyScale, fHeaderPad, evdb::Canvas::fLayout, fMC, fMCOn, fMetaFrame, evd::RawDrawingOptions::fMinSignal, fPlaneEntry, fPlaneLabel, fPlaneQ, fPlanes, fRawCalibDraw, fRawDraw, evd::EvdLayoutOptions::fShowEndPointSection, evd::SimulationDrawingOptions::fShowMCTruthText, evd::EvdLayoutOptions::fShowSideBar, fThresEntry, fThresLabel, fVFrame, fWireEntry, fWireLabel, fWireQ, evdb::Canvas::fXsize, evdb::Canvas::fYsize, geo::GeometryCore::Nplanes(), geo::GeometryCore::NTPC(), geo::GeometryCore::Nwires(), evd::DrawingPad::Pad(), pline, ppoints, evd::TQPad::SetPlaneWire(), and SetUpSideBar().

53  : evdb::Canvas(mf)
54  {
55 
57 
58  // first make pads for things that don't depend on the number of
59  // planes in the detector
60  // bottom left corner is (0.,0.), top right is (1., 1.)
61 
63  fHeaderPad = new HeaderPad("fHeaderPadMultiTPC", "Header", 0.0, 0.0, 0.15, 0.13, "");
64  fHeaderPad->Draw();
65 
67  fMC = new MCBriefPad("fMCPadMultiTPC", "MC Info.", 0.15, 0.13, 1.0, 0.17, "");
68  fMC->Draw();
69 
71  fWireQ = new TQPad("fWireQPadMultiTPC", "ADCvsTime", 0.15, 0.0, 1.0, 0.13, "TQ", 0, 0);
72  fWireQ->Pad()->SetBit(TPad::kCannotMove, true);
73  fWireQ->Draw();
74 
75  // add new "meta frame" to hold the GUI Canvas and a side frame (vframe)
76  fMetaFrame = new TGCompositeFrame(mf, 60, 60, kHorizontalFrame);
77  fMetaFrame->SetBit(TPad::kCannotMove, true);
78 
79  //new frame organizing the buttons on the left of the canvas.
80  fVFrame = new TGCompositeFrame(fMetaFrame, 60, 60, kVerticalFrame);
81  // Define a layout for placing the canvas within the frame.
82  fLayout =
83  new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5);
84 
85  mf->RemoveFrame((TGFrame*)fEmbCanvas);
86  mf->RemoveFrame(fFrame);
87 
88  fEmbCanvas->ReparentWindow(fMetaFrame, fXsize, fYsize);
89 
90  fMetaFrame->AddFrame(fVFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandY));
91  fMetaFrame->AddFrame(fEmbCanvas, fLayout);
92 
93  mf->AddFrame(fMetaFrame, fLayout);
94  mf->AddFrame(fFrame);
95 
96  // plane number entry
97  fPlaneEntry = new TGNumberEntry(fFrame,
98  0,
99  2,
100  -1,
101  TGNumberFormat::kNESInteger,
102  TGNumberFormat::kNEAAnyNumber,
103  TGNumberFormat::kNELLimitMinMax,
104  0,
105  geo->Nplanes() - 1);
106 
107  kPlane = 0;
108  constexpr geo::PlaneID planeid{0, 0, 0};
109  kWire = TMath::Nint(0.5 * geo->Nwires(planeid));
110  kDistance = 1.5;
111  fWireQ->SetPlaneWire(kPlane, kWire);
112 
113  // Initial value
114  fPlaneEntry->SetNumber(kPlane);
115 
116  // There are two "signals" to which a TGNumberEntry may respond:
117  // when the user clicks on the arrows, or when the user types in a
118  // new number in the text field.
119  fPlaneEntry->Connect("ValueSet(Long_t)", "evd::TWQMultiTPCProjectionView", this, "SetPlane()");
120  fPlaneEntry->GetNumberEntry()->Connect(
121  "ReturnPressed()", "evd::TWQMultiTPCProjectionView", this, "SetPlane()");
122  // Text label for this numeric field.
123  fPlaneLabel = new TGLabel(fFrame, "Plane");
124 
125  // wire number entry
126  fWireEntry = new TGNumberEntry(fFrame,
127  0,
128  6,
129  -1,
130  TGNumberFormat::kNESInteger,
131  TGNumberFormat::kNEAAnyNumber,
132  TGNumberFormat::kNELLimitMinMax,
133  0,
134  geo->Nwires(planeid) - 1);
135  // Initial value
136  fWireEntry->SetNumber(kWire);
137 
138  // There are two "signals" to which a TGNumberEntry may respond:
139  // when the user clicks on the arrows, or when the user types in a
140  // new number in the text field.
141  fWireEntry->Connect("ValueSet(Long_t)", "evd::TWQMultiTPCProjectionView", this, "SetWire()");
142  fWireEntry->GetNumberEntry()->Connect(
143  "ReturnPressed()", "evd::TWQMultiTPCProjectionView", this, "SetWire()");
144 
145  // Text label for this numeric field.
146  fWireLabel = new TGLabel(fFrame, "Wire");
147 
148  // adc threshold number entry
149  fThresEntry = new TGNumberEntry(fFrame,
150  0,
151  6,
152  -1,
153  TGNumberFormat::kNESInteger,
154  TGNumberFormat::kNEAAnyNumber,
155  TGNumberFormat::kNELLimitMinMax,
156  0,
157  geo->Nwires(planeid) - 1);
158  // Initial value
163 
164  fThresEntry->SetNumber(rawopt->fMinSignal);
165 
166  // There are two "signals" to which a TGNumberEntry may respond:
167  // when the user clicks on the arrows, or when the user types in a
168  // new number in the text field.
169  fThresEntry->Connect(
170  "ValueSet(Long_t)", "evd::TWQMultiTPCProjectionView", this, "SetThreshold()");
171  fThresEntry->GetNumberEntry()->Connect(
172  "ReturnPressed()", "evd::TWQMultiTPCProjectionView", this, "SetThreshold()");
173 
174  // Text label for this numeric field.
175  fThresLabel = new TGLabel(fFrame, "ADC Threshold");
176 
177  // check button to toggle color vs grey
178  fGreyScale = new TGCheckButton(fFrame, "Grayscale", 1);
179  fGreyScale->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "SetGreyscale()");
180  if (cst->fColorOrGray == 1) fGreyScale->SetState(kButtonDown);
181 
182  // check button to toggle MC information
183  if (evdlayoutopt->fEnableMCTruthCheckBox) {
184  fMCOn = new TGCheckButton(fFrame, "MC Truth", 5);
185  fMCOn->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "SetMCInfo()");
186  if (sdo->fShowMCTruthText == 1) fMCOn->SetState(kButtonDown);
187  }
188 
189  // radio buttons to toggle drawing raw vs calibrated information
190  fRawCalibDraw = new TGRadioButton(fFrame, "Both", 2);
191  fCalibDraw = new TGRadioButton(fFrame, "Reconstructed", 3);
192  fRawDraw = new TGRadioButton(fFrame, "Raw", 4);
193  fRawDraw->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "SetRawCalib()");
194  fCalibDraw->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "SetRawCalib()");
195  fRawCalibDraw->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "SetRawCalib()");
196  if (rawopt->fDrawRawDataOrCalibWires == 0)
197  fRawDraw->SetState(kButtonDown);
198  else if (rawopt->fDrawRawDataOrCalibWires == 1)
199  fCalibDraw->SetState(kButtonDown);
200  else if (rawopt->fDrawRawDataOrCalibWires == 2)
201  fRawCalibDraw->SetState(kButtonDown);
202 
203  // Put all these widgets into the frame. The last
204  // four numbers in each TGLayoutHint are padleft, padright,
205  // padtop, padbottom.
206  if (evdlayoutopt->fEnableMCTruthCheckBox) {
207  fFrame->AddFrame(fMCOn, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 1));
208  }
209  fFrame->AddFrame(fGreyScale, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 1));
210  fFrame->AddFrame(fRawCalibDraw, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 1));
211  fFrame->AddFrame(fCalibDraw, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 1));
212  fFrame->AddFrame(fRawDraw, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 1));
213  fFrame->AddFrame(fPlaneEntry, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 2, 1));
214  fFrame->AddFrame(fPlaneLabel, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 1));
215  fFrame->AddFrame(fWireEntry, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 2, 1));
216  fFrame->AddFrame(fWireLabel, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 1));
217  fFrame->AddFrame(fThresEntry, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 2, 1));
218  fFrame->AddFrame(fThresLabel, new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 1));
219 
220  if (evdlayoutopt->fShowSideBar)
221  SetUpSideBar();
222  else
223  evdlayoutopt->fShowEndPointSection =
224  0; // zero it to avoid a misconfiguration in the fcl file.
225 
226  //zero the ppoints queue.
227  ppoints.clear();
228  pline.clear();
229 
230  // geometry to figure out the number of TPCs
231  unsigned int ntpc = geo->NTPC();
232 
233  // geometry to figure out the number of planes
234  unsigned int nplanes = geo->Nplanes();
235 
236  // now determine the positions of all the time vs wire number
237  // and charge histograms for the planes
238  for (unsigned int t = 0; t < ntpc; ++t) {
239  for (unsigned int i = 0; i < nplanes; ++i) {
240  double twx1 = 0. + t * 0.97 / (1. * ntpc);
241  double twx2 = t * 0.97 / (1. * ntpc);
242  double twx3 = 1.0;
243  double twy1 = 0.17 + (i) * (1.0 - 0.171) / (1. * nplanes);
244  double twy2 = 0.17 + (i + 1) * (1.0 - 0.171) / (1. * nplanes);
245 
246  TString padname = "fWireProjTPC";
247  padname += t;
248  padname += "Plane";
249  padname += i;
250 
251  TString padtitle = "TPC";
252  padtitle += t;
253  padtitle += "Plane";
254  padtitle += i;
255 
256  evdb::Canvas::fCanvas->cd();
257 
258  mf::LogVerbatim("MultiTPC") << "make new plane ";
259  fPlanes.push_back(
260  new TWireProjPad(padname, padtitle, twx1, twy1, twx2, twy2, i + t * nplanes));
261  fPlanes.back()->Draw();
262  // fPlanes.back()->Pad()->AddExec("mousedispatch",
263  // Form("evd::TWQMultiTPCProjectionView::MouseDispatch(%d, (void*)%d)",
264  // i+t*nplanes, this)
265  // );
266  fPlanes.back()->Pad()->AddExec(
267  "mousedispatch",
268  Form("evd::TWQMultiTPCProjectionView::MouseDispatch(%d, (void*)%lu)",
269  i + t * nplanes,
270  (unsigned long)this));
271 
272  mf::LogVerbatim("MultiTPC") << "size of planes vec is now " << fPlanes.size();
273 
274  if (t + 1 == ntpc) {
275  padname = "fQPadTPC";
276  padname += t;
277  padname += "Plane";
278  padname += i;
279 
280  padtitle = "QTPC";
281  padtitle += t;
282  padname += "Plane";
283  padname += i;
284 
285  evdb::Canvas::fCanvas->cd();
286  fPlaneQ.push_back(new TQPad(padname, padtitle, twx2, twy1, twx3, twy2, "Q", i, 0));
287  fPlaneQ[i]->Draw();
288  }
289  } // end loop to draw pads
290  }
291 
292  evdb::Canvas::fCanvas->Update();
293  }
TGRadioButton * fCalibDraw
Draw calibrated information only.
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
unsigned int NTPC(CryostatID const &cryoid=cryostat_zero) const
Returns the total number of TPCs in the specified cryostat.
Definition: GeometryCore.h:686
TQPad * fWireQ
Histogram of charge vs time on selected wire.
int fEnableMCTruthCheckBox
1 to have the check box appear, 0 otherwise
static unsigned int kWire
TGCompositeFrame * fVFrame
needed for the side frame
int fDrawRawDataOrCalibWires
0 for raw
TGCompositeFrame * fFrame
Graphics frame.
Definition: Canvas.h:39
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
TGNumberEntry * fThresEntry
ADC threshold to display.
static unsigned int kPlane
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
void Draw()
Definition: TQPad.cxx:112
TGRadioButton * fRawCalibDraw
Draw raw and calibrated information.
TGLayoutHints * fLayout
Layout hints for frame.
Definition: Canvas.h:40
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
MCBriefPad * fMC
Short summary of MC event.
static double kDistance
TGNumberEntry * fPlaneEntry
Plane number displayed.
int fShowEndPointSection
Show section corresponding to EndPoint finding.
HeaderPad * fHeaderPad
Show header information.
std::deque< util::PxPoint > ppoints
list of points in each WireProjPad used for x,y,z finding
TGCheckButton * fMCOn
Display MC truth information.
int fShowSideBar
1 to show, 0 don&#39;t show
unsigned short fXsize
Size of the canvas;.
Definition: Canvas.h:44
double fMinSignal
minimum ADC count to display a time bin
TGRadioButton * fRawDraw
Draw Raw information only.
TPad * Pad()
Definition: DrawingPad.h:31
TGCompositeFrame * fMetaFrame
needed for the side frame
unsigned short fYsize
Size of the canvas;.
Definition: Canvas.h:45
void Draw(const char *opt="")
Definition: HeaderPad.cxx:47
std::vector< TQPad * > fPlaneQ
charge on each plane
TGCheckButton * fGreyScale
Display gray or color scale.
unsigned int Nwires(PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Definition: GeometryCore.h:977
std::deque< util::PxLine > pline
list of lines in each WireProjPad used for calculating 2d and 3d angles
TGNumberEntry * fWireEntry
Wire number displayed.
Namespace collecting geometry-related classes utilities.
TRootEmbeddedCanvas * fEmbCanvas
Embedded canvas.
Definition: Canvas.h:41
void SetPlaneWire(unsigned int plane=0, unsigned int wire=0)
Definition: TQPad.h:40
evd::TWQMultiTPCProjectionView::~TWQMultiTPCProjectionView ( )

Definition at line 296 of file TWQMultiTPCProjection.cxx.

References fHeaderPad, fMC, fPlaneEntry, fPlaneLabel, fPlaneQ, fPlanes, fWireEntry, fWireLabel, and fWireQ.

297  {
298  if (fHeaderPad) {
299  delete fHeaderPad;
300  fHeaderPad = 0;
301  }
302  if (fMC) {
303  delete fMC;
304  fMC = 0;
305  }
306  if (fWireQ) {
307  delete fWireQ;
308  fWireQ = 0;
309  }
310  if (fPlaneEntry) {
311  delete fPlaneEntry;
312  fPlaneEntry = 0;
313  }
314  if (fWireEntry) {
315  delete fWireEntry;
316  fWireEntry = 0;
317  }
318  if (fPlaneLabel) {
319  delete fPlaneLabel;
320  fPlaneLabel = 0;
321  }
322  if (fWireLabel) {
323  delete fWireLabel;
324  fWireLabel = 0;
325  }
326  for (unsigned int i = 0; i < fPlanes.size(); ++i) {
327  if (fPlanes[i]) {
328  delete fPlanes[i];
329  fPlanes[i] = 0;
330  }
331  if (fPlaneQ[i]) {
332  delete fPlaneQ[i];
333  fPlaneQ[i] = 0;
334  }
335  }
336  fPlanes.clear();
337  fPlaneQ.clear();
338  }
TQPad * fWireQ
Histogram of charge vs time on selected wire.
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
MCBriefPad * fMC
Short summary of MC event.
TGNumberEntry * fPlaneEntry
Plane number displayed.
HeaderPad * fHeaderPad
Show header information.
std::vector< TQPad * > fPlaneQ
charge on each plane
TGNumberEntry * fWireEntry
Wire number displayed.

Member Function Documentation

void evdb::Printable::AddToListOfPrintables ( const char *  name,
evdb::Printable p 
)
staticinherited

Definition at line 29 of file Printable.cxx.

Referenced by evdb::Canvas::Connect(), evdb::ObjListCanvas::Connect(), evdb::Printable::Description(), and evdb::testCanvas1::testCanvas1().

31  {
32  std::string s(name);
33 
34  if (gsPrintables[s] == 0) {
35  gsPrintables[s] = p;
36  }
37  else {
38  if (gsPrintables[s] != p) {
39  std::cerr << "Printable: Name " << name << " reused.\n";
40  std::abort();
41  }
42  }
43  }
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
void evd::TWQMultiTPCProjectionView::ChangeWire ( int  plane)

Definition at line 497 of file TWQMultiTPCProjection.cxx.

References SetPlaneWire(), x, and xx.

Referenced by MouseDispatch().

498  {
499  //initial check for a mouse click on a TBox object
500  int event = gPad->GetEvent();
501  int px = gPad->GetEventX();
502  if (event != 11) return;
503  TObject* select = gPad->GetSelected();
504  if (!select) return;
505  if (!select->InheritsFrom("TBox")) return;
506 
507  //now find wire that was clicked on
508  float xx = gPad->AbsPixeltoX(px);
509  float x = gPad->PadtoX(xx);
510 
511  kPlane = plane;
512  kWire = (unsigned int)TMath::Nint(x);
513 
514  this->SetPlaneWire();
515 
516  return;
517  }
Float_t x
Definition: compare.C:6
Double_t xx
Definition: macro.C:12
static unsigned int kWire
static unsigned int kPlane
Event finding and building.
void evd::TWQMultiTPCProjectionView::ClearEndPoints ( )

Definition at line 580 of file TWQMultiTPCProjection.cxx.

References fPlanes, ppoints, and x.

581  {
582  for (size_t x = 0; x < fPlanes.size(); ++x) {
583  fPlanes[x]->Pad()->cd();
584  fPlanes[x]->View()->Clear();
585  fPlanes[x]->View()->AddMarker(0.0, 0.0, 2, 1, 0.1);
586  fPlanes[x]->Pad()->Update();
587  fPlanes[x]->View()->Draw();
588  }
589  ppoints.clear();
590  gPad->Modified();
591  gPad->Update();
592  gPad->cd();
593  }
Float_t x
Definition: compare.C:6
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
std::deque< util::PxPoint > ppoints
list of points in each WireProjPad used for x,y,z finding
void evdb::Canvas::Connect ( )
inherited

Make signal/slot connections.

Definition at line 68 of file Canvas.cxx.

References evdb::Printable::AddToListOfPrintables(), and evdb::Canvas::Description().

Referenced by evd::CalorView::CalorView(), evdb::Canvas::Description(), evd::Display3DView::Display3DView(), and evdb::DisplayWindow::DisplayWindow().

69  {
70  // Make connections for drawing and printing
71  // IoModule::Instance()->Connect("NewEvent()",
72  // "evdb::Canvas",this,"Draw()");
74  }
virtual const char * Description() const
Definition: Canvas.h:33
static void AddToListOfPrintables(const char *name, evdb::Printable *p)
Definition: Printable.cxx:29
const char* evd::TWQMultiTPCProjectionView::Description ( ) const
inlinevirtual

Reimplemented from evdb::Canvas.

Definition at line 65 of file TWQMultiTPCProjection.h.

65 { return "Time/Wire/Charge Projections"; }
void evd::TWQMultiTPCProjectionView::Draw ( const char *  opt = "")
virtual

Implements evdb::Canvas.

Definition at line 355 of file TWQMultiTPCProjection.cxx.

References evd::HeaderPad::Draw(), evd::MCBriefPad::Draw(), evd::TQPad::Draw(), fAngleInfo, evdb::Canvas::fCanvas, fHeaderPad, fMC, fPlaneQ, fPlanes, fPrevZoomOpt, evd::EvdLayoutOptions::fPrintTotalCharge, fWireQ, fXYZPosition, fZoomOpt, pline, ppoints, PrintCharge(), evd::ZoomOptionsMultiTPC::tmax, evd::ZoomOptionsMultiTPC::tmin, evd::ZoomOptionsMultiTPC::wmax, and evd::ZoomOptionsMultiTPC::wmin.

356  {
358 
359  fPrevZoomOpt.clear();
360 
361  evdb::Canvas::fCanvas->cd();
362  zoom_opt = 0;
363  fHeaderPad->Draw();
364  fMC->Draw();
365  fWireQ->Draw();
366 
368 
369  if (evdlayoutopt->fPrintTotalCharge) PrintCharge();
370 
371  //clear queue of selected points
372  ppoints.clear();
373  pline.clear();
374  // Reset current zooming plane - since it's not currently zooming.
375  curr_zooming_plane = -1;
376 
377  // double Charge=0, ConvCharge=0;
378  for (size_t i = 0; i < fPlanes.size(); ++i) {
379  fPlanes[i]->Draw(opt);
380  fPlanes[i]->Pad()->Update();
381  fPlanes[i]->Pad()->GetFrame()->SetBit(TPad::kCannotMove, true);
382  fPlaneQ[i]->Draw();
383  std::vector<double> ZoomParams = fPlanes[i]->GetCurrentZoom();
384  fZoomOpt.wmin[i] = ZoomParams[0];
385  fZoomOpt.wmax[i] = ZoomParams[1];
386  fZoomOpt.tmin[i] = ZoomParams[2];
387  fZoomOpt.tmax[i] = ZoomParams[3];
388  }
389 
390  // Reset any text boxes which are enabled
391  if (fXYZPosition) fXYZPosition->SetForegroundColor(kBlack);
392 
393  if (fAngleInfo) fAngleInfo->SetForegroundColor(kBlack);
394 
395  evdb::Canvas::fCanvas->Update();
396  }
TQPad * fWireQ
Histogram of charge vs time on selected wire.
std::map< int, double > tmin
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
void Draw()
Definition: TQPad.cxx:112
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
MCBriefPad * fMC
Short summary of MC event.
HeaderPad * fHeaderPad
Show header information.
std::deque< util::PxPoint > ppoints
list of points in each WireProjPad used for x,y,z finding
static int curr_zooming_plane
TGTextView * fXYZPosition
Display the xyz position.
void Draw(const char *opt="")
Definition: HeaderPad.cxx:47
std::map< int, double > wmax
std::vector< TQPad * > fPlaneQ
charge on each plane
static const char * zoom_opt
std::vector< ZoomOptionsMultiTPC > fPrevZoomOpt
int fPrintTotalCharge
Print out the total charge in an event.
std::deque< util::PxLine > pline
list of lines in each WireProjPad used for calculating 2d and 3d angles
std::map< int, double > wmin
std::map< int, double > tmax
Namespace collecting geometry-related classes utilities.
int evd::TWQMultiTPCProjectionView::DrawLine ( int  plane,
util::PxLine pline 
)
private
void evd::TWQMultiTPCProjectionView::DrawPads ( const char *  opt = "")

Definition at line 341 of file TWQMultiTPCProjection.cxx.

References fPlaneQ, and fPlanes.

Referenced by SetGreyscale(), SetRawCalib(), and SetThreshold().

342  {
343  for (unsigned int i = 0; i < fPlanes.size(); ++i) {
344  fPlanes[i]->Draw();
345  fPlanes[i]->Pad()->Update();
346  fPlanes[i]->Pad()->GetFrame()->SetBit(TPad::kCannotMove, true);
347  }
348  for (unsigned int j = 0; j < fPlaneQ.size(); ++j) {
349  fPlaneQ[j]->Draw();
350  fPlaneQ[j]->Pad()->Update();
351  fPlaneQ[j]->Pad()->GetFrame()->SetBit(TPad::kCannotMove, true);
352  }
353  }
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
std::vector< TQPad * > fPlaneQ
charge on each plane
void evd::TWQMultiTPCProjectionView::FindEndPoint ( )

Definition at line 729 of file TWQMultiTPCProjection.cxx.

References geo::GeometryCore::ChannelsIntersect(), evd::RawDrawingOptions::fCryostat, fPlanes, evd::EvdLayoutOptions::fShowEndPointMarkers, evd::RawDrawingOptions::fTPC, fXYZPosition, evdb::EventHolder::GetEvent(), evdb::EventHolder::Instance(), geo::GeometryCore::NearestWireID(), geo::origin(), geo::GeometryCore::Plane(), geo::GeometryCore::PlaneWireToChannel(), ppoints, detinfo::sampling_rate(), geo::PlaneGeo::toWorldCoords(), detinfo::trigger_offset(), w, geo::WireID::Wire, xx, y, and z.

730  {
731  art::Event const* pEvent = evdb::EventHolder::Instance()->GetEvent();
732  if (not pEvent) {
733  std::cerr << "No event available\n";
734  return;
735  }
736 
737  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService>()->DataFor(*pEvent);
738  auto const detProp =
739  art::ServiceHandle<detinfo::DetectorPropertiesService>()->DataFor(*pEvent, clockData);
740 
741  // if list is larger than or equal to two, can project to XYZ and extrapolate to third plane (if exists)
742 
743  if (ppoints.size() >= 2) {
744 
745  double xyz_vertex_fit[3] = {0.};
746  double second_time = 0.;
747  geo::PlaneGeo::LocalPoint_t const origin{0., 0., 0.};
748  double y = 0.;
749  double z = 0.;
750 
753  double ftimetick = sampling_rate(clockData) / 1000.;
754  double larv = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
755 
756  geo::TPCID const tpcid{rawOpt->fCryostat, rawOpt->fTPC};
757  geo::PlaneID const plane_0{tpcid, ppoints[0].plane};
758  geo::PlaneID const plane_1{tpcid, ppoints[1].plane};
759 
760  //find channels corresponding to found wires.
761  int chan1 = geom->PlaneWireToChannel(geo::WireID(plane_0, ppoints[0].w));
762  int chan2 = geom->PlaneWireToChannel(geo::WireID(plane_1, ppoints[1].w));
763 
764  bool wires_cross = false;
765  bool time_good = false;
766 
767  if (fabs(ppoints[0].t - ppoints[1].t) < 200) {
768  wires_cross = geom->ChannelsIntersect(chan1, chan2, y, z);
769  time_good = true;
770  }
771  else {
772  TGText* tt = new TGText("too big");
773  tt->InsLine(1, "time distance");
774  fXYZPosition->SetText(tt);
775  fXYZPosition->Update();
776  // return; //not returning, because may need to delete marker from wplane
777  }
778 
779  if (wires_cross) {
780  xyz_vertex_fit[1] = y;
781  xyz_vertex_fit[2] = z;
782  auto pos = geom->Plane(plane_0).toWorldCoords(origin);
783  xyz_vertex_fit[0] = (ppoints[0].t - trigger_offset(clockData)) * larv * ftimetick + pos.X();
784  pos = geom->Plane(plane_1).toWorldCoords(origin);
785  second_time = (ppoints[1].t - trigger_offset(clockData)) * larv * ftimetick + pos.X();
786 
787  TGText* tt = new TGText(Form("z:%4.1f", z));
788  tt->InsLine(1, Form("x:%4.1f,", (xyz_vertex_fit[0] + second_time) / 2));
789  tt->InsLine(1, Form("y:%4.1f,", y));
790  fXYZPosition->SetText(tt);
791  fXYZPosition->Update();
793  }
794  else {
795  if (time_good) { //otherwise the wires_cross are false by default
796  TGText* tt = new TGText("cross");
797  tt->InsLine(1, "wires do not");
798  fXYZPosition->SetText(tt);
799  fXYZPosition->Update();
800  }
801  // return; //not returning, because may need to delete marker from wplanereturn;
802  }
803  // extrapolate third point only if there are enough planes
804  if (fPlanes.size() > 2) {
805 
806  unsigned int wplane = 0;
807  unsigned int wirevertex = 0;
809 
810  for (size_t xx = 0; xx < fPlanes.size(); ++xx) {
811  wplane = 0;
812  for (int yy = 0; yy < 2; ++yy)
813  if (ppoints[yy].plane == xx) ++wplane;
814 
815  if (!wplane) {
816  wplane = xx;
817  break;
818  }
819  }
820 
821  geo::PlaneID const planeID{tpcid, wplane};
822  auto pos = geom->Plane(planeID).toWorldCoords(origin);
823  pos.SetY(xyz_vertex_fit[1]);
824  pos.SetZ(xyz_vertex_fit[2]);
825 
826  wirevertex = geom->NearestWireID(pos, planeID).Wire;
827 
828  double drifttick =
829  ((xyz_vertex_fit[0]) / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
830  (1. / ftimetick);
831  double timestart =
832  drifttick -
833  (pos.X() / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
834  (1. / ftimetick) +
835  trigger_offset(clockData);
836 
837  fPlanes[wplane]->Pad()->cd();
838  fPlanes[wplane]->View()->Clear();
839  if (wires_cross && evdlayoutopt->fShowEndPointMarkers) //only Draw if it makes sense
840  fPlanes[wplane]->View()->AddMarker(wirevertex, timestart, kMagenta, 29, 2.0);
841  else //draw dummy marker to delete old one
842  fPlanes[wplane]->View()->AddMarker(0.0, 0.0, 2, 1, 0.1);
843  fPlanes[wplane]->Pad()->Update();
844  fPlanes[wplane]->View()->Draw();
845  } // end if(fPlanes.size()>2)
846  //update pad?
847  gPad->Modified();
848  gPad->Update();
849  gPad->cd();
850  } // end if( this->ppoints.size()>=2)
851  else {
852  TGText* tt = new TGText("selected points");
853  tt->InsLine(1, "not enough");
854  fXYZPosition->SetText(tt);
855  fXYZPosition->Update();
856  }
857 
858  return;
859  }
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
Double_t xx
Definition: macro.C:12
unsigned int fTPC
TPC number to draw, typically set by TWQProjectionView.
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
bool ChannelsIntersect(raw::ChannelID_t c1, raw::ChannelID_t c2, double &y, double &z) const
Returns an intersection point of two channels.
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:563
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
std::deque< util::PxPoint > ppoints
list of points in each WireProjPad used for x,y,z finding
Definition: type_traits.h:61
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local plane frame to world frame.
Definition: PlaneGeo.h:1225
unsigned int fCryostat
Cryostat number to draw, typically set by TWQProjectionView.
static EventHolder * Instance()
Definition: EventHolder.cxx:15
int fShowEndPointMarkers
Draw EndPoint Markers if clicked.
TGTextView * fXYZPosition
Display the xyz position.
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
WireID NearestWireID(Point_t const &point, PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
int trigger_offset(DetectorClocksData const &data)
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
Float_t w
Definition: plot.C:20
geo::Point3DBase_t< PlaneGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML wire plane frame.
Definition: PlaneGeo.h:106
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:229
double evd::TWQMultiTPCProjectionView::FindLineLength ( detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp 
)

Definition at line 596 of file TWQMultiTPCProjection.cxx.

References geo::GeometryCore::ChannelsIntersect(), detinfo::DetectorPropertiesData::DriftVelocity(), detinfo::DetectorPropertiesData::Efield(), evd::RawDrawingOptions::fCryostat, evd::RawDrawingOptions::fTPC, fXYZPosition, geo::PlaneGeo::GetBoxCenter(), geo::GeometryCore::Plane(), geo::GeometryCore::PlaneWireToChannel(), pline, detinfo::sampling_rate(), t1, detinfo::DetectorPropertiesData::Temperature(), detinfo::trigger_offset(), y, and z.

598  {
599  // if list is larger than or equal to two, can project to XYZ and extrapolate to third plane (if exists)
600 
601  if (pline.size() >= 2) {
602 
603  double xyz_vertex_fit[3];
604  double second_time;
605  double xx0 = 0., yy0 = 0., zz0 = 0.;
606  double xx1 = 0., yy1 = 0., zz1 = 0.;
607  double length;
608 
609  double y, z;
610 
613  double ftimetick = sampling_rate(clockData) / 1000.;
614  double larv = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
615 
616  //find channels corresponding to found wires.
617  geo::TPCID const tpcid{rawOpt->fCryostat, rawOpt->fTPC};
618  geo::PlaneID const plane_0{tpcid, pline[0].plane};
619  geo::PlaneID const plane_1{tpcid, pline[1].plane};
620  int chan1 = geom->PlaneWireToChannel(geo::WireID(plane_0, pline[0].w0));
621  int chan2 = geom->PlaneWireToChannel(geo::WireID(plane_1, pline[1].w0));
622 
623  bool wires_cross = false;
624  bool time_good = false;
625 
626  if (fabs(pline[0].t0 - pline[1].t0) < 200) {
627  wires_cross = geom->ChannelsIntersect(chan1, chan2, y, z);
628  time_good = true;
629  }
630  else {
631  TGText* tt = new TGText("too big");
632  tt->InsLine(1, "time distance");
633  fXYZPosition->SetText(tt);
634  fXYZPosition->Update();
635  // return; //not returning, because may need to delete marker from wplane
636  }
637 
638  if (wires_cross) {
639  TGText* tt = new TGText("wires cross");
640  fXYZPosition->SetText(tt);
641  fXYZPosition->Update();
642  xyz_vertex_fit[1] = y;
643  xyz_vertex_fit[2] = z;
644  auto pos = geom->Plane(plane_0).GetBoxCenter();
645  xyz_vertex_fit[0] = (pline[0].t0 - trigger_offset(clockData)) * larv * ftimetick + pos.X();
646  pos = geom->Plane(plane_1).GetBoxCenter();
647  second_time = (pline[1].t0 - trigger_offset(clockData)) * larv * ftimetick + pos.X();
648 
649  xx0 = (xyz_vertex_fit[0] + second_time) / 2;
650  yy0 = y;
651  zz0 = z;
652 
654  }
655  else {
656  if (time_good) { //otherwise the wires_cross are false by default
657  TGText* tt = new TGText("cross");
658  tt->InsLine(1, "wires do not");
659  fXYZPosition->SetText(tt);
660  fXYZPosition->Update();
661  }
662  // return; //not returning, because may need to delete marker from wplanereturn;
663  }
664  //find channels corresponding to found wires AT END OF LINE.
665  chan1 = geom->PlaneWireToChannel(geo::WireID(plane_0, pline[0].w1));
666  chan2 = geom->PlaneWireToChannel(geo::WireID(plane_1, pline[1].w1));
667 
668  wires_cross = false;
669  time_good = false;
670 
671  if (fabs(pline[0].t1 - pline[1].t1) < 200) {
672  wires_cross = geom->ChannelsIntersect(chan1, chan2, y, z);
673  time_good = true;
674  }
675  else {
676  TGText* tt = new TGText("too big");
677  tt->InsLine(1, "time distance");
678  fXYZPosition->SetText(tt);
679  fXYZPosition->Update();
680  // return; //not returning, because may need to delete marker from wplane
681  }
682 
683  if (wires_cross) {
684  TGText* tt = new TGText("wires do cross");
685  fXYZPosition->SetText(tt);
686  fXYZPosition->Update();
687  xyz_vertex_fit[1] = y;
688  xyz_vertex_fit[2] = z;
689  constexpr geo::TPCID tpcid{0, 0};
690  auto pos = geom->Plane(geo::PlaneID(tpcid, pline[0].plane)).GetBoxCenter();
691  xyz_vertex_fit[0] = (pline[0].t1 - trigger_offset(clockData)) * larv * ftimetick + pos.X();
692  pos = geom->Plane(geo::PlaneID(tpcid, pline[1].plane)).GetBoxCenter();
693  second_time = (pline[1].t1 - trigger_offset(clockData)) * larv * ftimetick + pos.X();
694 
695  xx1 = (xyz_vertex_fit[0] + second_time) / 2;
696  yy1 = y;
697  zz1 = z;
698  }
699  else {
700  if (time_good) { //otherwise the wires_cross are false by default
701  TGText* tt = new TGText("cross");
702  tt->InsLine(1, "wires do not");
703  fXYZPosition->SetText(tt);
704  fXYZPosition->Update();
705  }
706  // return; //not returning, because may need to delete marker from wplanereturn;
707  }
708  //update pad?
709  gPad->Modified();
710  gPad->Update();
711  gPad->cd();
712 
713  length = pow(xx0 - xx1, 2) + pow(yy0 - yy1, 2) + pow(zz0 - zz1, 2);
714  length = pow(length, 0.5);
715  return length;
716  } // end if( this->ppoints.size()>=2)
717 
718  else {
719  TGText* tt = new TGText("selected points");
720  tt->InsLine(1, "not enough");
721  fXYZPosition->SetText(tt);
722  fXYZPosition->Update();
723  }
724 
725  return -99;
726  }
code to link reconstructed objects back to the MC truth information
unsigned int fTPC
TPC number to draw, typically set by TWQProjectionView.
TTree * t1
Definition: plottest35.C:26
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
bool ChannelsIntersect(raw::ChannelID_t c1, raw::ChannelID_t c2, double &y, double &z) const
Returns an intersection point of two channels.
Definition: type_traits.h:61
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
Point_t GetBoxCenter() const
Returns the centre of the box representing the plane.
Definition: PlaneGeo.h:449
unsigned int fCryostat
Cryostat number to draw, typically set by TWQProjectionView.
TGTextView * fXYZPosition
Display the xyz position.
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
int trigger_offset(DetectorClocksData const &data)
std::deque< util::PxLine > pline
list of lines in each WireProjPad used for calculating 2d and 3d angles
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
std::map< std::string, evdb::Printable * > & evdb::Printable::GetPrintables ( )
staticinherited

Definition at line 61 of file Printable.cxx.

References evdb::gsPrintables.

Referenced by evdb::Printable::Description(), evdb::EventDisplay::postProcessEvent(), and evdb::PrintDialog::PrintDialog().

62  {
63  return gsPrintables;
64  }
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
void evd::TWQMultiTPCProjectionView::MouseDispatch ( int  plane,
void *  wqpv 
)
static

Definition at line 469 of file TWQMultiTPCProjection.cxx.

References ChangeWire(), evd::EvdLayoutOptions::fChangeWire, SelectPoint(), and SetMouseZoomRegion().

470  {
471  //initial check for a mouse click on a TBox object
472  int event = gPad->GetEvent();
475 
476  switch (event) {
477 
478  case kButton1Shift:
479  shift_lock = 1;
480  // TWQMultiTPCProjectionView::SelectHit() is undefined
481  //if(evdlayoutopt->fMakeClusters==1){wqpp->SelectHit(plane);}
482  //else {wqpp->SelectPoint(plane);}
483  wqpp->SelectPoint(plane);
484  break;
485  case kButton1Up:
486  if (shift_lock == 1) break;
487  if (evdlayoutopt->fChangeWire == 1) wqpp->ChangeWire(plane);
488  case kButton1Down: shift_lock = 0;
489  case kButton1Motion:
490  wqpp->SetMouseZoomRegion(plane);
491  break;
492  // default:
493  }
494  }
static int shift_lock
int fChangeWire
1 to click mouse and change wire, 0 don&#39;t
Event finding and building.
void evdb::Canvas::Print ( const char *  f)
virtualinherited

Implements evdb::Printable.

Definition at line 88 of file Canvas.cxx.

References evdb::Canvas::fCanvas.

Referenced by evdb::Canvas::Description().

88 { fCanvas->Print(f); }
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
TFile f
Definition: plotHisto.C:6
void evd::TWQMultiTPCProjectionView::PrintCharge ( )

Definition at line 442 of file TWQMultiTPCProjection.cxx.

References evd::RawDrawingOptions::CurrentTPC(), evd::RawDrawingOptions::fDrawRawDataOrCalibWires, fPlanes, geo::kCollection, and geo::GeometryCore::SignalType().

Referenced by Draw().

443  {
444 
447 
448  geo::TPCID tpcid = rawopt->CurrentTPC();
449 
450  for (size_t iplane = 0; iplane < fPlanes.size(); ++iplane) {
451  if (geo->SignalType(geo::PlaneID(tpcid, iplane)) == geo::kCollection) {
452  double ch = 0, convch = 0;
453  if (rawopt->fDrawRawDataOrCalibWires == 0) {
454  fPlanes[iplane]->RawDataDraw()->GetChargeSum(iplane, ch, convch);
455  mf::LogVerbatim("TWQMultiTPCProjectionView") << "Warning! Calculating for RawData! ";
456  }
457  else {
458  fPlanes[iplane]->RecoBaseDraw()->GetChargeSum(iplane, ch, convch);
459  }
460 
461  mf::LogVerbatim("TWQMultiTPCProjectionView")
462  << "\ncharge collected at collection plane: " << iplane << " " << ch << " " << convch;
463  }
464  }
465  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
int fDrawRawDataOrCalibWires
0 for raw
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
Namespace collecting geometry-related classes utilities.
Signal from collection planes.
Definition: geo_types.h:152
const char* evd::TWQMultiTPCProjectionView::PrintTag ( ) const
inlinevirtual

Reimplemented from evdb::Canvas.

Definition at line 66 of file TWQMultiTPCProjection.h.

References Draw().

66 { return "twq-multiTPC-proj"; }
void evd::TWQMultiTPCProjectionView::RadioButtonsDispatch ( int  parameter)

Definition at line 1081 of file TWQMultiTPCProjection.cxx.

References fToggleZoom.

1082  {
1083  if (parameter == 1 || parameter == 2) { fToggleZoom->SetState(kButtonUp); }
1084  }
TGRadioButton * fToggleZoom
Use zoom setting.
void evdb::Printable::RemoveFromListOfPrintables ( evdb::Printable p)
staticinherited

Definition at line 47 of file Printable.cxx.

Referenced by evdb::Printable::Description(), evdb::Printable::~Printable(), and evdb::testCanvas1::~testCanvas1().

48  {
51  for (; itr!=itrEnd; ++itr) {
52  if ( itr->second == p) {
53  gsPrintables.erase(itr);
54  return;
55  }
56  }
57  }
intermediate_table::iterator iterator
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
void evd::TWQMultiTPCProjectionView::SelectPoint ( int  plane)

Definition at line 520 of file TWQMultiTPCProjection.cxx.

References fPlanes, evd::EvdLayoutOptions::fShowEndPointMarkers, evd::EvdLayoutOptions::fShowEndPointSection, util::PxPoint::plane, ppoints, util::PxPoint::t, util::PxPoint::w, x, and y.

Referenced by MouseDispatch().

521  {
522  //initial check for a mouse click on a TBox object
523  int event = gPad->GetEvent();
524 
525  if (event != 7) return;
526 
528  if (evdlayoutopt->fShowEndPointSection != 1) return;
529  //struct planepoint;
530  int px = gPad->GetEventX();
531  double w0 = gPad->AbsPixeltoX(px);
532  double x = gPad->PadtoX(w0);
533 
534  int py = gPad->GetEventY();
535  double t0 = gPad->AbsPixeltoY(py);
536  double y = gPad->PadtoY(t0);
537 
538  util::PxPoint ppx(plane, x, y);
539  curr_zooming_plane = -1;
540 
541  // check if not clicking on a plane that is already in the ppoints list:
542  int repeat_plane = -1;
543  for (size_t ii = 0; ii < this->ppoints.size(); ++ii)
544  if (ppx.plane == this->ppoints[ii].plane) {
545  this->ppoints[ii] = ppx;
546  //clear View and draw new Marker
547  this->fPlanes[this->ppoints[ii].plane]->View()->Clear();
548  if (evdlayoutopt->fShowEndPointMarkers)
549  this->fPlanes[this->ppoints[ii].plane]->View()->AddMarker(ppx.w, ppx.t, kRed, 29, 2.0);
550  else
551  this->fPlanes[plane]->View()->AddMarker(0.0, 0.0, 2, 1, 0.1);
552  this->fPlanes[this->ppoints[ii].plane]->View()->Draw();
553  repeat_plane = this->ppoints[ii].plane;
554  break;
555  }
556 
557  //if plane does not repeat and size of list is larger than 2 pop_front
558  // and delete its marker. Otherwise just push_back.
559  if (repeat_plane == -1) {
560  if (this->ppoints.size() >= 2) {
561  this->fPlanes[this->ppoints[0].plane]->Pad()->cd();
562  this->fPlanes[this->ppoints[0].plane]->View()->Clear();
563  this->fPlanes[this->ppoints[0].plane]->View()->Draw();
564  this->ppoints.pop_front();
565  }
566  this->ppoints.push_back(ppx);
567  this->fPlanes[plane]->Pad()->cd();
568  this->fPlanes[plane]->View()->Clear();
569  if (evdlayoutopt->fShowEndPointMarkers)
570  this->fPlanes[plane]->View()->AddMarker(ppx.w, ppx.t, kRed, 29, 2.0);
571  else
572  this->fPlanes[plane]->View()->AddMarker(0.0, 0.0, 2, 1, 0.1);
573  this->fPlanes[plane]->View()->Draw();
574  }
575 
576  return;
577  }
Float_t x
Definition: compare.C:6
code to link reconstructed objects back to the MC truth information
Float_t y
Definition: compare.C:6
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
int fShowEndPointSection
Show section corresponding to EndPoint finding.
std::deque< util::PxPoint > ppoints
list of points in each WireProjPad used for x,y,z finding
static int curr_zooming_plane
int fShowEndPointMarkers
Draw EndPoint Markers if clicked.
Event finding and building.
void evd::TWQMultiTPCProjectionView::SetDistance ( )

Definition at line 1248 of file TWQMultiTPCProjection.cxx.

References fDistance.

1249  {
1250  kDistance = (double)fDistance->GetNumberEntry()->GetNumber();
1251  }
static double kDistance
TGNumberEntry * fDistance
Distance from line to find hits in cluster.
void evd::TWQMultiTPCProjectionView::SetGreyscale ( )

Definition at line 1273 of file TWQMultiTPCProjection.cxx.

References DrawPads(), evdb::Canvas::fCanvas, and evd::ColorDrawingOptions::fColorOrGray.

1274  {
1276 
1277  TGButton* b = (TGButton*)gTQSender;
1278  if (b->GetState() == kButtonDown) { cst->fColorOrGray = 1; }
1279  else {
1280  cst->fColorOrGray = 0;
1281  }
1282 
1283  TVirtualPad* ori = gPad;
1284  this->DrawPads(zoom_opt);
1285  evdb::Canvas::fCanvas->cd();
1286  evdb::Canvas::fCanvas->Modified();
1287  evdb::Canvas::fCanvas->Update();
1288 
1289  ori->cd();
1290 
1291  return;
1292  }
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
int fColorOrGray
0 = color, 1 = gray
static const char * zoom_opt
void evd::TWQMultiTPCProjectionView::SetMCInfo ( )

Definition at line 1340 of file TWQMultiTPCProjection.cxx.

References evd::MCBriefPad::Draw(), evdb::Canvas::fCanvas, fMC, evd::SimulationDrawingOptions::fShowMCTruthText, and evd::SimulationDrawingOptions::fShowMCTruthVectors.

1341  {
1343 
1344  TGButton* b = (TGButton*)gTQSender;
1345  if (b->GetState() == kButtonDown) {
1346  sdo->fShowMCTruthText = 1;
1347  sdo->fShowMCTruthVectors = 1;
1348  }
1349  else {
1350  sdo->fShowMCTruthText = 0;
1351  sdo->fShowMCTruthVectors = 0;
1352  }
1353 
1354  TVirtualPad* ori = gPad;
1355 
1356  fMC->Draw();
1357  evdb::Canvas::fCanvas->cd();
1358  evdb::Canvas::fCanvas->Modified();
1359  evdb::Canvas::fCanvas->Update();
1360 
1361  ori->cd();
1362  }
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
MCBriefPad * fMC
Short summary of MC event.
void evd::TWQMultiTPCProjectionView::SetMouseZoomRegion ( int  plane)

Definition at line 862 of file TWQMultiTPCProjection.cxx.

References SetZoom(), t1, and x.

Referenced by MouseDispatch().

863  {
864  //*-*-*-*-*-*-*-*-*-*-*Create a new arrow in this pad*-*-*-*-*-*-*-*-*-*-*-*-*
865  //*-* ==============================
866  //
867  TObject* select = gPad->GetSelected();
868  if (!select) return;
869  if (!select->InheritsFrom("TBox")) return;
870 
871  static Float_t w0 = -1, t0 = -1, w1 = -1, t1 = -1;
872 
873  static Int_t pxold, pyold;
874  static Int_t pw0, pt0;
875  static Int_t linedrawn;
876  //static int curr_plane;
877  //TLine *line;
878 
879  static int wstart, wend;
880  static float tstart, tend;
881 
882  int event = gPad->GetEvent();
883  int px = gPad->GetEventX();
884  int py = gPad->GetEventY();
885 
886  switch (event) {
887 
888  case kButton1Down: {
889  gVirtualX->SetLineColor(-1);
890  w0 = gPad->AbsPixeltoX(px);
891  t0 = gPad->AbsPixeltoY(py);
892  pw0 = px;
893  pt0 = py;
894  pxold = px;
895  pyold = py;
896  linedrawn = 0;
897  float x = gPad->PadtoX(w0);
898  tstart = gPad->PadtoY(t0);
899 
900  wstart = (unsigned int)TMath::Nint(x);
901  curr_zooming_plane = plane;
902  break;
903  }
904  case kButton1Motion: {
905  int lx, hx, ly, hy;
906  if (pw0 < pxold) {
907  lx = pw0;
908  hx = pxold;
909  }
910  else {
911  lx = pxold;
912  hx = pw0;
913  }
914 
915  if (pt0 < pyold) {
916  ly = pt0;
917  hy = pyold;
918  }
919  else {
920  ly = pyold;
921  hy = pt0;
922  }
923 
924  if (linedrawn) gVirtualX->DrawBox(lx, ly, hx, hy, TVirtualX::kHollow);
925  pxold = px;
926  pyold = py;
927  linedrawn = 1;
928 
929  if (pw0 < pxold) {
930  lx = pw0;
931  hx = pxold;
932  }
933  else {
934  lx = pxold;
935  hx = pw0;
936  }
937 
938  if (pt0 < pyold) {
939  ly = pt0;
940  hy = pyold;
941  }
942  else {
943  ly = pyold;
944  hy = pt0;
945  }
946 
947  gVirtualX->DrawBox(lx, ly, hx, hy, TVirtualX::kHollow);
948  break;
949  }
950  case kButton1Up: {
951  if (px == pw0 && py == pt0) break;
952  w1 = gPad->AbsPixeltoX(px);
953  t1 = gPad->AbsPixeltoY(py);
954  gPad->Modified(kTRUE);
955 
956  // line = new TLine(w0,t0,w1,t1);
957  // line->Draw();
958 
959  float x = gPad->PadtoX(w1);
960  tend = gPad->PadtoY(t1);
961  wend = (unsigned int)TMath::Nint(x);
962 
963  gROOT->SetEditorMode();
964 
965  //make sure the box is significantly big to avoid accidental zooms on nothing.
966  double xx1, yy1, xx2, yy2;
967 
968  gPad->GetRangeAxis(xx1, yy1, xx2, yy2);
969 
970  if (wstart != 0 && tstart != 0 && (fabs(wend - wstart) > 0.01 * (xx2 - xx1)) &&
971  (fabs(tend - tstart) > 0.01 * (yy2 - yy1) && curr_zooming_plane == plane)) {
972 
973  this->SetZoom(plane, wstart, wend, tstart, tend);
974  wstart = -1;
975  tstart = -1;
976  }
977  break;
978  }
979  } // end switch
980  }
Float_t x
Definition: compare.C:6
code to link reconstructed objects back to the MC truth information
TTree * t1
Definition: plottest35.C:26
static int curr_zooming_plane
void SetZoom(int plane, int wirelow, int wirehi, int timelo, int timehi, bool StoreZoom=true)
Event finding and building.
void evd::TWQMultiTPCProjectionView::SetPlane ( )

Definition at line 1232 of file TWQMultiTPCProjection.cxx.

References fPlaneEntry, and SetPlaneWire().

1233  {
1234  kPlane = (unsigned int)fPlaneEntry->GetNumberEntry()->GetNumber();
1235 
1236  this->SetPlaneWire();
1237  }
static unsigned int kPlane
TGNumberEntry * fPlaneEntry
Plane number displayed.
void evd::TWQMultiTPCProjectionView::SetPlaneWire ( )

Definition at line 1208 of file TWQMultiTPCProjection.cxx.

References evd::TQPad::Draw(), evdb::Canvas::fCanvas, fPlaneEntry, fWireEntry, fWireQ, evd::DrawingPad::Pad(), and evd::TQPad::SetPlaneWire().

Referenced by ChangeWire(), SetPlane(), and SetWire().

1209  {
1210  TVirtualPad* ori = gPad;
1211 
1213 
1214  fWireQ->Draw();
1215  fWireQ->Pad()->cd();
1216  fWireQ->Pad()->Modified();
1217  fWireQ->Pad()->Update();
1218  fWireQ->Pad()->SetBit(TPad::kCannotMove, true);
1219  fWireQ->Pad()->GetFrame()->SetBit(TPad::kCannotMove, true);
1220 
1221  fPlaneEntry->SetNumber(kPlane);
1222  fWireEntry->SetNumber(kWire);
1223 
1224  evdb::Canvas::fCanvas->cd();
1225  evdb::Canvas::fCanvas->Modified();
1226  evdb::Canvas::fCanvas->Update();
1227 
1228  ori->cd();
1229  }
TQPad * fWireQ
Histogram of charge vs time on selected wire.
static unsigned int kWire
static unsigned int kPlane
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
void Draw()
Definition: TQPad.cxx:112
TGNumberEntry * fPlaneEntry
Plane number displayed.
TPad * Pad()
Definition: DrawingPad.h:31
TGNumberEntry * fWireEntry
Wire number displayed.
void SetPlaneWire(unsigned int plane=0, unsigned int wire=0)
Definition: TQPad.h:40
void evd::TWQMultiTPCProjectionView::SetRawCalib ( )

Definition at line 1295 of file TWQMultiTPCProjection.cxx.

References evd::TQPad::Draw(), DrawPads(), fCalibDraw, evdb::Canvas::fCanvas, evd::RawDrawingOptions::fDrawRawDataOrCalibWires, fRawCalibDraw, fRawDraw, fWireQ, and evd::DrawingPad::Pad().

1296  {
1298 
1299  TGButton* b = (TGButton*)gTQSender;
1300  int id = b->WidgetId();
1301 
1302  // id values are set in lines 125 - 127
1303  if (id == 4) {
1304  rawopt->fDrawRawDataOrCalibWires = 0;
1305  fRawDraw->SetState(kButtonDown);
1306  fCalibDraw->SetState(kButtonUp);
1307  fRawCalibDraw->SetState(kButtonUp);
1308  }
1309  else if (id == 3) {
1310  rawopt->fDrawRawDataOrCalibWires = 1;
1311  fRawDraw->SetState(kButtonUp);
1312  fCalibDraw->SetState(kButtonDown);
1313  fRawCalibDraw->SetState(kButtonUp);
1314  }
1315  else if (id == 2) {
1316  rawopt->fDrawRawDataOrCalibWires = 2;
1317  fRawDraw->SetState(kButtonUp);
1318  fCalibDraw->SetState(kButtonUp);
1319  fRawCalibDraw->SetState(kButtonDown);
1320  }
1321 
1322  TVirtualPad* ori = gPad;
1323 
1324  fWireQ->Draw();
1325  fWireQ->Pad()->cd();
1326  fWireQ->Pad()->Modified();
1327  fWireQ->Pad()->Update();
1328 
1329  this->DrawPads(zoom_opt);
1330  evdb::Canvas::fCanvas->cd();
1331  evdb::Canvas::fCanvas->Modified();
1332  evdb::Canvas::fCanvas->Update();
1333 
1334  ori->cd();
1335 
1336  return;
1337  }
TGRadioButton * fCalibDraw
Draw calibrated information only.
TQPad * fWireQ
Histogram of charge vs time on selected wire.
int fDrawRawDataOrCalibWires
0 for raw
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
void Draw()
Definition: TQPad.cxx:112
TGRadioButton * fRawCalibDraw
Draw raw and calibrated information.
TGRadioButton * fRawDraw
Draw Raw information only.
TPad * Pad()
Definition: DrawingPad.h:31
static const char * zoom_opt
void evd::TWQMultiTPCProjectionView::SetThreshold ( )

Definition at line 1254 of file TWQMultiTPCProjection.cxx.

References DrawPads(), evdb::Canvas::fCanvas, evd::RawDrawingOptions::fMinSignal, and fThresEntry.

1255  {
1256  double threshold = fThresEntry->GetNumberEntry()->GetNumber();
1257 
1259  rawopt->fMinSignal = threshold;
1260 
1261  TVirtualPad* ori = gPad;
1262  this->DrawPads(zoom_opt);
1263  evdb::Canvas::fCanvas->cd();
1264  evdb::Canvas::fCanvas->Modified();
1265  evdb::Canvas::fCanvas->Update();
1266 
1267  ori->cd();
1268 
1269  return;
1270  }
TGNumberEntry * fThresEntry
ADC threshold to display.
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
double fMinSignal
minimum ADC count to display a time bin
static const char * zoom_opt
void evd::TWQMultiTPCProjectionView::SetUpPositionFind ( )

< Display the xyz position

< Toggle the ShowEndPointMarkers Setting

Definition at line 1087 of file TWQMultiTPCProjection.cxx.

References fClearPPoints, fFindEndpoint, evd::EvdLayoutOptions::fShowEndPointMarkers, evd::EvdLayoutOptions::fShowEndPointSection, fToggleShowMarkers, fVFrame, and fXYZPosition.

Referenced by SetUpSideBar().

1088  {
1089  // enter zoom buttons
1091  if (!evdlayoutopt->fShowEndPointSection) return;
1092 
1093  // int fShowEndPointMarkers; ///< Draw EndPoint Markers if clicked.
1094 
1095  fFindEndpoint = new TGTextButton(fVFrame, "&Find XYZ", 150);
1096  fFindEndpoint->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "FindEndPoint()");
1097 
1098  fXYZPosition = new TGTextView(
1099  fVFrame, 100, 55, 999, TGView::kNoHSB | TGView::kNoVSB);
1100  fXYZPosition->SetEditable("false");
1101  TGText* tt = new TGText("x,y,z");
1102  fXYZPosition->SetText(tt);
1103 
1104  fClearPPoints = new TGTextButton(fVFrame, "&Clear Points", 150);
1105  fClearPPoints->Connect(
1106  "Clicked()", "evd::TWQMultiTPCProjectionView", this, "ClearEndPoints()"); // ?
1107 
1109  new TGCheckButton(fVFrame, "ShowMarkers", 0);
1110  fToggleShowMarkers->Connect(
1111  "Clicked()", "evd::TWQMultiTPCProjectionView", this, "ToggleEndPointMarkers()");
1112  if (evdlayoutopt->fShowEndPointMarkers == 1) fToggleShowMarkers->SetState(kButtonDown);
1113 
1114  fVFrame->AddFrame(fFindEndpoint, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1115  fVFrame->AddFrame(fXYZPosition, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1116  fVFrame->AddFrame(fClearPPoints, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1117  fVFrame->AddFrame(fToggleShowMarkers, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1118  }
TGCompositeFrame * fVFrame
needed for the side frame
int fShowEndPointSection
Show section corresponding to EndPoint finding.
TGTextButton * fFindEndpoint
Calculate XYZ position of two points in wire planes.
Definition: type_traits.h:61
TGTextButton * fClearPPoints
Clear current list of End Points.
int fShowEndPointMarkers
Draw EndPoint Markers if clicked.
TGTextView * fXYZPosition
Display the xyz position.
TGCheckButton * fToggleShowMarkers
Toggle the ShowEndPointMarkersSetting.
void evd::TWQMultiTPCProjectionView::SetUpSideBar ( )
void evd::TWQMultiTPCProjectionView::SetUpZoomButtons ( )

< Toggle the autozoom setting

Definition at line 1051 of file TWQMultiTPCProjection.cxx.

References evd::EvdLayoutOptions::fAutoZoomInterest, fToggleAutoZoom, fUnZoomInterest, fVFrame, fZoomBack, and fZoomInterest.

Referenced by SetUpSideBar().

1052  {
1053  // enter zoom buttons
1055 
1056  fZoomInterest = new TGTextButton(fVFrame, "&Zoom Interest", 150);
1057  fZoomInterest->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "ZoomInterest()");
1058 
1059  fUnZoomInterest = new TGTextButton(fVFrame, "&UnZoom Interest", 150);
1060  fUnZoomInterest->Connect(
1061  "Clicked()", "evd::TWQMultiTPCProjectionView", this, "ZoomInterest(=false)");
1062 
1063  fZoomBack = new TGTextButton(fVFrame, "&Zoom Back", 150);
1064  fZoomBack->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "ZoomBack()");
1065 
1066  fToggleAutoZoom = new TGCheckButton(fVFrame, "AutoZoom", 0);
1067  ;
1068  fToggleAutoZoom->Connect(
1069  "Clicked()", "evd::TWQMultiTPCProjectionView", this, "SetZoomInterest()");
1070  if (evdlayoutopt->fAutoZoomInterest == 1) fToggleAutoZoom->SetState(kButtonDown);
1071 
1072  fVFrame->AddFrame(fZoomInterest, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1073  fVFrame->AddFrame(fUnZoomInterest, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1074 
1075  fVFrame->AddFrame(fZoomBack, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1076 
1077  fVFrame->AddFrame(fToggleAutoZoom, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1078  }
TGCompositeFrame * fVFrame
needed for the side frame
TGTextButton * fUnZoomInterest
Unzoom on iteresting region.
TGTextButton * fZoomBack
Unzoom on iteresting region.
int fAutoZoomInterest
Set the automatic zoom to the interest region.
TGCheckButton * fToggleAutoZoom
Toggle the autozoom setting.
TGTextButton * fZoomInterest
Zoom on iteresting region.
void evd::TWQMultiTPCProjectionView::SetWire ( )

Definition at line 1240 of file TWQMultiTPCProjection.cxx.

References fWireEntry, and SetPlaneWire().

1241  {
1242  kWire = (unsigned int)fWireEntry->GetNumberEntry()->GetNumber();
1243 
1244  this->SetPlaneWire();
1245  }
static unsigned int kWire
TGNumberEntry * fWireEntry
Wire number displayed.
void evd::TWQMultiTPCProjectionView::SetZoom ( int  plane,
int  wirelow,
int  wirehi,
int  timelo,
int  timehi,
bool  StoreZoom = true 
)

Definition at line 1155 of file TWQMultiTPCProjection.cxx.

References evdb::Canvas::fCanvas, fPlanes, fPrevZoomOpt, fZoomOpt, evd::ZoomOptionsMultiTPC::OnlyPlaneChanged, evd::ZoomOptionsMultiTPC::tmax, evd::ZoomOptionsMultiTPC::tmin, evd::ZoomOptionsMultiTPC::wmax, and evd::ZoomOptionsMultiTPC::wmin.

Referenced by SetMouseZoomRegion(), ZoomBack(), and ZoomInterest().

1161  {
1162 
1163  if (StoreZoom) {
1164  fPrevZoomOpt.push_back(fZoomOpt);
1165  fZoomOpt.OnlyPlaneChanged = plane;
1166  }
1167 
1168  fZoomOpt.wmin[plane] = wirelow;
1169  fZoomOpt.wmax[plane] = wirehi;
1170  fZoomOpt.tmin[plane] = timelow;
1171  fZoomOpt.tmax[plane] = timehi;
1172 
1173  TVirtualPad* ori = gPad;
1174  zoom_opt = "1";
1175 
1176  // error checking - useful for the mouse zoom.
1177  if (wirehi < wirelow) {
1178  int temp = wirelow;
1179  wirelow = wirehi;
1180  wirehi = temp;
1181  }
1182 
1183  if (timehi < timelow) {
1184  int temp = timelow;
1185  timelow = timehi;
1186  timehi = temp;
1187  }
1188 
1189  //if drawing, then currently not zooming
1190  curr_zooming_plane = -1;
1191 
1192  fPlanes[plane]->SetZoomRange(wirelow, wirehi, timelow, timehi);
1193  fPlanes[plane]->Draw("1");
1194  fPlanes[plane]->UpdatePad();
1195 
1196  evdb::Canvas::fCanvas->cd();
1197  evdb::Canvas::fCanvas->Modified();
1198  evdb::Canvas::fCanvas->Update();
1199 
1200  // UpdateSeedCurve();
1201 
1202  ori->cd();
1203 
1204  return;
1205  }
std::map< int, double > tmin
TCanvas * fCanvas
The ROOT drawing canvas.
Definition: Canvas.h:42
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
static int curr_zooming_plane
std::map< int, double > wmax
static const char * zoom_opt
std::vector< ZoomOptionsMultiTPC > fPrevZoomOpt
std::map< int, double > wmin
std::map< int, double > tmax
void evd::TWQMultiTPCProjectionView::SetZoomInterest ( )

Definition at line 1037 of file TWQMultiTPCProjection.cxx.

References evd::EvdLayoutOptions::fAutoZoomInterest, and fToggleAutoZoom.

1038  {
1040  evdlayoutopt->fAutoZoomInterest = fToggleAutoZoom->GetState();
1041  }
int fAutoZoomInterest
Set the automatic zoom to the interest region.
TGCheckButton * fToggleAutoZoom
Toggle the autozoom setting.
void evd::TWQMultiTPCProjectionView::ToggleEndPointMarkers ( )

Definition at line 1044 of file TWQMultiTPCProjection.cxx.

References evd::EvdLayoutOptions::fShowEndPointMarkers, and fToggleShowMarkers.

1045  {
1047  evdlayoutopt->fShowEndPointMarkers = fToggleShowMarkers->GetState();
1048  }
int fShowEndPointMarkers
Draw EndPoint Markers if clicked.
TGCheckButton * fToggleShowMarkers
Toggle the ShowEndPointMarkersSetting.
void evd::TWQMultiTPCProjectionView::ZoomBack ( )

Definition at line 1123 of file TWQMultiTPCProjection.cxx.

References fPlanes, fPrevZoomOpt, fZoomOpt, evd::ZoomOptionsMultiTPC::OnlyPlaneChanged, SetZoom(), evd::ZoomOptionsMultiTPC::tmax, evd::ZoomOptionsMultiTPC::tmin, evd::ZoomOptionsMultiTPC::wmax, and evd::ZoomOptionsMultiTPC::wmin.

1124  {
1125  if (fPrevZoomOpt.size() > 0) {
1126  ZoomOptionsMultiTPC ThePrevZoomOpt = fPrevZoomOpt.at(fPrevZoomOpt.size() - 1);
1127  int plane = fZoomOpt.OnlyPlaneChanged;
1128  if (plane != -1) {
1129  SetZoom(plane,
1130  ThePrevZoomOpt.wmin[plane],
1131  ThePrevZoomOpt.wmax[plane],
1132  ThePrevZoomOpt.tmin[plane],
1133  ThePrevZoomOpt.tmax[plane],
1134  false);
1135  }
1136  else {
1137  for (size_t iplane = 0; iplane != fPlanes.size(); ++iplane) {
1138  SetZoom(iplane,
1139  ThePrevZoomOpt.wmin[iplane],
1140  ThePrevZoomOpt.wmax[iplane],
1141  ThePrevZoomOpt.tmin[iplane],
1142  ThePrevZoomOpt.tmax[iplane],
1143  false);
1144  }
1145  }
1146 
1147  fPrevZoomOpt.pop_back();
1148  }
1149  else
1150  mf::LogVerbatim("TWQMultiTPCProjectionView")
1151  << "unable to unzoom further - no zoom settings left on stack" << std::endl;
1152  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
std::vector< ZoomOptionsMultiTPC > fPrevZoomOpt
void SetZoom(int plane, int wirelow, int wirehi, int timelo, int timehi, bool StoreZoom=true)
void evd::TWQMultiTPCProjectionView::ZoomInterest ( bool  flag = true)

Definition at line 984 of file TWQMultiTPCProjection.cxx.

References evd::RawDrawingOptions::fDrawRawDataOrCalibWires, fPlanes, fPrevZoomOpt, fZoomOpt, geo::GeometryCore::Nwires(), evd::ZoomOptionsMultiTPC::OnlyPlaneChanged, SetZoom(), evd::ZoomOptionsMultiTPC::tmax, evd::ZoomOptionsMultiTPC::tmin, evd::ZoomOptionsMultiTPC::wmax, and evd::ZoomOptionsMultiTPC::wmin.

985  {
986  mf::LogVerbatim("TWQMultiTPCProjectionView") << "ZoomInterest called";
987 
988  if (flag == true)
989  zoom_opt = "1";
990  else
991  zoom_opt = "0";
992 
995 
996  ZoomOptionsMultiTPC zo;
997  // mf::LogVerbatim("TWQMultiTPCProjectionView") <<"Zoom interest pushing back zoom options"<<std::endl;
998  fPrevZoomOpt.push_back(fZoomOpt);
999 
1000  for (size_t iplane = 0; iplane < fPlanes.size(); ++iplane) {
1001  int minw, maxw, mint, maxt;
1002  if (flag) {
1003  int test = 0;
1004  if (rawopt->fDrawRawDataOrCalibWires == 0)
1005  fPlanes[iplane]->RawDataDraw()->GetRegionOfInterest(iplane, minw, maxw, mint, maxt);
1006  else
1007  fPlanes[iplane]->RecoBaseDraw()->GetRegionOfInterest(iplane, minw, maxw, mint, maxt);
1008 
1009  if (test == -1) continue;
1010  }
1011  else {
1012  geo::PlaneID const planeID(0, 0, iplane);
1013  minw = -0.005 * (geo->Nwires(planeID) - 1);
1014  maxw = 1.005 * (geo->Nwires(planeID) - 1);
1015  mint = -0.005 * fPlanes[iplane]->RawDataDraw()->TotalClockTicks();
1016  maxt = 1.01 * fPlanes[iplane]->RawDataDraw()->TotalClockTicks();
1017  }
1018 
1019  SetZoom(iplane, minw, maxw, mint, maxt, false);
1020  zo.wmin[iplane] = minw;
1021  zo.tmin[iplane] = mint;
1022  zo.wmax[iplane] = maxw;
1023  zo.tmax[iplane] = maxt;
1024  zo.OnlyPlaneChanged = -1;
1025  }
1026  fZoomOpt = zo;
1027  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
int fDrawRawDataOrCalibWires
0 for raw
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
unsigned int Nwires(PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
static const char * zoom_opt
std::vector< ZoomOptionsMultiTPC > fPrevZoomOpt
void SetZoom(int plane, int wirelow, int wirehi, int timelo, int timehi, bool StoreZoom=true)
Namespace collecting geometry-related classes utilities.

Member Data Documentation

TGTextView* evd::TWQMultiTPCProjectionView::fAngleInfo
private

Definition at line 139 of file TWQMultiTPCProjection.h.

Referenced by Draw().

float evdb::Canvas::fAspectRatio
protectedinherited

fYsize/fXsize

Definition at line 46 of file Canvas.h.

Referenced by evdb::Canvas::Canvas().

TGTextButton* evd::TWQMultiTPCProjectionView::fCalcAngle
private

Calculate the 2D & 3D angles between lines.

Definition at line 146 of file TWQMultiTPCProjection.h.

TGRadioButton* evd::TWQMultiTPCProjectionView::fCalibDraw
private

Draw calibrated information only.

Definition at line 131 of file TWQMultiTPCProjection.h.

Referenced by SetRawCalib(), and TWQMultiTPCProjectionView().

TGTextButton* evd::TWQMultiTPCProjectionView::fClear
private

Clears the selected points in an event.

Definition at line 147 of file TWQMultiTPCProjection.h.

TGTextButton* evd::TWQMultiTPCProjectionView::fClearPPoints
private

Clear current list of End Points.

Definition at line 142 of file TWQMultiTPCProjection.h.

Referenced by SetUpPositionFind().

TGNumberEntry* evd::TWQMultiTPCProjectionView::fDistance
private

Distance from line to find hits in cluster.

Definition at line 127 of file TWQMultiTPCProjection.h.

Referenced by SetDistance().

TGLabel* evd::TWQMultiTPCProjectionView::fDistanceLabel
private

Definition at line 119 of file TWQMultiTPCProjection.h.

TRootEmbeddedCanvas* evdb::Canvas::fEmbCanvas
protectedinherited
TGTextButton* evd::TWQMultiTPCProjectionView::fFindEndpoint
private

Calculate XYZ position of two points in wire planes.

Definition at line 141 of file TWQMultiTPCProjection.h.

Referenced by SetUpPositionFind().

TGCompositeFrame* evdb::Canvas::fFrame
protectedinherited
TGLabel* evd::TWQMultiTPCProjectionView::fGreyLabel
private

Definition at line 122 of file TWQMultiTPCProjection.h.

TGCheckButton* evd::TWQMultiTPCProjectionView::fGreyScale
private

Display gray or color scale.

Definition at line 128 of file TWQMultiTPCProjection.h.

Referenced by TWQMultiTPCProjectionView().

HeaderPad* evd::TWQMultiTPCProjectionView::fHeaderPad
private

Show header information.

Definition at line 109 of file TWQMultiTPCProjection.h.

Referenced by Draw(), TWQMultiTPCProjectionView(), and ~TWQMultiTPCProjectionView().

TGLayoutHints* evdb::Canvas::fLayout
protectedinherited
MCBriefPad* evd::TWQMultiTPCProjectionView::fMC
private

Short summary of MC event.

Definition at line 111 of file TWQMultiTPCProjection.h.

Referenced by Draw(), SetMCInfo(), TWQMultiTPCProjectionView(), and ~TWQMultiTPCProjectionView().

TGCheckButton* evd::TWQMultiTPCProjectionView::fMCOn
private

Display MC truth information.

Definition at line 129 of file TWQMultiTPCProjection.h.

Referenced by TWQMultiTPCProjectionView().

TGCompositeFrame* evd::TWQMultiTPCProjectionView::fMetaFrame
private

needed for the side frame

Definition at line 116 of file TWQMultiTPCProjection.h.

Referenced by TWQMultiTPCProjectionView().

TGNumberEntry* evd::TWQMultiTPCProjectionView::fPlaneEntry
private

Plane number displayed.

Definition at line 125 of file TWQMultiTPCProjection.h.

Referenced by SetPlane(), SetPlaneWire(), TWQMultiTPCProjectionView(), and ~TWQMultiTPCProjectionView().

TGLabel* evd::TWQMultiTPCProjectionView::fPlaneLabel
private
std::vector<TQPad*> evd::TWQMultiTPCProjectionView::fPlaneQ
private

charge on each plane

Definition at line 112 of file TWQMultiTPCProjection.h.

Referenced by Draw(), DrawPads(), TWQMultiTPCProjectionView(), and ~TWQMultiTPCProjectionView().

std::vector<TWireProjPad*> evd::TWQMultiTPCProjectionView::fPlanes
private
std::vector<ZoomOptionsMultiTPC> evd::TWQMultiTPCProjectionView::fPrevZoomOpt
private

Definition at line 157 of file TWQMultiTPCProjection.h.

Referenced by Draw(), SetZoom(), ZoomBack(), and ZoomInterest().

TGRadioButton* evd::TWQMultiTPCProjectionView::fRawCalibDraw
private

Draw raw and calibrated information.

Definition at line 132 of file TWQMultiTPCProjection.h.

Referenced by SetRawCalib(), and TWQMultiTPCProjectionView().

TGRadioButton* evd::TWQMultiTPCProjectionView::fRawDraw
private

Draw Raw information only.

Definition at line 130 of file TWQMultiTPCProjection.h.

Referenced by SetRawCalib(), and TWQMultiTPCProjectionView().

TGNumberEntry* evd::TWQMultiTPCProjectionView::fThresEntry
private

ADC threshold to display.

Definition at line 126 of file TWQMultiTPCProjection.h.

Referenced by SetThreshold(), and TWQMultiTPCProjectionView().

TGLabel* evd::TWQMultiTPCProjectionView::fThresLabel
private

Definition at line 121 of file TWQMultiTPCProjection.h.

Referenced by TWQMultiTPCProjectionView().

TGCheckButton* evd::TWQMultiTPCProjectionView::fToggleAutoZoom
private

Toggle the autozoom setting.

Definition at line 137 of file TWQMultiTPCProjection.h.

Referenced by SetUpZoomButtons(), and SetZoomInterest().

TGCheckButton* evd::TWQMultiTPCProjectionView::fToggleShowMarkers
private

Toggle the ShowEndPointMarkersSetting.

Definition at line 143 of file TWQMultiTPCProjection.h.

Referenced by SetUpPositionFind(), and ToggleEndPointMarkers().

TGRadioButton* evd::TWQMultiTPCProjectionView::fToggleZoom
private

Use zoom setting.

Definition at line 138 of file TWQMultiTPCProjection.h.

Referenced by RadioButtonsDispatch().

TGTextButton* evd::TWQMultiTPCProjectionView::fUnZoomInterest
private

Unzoom on iteresting region.

Definition at line 135 of file TWQMultiTPCProjection.h.

Referenced by SetUpZoomButtons().

TGCompositeFrame* evd::TWQMultiTPCProjectionView::fVFrame
private

needed for the side frame

Definition at line 115 of file TWQMultiTPCProjection.h.

Referenced by SetUpPositionFind(), SetUpZoomButtons(), and TWQMultiTPCProjectionView().

TGNumberEntry* evd::TWQMultiTPCProjectionView::fWireEntry
private

Wire number displayed.

Definition at line 124 of file TWQMultiTPCProjection.h.

Referenced by SetPlaneWire(), SetWire(), TWQMultiTPCProjectionView(), and ~TWQMultiTPCProjectionView().

TGLabel* evd::TWQMultiTPCProjectionView::fWireLabel
private
TQPad* evd::TWQMultiTPCProjectionView::fWireQ
private

Histogram of charge vs time on selected wire.

Definition at line 110 of file TWQMultiTPCProjection.h.

Referenced by Draw(), SetPlaneWire(), SetRawCalib(), TWQMultiTPCProjectionView(), and ~TWQMultiTPCProjectionView().

unsigned short evdb::Canvas::fXsize
protectedinherited

Size of the canvas;.

Definition at line 44 of file Canvas.h.

Referenced by evdb::Canvas::Canvas(), TWQMultiTPCProjectionView(), and evd::TWQProjectionView::TWQProjectionView().

TGTextView* evd::TWQMultiTPCProjectionView::fXYZPosition
private

Display the xyz position.

Definition at line 144 of file TWQMultiTPCProjection.h.

Referenced by Draw(), FindEndPoint(), FindLineLength(), and SetUpPositionFind().

unsigned short evdb::Canvas::fYsize
protectedinherited

Size of the canvas;.

Definition at line 45 of file Canvas.h.

Referenced by evdb::Canvas::Canvas(), TWQMultiTPCProjectionView(), and evd::TWQProjectionView::TWQProjectionView().

TGTextButton* evd::TWQMultiTPCProjectionView::fZoomBack
private

Unzoom on iteresting region.

Definition at line 136 of file TWQMultiTPCProjection.h.

Referenced by SetUpZoomButtons().

TGTextButton* evd::TWQMultiTPCProjectionView::fZoomInterest
private

Zoom on iteresting region.

Definition at line 134 of file TWQMultiTPCProjection.h.

Referenced by SetUpZoomButtons().

ZoomOptionsMultiTPC evd::TWQMultiTPCProjectionView::fZoomOpt
private

Definition at line 156 of file TWQMultiTPCProjection.h.

Referenced by Draw(), SetZoom(), ZoomBack(), and ZoomInterest().

std::deque<util::PxLine> evd::TWQMultiTPCProjectionView::pline
private

list of lines in each WireProjPad used for calculating 2d and 3d angles

Definition at line 154 of file TWQMultiTPCProjection.h.

Referenced by Draw(), FindLineLength(), and TWQMultiTPCProjectionView().

std::deque<util::PxPoint> evd::TWQMultiTPCProjectionView::ppoints
private

list of points in each WireProjPad used for x,y,z finding

Definition at line 152 of file TWQMultiTPCProjection.h.

Referenced by ClearEndPoints(), Draw(), FindEndPoint(), SelectPoint(), and TWQMultiTPCProjectionView().


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