LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 ()
 
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 54 of file TWQMultiTPCProjection.h.

Constructor & Destructor Documentation

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

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

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

Definition at line 288 of file TWQMultiTPCProjection.cxx.

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

289  {
290  if (fHeaderPad) { delete fHeaderPad; fHeaderPad = 0; }
291  if (fMC) { delete fMC; fMC = 0; }
292  if (fWireQ) { delete fWireQ; fWireQ = 0; }
293  if (fPlaneEntry){ delete fPlaneEntry; fPlaneEntry = 0; }
294  if (fWireEntry) { delete fWireEntry; fWireEntry = 0; }
295  if (fPlaneLabel){ delete fPlaneLabel; fPlaneLabel = 0; }
296  if (fWireLabel) { delete fWireLabel; fWireLabel = 0; }
297  for(unsigned int i = 0; i < fPlanes.size(); ++i){
298  if(fPlanes[i]){ delete fPlanes[i]; fPlanes[i] = 0; }
299  if(fPlaneQ[i]){ delete fPlaneQ[i]; fPlaneQ[i] = 0; }
300  }
301  fPlanes.clear();
302  fPlaneQ.clear();
303  }
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.

References s.

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  }
Float_t s
Definition: plot.C:23
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
void evd::TWQMultiTPCProjectionView::ChangeWire ( int  plane)

Definition at line 467 of file TWQMultiTPCProjection.cxx.

References SetPlaneWire(), x, and xx.

Referenced by MouseDispatch().

468  {
469  //initial check for a mouse click on a TBox object
470  int event = gPad->GetEvent();
471  int px = gPad->GetEventX();
472  if(event!=11) return;
473  TObject *select = gPad->GetSelected();
474  if(!select) return;
475  if(!select->InheritsFrom("TBox")) return;
476 
477  //now find wire that was clicked on
478  float xx = gPad->AbsPixeltoX(px);
479  float x = gPad->PadtoX(xx);
480 
481 
482  kPlane = plane;
483  kWire = (unsigned int)TMath::Nint(x);
484 
485  this->SetPlaneWire();
486 
487  return;
488 
489  }
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 555 of file TWQMultiTPCProjection.cxx.

References fPlanes, ppoints, and x.

556  {
557  for (size_t x = 0; x < fPlanes.size(); ++x){
558  fPlanes[x]->Pad()->cd();
559  fPlanes[x]->View()->Clear();
560  fPlanes[x]->View()->AddMarker(0.0,0.0,2,1,0.1);
561  fPlanes[x]->Pad()->Update();
562  fPlanes[x]->View()->Draw();
563  }
564  ppoints.clear();
565  gPad->Modified();
566  gPad->Update();
567  gPad->cd();
568 
569  }
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 64 of file TWQMultiTPCProjection.h.

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

Implements evdb::Canvas.

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

321  {
323 
324  fPrevZoomOpt.clear();
325 
326  evdb::Canvas::fCanvas->cd();
327  zoom_opt=0;
328  fHeaderPad->Draw();
329  fMC ->Draw();
330  fWireQ->Draw();
331 
333 
334  if(evdlayoutopt->fPrintTotalCharge) PrintCharge();
335 
336  //clear queue of selected points
337  ppoints.clear();
338  pline.clear();
339  // Reset current zooming plane - since it's not currently zooming.
341 
342  // double Charge=0, ConvCharge=0;
343  for(size_t i = 0; i < fPlanes.size(); ++i){
344  fPlanes[i]->Draw(opt);
345  fPlanes[i]->Pad()->Update();
346  fPlanes[i]->Pad()->GetFrame()->SetBit(TPad::kCannotMove,true);
347  fPlaneQ[i]->Draw();
348  std::vector<double> ZoomParams = fPlanes[i]->GetCurrentZoom();
349  fZoomOpt.wmin[i] = ZoomParams[0];
350  fZoomOpt.wmax[i] = ZoomParams[1];
351  fZoomOpt.tmin[i] = ZoomParams[2];
352  fZoomOpt.tmax[i] = ZoomParams[3];
353  }
354 
355  // Reset any text boxes which are enabled
356  if(fXYZPosition)
357  fXYZPosition->SetForegroundColor(kBlack);
358 
359  if(fAngleInfo)
360  fAngleInfo->SetForegroundColor(kBlack);
361 
362  evdb::Canvas::fCanvas->Update();
363  }
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:111
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
std::vector< TQPad * > fPlaneQ
charge on each plane
static int curr_zooming_plane
TGTextView * fXYZPosition
Display the xyz position.
void Draw(const char *opt="")
Definition: HeaderPad.cxx:42
std::map< int, double > wmax
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 306 of file TWQMultiTPCProjection.cxx.

References fPlaneQ, and fPlanes.

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

307  {
308  for(unsigned int i=0; i<fPlanes.size();++i){
309  fPlanes[i]->Draw();
310  fPlanes[i]->Pad()->Update();
311  fPlanes[i]->Pad()->GetFrame()->SetBit(TPad::kCannotMove,true);
312  }
313  for(unsigned int j=0;j<fPlaneQ.size();++j){
314  fPlaneQ[j]->Draw();
315  fPlaneQ[j]->Pad()->Update();
316  fPlaneQ[j]->Pad()->GetFrame()->SetBit(TPad::kCannotMove,true);
317  }
318  }
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 711 of file TWQMultiTPCProjection.cxx.

