LArSoft  v10_04_05
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 54 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, Get, geo::GeometryCore::NTPC(), evd::DrawingPad::Pad(), pline, ppoints, evd::TQPad::SetPlaneWire(), and SetUpSideBar().

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

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

294  {
295  if (fHeaderPad) {
296  delete fHeaderPad;
297  fHeaderPad = 0;
298  }
299  if (fMC) {
300  delete fMC;
301  fMC = 0;
302  }
303  if (fWireQ) {
304  delete fWireQ;
305  fWireQ = 0;
306  }
307  if (fPlaneEntry) {
308  delete fPlaneEntry;
309  fPlaneEntry = 0;
310  }
311  if (fWireEntry) {
312  delete fWireEntry;
313  fWireEntry = 0;
314  }
315  if (fPlaneLabel) {
316  delete fPlaneLabel;
317  fPlaneLabel = 0;
318  }
319  if (fWireLabel) {
320  delete fWireLabel;
321  fWireLabel = 0;
322  }
323  for (unsigned int i = 0; i < fPlanes.size(); ++i) {
324  if (fPlanes[i]) {
325  delete fPlanes[i];
326  fPlanes[i] = 0;
327  }
328  if (fPlaneQ[i]) {
329  delete fPlaneQ[i];
330  fPlaneQ[i] = 0;
331  }
332  }
333  fPlanes.clear();
334  fPlaneQ.clear();
335  }
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 446 of file TWQMultiTPCProjection.cxx.

References SetPlaneWire(), x, and xx.

Referenced by MouseDispatch().

447  {
448  //initial check for a mouse click on a TBox object
449  int event = gPad->GetEvent();
450  int px = gPad->GetEventX();
451  if (event != 11) return;
452  TObject* select = gPad->GetSelected();
453  if (!select) return;
454  if (!select->InheritsFrom("TBox")) return;
455 
456  //now find wire that was clicked on
457  float xx = gPad->AbsPixeltoX(px);
458  float x = gPad->PadtoX(xx);
459 
460  kPlane = plane;
461  kWire = (unsigned int)TMath::Nint(x);
462 
463  SetPlaneWire();
464 
465  return;
466  }
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 529 of file TWQMultiTPCProjection.cxx.

References fPlanes, ppoints, and x.

530  {
531  for (size_t x = 0; x < fPlanes.size(); ++x) {
532  fPlanes[x]->Pad()->cd();
533  fPlanes[x]->View()->Clear();
534  fPlanes[x]->View()->AddMarker(0.0, 0.0, 2, 1, 0.1);
535  fPlanes[x]->Pad()->Update();
536  fPlanes[x]->View()->Draw();
537  }
538  ppoints.clear();
539  gPad->Modified();
540  gPad->Update();
541  gPad->cd();
542  }
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 352 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.

353  {
354  fPrevZoomOpt.clear();
355 
356  evdb::Canvas::fCanvas->cd();
357  zoom_opt = 0;
358  fHeaderPad->Draw();
359  fMC->Draw();
360  fWireQ->Draw();
361 
363 
364  if (evdlayoutopt->fPrintTotalCharge) PrintCharge();
365 
366  //clear queue of selected points
367  ppoints.clear();
368  pline.clear();
369  // Reset current zooming plane - since it's not currently zooming.
370  curr_zooming_plane = -1;
371 
372  // double Charge=0, ConvCharge=0;
373  for (size_t i = 0; i < fPlanes.size(); ++i) {
374  fPlanes[i]->Draw(opt);
375  fPlanes[i]->Pad()->Update();
376  fPlanes[i]->Pad()->GetFrame()->SetBit(TPad::kCannotMove, true);
377  fPlaneQ[i]->Draw();
378  std::vector<double> ZoomParams = fPlanes[i]->GetCurrentZoom();
379  fZoomOpt.wmin[i] = ZoomParams[0];
380  fZoomOpt.wmax[i] = ZoomParams[1];
381  fZoomOpt.tmin[i] = ZoomParams[2];
382  fZoomOpt.tmax[i] = ZoomParams[3];
383  }
384 
385  // Reset any text boxes which are enabled
386  if (fXYZPosition) fXYZPosition->SetForegroundColor(kBlack);
387 
388  if (fAngleInfo) fAngleInfo->SetForegroundColor(kBlack);
389 
390  evdb::Canvas::fCanvas->Update();
391  }
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:110
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
int evd::TWQMultiTPCProjectionView::DrawLine ( int  plane,
util::PxLine pline 
)
private
void evd::TWQMultiTPCProjectionView::DrawPads ( const char *  opt = "")

Definition at line 338 of file TWQMultiTPCProjection.cxx.

References fPlaneQ, and fPlanes.

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

