LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TWQProjectionView.h
Go to the documentation of this file.
1 // clustering code written by ellen.klein@yale.edu
8 
9 #ifndef EVD_TWQPROJECTION_H
10 #define EVD_TWQPROJECTION_H
11 
12 #include "RQ_OBJECT.h"
15 namespace detinfo {
16  class DetectorClocksData;
17  class DetectorPropertiesData;
18 }
19 
20 #include <deque>
21 #include <map>
22 #include <vector>
23 
24 // Forward declarations
25 class TGCheckButton;
26 class TGCompositeFrame;
27 class TGLabel;
28 class TGMainFrame;
29 class TGNumberEntry;
30 class TGRadioButton;
31 class TGTextButton;
32 class TGTextView;
33 
34 namespace util {
35  class DataProductChangeTracker_t;
36 }
37 
38 namespace evd {
39 
40  class HeaderPad;
41  class MCBriefPad;
42  class TQPad;
43  class TWireProjPad;
44 
45  // Helper class, to store zoom settings in each view
46 
47  struct ZoomOptions {
48  std::map<int, double> wmin;
49  std::map<int, double> wmax;
50  std::map<int, double> tmin;
51  std::map<int, double> tmax;
52  int OnlyPlaneChanged{-1};
53  };
54 
56  public:
57  RQ_OBJECT("evd::TWQProjectionView")
58 
59  public:
60  TWQProjectionView(TGMainFrame* mf);
62 
63  const char* Description() const { return "Time/Wire/Charge Projections"; }
64  const char* PrintTag() const { return "twq-proj"; }
65 
66  void Draw(const char* opt = "");
67 
68  // void RangeChanged();
69  static void MouseDispatch(int plane, void* wqpv);
70 
71  void ChangeWire(int plane);
72  void SelectTPC();
73 
74  void SetMouseZoomRegion(int plane);
75 
76  void SelectPoint(int plane);
77  void SelectHit(int plane);
78  void SetPlaneWire();
79  void SetPlane();
80  void SetWire();
81  void SetDistance();
82  void SetThreshold();
83  void SetGreyscale();
84  void SetMCInfo();
85  void SetRawCalib();
86  void SetUpSideBar();
87  void ForceRedraw();
88  void SetUpZoomButtons();
89  void SetUpClusterButtons();
90  void SetUpDrawingButtons();
91  void SetUpTPCselection();
92  void SetUpPositionFind();
93  void SetZoom(int plane, int wirelow, int wirehi, int timelo, int timehi, bool StoreZoom = true);
94  void ZoomInterest(bool flag = true);
96  void ResetRegionsOfInterest();
97 
98  void ZoomBack(); // Revert to the previous zoom setting
99  void SetClusterInterest();
100 
101  void SetClusters(int plane);
102 
103  void SetZoomInterest();
104  void SetZoomFromView();
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  void SaveSelection();
116  void ClearSelection();
117 
119  bool OnNewEvent();
120 
121  void SetTestFlag(int number = 1);
122 
123  protected:
124  TGCompositeFrame* fVFrame;
125 
126  private:
130  std::vector<TQPad*> fPlaneQ;
131  std::vector<TWireProjPad*> fPlanes;
132 
133  double fLastThreshold;
134 
135  TGCompositeFrame* fMetaFrame;
136 
137  TGLabel* fWireLabel;
138  TGLabel* fDistanceLabel;
139  TGLabel* fPlaneLabel;
140  TGLabel* fThresLabel;
141 
142  TGNumberEntry* fWireEntry;
143  TGNumberEntry* fPlaneEntry;
144  TGNumberEntry* fThresEntry;
145  TGNumberEntry* fDistance;
146  TGCheckButton* fGreyScale;
147  TGCheckButton* fMCOn;
148  TGRadioButton* fRawDraw;
149  TGRadioButton* fCalibDraw;
150  TGRadioButton* fRawCalibDraw;
151 
152  TGTextButton* fZoomInterest;
153  TGTextButton* fUnZoomInterest;
154  TGTextButton* fZoomBack;
155  TGCheckButton* fToggleAutoZoom;
156  TGRadioButton* fToggleZoom;
157  TGRadioButton* fToggleClusters;
158  TGTextView* fAngleInfo;
159 
160  TGTextButton* fFindEndpoint;
161  TGTextButton* fClearPPoints;
162  TGCheckButton* fToggleShowMarkers;
163  TGTextView* fXYZPosition;
164 
165  TGTextButton* fCalcAngle;
166  TGTextButton* fClear;
167 
168  TGTextButton* fRedraw;
169 
170  TGNumberEntry* fCryoInput;
171  TGNumberEntry* fTPCInput;
172  TGLabel* fTotalTPCLabel;
173 
174  int DrawLine(int plane, util::PxLine& pline);
175 
176  std::deque<util::PxPoint>
178  std::deque<util::PxLine>
180 
181  std::vector<util::PxLine>
183 
185  std::vector<ZoomOptions> fPrevZoomOpt;
186 
188 
190 
192  void SetAutomaticZoomMode(bool bSet = true);
193 
195  static std::string TotalElementsString(unsigned int NElements);
196  };
197 
198 } // namespace
199 
200 #endif //EVD_TWQPROJECTION_H
std::vector< ZoomOptions > fPrevZoomOpt
TGNumberEntry * fCryoInput
current cryostat
TGRadioButton * fToggleClusters
Use make cluster setting.
HeaderPad * fHeaderPad
Show header information.
std::deque< util::PxLine > pline
list of lines in each WireProjPad used for calculating 2d and 3d angles, also making seeds (eventuall...
Namespace for general, non-LArSoft-specific utilities.
Definition: PIDAAlg.h:26
const char * Description() const
TGTextButton * fCalcAngle
Calculate the 2D & 3D angles between lines.
TGTextButton * fZoomBack
Unzoom on iteresting region.
hist1 Draw("HIST")
double fLastThreshold
Kludge to prevent double drawing when changing threshold.
Detects the presence of a new event or data product.
TGTextButton * fZoomInterest
Zoom on iteresting region.
bool isZoomAutomatic
true if user did not ask for custom zoom
TGNumberEntry * fTPCInput
current TPC
TGCheckButton * fToggleShowMarkers
Toggle the ShowEndPointMarkersSetting.
TQPad * fWireQ
Histogram of charge vs time on selected wire.
TGTextView * fXYZPosition
Display the xyz position.
const char * PrintTag() const
TGNumberEntry * fDistance
Distance from line to find hits in cluster.
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.
TGRadioButton * fRawCalibDraw
Draw raw and calibrated information.
std::vector< TQPad * > fPlaneQ
charge on each plane
Base class for define a detector display.
std::map< int, double > wmin
TGCheckButton * fToggleAutoZoom
Toggle the autozoom setting.
TGCompositeFrame * fMetaFrame
needed for the side frame
TGTextButton * fClear
Clears the selected points in an event.
TGTextButton * fClearPPoints
Clear current list of End Points.
TGRadioButton * fToggleZoom
Use zoom setting.
LArSoft includes.
TGLabel * fTotalTPCLabel
total TPCs in the current cryostat
TGTextButton * fRedraw
Button to force redraw.
TGCompositeFrame * fVFrame
needed for the side frame
TGNumberEntry * fThresEntry
ADC threshold to display.
General LArSoft Utilities.
std::vector< util::PxLine > seedlines
list of lines in each WireProjPad used for calculating 2d and 3d angles, also making seeds (eventuall...
TGRadioButton * fCalibDraw
Draw calibrated information only.
std::map< int, double > wmax
TGRadioButton * fRawDraw
Draw Raw information only.
TGTextButton * fUnZoomInterest
Unzoom on iteresting region.
TGNumberEntry * fPlaneEntry
Plane number displayed.
Contains all timing reference information for the detector.
TGCheckButton * fMCOn
Display MC truth information.
MCBriefPad * fMC
Short summary of MC event.
std::vector< TWireProjPad * > fPlanes
time vs wire projection for each plane
TGCheckButton * fGreyScale
Display gray or color scale.
std::map< int, double > tmin
util::DataProductChangeTracker_t * fLastEvent
keeps track of latest event
TGNumberEntry * fWireEntry
Wire number displayed.
std::map< int, double > tmax