References geo::GeometryCore::ChannelsIntersect(), detinfo::DetectorProperties::DriftVelocity(), detinfo::DetectorProperties::Efield(), fPlanes, evd::EvdLayoutOptions::fShowEndPointMarkers, fXYZPosition, geo::PlaneGeo::LocalToWorld(), geo::GeometryCore::NearestWire(), geo::origin(), geo::GeometryCore::Plane(), geo::GeometryCore::PlaneWireToChannel(), ppoints, detinfo::DetectorProperties::SamplingRate(), detinfo::DetectorProperties::Temperature(), detinfo::DetectorProperties::TriggerOffset(), w, xx, y, and z.

712  {
713  // if list is larger than or equal to two, can project to XYZ and extrapolate to third plane (if exists)
714 
715  if(ppoints.size()>=2 ){
716 
717  double xyz_vertex_fit[3] = {0.};
718  double second_time = 0.;
719  double pos[3] = {0.};
720  const double origin[3] = {0.,0.,0.};
721  double y = 0.;
722  double z = 0.;
723 
725  const detinfo::DetectorProperties* detp = lar::providerFrom<detinfo::DetectorPropertiesService>();
727  double ftimetick = detp->SamplingRate()/1000.;
728  double larv = detp->DriftVelocity(detp->Efield(), detp->Temperature());
729 
730  //find channels corresponding to found wires.
731  int chan1 = geom->PlaneWireToChannel(ppoints[0].plane,ppoints[0].w, rawOpt->fTPC, rawOpt->fCryostat);
732  int chan2 = geom->PlaneWireToChannel(ppoints[1].plane,ppoints[1].w, rawOpt->fTPC, rawOpt->fCryostat);
733 
734  bool wires_cross=false;
735  bool time_good=false;
736 
737  if(fabs(ppoints[0].t-ppoints[1].t) < 200){
738  wires_cross= geom->ChannelsIntersect(chan1,chan2,y,z);
739  time_good=true;
740  }
741  else{
742  TGText *tt=new TGText("too big");
743  tt->InsLine(1,"time distance");
744  fXYZPosition->SetText(tt);
745  fXYZPosition->Update();
746  // return; //not returning, because may need to delete marker from wplane
747  }
748 
749  if(wires_cross){
750  xyz_vertex_fit[1]=y;
751  xyz_vertex_fit[2]=z;
752  geom->Plane(ppoints[0].plane).LocalToWorld(origin, pos);
753  xyz_vertex_fit[0]=(ppoints[0].t-detp->TriggerOffset())*larv*ftimetick+pos[0];
754  geom->Plane(ppoints[1].plane).LocalToWorld(origin, pos);
755  second_time=(ppoints[1].t-detp->TriggerOffset())*larv*ftimetick+pos[0];
756 
757  TGText *tt=new TGText(Form("z:%4.1f",z));
758  tt->InsLine(1,Form("x:%4.1f,",(xyz_vertex_fit[0]+second_time)/2));
759  tt->InsLine(1,Form("y:%4.1f,",y));
760  fXYZPosition->SetText(tt);
761  fXYZPosition->Update();
763 
764  }
765  else{
766  if(time_good){ //otherwise the wires_cross are false by default
767  TGText *tt=new TGText("cross");
768  tt->InsLine(1,"wires do not");
769  fXYZPosition->SetText(tt);
770  fXYZPosition->Update();
771  }
772  // return; //not returning, because may need to delete marker from wplanereturn;
773  }
774  // extrapolate third point only if there are enough planes
775  if(fPlanes.size() > 2){
776 
777  unsigned int wplane = 0;
778  unsigned int wirevertex = 0;
780 
781  for(size_t xx = 0; xx < fPlanes.size(); ++xx){
782  wplane = 0;
783  for(int yy = 0; yy < 2; ++yy)
784  if(ppoints[yy].plane == xx)
785  ++wplane;
786 
787  if(!wplane){
788  wplane = xx;
789  break;
790  }
791  }
792 
793 
794  geom->Plane(wplane).LocalToWorld(origin, pos);
795  pos[1]=xyz_vertex_fit[1];
796  pos[2]=xyz_vertex_fit[2];
797 
798  wirevertex = geom->NearestWire(pos, wplane, rawOpt->fTPC, rawOpt->fCryostat);
799 
800  double drifttick=((xyz_vertex_fit[0])/detp->DriftVelocity(detp->Efield(),detp->Temperature()))*(1./ftimetick);
801  double timestart=drifttick-(pos[0]/detp->DriftVelocity(detp->Efield(),detp->Temperature()))*(1./ftimetick)+detp->TriggerOffset();
802 
803  fPlanes[wplane]->Pad()->cd();
804  fPlanes[wplane]->View()->Clear();
805  if(wires_cross && evdlayoutopt->fShowEndPointMarkers) //only Draw if it makes sense
806  fPlanes[wplane]->View()->AddMarker(wirevertex, timestart, kMagenta, 29, 2.0);
807  else //draw dummy marker to delete old one
808  fPlanes[wplane]->View()->AddMarker(0.0,0.0,2,1,0.1);
809  fPlanes[wplane]->Pad()->Update();
810  fPlanes[wplane]->View()->Draw();
811  }// end if(fPlanes.size()>2)
812  //update pad?
813  gPad->Modified();
814  gPad->Update();
815  gPad->cd();
816  } // end if( this->ppoints.size()>=2)
817  else{
818  TGText *tt=new TGText("selected points");
819  tt->InsLine(1,"not enough");
820  fXYZPosition->SetText(tt);
821  fXYZPosition->Update();
822  }
823 
824  return;
825  }
Double_t xx
Definition: macro.C:12
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
virtual int TriggerOffset() const =0
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
bool ChannelsIntersect(raw::ChannelID_t c1, raw::ChannelID_t c2, double &y, double &z) const
Returns an intersection point of two channels.
virtual double SamplingRate() const =0
Returns the period of the TPC readout electronics clock.
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:56
virtual double Temperature() const =0
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
int fShowEndPointMarkers
Draw EndPoint Markers if clicked.
TGTextView * fXYZPosition
Display the xyz position.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
virtual double Efield(unsigned int planegap=0) const =0
Returns the nominal electric field in the specified volume.
Float_t w
Definition: plot.C:23
void LocalToWorld(const double *plane, double *world) const
Transform point from local plane frame to world frame.
Definition: PlaneGeo.h:1124
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:230
double evd::TWQMultiTPCProjectionView::FindLineLength ( )

Definition at line 573 of file TWQMultiTPCProjection.cxx.

References geo::GeometryCore::ChannelsIntersect(), detinfo::DetectorProperties::DriftVelocity(), detinfo::DetectorProperties::Efield(), fXYZPosition, geo::PlaneGeo::LocalToWorld(), geo::origin(), geo::GeometryCore::Plane(), geo::GeometryCore::PlaneWireToChannel(), pline, detinfo::DetectorProperties::SamplingRate(), t1, detinfo::DetectorProperties::Temperature(), detinfo::DetectorProperties::TriggerOffset(), y, and z.

574  {
575  // if list is larger than or equal to two, can project to XYZ and extrapolate to third plane (if exists)
576 
578  // for(unsigned int ix=0;ix<ppoints.size();ix++)
579  // std::cout << "ppoints, planes,x,y :" << ix << " " << ppoints[ix].plane << " " << ppoints[ix].x << " " << ppoints[ix].y << std::endl;
580 
581  if(pline.size() >= 2){
582 
583  double xyz_vertex_fit[3];
584  double second_time;
585  double pos[3];
586  const double origin[3] = {0.,0.,0.};
587  double xx0 = 0., yy0 = 0., zz0 = 0.;
588  double xx1 = 0., yy1 = 0., zz1 = 0.;
589  double length;
590 
591  double y,z;
592 
594  const detinfo::DetectorProperties* detp = lar::providerFrom<detinfo::DetectorPropertiesService>();
596  double ftimetick = detp->SamplingRate()/1000.;
597  double larv = detp->DriftVelocity(detp->Efield(), detp->Temperature());
598 
599  //find channels corresponding to found wires.
600  int chan1 = geom->PlaneWireToChannel(pline[0].plane,pline[0].w0, rawOpt->fTPC, rawOpt->fCryostat);
601  int chan2 = geom->PlaneWireToChannel(pline[1].plane,pline[1].w0, rawOpt->fTPC, rawOpt->fCryostat);
602 
603  bool wires_cross=false;
604  bool time_good=false;
605 
606  if(fabs(pline[0].t0-pline[1].t0) < 200){
607  wires_cross= geom->ChannelsIntersect(chan1,chan2,y,z);
608  time_good=true;
609  }
610  else{
611  TGText *tt=new TGText("too big");
612  tt->InsLine(1,"time distance");
613  fXYZPosition->SetText(tt);
614  fXYZPosition->Update();
615  // return; //not returning, because may need to delete marker from wplane
616  }
617 
618  if(wires_cross){
619  TGText *tt=new TGText("wires cross");
620  fXYZPosition->SetText(tt);
621  fXYZPosition->Update();
622  xyz_vertex_fit[1]=y;
623  xyz_vertex_fit[2]=z;
624  geom->Plane(pline[0].plane).LocalToWorld(origin, pos);
625  xyz_vertex_fit[0]=(pline[0].t0-detp->TriggerOffset())*larv*ftimetick+pos[0];
626  geom->Plane(pline[1].plane).LocalToWorld(origin, pos);
627  second_time=(pline[1].t0-detp->TriggerOffset())*larv*ftimetick+pos[0];
628 
629  xx0=(xyz_vertex_fit[0]+second_time)/2;
630  yy0=y;
631  zz0=z;
632 
634  }
635  else{
636  if(time_good){ //otherwise the wires_cross are false by default
637  TGText *tt=new TGText("cross");
638  tt->InsLine(1,"wires do not");
639  fXYZPosition->SetText(tt);
640  fXYZPosition->Update();
641  }
642  // return; //not returning, because may need to delete marker from wplanereturn;
643  }
644  //find channels corresponding to found wires AT END OF LINE.
645  chan1 = geom->PlaneWireToChannel(pline[0].plane,pline[0].w1, rawOpt->fTPC, rawOpt->fCryostat);
646  chan2 = geom->PlaneWireToChannel(pline[1].plane,pline[1].w1, rawOpt->fTPC, rawOpt->fCryostat);
647 
648  wires_cross=false;
649  time_good=false;
650 
651  if(fabs(pline[0].t1-pline[1].t1) < 200){
652  wires_cross= geom->ChannelsIntersect(chan1,chan2,y,z);
653  time_good=true;
654  }
655  else{
656  TGText *tt=new TGText("too big");
657  tt->InsLine(1,"time distance");
658  fXYZPosition->SetText(tt);
659  fXYZPosition->Update();
660  // return; //not returning, because may need to delete marker from wplane
661  }
662 
663  if(wires_cross){
664  TGText *tt=new TGText("wires do cross");
665  fXYZPosition->SetText(tt);
666  fXYZPosition->Update();
667  xyz_vertex_fit[1]=y;
668  xyz_vertex_fit[2]=z;
669  geom->Plane(pline[0].plane).LocalToWorld(origin, pos);
670  xyz_vertex_fit[0]=(pline[0].t1-detp->TriggerOffset())*larv*ftimetick+pos[0];
671  geom->Plane(pline[1].plane).LocalToWorld(origin, pos);
672  second_time=(pline[1].t1-detp->TriggerOffset())*larv*ftimetick+pos[0];
673 
674  xx1=(xyz_vertex_fit[0]+second_time)/2;
675  yy1=y;
676  zz1=z;
677 
678  }
679  else{
680  if(time_good){ //otherwise the wires_cross are false by default
681  TGText *tt=new TGText("cross");
682  tt->InsLine(1,"wires do not");
683  fXYZPosition->SetText(tt);
684  fXYZPosition->Update();
685  }
686  // return; //not returning, because may need to delete marker from wplanereturn;
687  }
688  //update pad?
689  gPad->Modified();
690  gPad->Update();
691  gPad->cd();
692 
693  length=pow(xx0-xx1,2)+pow(yy0-yy1,2)+pow(zz0-zz1,2);
694  length=pow(length,0.5);
695  return length;
696  } // end if( this->ppoints.size()>=2)
697 
698  else{
699  TGText *tt=new TGText("selected points");
700  tt->InsLine(1,"not enough");
701  fXYZPosition->SetText(tt);
702  fXYZPosition->Update();
703  }
704 
705 
706 
707  return -99;
708  }
code to link reconstructed objects back to the MC truth information
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
TTree * t1
Definition: plottest35.C:26
virtual int TriggerOffset() const =0
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
bool ChannelsIntersect(raw::ChannelID_t c1, raw::ChannelID_t c2, double &y, double &z) const
Returns an intersection point of two channels.
virtual double SamplingRate() const =0
Returns the period of the TPC readout electronics clock.
Definition: type_traits.h:56
virtual double Temperature() const =0
TGTextView * fXYZPosition
Display the xyz position.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
std::deque< util::PxLine > pline
list of lines in each WireProjPad used for calculating 2d and 3d angles
virtual double Efield(unsigned int planegap=0) const =0
Returns the nominal electric field in the specified volume.
void LocalToWorld(const double *plane, double *world) const
Transform point from local plane frame to world frame.
Definition: PlaneGeo.h:1124
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:230
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 438 of file TWQMultiTPCProjection.cxx.

References ChangeWire(), SelectPoint(), and SetMouseZoomRegion().

439  {
440  //initial check for a mouse click on a TBox object
441  int event = gPad->GetEvent();
444 
445  switch (event){
446 
447  case kButton1Shift:
448  shift_lock=1;
449  // TWQMultiTPCProjectionView::SelectHit() is undefined
450  //if(evdlayoutopt->fMakeClusters==1){wqpp->SelectHit(plane);}
451  //else {wqpp->SelectPoint(plane);}
452  wqpp->SelectPoint(plane);
453  break;
454  case kButton1Up:
455  if(shift_lock==1) break;
456  if(evdlayoutopt-> fChangeWire==1) wqpp->ChangeWire(plane);
457  case kButton1Down: shift_lock=0;
458  case kButton1Motion:
459  wqpp->SetMouseZoomRegion(plane);
460  break;
461  // default:
462  }
463  }
static int shift_lock
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 409 of file TWQMultiTPCProjection.cxx.

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

Referenced by Draw().

410  {
411 
414 
415  geo::TPCID tpcid = rawopt->CurrentTPC();
416 
417  for(size_t iplane = 0; iplane < fPlanes.size(); ++iplane){
418  if(geo->SignalType(geo::PlaneID(tpcid, iplane))==geo::kCollection){
419  double ch=0,convch=0;
420  if(rawopt->fDrawRawDataOrCalibWires == 0){
421  fPlanes[iplane]->RawDataDraw()->GetChargeSum(iplane,ch,convch);
422  mf::LogVerbatim("TWQMultiTPCProjectionView") << "Warning! Calculating for RawData! ";
423  }
424  else{
425  fPlanes[iplane]->RecoBaseDraw()->GetChargeSum(iplane,ch,convch);
426  }
427 
428  mf::LogVerbatim("TWQMultiTPCProjectionView") << "\ncharge collected at collection plane: "
429  << iplane << " " << ch << " " << convch;
430  }
431  }
432 
433 
434  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
int fDrawRawDataOrCalibWires
0 for raw
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
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:195
Namespace collecting geometry-related classes utilities.
Signal from collection planes.
Definition: geo_types.h:93
const char* evd::TWQMultiTPCProjectionView::PrintTag ( ) const
inlinevirtual

Reimplemented from evdb::Canvas.

Definition at line 65 of file TWQMultiTPCProjection.h.

References Draw().

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

Definition at line 1050 of file TWQMultiTPCProjection.cxx.

References fToggleZoom.

1051  {
1053  if(parameter==1 || parameter == 2){
1054  fToggleZoom->SetState(kButtonUp);
1055  }
1056 
1057  }
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 492 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().

493  {
494  //initial check for a mouse click on a TBox object
495  int event = gPad->GetEvent();
496 
497  if(event!=7) return;
498 
500  if(evdlayoutopt->fShowEndPointSection!=1)
501  return;
502  //struct planepoint;
503  int px = gPad->GetEventX();
504  double w0 = gPad->AbsPixeltoX(px);
505  double x = gPad->PadtoX(w0);
506 
507  int py = gPad->GetEventY();
508  double t0 = gPad->AbsPixeltoY(py);
509  double y = gPad->PadtoY(t0);
510 
511  util::PxPoint ppx(plane,x,y);
513 
514  // check if not clicking on a plane that is already in the ppoints list:
515  int repeat_plane=-1;
516  for(size_t ii = 0; ii < this->ppoints.size(); ++ii)
517  if(ppx.plane==this->ppoints[ii].plane){
518  this->ppoints[ii]=ppx;
519  //clear View and draw new Marker
520  this->fPlanes[this->ppoints[ii].plane]->View()->Clear();
521  if(evdlayoutopt->fShowEndPointMarkers)
522  this->fPlanes[this->ppoints[ii].plane]->View()->AddMarker(ppx.w, ppx.t, kRed, 29, 2.0);
523  else
524  this->fPlanes[plane]->View()->AddMarker(0.0,0.0,2,1,0.1);
525  this->fPlanes[this->ppoints[ii].plane]->View()->Draw();
526  repeat_plane=this->ppoints[ii].plane;
527  break;
528  }
529 
530  //if plane does not repeat and size of list is larger than 2 pop_front
531  // and delete its marker. Otherwise just push_back.
532  if(repeat_plane==-1){
533  if( this->ppoints.size()>=2){
534  this->fPlanes[this->ppoints[0].plane]->Pad()->cd();
535  this->fPlanes[this->ppoints[0].plane]->View()->Clear();
536  this->fPlanes[this->ppoints[0].plane]->View()->Draw();
537  this->ppoints.pop_front();
538  }
539  this->ppoints.push_back(ppx);
540  this->fPlanes[plane]->Pad()->cd();
541  this->fPlanes[plane]->View()->Clear();
542  if(evdlayoutopt->fShowEndPointMarkers)
543  this->fPlanes[plane]->View()->AddMarker(ppx.w, ppx.t, kRed, 29, 2.0);
544  else
545  this->fPlanes[plane]->View()->AddMarker(0.0,0.0,2,1,0.1);
546  this->fPlanes[plane]->View()->Draw();
547  }
548 
549 
550  return;
551 
552  }
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 1221 of file TWQMultiTPCProjection.cxx.

References fDistance.

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

Definition at line 1246 of file TWQMultiTPCProjection.cxx.

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

1247  {
1249 
1250  TGButton *b = (TGButton *)gTQSender;
1251  if(b->GetState() == kButtonDown){
1252  cst->fColorOrGray = 1;
1253  }
1254  else{
1255  cst->fColorOrGray = 0;
1256  }
1257 
1258  TVirtualPad *ori = gPad;
1259  this->DrawPads(zoom_opt);
1260  evdb::Canvas::fCanvas->cd();
1261  evdb::Canvas::fCanvas->Modified();
1262  evdb::Canvas::fCanvas->Update();
1263 
1264  ori->cd();
1265 
1266  return;
1267  }
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 1315 of file TWQMultiTPCProjection.cxx.

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

1316  {
1318 
1319  TGButton *b = (TGButton *)gTQSender;
1320  if(b->GetState() == kButtonDown){
1321  sdo->fShowMCTruthText = 1;
1322  sdo->fShowMCTruthVectors = 1;
1323  }
1324  else{
1325  sdo->fShowMCTruthText = 0;
1326  sdo->fShowMCTruthVectors = 0;
1327  }
1328 
1329  TVirtualPad *ori = gPad;
1330 
1331  fMC->Draw();
1332  evdb::Canvas::fCanvas->cd();
1333  evdb::Canvas::fCanvas->Modified();
1334  evdb::Canvas::fCanvas->Update();
1335 
1336  ori->cd();
1337  }
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 828 of file TWQMultiTPCProjection.cxx.

References SetZoom(), t1, and x.

Referenced by MouseDispatch().

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

References fPlaneEntry, and SetPlaneWire().

1206  {
1207  kPlane = (unsigned int)fPlaneEntry->GetNumberEntry()->GetNumber();
1208 
1209  this->SetPlaneWire();
1210  }
static unsigned int kPlane
TGNumberEntry * fPlaneEntry
Plane number displayed.
void evd::TWQMultiTPCProjectionView::SetPlaneWire ( )

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

1182  {
1183  TVirtualPad *ori = gPad;
1184 
1186 
1187  fWireQ->Draw();
1188  fWireQ->Pad()->cd();
1189  fWireQ->Pad()->Modified();
1190  fWireQ->Pad()->Update();
1191  fWireQ->Pad()->SetBit(TPad::kCannotMove,true);
1192  fWireQ->Pad()->GetFrame()->SetBit(TPad::kCannotMove,true);
1193 
1194  fPlaneEntry->SetNumber(kPlane);
1195  fWireEntry->SetNumber(kWire);
1196 
1197  evdb::Canvas::fCanvas->cd();
1198  evdb::Canvas::fCanvas->Modified();
1199  evdb::Canvas::fCanvas->Update();
1200 
1201  ori->cd();
1202  }
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:111
TGNumberEntry * fPlaneEntry
Plane number displayed.
TPad * Pad()
Definition: DrawingPad.h:37
TGNumberEntry * fWireEntry
Wire number displayed.
void SetPlaneWire(unsigned int plane=0, unsigned int wire=0)
Definition: TQPad.h:24
void evd::TWQMultiTPCProjectionView::SetRawCalib ( )

Definition at line 1270 of file TWQMultiTPCProjection.cxx.

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

1271  {
1273 
1274  TGButton *b = (TGButton *)gTQSender;
1275  int id = b->WidgetId();
1276 
1277  // id values are set in lines 125 - 127
1278  if(id == 4){
1279  rawopt->fDrawRawDataOrCalibWires = 0;
1280  fRawDraw->SetState(kButtonDown);
1281  fCalibDraw->SetState(kButtonUp);
1282  fRawCalibDraw->SetState(kButtonUp);
1283  }
1284  else if(id == 3){
1285  rawopt->fDrawRawDataOrCalibWires = 1;
1286  fRawDraw->SetState(kButtonUp);
1287  fCalibDraw->SetState(kButtonDown);
1288  fRawCalibDraw->SetState(kButtonUp);
1289  }
1290  else if(id == 2){
1291  rawopt->fDrawRawDataOrCalibWires = 2;
1292  fRawDraw->SetState(kButtonUp);
1293  fCalibDraw->SetState(kButtonUp);
1294  fRawCalibDraw->SetState(kButtonDown);
1295  }
1296 
1297  TVirtualPad *ori = gPad;
1298 
1299  fWireQ->Draw();
1300  fWireQ->Pad()->cd();
1301  fWireQ->Pad()->Modified();
1302  fWireQ->Pad()->Update();
1303 
1304  this->DrawPads(zoom_opt);
1305  evdb::Canvas::fCanvas->cd();
1306  evdb::Canvas::fCanvas->Modified();
1307  evdb::Canvas::fCanvas->Update();
1308 
1309  ori->cd();
1310 
1311  return;
1312  }
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:111
TGRadioButton * fRawCalibDraw
Draw raw and calibrated information.
TGRadioButton * fRawDraw
Draw Raw information only.
TPad * Pad()
Definition: DrawingPad.h:37
static const char * zoom_opt
void evd::TWQMultiTPCProjectionView::SetThreshold ( )

Definition at line 1227 of file TWQMultiTPCProjection.cxx.

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

1228  {
1229  double threshold = fThresEntry->GetNumberEntry()->GetNumber();
1230 
1232  rawopt->fMinSignal = threshold;
1233 
1234  TVirtualPad *ori = gPad;
1235  this->DrawPads(zoom_opt);
1236  evdb::Canvas::fCanvas->cd();
1237  evdb::Canvas::fCanvas->Modified();
1238  evdb::Canvas::fCanvas->Update();
1239 
1240  ori->cd();
1241 
1242  return;
1243  }
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 1060 of file TWQMultiTPCProjection.cxx.

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

Referenced by SetUpSideBar().

1061  {
1062  // enter zoom buttons
1064  if(!evdlayoutopt->fShowEndPointSection)
1065  return;
1066 
1067  // int fShowEndPointMarkers; ///< Draw EndPoint Markers if clicked.
1068 
1069  fFindEndpoint=new TGTextButton(fVFrame,"&Find XYZ",150);
1070  fFindEndpoint->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "FindEndPoint()");
1071 
1072  fXYZPosition=new TGTextView(fVFrame,100,55,999,TGView::kNoHSB | TGView::kNoVSB);
1073  fXYZPosition->SetEditable("false");
1074  TGText *tt=new TGText("x,y,z");
1075  fXYZPosition->SetText(tt);
1076 
1077 
1078  fClearPPoints=new TGTextButton(fVFrame,"&Clear Points",150);
1079  fClearPPoints->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "ClearEndPoints()"); // ?
1080 
1081  fToggleShowMarkers=new TGCheckButton(fVFrame,"ShowMarkers",0);
1082  fToggleShowMarkers->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "ToggleEndPointMarkers()");
1083  if(evdlayoutopt->fShowEndPointMarkers == 1) fToggleShowMarkers->SetState(kButtonDown);
1084 
1085  fVFrame->AddFrame(fFindEndpoint, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1 ) );
1086  fVFrame->AddFrame(fXYZPosition, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1 ) );
1087  fVFrame->AddFrame(fClearPPoints, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1 ) );
1088  fVFrame->AddFrame(fToggleShowMarkers, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1 ) );
1089  }
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:56
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 1018 of file TWQMultiTPCProjection.cxx.

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

Referenced by SetUpSideBar().

1019  {
1020  // enter zoom buttons
1022 
1023  fZoomInterest=new TGTextButton(fVFrame,"&Zoom Interest",150);
1024  fZoomInterest->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "ZoomInterest()");
1025 
1026 
1027 
1028  fUnZoomInterest=new TGTextButton(fVFrame,"&UnZoom Interest",150);
1029  fUnZoomInterest->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "ZoomInterest(=false)");
1030 
1031 
1032  fZoomBack=new TGTextButton(fVFrame,"&Zoom Back",150);
1033  fZoomBack->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "ZoomBack()");
1034 
1035 
1036  fToggleAutoZoom=new TGCheckButton(fVFrame,"AutoZoom",0);;
1037  fToggleAutoZoom->Connect("Clicked()", "evd::TWQMultiTPCProjectionView", this, "SetZoomInterest()");
1038  if(evdlayoutopt->fAutoZoomInterest == 1) fToggleAutoZoom->SetState(kButtonDown);
1039 
1040  fVFrame->AddFrame(fZoomInterest, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1 ) );
1041  fVFrame->AddFrame(fUnZoomInterest, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1 ) );
1042 
1043  fVFrame->AddFrame(fZoomBack, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1 ) );
1044 
1045  fVFrame->AddFrame(fToggleAutoZoom, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 5, 1 ) );
1046  }
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 1213 of file TWQMultiTPCProjection.cxx.