339  {
340  for (unsigned int i = 0; i < fPlanes.size(); ++i) {
341  fPlanes[i]->Draw();
342  fPlanes[i]->Pad()->Update();
343  fPlanes[i]->Pad()->GetFrame()->SetBit(TPad::kCannotMove, true);
344  }
345  for (unsigned int j = 0; j < fPlaneQ.size(); ++j) {
346  fPlaneQ[j]->Draw();
347  fPlaneQ[j]->Pad()->Update();
348  fPlaneQ[j]->Pad()->GetFrame()->SetBit(TPad::kCannotMove, true);
349  }
350  }
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 677 of file TWQMultiTPCProjection.cxx.

References evd::RawDrawingOptions::fCryostat, fPlanes, evd::EvdLayoutOptions::fShowEndPointMarkers, evd::RawDrawingOptions::fTPC, fXYZPosition, Get, evdb::EventHolder::GetEvent(), evdb::EventHolder::Instance(), geo::origin(), geo::PlaneID::Plane, ppoints, detinfo::sampling_rate(), detinfo::trigger_offset(), w, and xx.

678  {
679  art::Event const* pEvent = evdb::EventHolder::Instance()->GetEvent();
680  if (not pEvent) {
681  std::cerr << "No event available\n";
682  return;
683  }
684 
685  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService>()->DataFor(*pEvent);
686  auto const detProp =
687  art::ServiceHandle<detinfo::DetectorPropertiesService>()->DataFor(*pEvent, clockData);
688 
689  // if list is larger than or equal to two, can project to XYZ and extrapolate to third plane (if exists)
690 
691  if (ppoints.size() >= 2) {
692 
693  double xyz_vertex_fit[3] = {0.};
694  double second_time = 0.;
695  geo::PlaneGeo::LocalPoint_t const origin{0., 0., 0.};
696 
699  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout const>()->Get();
700  double ftimetick = sampling_rate(clockData) / 1000.;
701  double larv = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
702 
703  geo::TPCID const tpcid{rawOpt->fCryostat, rawOpt->fTPC};
704  geo::PlaneID const plane_0{tpcid, ppoints[0].plane};
705  geo::PlaneID const plane_1{tpcid, ppoints[1].plane};
706 
707  //find channels corresponding to found wires.
708  int chan1 = wireReadoutGeom.PlaneWireToChannel(geo::WireID(plane_0, ppoints[0].w));
709  int chan2 = wireReadoutGeom.PlaneWireToChannel(geo::WireID(plane_1, ppoints[1].w));
710 
711  std::optional<geo::WireIDIntersection> wires_cross{};
712  bool time_good = false;
713 
714  if (fabs(ppoints[0].t - ppoints[1].t) < 200) {
715  wires_cross = wireReadoutGeom.ChannelsIntersect(chan1, chan2);
716  time_good = true;
717  }
718  else {
719  TGText* tt = new TGText("too big");
720  tt->InsLine(1, "time distance");
721  fXYZPosition->SetText(tt);
722  fXYZPosition->Update();
723  //not returning, because may need to delete marker from wplane
724  }
725 
726  if (wires_cross) {
727  xyz_vertex_fit[1] = wires_cross->y;
728  xyz_vertex_fit[2] = wires_cross->z;
729  auto pos = wireReadoutGeom.Plane(plane_0).toWorldCoords(origin);
730  xyz_vertex_fit[0] = (ppoints[0].t - trigger_offset(clockData)) * larv * ftimetick + pos.X();
731  pos = wireReadoutGeom.Plane(plane_1).toWorldCoords(origin);
732  second_time = (ppoints[1].t - trigger_offset(clockData)) * larv * ftimetick + pos.X();
733 
734  TGText* tt = new TGText(Form("z:%4.1f", wires_cross->z));
735  tt->InsLine(1, Form("x:%4.1f,", (xyz_vertex_fit[0] + second_time) / 2));
736  tt->InsLine(1, Form("y:%4.1f,", wires_cross->y));
737  fXYZPosition->SetText(tt);
738  fXYZPosition->Update();
740  }
741  else {
742  if (time_good) { //otherwise the wires_cross are false by default
743  TGText* tt = new TGText("cross");
744  tt->InsLine(1, "wires do not");
745  fXYZPosition->SetText(tt);
746  fXYZPosition->Update();
747  }
748  //not returning, because may need to delete marker from wplanereturn;
749  }
750  // extrapolate third point only if there are enough planes
751  if (fPlanes.size() > 2) {
752 
753  unsigned int wplane = 0;
754  unsigned int wirevertex = 0;
756 
757  for (size_t xx = 0; xx < fPlanes.size(); ++xx) {
758  wplane = 0;
759  for (int yy = 0; yy < 2; ++yy)
760  if (ppoints[yy].plane == xx) ++wplane;
761 
762  if (!wplane) {
763  wplane = xx;
764  break;
765  }
766  }
767 
768  geo::PlaneID const planeID{tpcid, wplane};
769  auto const& planeg = wireReadoutGeom.Plane(planeID);
770  auto pos = planeg.toWorldCoords(origin);
771  pos.SetY(xyz_vertex_fit[1]);
772  pos.SetZ(xyz_vertex_fit[2]);
773 
774  wirevertex = planeg.NearestWireID(pos).Wire;
775 
776  double drifttick =
777  ((xyz_vertex_fit[0]) / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
778  (1. / ftimetick);
779  double timestart =
780  drifttick -
781  (pos.X() / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
782  (1. / ftimetick) +
783  trigger_offset(clockData);
784 
785  fPlanes[wplane]->Pad()->cd();
786  fPlanes[wplane]->View()->Clear();
787  if (wires_cross && evdlayoutopt->fShowEndPointMarkers) //only Draw if it makes sense
788  fPlanes[wplane]->View()->AddMarker(wirevertex, timestart, kMagenta, 29, 2.0);
789  else //draw dummy marker to delete old one
790  fPlanes[wplane]->View()->AddMarker(0.0, 0.0, 2, 1, 0.1);
791  fPlanes[wplane]->Pad()->Update();
792  fPlanes[wplane]->View()->Draw();
793  } // end if(fPlanes.size()>2)
794  //update pad?
795  gPad->Modified();
796  gPad->Update();
797  gPad->cd();
798  } // end if( ppoints.size()>=2)
799  else {
800  TGText* tt = new TGText("selected points");
801  tt->InsLine(1, "not enough");
802  fXYZPosition->SetText(tt);
803  fXYZPosition->Update();
804  }
805  }
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.
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
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
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:306
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:373
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
Point3DBase_t< PlaneGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML wire plane frame.
Definition: PlaneGeo.h:94
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 545 of file TWQMultiTPCProjection.cxx.

References detinfo::DetectorPropertiesData::DriftVelocity(), detinfo::DetectorPropertiesData::Efield(), evd::RawDrawingOptions::fCryostat, evd::RawDrawingOptions::fTPC, fXYZPosition, Get, pline, detinfo::sampling_rate(), t1, detinfo::DetectorPropertiesData::Temperature(), and detinfo::trigger_offset().

547  {
548  // if list is larger than or equal to two, can project to XYZ and extrapolate to third plane (if exists)
549 
550  if (pline.size() >= 2) {
551 
552  double xyz_vertex_fit[3];
553  double second_time;
554  double xx0 = 0., yy0 = 0., zz0 = 0.;
555  double xx1 = 0., yy1 = 0., zz1 = 0.;
556  double length;
557 
560  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout const>()->Get();
561  double ftimetick = sampling_rate(clockData) / 1000.;
562  double larv = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
563 
564  //find channels corresponding to found wires.
565  geo::TPCID const tpcid{rawOpt->fCryostat, rawOpt->fTPC};
566  geo::PlaneID const plane_0{tpcid, pline[0].plane};
567  geo::PlaneID const plane_1{tpcid, pline[1].plane};
568  int chan1 = wireReadoutGeom.PlaneWireToChannel(geo::WireID(plane_0, pline[0].w0));
569  int chan2 = wireReadoutGeom.PlaneWireToChannel(geo::WireID(plane_1, pline[1].w0));
570 
571  std::optional<geo::WireIDIntersection> wires_cross{};
572  bool time_good = false;
573 
574  if (fabs(pline[0].t0 - pline[1].t0) < 200) {
575  wires_cross = wireReadoutGeom.ChannelsIntersect(chan1, chan2);
576  time_good = true;
577  }
578  else {
579  TGText* tt = new TGText("too big");
580  tt->InsLine(1, "time distance");
581  fXYZPosition->SetText(tt);
582  fXYZPosition->Update();
583  //not returning, because may need to delete marker from wplane
584  }
585 
586  if (wires_cross) {
587  TGText* tt = new TGText("wires cross");
588  fXYZPosition->SetText(tt);
589  fXYZPosition->Update();
590  xyz_vertex_fit[1] = wires_cross->y;
591  xyz_vertex_fit[2] = wires_cross->z;
592  auto pos = wireReadoutGeom.Plane(plane_0).GetBoxCenter();
593  xyz_vertex_fit[0] = (pline[0].t0 - trigger_offset(clockData)) * larv * ftimetick + pos.X();
594  pos = wireReadoutGeom.Plane(plane_1).GetBoxCenter();
595  second_time = (pline[1].t0 - trigger_offset(clockData)) * larv * ftimetick + pos.X();
596 
597  xx0 = (xyz_vertex_fit[0] + second_time) / 2;
598  yy0 = wires_cross->y;
599  zz0 = wires_cross->z;
600 
602  }
603  else {
604  if (time_good) { //otherwise the wires_cross are false by default
605  TGText* tt = new TGText("cross");
606  tt->InsLine(1, "wires do not");
607  fXYZPosition->SetText(tt);
608  fXYZPosition->Update();
609  }
610  //not returning, because may need to delete marker from wplanereturn;
611  }
612  //find channels corresponding to found wires AT END OF LINE.
613  chan1 = wireReadoutGeom.PlaneWireToChannel(geo::WireID(plane_0, pline[0].w1));
614  chan2 = wireReadoutGeom.PlaneWireToChannel(geo::WireID(plane_1, pline[1].w1));
615 
616  wires_cross = std::nullopt;
617  time_good = false;
618 
619  if (fabs(pline[0].t1 - pline[1].t1) < 200) {
620  wires_cross = wireReadoutGeom.ChannelsIntersect(chan1, chan2);
621  time_good = true;
622  }
623  else {
624  TGText* tt = new TGText("too big");
625  tt->InsLine(1, "time distance");
626  fXYZPosition->SetText(tt);
627  fXYZPosition->Update();
628  //not returning, because may need to delete marker from wplane
629  }
630 
631  if (wires_cross) {
632  TGText* tt = new TGText("wires do cross");
633  fXYZPosition->SetText(tt);
634  fXYZPosition->Update();
635  xyz_vertex_fit[1] = wires_cross->y;
636  xyz_vertex_fit[2] = wires_cross->z;
637  constexpr geo::TPCID tpcid{0, 0};
638  auto pos = wireReadoutGeom.Plane(geo::PlaneID(tpcid, pline[0].plane)).GetBoxCenter();
639  xyz_vertex_fit[0] = (pline[0].t1 - trigger_offset(clockData)) * larv * ftimetick + pos.X();
640  pos = wireReadoutGeom.Plane(geo::PlaneID(tpcid, pline[1].plane)).GetBoxCenter();
641  second_time = (pline[1].t1 - trigger_offset(clockData)) * larv * ftimetick + pos.X();
642 
643  xx1 = (xyz_vertex_fit[0] + second_time) / 2;
644  yy1 = wires_cross->y;
645  zz1 = wires_cross->z;
646  }
647  else {
648  if (time_good) { //otherwise the wires_cross are false by default
649  TGText* tt = new TGText("cross");
650  tt->InsLine(1, "wires do not");
651  fXYZPosition->SetText(tt);
652  fXYZPosition->Update();
653  }
654  // return; //not returning, because may need to delete marker from wplanereturn;
655  }
656  //update pad?
657  gPad->Modified();
658  gPad->Update();
659  gPad->cd();
660 
661  length = pow(xx0 - xx1, 2) + pow(yy0 - yy1, 2) + pow(zz0 - zz1, 2);
662  length = pow(length, 0.5);
663  return length;
664  } // end if( ppoints.size()>=2)
665 
666  else {
667  TGText* tt = new TGText("selected points");
668  tt->InsLine(1, "not enough");
669  fXYZPosition->SetText(tt);
670  fXYZPosition->Update();
671  }
672 
673  return -99;
674  }
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
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
Definition: type_traits.h:61
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:306
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 421 of file TWQMultiTPCProjection.cxx.

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

422  {
423  //initial check for a mouse click on a TBox object
424  int event = gPad->GetEvent();
427 
428  switch (event) {
429 
430  case kButton1Shift:
431  shift_lock = 1;
432  wqpp->SelectPoint(plane);
433  break;
434  case kButton1Up:
435  if (shift_lock == 1) break;
436  if (evdlayoutopt->fChangeWire == 1) wqpp->ChangeWire(plane);
437  case kButton1Down: shift_lock = 0;
438  case kButton1Motion:
439  wqpp->SetMouseZoomRegion(plane);
440  break;
441  // default:
442  }
443  }
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 395 of file TWQMultiTPCProjection.cxx.

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

Referenced by Draw().

396  {
398  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout const>()->Get();
399 
400  geo::TPCID tpcid = rawopt->CurrentTPC();
401 
402  for (size_t iplane = 0; iplane < fPlanes.size(); ++iplane) {
403  if (wireReadoutGeom.SignalType(geo::PlaneID(tpcid, iplane)) == geo::kCollection) {
404  double ch = 0, convch = 0;
405  if (rawopt->fDrawRawDataOrCalibWires == 0) {
406  fPlanes[iplane]->RawDataDraw()->GetChargeSum(iplane, ch, convch);
407  mf::LogVerbatim("TWQMultiTPCProjectionView") << "Warning! Calculating for RawData! ";
408  }
409  else {
410  fPlanes[iplane]->RecoBaseDraw()->GetChargeSum(iplane, ch, convch);
411  }
412 
413  mf::LogVerbatim("TWQMultiTPCProjectionView")
414  << "\ncharge collected at collection plane: " << iplane << " " << ch << " " << convch;
415  }
416  }
417  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
int fDrawRawDataOrCalibWires
0 for raw
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
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:306
Signal from collection planes.
Definition: geo_types.h:148
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 1027 of file TWQMultiTPCProjection.cxx.

References fToggleZoom.

1028  {
1029  if (parameter == 1 || parameter == 2) { fToggleZoom->SetState(kButtonUp); }
1030  }
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 469 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().

470  {
471  //initial check for a mouse click on a TBox object
472  int event = gPad->GetEvent();
473 
474  if (event != 7) return;
475 
477  if (evdlayoutopt->fShowEndPointSection != 1) return;
478  //struct planepoint;
479  int px = gPad->GetEventX();
480  double w0 = gPad->AbsPixeltoX(px);
481  double x = gPad->PadtoX(w0);
482 
483  int py = gPad->GetEventY();
484  double t0 = gPad->AbsPixeltoY(py);
485  double y = gPad->PadtoY(t0);
486 
487  util::PxPoint ppx(plane, x, y);
488  curr_zooming_plane = -1;
489 
490  // check if not clicking on a plane that is already in the ppoints list:
491  int repeat_plane = -1;
492  for (size_t ii = 0; ii < ppoints.size(); ++ii)
493  if (ppx.plane == ppoints[ii].plane) {
494  ppoints[ii] = ppx;
495  //clear View and draw new Marker
496  fPlanes[ppoints[ii].plane]->View()->Clear();
497  if (evdlayoutopt->fShowEndPointMarkers)
498  fPlanes[ppoints[ii].plane]->View()->AddMarker(ppx.w, ppx.t, kRed, 29, 2.0);
499  else
500  fPlanes[plane]->View()->AddMarker(0.0, 0.0, 2, 1, 0.1);
501  fPlanes[ppoints[ii].plane]->View()->Draw();
502  repeat_plane = ppoints[ii].plane;
503  break;
504  }
505 
506  //if plane does not repeat and size of list is larger than 2 pop_front
507  // and delete its marker. Otherwise just push_back.
508  if (repeat_plane == -1) {
509  if (ppoints.size() >= 2) {
510  fPlanes[ppoints[0].plane]->Pad()->cd();
511  fPlanes[ppoints[0].plane]->View()->Clear();
512  fPlanes[ppoints[0].plane]->View()->Draw();
513  ppoints.pop_front();
514  }
515  ppoints.push_back(ppx);
516  fPlanes[plane]->Pad()->cd();
517  fPlanes[plane]->View()->Clear();
518  if (evdlayoutopt->fShowEndPointMarkers)
519  fPlanes[plane]->View()->AddMarker(ppx.w, ppx.t, kRed, 29, 2.0);
520  else
521  fPlanes[plane]->View()->AddMarker(0.0, 0.0, 2, 1, 0.1);
522  fPlanes[plane]->View()->Draw();
523  }
524 
525  return;
526  }
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 1192 of file TWQMultiTPCProjection.cxx.

References fDistance.

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

Definition at line 1217 of file TWQMultiTPCProjection.cxx.

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

1218  {
1220 
1221  TGButton* b = (TGButton*)gTQSender;
1222  if (b->GetState() == kButtonDown) { cst->fColorOrGray = 1; }
1223  else {
1224  cst->fColorOrGray = 0;
1225  }
1226 
1227  TVirtualPad* ori = gPad;
1228  DrawPads(zoom_opt);
1229  evdb::Canvas::fCanvas->cd();
1230  evdb::Canvas::fCanvas->Modified();
1231  evdb::Canvas::fCanvas->Update();
1232 
1233  ori->cd();
1234 
1235  return;
1236  }
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 1284 of file TWQMultiTPCProjection.cxx.

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

1285  {
1287 
1288  TGButton* b = (TGButton*)gTQSender;
1289  if (b->GetState() == kButtonDown) {
1290  sdo->fShowMCTruthText = 1;
1291  sdo->fShowMCTruthVectors = 1;
1292  }
1293  else {
1294  sdo->fShowMCTruthText = 0;
1295  sdo->fShowMCTruthVectors = 0;
1296  }
1297 
1298  TVirtualPad* ori = gPad;
1299 
1300  fMC->Draw();
1301  evdb::Canvas::fCanvas->cd();
1302  evdb::Canvas::fCanvas->Modified();
1303  evdb::Canvas::fCanvas->Update();
1304 
1305  ori->cd();
1306  }
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 808 of file TWQMultiTPCProjection.cxx.

References SetZoom(), t1, and x.

Referenced by MouseDispatch().

809  {
810  //*-*-*-*-*-*-*-*-*-*-*Create a new arrow in this pad*-*-*-*-*-*-*-*-*-*-*-*-*
811  //*-* ==============================
812  //
813  TObject* select = gPad->GetSelected();
814  if (!select) return;
815  if (!select->InheritsFrom("TBox")) return;
816 
817  static Float_t w0 = -1, t0 = -1, w1 = -1, t1 = -1;
818 
819  static Int_t pxold, pyold;
820  static Int_t pw0, pt0;
821  static Int_t linedrawn;
822  //static int curr_plane;
823  //TLine *line;
824 
825  static int wstart, wend;
826  static float tstart, tend;
827 
828  int event = gPad->GetEvent();
829  int px = gPad->GetEventX();
830  int py = gPad->GetEventY();
831 
832  switch (event) {
833 
834  case kButton1Down: {
835  gVirtualX->SetLineColor(-1);
836  w0 = gPad->AbsPixeltoX(px);
837  t0 = gPad->AbsPixeltoY(py);
838  pw0 = px;
839  pt0 = py;
840  pxold = px;
841  pyold = py;
842  linedrawn = 0;
843  float x = gPad->PadtoX(w0);
844  tstart = gPad->PadtoY(t0);
845 
846  wstart = (unsigned int)TMath::Nint(x);
847  curr_zooming_plane = plane;
848  break;
849  }
850  case kButton1Motion: {
851  int lx, hx, ly, hy;
852  if (pw0 < pxold) {
853  lx = pw0;
854  hx = pxold;
855  }
856  else {
857  lx = pxold;
858  hx = pw0;
859  }
860 
861  if (pt0 < pyold) {
862  ly = pt0;
863  hy = pyold;
864  }
865  else {
866  ly = pyold;
867  hy = pt0;
868  }
869 
870  if (linedrawn) gVirtualX->DrawBox(lx, ly, hx, hy, TVirtualX::kHollow);
871  pxold = px;
872  pyold = py;
873  linedrawn = 1;
874 
875  if (pw0 < pxold) {
876  lx = pw0;
877  hx = pxold;
878  }
879  else {
880  lx = pxold;
881  hx = pw0;
882  }
883 
884  if (pt0 < pyold) {
885  ly = pt0;
886  hy = pyold;
887  }
888  else {
889  ly = pyold;
890  hy = pt0;
891  }
892 
893  gVirtualX->DrawBox(lx, ly, hx, hy, TVirtualX::kHollow);
894  break;
895  }
896  case kButton1Up: {
897  if (px == pw0 && py == pt0) break;
898  w1 = gPad->AbsPixeltoX(px);
899  t1 = gPad->AbsPixeltoY(py);
900  gPad->Modified(kTRUE);
901 
902  // line = new TLine(w0,t0,w1,t1);
903  // line->Draw();
904 
905  float x = gPad->PadtoX(w1);
906  tend = gPad->PadtoY(t1);
907  wend = (unsigned int)TMath::Nint(x);
908 
909  gROOT->SetEditorMode();
910 
911  //make sure the box is significantly big to avoid accidental zooms on nothing.
912  double xx1, yy1, xx2, yy2;
913 
914  gPad->GetRangeAxis(xx1, yy1, xx2, yy2);
915 
916  if (wstart != 0 && tstart != 0 && (fabs(wend - wstart) > 0.01 * (xx2 - xx1)) &&
917  (fabs(tend - tstart) > 0.01 * (yy2 - yy1) && curr_zooming_plane == plane)) {
918 
919  SetZoom(plane, wstart, wend, tstart, tend);
920  wstart = -1;
921  tstart = -1;
922  }
923  break;
924  }
925  } // end switch
926  }
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 1176 of file TWQMultiTPCProjection.cxx.

References fPlaneEntry, and SetPlaneWire().

1177  {
1178  kPlane = (unsigned int)fPlaneEntry->GetNumberEntry()->GetNumber();
1179 
1180  SetPlaneWire();
1181  }
static unsigned int kPlane
TGNumberEntry * fPlaneEntry
Plane number displayed.
void evd::TWQMultiTPCProjectionView::SetPlaneWire ( )

Definition at line 1152 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().

1153  {
1154  TVirtualPad* ori = gPad;
1155 
1157 
1158  fWireQ->Draw();
1159  fWireQ->Pad()->cd();
1160  fWireQ->Pad()->Modified();
1161  fWireQ->Pad()->Update();
1162  fWireQ->Pad()->SetBit(TPad::kCannotMove, true);
1163  fWireQ->Pad()->GetFrame()->SetBit(TPad::kCannotMove, true);
1164 
1165  fPlaneEntry->SetNumber(kPlane);
1166  fWireEntry->SetNumber(kWire);
1167 
1168  evdb::Canvas::fCanvas->cd();
1169  evdb::Canvas::fCanvas->Modified();
1170  evdb::Canvas::fCanvas->Update();
1171 
1172  ori->cd();
1173  }
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:110
TGNumberEntry * fPlaneEntry
Plane number displayed.
TPad * Pad()
Definition: DrawingPad.h:30
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 1239 of file TWQMultiTPCProjection.cxx.

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

1240  {
1242 
1243  TGButton* b = (TGButton*)gTQSender;
1244  int id = b->WidgetId();
1245 
1246  // id values are set in lines 125 - 127
1247  if (id == 4) {
1248  rawopt->fDrawRawDataOrCalibWires = 0;
1249  fRawDraw->SetState(kButtonDown);
1250  fCalibDraw->SetState(kButtonUp);
1251  fRawCalibDraw->SetState(kButtonUp);
1252  }
1253  else if (id == 3) {
1254  rawopt->fDrawRawDataOrCalibWires = 1;
1255  fRawDraw->SetState(kButtonUp);
1256  fCalibDraw->SetState(kButtonDown);
1257  fRawCalibDraw->SetState(kButtonUp);
1258  }
1259  else if (id == 2) {
1260  rawopt->fDrawRawDataOrCalibWires = 2;
1261  fRawDraw->SetState(kButtonUp);
1262  fCalibDraw->SetState(kButtonUp);
1263  fRawCalibDraw->SetState(kButtonDown);
1264  }
1265 
1266  TVirtualPad* ori = gPad;
1267 
1268  fWireQ->Draw();
1269  fWireQ->Pad()->cd();
1270  fWireQ->Pad()->Modified();
1271  fWireQ->Pad()->Update();
1272 
1273  DrawPads(zoom_opt);
1274  evdb::Canvas::fCanvas->cd();
1275  evdb::Canvas::fCanvas->Modified();
1276  evdb::Canvas::fCanvas->Update();
1277 
1278  ori->cd();
1279 
1280  return;
1281  }
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:110
TGRadioButton * fRawCalibDraw
Draw raw and calibrated information.
TGRadioButton * fRawDraw
Draw Raw information only.
TPad * Pad()
Definition: DrawingPad.h:30
static const char * zoom_opt
void evd::TWQMultiTPCProjectionView::SetThreshold ( )

Definition at line 1198 of file TWQMultiTPCProjection.cxx.

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

1199  {
1200  double threshold = fThresEntry->GetNumberEntry()->GetNumber();
1201 
1203  rawopt->fMinSignal = threshold;
1204 
1205  TVirtualPad* ori = gPad;
1206  DrawPads(zoom_opt);
1207  evdb::Canvas::fCanvas->cd();
1208  evdb::Canvas::fCanvas->Modified();
1209  evdb::Canvas::fCanvas->Update();
1210 
1211  ori->cd();
1212 
1213  return;
1214  }
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 1033 of file TWQMultiTPCProjection.cxx.

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

Referenced by SetUpSideBar().

1034  {
1035  // enter zoom buttons
1037  if (!evdlayoutopt->fShowEndPointSection) return;
1038 
1039  fFindEndpoint = new TGTextButton(fVFrame, "&Find XYZ", 150);
1040  fFindEndpoint->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "FindEndPoint()");
1041 
1042  fXYZPosition = new TGTextView(
1043  fVFrame, 100, 55, 999, TGView::kNoHSB | TGView::kNoVSB);
1044  fXYZPosition->SetEditable("false");
1045  TGText* tt = new TGText("x,y,z");
1046  fXYZPosition->SetText(tt);
1047 
1048  fClearPPoints = new TGTextButton(fVFrame, "&Clear Points", 150);
1049  fClearPPoints->Connect(
1050  "Clicked()", "evd::TWQMultiTPCProjectionView", this, "ClearEndPoints()"); // ?
1051 
1053  new TGCheckButton(fVFrame, "ShowMarkers", 0);
1054  fToggleShowMarkers->Connect(
1055  "Clicked()", "evd::TWQMultiTPCProjectionView", this, "ToggleEndPointMarkers()");
1056  if (evdlayoutopt->fShowEndPointMarkers == 1) fToggleShowMarkers->SetState(kButtonDown);
1057 
1058  fVFrame->AddFrame(fFindEndpoint, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1059  fVFrame->AddFrame(fXYZPosition, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1060  fVFrame->AddFrame(fClearPPoints, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1061  fVFrame->AddFrame(fToggleShowMarkers, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1062  }
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 997 of file TWQMultiTPCProjection.cxx.

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

Referenced by SetUpSideBar().

998  {
999  // enter zoom buttons
1001 
1002  fZoomInterest = new TGTextButton(fVFrame, "&Zoom Interest", 150);
1003  fZoomInterest->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "ZoomInterest()");
1004 
1005  fUnZoomInterest = new TGTextButton(fVFrame, "&UnZoom Interest", 150);
1006  fUnZoomInterest->Connect(
1007  "Clicked()", "evd::TWQMultiTPCProjectionView", this, "ZoomInterest(=false)");
1008 
1009  fZoomBack = new TGTextButton(fVFrame, "&Zoom Back", 150);
1010  fZoomBack->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "ZoomBack()");
1011 
1012  fToggleAutoZoom = new TGCheckButton(fVFrame, "AutoZoom", 0);
1013  ;
1014  fToggleAutoZoom->Connect(
1015  "Clicked()", "evd::TWQMultiTPCProjectionView", this, "SetZoomInterest()");
1016  if (evdlayoutopt->fAutoZoomInterest == 1) fToggleAutoZoom->SetState(kButtonDown);
1017 
1018  fVFrame->AddFrame(fZoomInterest, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1019  fVFrame->AddFrame(fUnZoomInterest, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1020 
1021  fVFrame->AddFrame(fZoomBack, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1022 
1023  fVFrame->AddFrame(fToggleAutoZoom, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1));
1024  }
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 1184 of file TWQMultiTPCProjection.cxx.

References fWireEntry, and SetPlaneWire().

1185  {
1186  kWire = (unsigned int)fWireEntry->GetNumberEntry()->GetNumber();
1187 
1188  SetPlaneWire();
1189  }
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 1099 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().

1105  {
1106 
1107  if (StoreZoom) {
1108  fPrevZoomOpt.push_back(fZoomOpt);
1109  fZoomOpt.OnlyPlaneChanged = plane;
1110  }
1111 
1112  fZoomOpt.wmin[plane] = wirelow;
1113  fZoomOpt.wmax[plane] = wirehi;
1114  fZoomOpt.tmin[plane] = timelow;
1115  fZoomOpt.tmax[plane] = timehi;
1116 
1117  TVirtualPad* ori = gPad;
1118  zoom_opt = "1";
1119 
1120  // error checking - useful for the mouse zoom.
1121  if (wirehi < wirelow) {
1122  int temp = wirelow;
1123  wirelow = wirehi;
1124  wirehi = temp;
1125  }
1126 
1127  if (timehi < timelow) {
1128  int temp = timelow;
1129  timelow = timehi;
1130  timehi = temp;
1131  }
1132 
1133  //if drawing, then currently not zooming
1134  curr_zooming_plane = -1;
1135 
1136  fPlanes[plane]->SetZoomRange(wirelow, wirehi, timelow, timehi);
1137  fPlanes[plane]->Draw("1");
1138  fPlanes[plane]->UpdatePad();
1139 
1140  evdb::Canvas::fCanvas->cd();
1141  evdb::Canvas::fCanvas->Modified();
1142  evdb::Canvas::fCanvas->Update();
1143 
1144  // UpdateSeedCurve();
1145 
1146  ori->cd();
1147 
1148  return;
1149  }
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 983 of file TWQMultiTPCProjection.cxx.

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

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

Definition at line 990 of file TWQMultiTPCProjection.cxx.

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

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

Definition at line 1067 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.

1068  {
1069  if (fPrevZoomOpt.size() > 0) {
1070  ZoomOptionsMultiTPC ThePrevZoomOpt = fPrevZoomOpt.at(fPrevZoomOpt.size() - 1);
1071  int plane = fZoomOpt.OnlyPlaneChanged;
1072  if (plane != -1) {
1073  SetZoom(plane,
1074  ThePrevZoomOpt.wmin[plane],
1075  ThePrevZoomOpt.wmax[plane],
1076  ThePrevZoomOpt.tmin[plane],
1077  ThePrevZoomOpt.tmax[plane],
1078  false);
1079  }
1080  else {
1081  for (size_t iplane = 0; iplane != fPlanes.size(); ++iplane) {
1082  SetZoom(iplane,
1083  ThePrevZoomOpt.wmin[iplane],
1084  ThePrevZoomOpt.wmax[iplane],
1085  ThePrevZoomOpt.tmin[iplane],
1086  ThePrevZoomOpt.tmax[iplane],
1087  false);
1088  }
1089  }
1090 
1091  fPrevZoomOpt.pop_back();
1092  }
1093  else
1094  mf::LogVerbatim("TWQMultiTPCProjectionView")
1095  << "unable to unzoom further - no zoom settings left on stack" << std::endl;
1096  }
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 930 of file TWQMultiTPCProjection.cxx.

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

931  {
932  mf::LogVerbatim("TWQMultiTPCProjectionView") << "ZoomInterest called";
933 
934  if (flag == true)
935  zoom_opt = "1";
936  else
937  zoom_opt = "0";
938 
939  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout>()->Get();
941 
942  ZoomOptionsMultiTPC zo;
943  // mf::LogVerbatim("TWQMultiTPCProjectionView") <<"Zoom interest pushing back zoom options"<<std::endl;
944  fPrevZoomOpt.push_back(fZoomOpt);
945 
946  for (size_t iplane = 0; iplane < fPlanes.size(); ++iplane) {
947  int minw, maxw, mint, maxt;
948  if (flag) {
949  int test = 0;
950  if (rawopt->fDrawRawDataOrCalibWires == 0)
951  fPlanes[iplane]->RawDataDraw()->GetRegionOfInterest(iplane, minw, maxw, mint, maxt);
952  else
953  fPlanes[iplane]->RecoBaseDraw()->GetRegionOfInterest(iplane, minw, maxw, mint, maxt);
954 
955  if (test == -1) continue;
956  }
957  else {
958  geo::PlaneID const planeID(0, 0, iplane);
959  minw = -0.005 * (wireReadoutGeom.Nwires(planeID) - 1);
960  maxw = 1.005 * (wireReadoutGeom.Nwires(planeID) - 1);
961  mint = -0.005 * fPlanes[iplane]->RawDataDraw()->TotalClockTicks();
962  maxt = 1.01 * fPlanes[iplane]->RawDataDraw()->TotalClockTicks();
963  }
964 
965  SetZoom(iplane, minw, maxw, mint, maxt, false);
966  zo.wmin[iplane] = minw;
967  zo.tmin[iplane] = mint;
968  zo.wmax[iplane] = maxw;
969  zo.tmax[iplane] = maxt;
970  zo.OnlyPlaneChanged = -1;
971  }
972  fZoomOpt = zo;
973  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
int fDrawRawDataOrCalibWires
0 for raw
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each 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)

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: