TWQMultiTPCProjection.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file TWQProjectionView.h
4 /// \brief A view showing the time vs wire, charge and charge vs time information for an event
5 /// \author brebel@fnal.gov
6 // clustering code written by ellen.klein@yale.edu
7 ////////////////////////////////////////////////////////////////////////
8 
9 #ifndef EVD_TWQMULTITPCPROJECTION_H
10 #define EVD_TWQMULTITPCPROJECTION_H
11 
12 #include "lardata/Utilities/PxUtils.h" // util::PxPoint, util::PxLine
13 #include "nuevdb/EventDisplayBase/Canvas.h"
14 namespace detinfo {
15  class DetectorClocksData;
16  class DetectorPropertiesData;
17 }
18 
19 #include "RQ_OBJECT.h"
20 
21 #include <deque>
22 #include <map>
23 #include <vector>
24 
25 // Forward declarations
26 class TGCheckButton;
27 class TGCompositeFrame;
28 class TGLabel;
29 class TGMainFrame;
30 class TGNumberEntry;
31 class TGRadioButton;
32 class TGTextButton;
33 class TGTextView;
34 
35 namespace evd {
36 
37  class HeaderPad;
38  class MCBriefPad;
39  class TQPad;
40  class TWireProjPad;
41 
42  // Helper class, to store zoom settings in each view
43 
45 
46  public:
47  ZoomOptionsMultiTPC() { OnlyPlaneChanged = -1; }
49  std::map<int, double> wmin;
50  std::map<int, double> wmax;
51  std::map<int, double> tmin;
52  std::map<int, double> tmax;
54  };
55 
56  class TWQMultiTPCProjectionView : public evdb::Canvas {
57 
58  public:
59  RQ_OBJECT("evd::TWQMultiTPCProjectionView")
60 
61  public:
62  TWQMultiTPCProjectionView(TGMainFrame* mf);
64 
65  const char*
66  Description() const
67  {
68  return "Time/Wire/Charge Projections";
69  }
70  const char*
71  PrintTag() const
72  {
73  return "twq-multiTPC-proj";
74  }
75 
76  void Draw(const char* opt = "");
77 
78  // void RangeChanged();
79  static void MouseDispatch(int plane, void* wqpv);
80 
81  void ChangeWire(int plane);
82 
83  void SetMouseZoomRegion(int plane);
84 
85  void SelectPoint(int plane);
86  // TWQMultiTPCProjectionView::SelectHit() is undefined
87  //void SelectHit(int plane);
88  void SetPlaneWire();
89  void SetPlane();
90  void SetWire();
91  void SetDistance();
92  void SetThreshold();
93  void SetGreyscale();
94  void SetMCInfo();
95  void SetRawCalib();
96  void SetUpSideBar();
97  void SetUpZoomButtons();
98  void SetUpPositionFind();
99  void SetZoom(int plane, int wirelow, int wirehi, int timelo, int timehi, bool StoreZoom = true);
100  void ZoomInterest(bool flag = true);
101 
102  void ZoomBack(); // Revert to the previous zoom setting
103 
104  void SetZoomInterest();
105  void PrintCharge();
106  void DrawPads(const char* opt = "");
107 
108  void FindEndPoint();
109  double FindLineLength(detinfo::DetectorClocksData const& clockData,
110  detinfo::DetectorPropertiesData const& detProp);
111  void ClearEndPoints();
112  void ToggleEndPointMarkers();
113 
114  void RadioButtonsDispatch(int parameter);
115 
116  private:
117  HeaderPad* fHeaderPad; ///< Show header information
118  TQPad* fWireQ; ///< Histogram of charge vs time on selected wire
119  MCBriefPad* fMC; ///< Short summary of MC event
120  std::vector<TQPad*> fPlaneQ; ///< charge on each plane
121  std::vector<TWireProjPad*> fPlanes; ///< time vs wire projection for each plane
122 
123  TGCompositeFrame* fVFrame; ///< needed for the side frame
124  TGCompositeFrame* fMetaFrame; ///< needed for the side frame
125 
126  TGLabel* fWireLabel;
127  TGLabel* fDistanceLabel;
128  TGLabel* fPlaneLabel;
129  TGLabel* fThresLabel;
130  TGLabel* fGreyLabel;
131 
132  TGNumberEntry* fWireEntry; ///< Wire number displayed.
133  TGNumberEntry* fPlaneEntry; ///< Plane number displayed.
134  TGNumberEntry* fThresEntry; ///< ADC threshold to display.
135  TGNumberEntry* fDistance; ///< Distance from line to find hits in cluster
136  TGCheckButton* fGreyScale; ///< Display gray or color scale
137  TGCheckButton* fMCOn; ///< Display MC truth information
138  TGRadioButton* fRawDraw; ///< Draw Raw information only
139  TGRadioButton* fCalibDraw; ///< Draw calibrated information only
140  TGRadioButton* fRawCalibDraw; ///< Draw raw and calibrated information
141 
142  TGTextButton* fZoomInterest; ///< Zoom on iteresting region
143  TGTextButton* fUnZoomInterest; ///< Unzoom on iteresting region
144  TGTextButton* fZoomBack; ///< Unzoom on iteresting region
145  TGCheckButton* fToggleAutoZoom; ///< Toggle the autozoom setting
146  TGRadioButton* fToggleZoom; ///< Use zoom setting
147  TGTextView* fAngleInfo;
148 
149  TGTextButton* fFindEndpoint; ///< Calculate XYZ position of two points in wire planes
150  TGTextButton* fClearPPoints; ///< Clear current list of End Points
151  TGCheckButton* fToggleShowMarkers; ///< Toggle the ShowEndPointMarkersSetting
152  TGTextView* fXYZPosition; ///< Display the xyz position
153 
154  TGTextButton* fCalcAngle; ///< Calculate the 2D & 3D angles between lines
155  TGTextButton* fClear; ///< Clears the selected points in an event
156 
157  int DrawLine(int plane, util::PxLine& pline);
158 
159  std::deque<util::PxPoint>
160  ppoints; ///< list of points in each WireProjPad used for x,y,z finding
161  std::deque<util::PxLine>
162  pline; ///< list of lines in each WireProjPad used for calculating 2d and 3d angles
163 
165  std::vector<ZoomOptionsMultiTPC> fPrevZoomOpt;
166  };
167 
168 } // namespace
169 
170 #endif //EVD_TWQPROJECTION_H
TGRadioButton * fCalibDraw
Draw calibrated information only.
TQPad * fWireQ
Histogram of charge vs time on selected wire.
TGCompositeFrame * fVFrame
needed for the side frame
opt
Definition: train.py:196
TGNumberEntry * fThresEntry
ADC threshold to display.
std::map< int, double > tmin
TGTextButton * fUnZoomInterest
Unzoom on iteresting region.
TGRadioButton * fRawCalibDraw
Draw raw and calibrated information.
def DrawLine(c1, val=0)
Definition: HandyFuncs.py:257
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
static Argument * parameter
MCBriefPad * fMC
Short summary of MC event.
TGNumberEntry * fPlaneEntry
Plane number displayed.
HeaderPad * fHeaderPad
Show header information.
std::deque< util::PxPoint > ppoints
list of points in each WireProjPad used for x,y,z finding
TGTextButton * fFindEndpoint
Calculate XYZ position of two points in wire planes.
TGCheckButton * fMCOn
Display MC truth information.
TGTextButton * fZoomBack
Unzoom on iteresting region.
LArSoft includes.
Definition: InfoTransfer.h:33
TGCheckButton * fToggleAutoZoom
Toggle the autozoom setting.
TGTextButton * fClearPPoints
Clear current list of End Points.
TGTextView * fXYZPosition
Display the xyz position.
TGRadioButton * fRawDraw
Draw Raw information only.
TGTextButton * fClear
Clears the selected points in an event.
General LArSoft Utilities.
TGCompositeFrame * fMetaFrame
needed for the side frame
void Draw(const char *plot, const char *title)
Definition: gXSecComp.cxx:580
TGTextButton * fCalcAngle
Calculate the 2D & 3D angles between lines.
std::map< int, double > wmax
TGTextButton * fZoomInterest
Zoom on iteresting region.
Contains all timing reference information for the detector.
TGRadioButton * fToggleZoom
Use zoom setting.
std::vector< TQPad * > fPlaneQ
charge on each plane
TGCheckButton * fGreyScale
Display gray or color scale.
std::vector< ZoomOptionsMultiTPC > fPrevZoomOpt
std::deque< util::PxLine > pline
list of lines in each WireProjPad used for calculating 2d and 3d angles
std::map< int, double > wmin
TGNumberEntry * fWireEntry
Wire number displayed.
std::map< int, double > tmax
TGNumberEntry * fDistance
Distance from line to find hits in cluster.
TGCheckButton * fToggleShowMarkers
Toggle the ShowEndPointMarkersSetting.