References fWireEntry, and SetPlaneWire().

1214  {
1215  kWire = (unsigned int)fWireEntry->GetNumberEntry()->GetNumber();
1216 
1217  this->SetPlaneWire();
1218  }
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 1127 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().

1133  {
1134 
1135  if(StoreZoom){
1136  fPrevZoomOpt.push_back(fZoomOpt);
1137  fZoomOpt.OnlyPlaneChanged = plane;
1138  }
1139 
1140  fZoomOpt.wmin[plane] = wirelow;
1141  fZoomOpt.wmax[plane] = wirehi;
1142  fZoomOpt.tmin[plane] = timelow;
1143  fZoomOpt.tmax[plane] = timehi;
1144 
1145 
1146  TVirtualPad *ori = gPad;
1147  zoom_opt="1";
1148 
1149  // error checking - useful for the mouse zoom.
1150  if(wirehi<wirelow){
1151  int temp=wirelow;
1152  wirelow=wirehi;
1153  wirehi=temp;
1154  }
1155 
1156  if(timehi<timelow){
1157  int temp=timelow;
1158  timelow=timehi;
1159  timehi=temp;
1160  }
1161 
1162  //if drawing, then currently not zooming
1163  curr_zooming_plane=-1;
1164 
1165  fPlanes[plane]->SetZoomRange(wirelow, wirehi,timelow,timehi);
1166  fPlanes[plane]->Draw("1");
1167  fPlanes[plane]->UpdatePad();
1168 
1169  evdb::Canvas::fCanvas->cd();
1170  evdb::Canvas::fCanvas->Modified();
1171  evdb::Canvas::fCanvas->Update();
1172 
1173  // UpdateSeedCurve();
1174 
1175  ori->cd();
1176 
1177  return;
1178  }
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 1004 of file TWQMultiTPCProjection.cxx.

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

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

Definition at line 1011 of file TWQMultiTPCProjection.cxx.

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

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

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

1096  {
1097  if(fPrevZoomOpt.size()>0){
1098  ZoomOptionsMultiTPC ThePrevZoomOpt = fPrevZoomOpt.at(fPrevZoomOpt.size()-1);
1099  int plane = fZoomOpt.OnlyPlaneChanged;
1100  if(plane != -1){
1101  SetZoom(plane,
1102  ThePrevZoomOpt.wmin[plane],
1103  ThePrevZoomOpt.wmax[plane],
1104  ThePrevZoomOpt.tmin[plane],
1105  ThePrevZoomOpt.tmax[plane],
1106  false);
1107  }
1108  else{
1109  for( size_t iplane = 0; iplane != fPlanes.size(); ++iplane){
1110  SetZoom(iplane,
1111  ThePrevZoomOpt.wmin[iplane],
1112  ThePrevZoomOpt.wmax[iplane],
1113  ThePrevZoomOpt.tmin[iplane],
1114  ThePrevZoomOpt.tmax[iplane],
1115  false);
1116 
1117  }
1118  }
1119 
1120  fPrevZoomOpt.pop_back();
1121  }
1122  else
1123  mf::LogVerbatim("TWQMultiTPCProjectionView") <<"unable to unzoom further - no zoom settings left on stack"<<std::endl;
1124  }
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 951 of file TWQMultiTPCProjection.cxx.

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

952  {
953  mf::LogVerbatim("TWQMultiTPCProjectionView") <<"ZoomInterest called";
954 
955  if(flag==true) zoom_opt="1";
956  else zoom_opt="0";
957 
960 
961  ZoomOptionsMultiTPC zo;
962  // mf::LogVerbatim("TWQMultiTPCProjectionView") <<"Zoom interest pushing back zoom options"<<std::endl;
963  fPrevZoomOpt.push_back(fZoomOpt);
964 
965 
966  for(size_t iplane = 0; iplane < fPlanes.size(); ++iplane){
967  int minw,maxw,mint,maxt;
968  if(flag){
969  int test=0;
970  if(rawopt->fDrawRawDataOrCalibWires == 0)
971  fPlanes[iplane]->RawDataDraw()->GetRegionOfInterest(iplane,minw,maxw,mint,maxt);
972  else
973  fPlanes[iplane]->RecoBaseDraw()->GetRegionOfInterest(iplane,minw,maxw,mint,maxt);
974 
975  if(test==-1)
976  continue;
977  }
978  else{
979  minw = -0.005*(geo->Nwires(iplane)-1);
980  maxw = 1.005*(geo->Nwires(iplane)-1);
981  mint = -0.005*fPlanes[iplane]->RawDataDraw()->TotalClockTicks();
982  maxt = 1.01*fPlanes[iplane]->RawDataDraw()->TotalClockTicks();
983  }
984 
985  SetZoom(iplane,minw,maxw,mint,maxt,false);
986  zo.wmin[iplane]=minw;
987  zo.tmin[iplane]=mint;
988  zo.wmax[iplane]=maxw;
989  zo.tmax[iplane]=maxt;
990  zo.OnlyPlaneChanged=-1;
991  }
992  fZoomOpt=zo;
993 
994  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
int fDrawRawDataOrCalibWires
0 for raw
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
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 140 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 147 of file TWQMultiTPCProjection.h.

TGRadioButton* evd::TWQMultiTPCProjectionView::fCalibDraw
private

Draw calibrated information only.

Definition at line 132 of file TWQMultiTPCProjection.h.

Referenced by SetRawCalib(), and TWQMultiTPCProjectionView().

TGTextButton* evd::TWQMultiTPCProjectionView::fClear
private

Clears the selected points in an event.

Definition at line 148 of file TWQMultiTPCProjection.h.

TGTextButton* evd::TWQMultiTPCProjectionView::fClearPPoints
private

Clear current list of End Points.

Definition at line 143 of file TWQMultiTPCProjection.h.

Referenced by SetUpPositionFind().

TGNumberEntry* evd::TWQMultiTPCProjectionView::fDistance
private

Distance from line to find hits in cluster.

Definition at line 128 of file TWQMultiTPCProjection.h.

Referenced by SetDistance().

TGLabel* evd::TWQMultiTPCProjectionView::fDistanceLabel
private

Definition at line 120 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 142 of file TWQMultiTPCProjection.h.

Referenced by SetUpPositionFind().

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

Definition at line 123 of file TWQMultiTPCProjection.h.

TGCheckButton* evd::TWQMultiTPCProjectionView::fGreyScale
private

Display gray or color scale.

Definition at line 129 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 130 of file TWQMultiTPCProjection.h.

Referenced by TWQMultiTPCProjectionView().

TGCompositeFrame* evd::TWQMultiTPCProjectionView::fMetaFrame
private

needed for the side frame

Definition at line 117 of file TWQMultiTPCProjection.h.

Referenced by TWQMultiTPCProjectionView().

TGNumberEntry* evd::TWQMultiTPCProjectionView::fPlaneEntry
private

Plane number displayed.

Definition at line 126 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 156 of file TWQMultiTPCProjection.h.

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

TGRadioButton* evd::TWQMultiTPCProjectionView::fRawCalibDraw
private

Draw raw and calibrated information.

Definition at line 133 of file TWQMultiTPCProjection.h.

Referenced by SetRawCalib(), and TWQMultiTPCProjectionView().

TGRadioButton* evd::TWQMultiTPCProjectionView::fRawDraw
private

Draw Raw information only.

Definition at line 131 of file TWQMultiTPCProjection.h.

Referenced by SetRawCalib(), and TWQMultiTPCProjectionView().

TGNumberEntry* evd::TWQMultiTPCProjectionView::fThresEntry
private

ADC threshold to display.

Definition at line 127 of file TWQMultiTPCProjection.h.

Referenced by SetThreshold(), and TWQMultiTPCProjectionView().

TGLabel* evd::TWQMultiTPCProjectionView::fThresLabel
private

Definition at line 122 of file TWQMultiTPCProjection.h.

Referenced by TWQMultiTPCProjectionView().

TGCheckButton* evd::TWQMultiTPCProjectionView::fToggleAutoZoom
private

Toggle the autozoom setting.

Definition at line 138 of file TWQMultiTPCProjection.h.

Referenced by SetUpZoomButtons(), and SetZoomInterest().

TGCheckButton* evd::TWQMultiTPCProjectionView::fToggleShowMarkers
private

Toggle the ShowEndPointMarkersSetting.

Definition at line 144 of file TWQMultiTPCProjection.h.

Referenced by SetUpPositionFind(), and ToggleEndPointMarkers().

TGRadioButton* evd::TWQMultiTPCProjectionView::fToggleZoom
private

Use zoom setting.

Definition at line 139 of file TWQMultiTPCProjection.h.

Referenced by RadioButtonsDispatch().

TGTextButton* evd::TWQMultiTPCProjectionView::fUnZoomInterest
private

Unzoom on iteresting region.

Definition at line 136 of file TWQMultiTPCProjection.h.

Referenced by SetUpZoomButtons().

TGCompositeFrame* evd::TWQMultiTPCProjectionView::fVFrame
private

needed for the side frame

Definition at line 116 of file TWQMultiTPCProjection.h.

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

TGNumberEntry* evd::TWQMultiTPCProjectionView::fWireEntry
private

Wire number displayed.

Definition at line 125 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 145 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 137 of file TWQMultiTPCProjection.h.

Referenced by SetUpZoomButtons().

TGTextButton* evd::TWQMultiTPCProjectionView::fZoomInterest
private

Zoom on iteresting region.

Definition at line 135 of file TWQMultiTPCProjection.h.

Referenced by SetUpZoomButtons().

ZoomOptionsMultiTPC evd::TWQMultiTPCProjectionView::fZoomOpt
private

Definition at line 155 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 153 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: