LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 
14 #include "RQ_OBJECT.h"
15 #include <vector>
16 #include <deque>
17 
18 // Forward declarations
19 #include "TGButton.h" // For TGCheckButton
20 
21 class TGNumberEntry;
22 class TGTextView;
23 class TGLabel;
24 class TRootEmbeddedCanvas;
25 
26 namespace util {
27 // class PxLine;
28 // class PxPoint;
29 
30  class DataProductChangeTracker_t;
31 }
32 
33 namespace evd {
34 
35 class MCBriefPad;
36 class TQPad;
37 class TWireProjPad;
38 class HeaderPad;
39 
40 
41 // Helper class, to store zoom settings in each view
42 
44 {
45 
46 public:
47  ZoomOptions() {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 
57 
59 
60 public:
61 
62  RQ_OBJECT("evd::TWQProjectionView")
63 
64 public:
65  TWQProjectionView(TGMainFrame* mf);
67 
68  const char* Description() const { return "Time/Wire/Charge Projections"; }
69  const char* PrintTag() const { return "twq-proj"; }
70 
71  void Draw(const char* opt="");
72 
73  // void RangeChanged();
74  static void MouseDispatch(int plane, void * wqpv);
75 
76 
77  void ChangeWire(int plane);
78  void SelectTPC();
79 
80  void SetMouseZoomRegion(int plane);
81 
82  void SelectPoint(int plane);
83  void SelectHit(int plane);
84  void SetPlaneWire();
85  void SetPlane();
86  void SetWire();
87  void SetDistance();
88  void SetThreshold();
89  void SetGreyscale();
90  void SetMCInfo();
91  void SetRawCalib();
92  void SetUpSideBar();
93  void ForceRedraw();
94  void SetUpZoomButtons();
95  void SetUpClusterButtons();
96  void SetUpDrawingButtons();
97  void SetUpTPCselection();
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);
102  void ResetRegionsOfInterest();
103 
104  void ZoomBack(); // Revert to the previous zoom setting
105  void SetClusterInterest();
106 
107 
108 
109  void SetSeedInterest();
110  void ClearLastSeed();
111  void ClearAllSeeds();
112  void SetSeeds(int plane);
113  void RefitSeeds();
114  void SetClusters(int plane);
115 
116  void SetZoomInterest();
117  void SetZoomFromView();
118  void PrintCharge();
119  void DrawPads(const char* opt="");
120 
121  void FindEndPoint();
122  double FindLineLength();
123  void ClearEndPoints();
124  void ToggleEndPointMarkers();
125 
126  void RadioButtonsDispatch(int parameter);
127  void SaveSelection();
128  void ClearSelection();
129  double UpdateSeedCurve();
130 
132  bool OnNewEvent();
133 
134  void SetTestFlag(int number=1);
135 
136 protected:
137  TGCompositeFrame* fVFrame;
138 
139 
140 private:
141 
145  std::vector<TQPad* > fPlaneQ;
146  std::vector<TWireProjPad*> fPlanes;
147 
148  double fLastThreshold;
149 
150 
151  TGCompositeFrame* fMetaFrame;
152 
153  TGLabel* fWireLabel;
154  TGLabel* fDistanceLabel;
155  TGLabel* fPlaneLabel;
156  TGLabel* fThresLabel;
157  //TGLabel* fGreyLabel;
158 
159  TGNumberEntry* fWireEntry;
160  TGNumberEntry* fPlaneEntry;
161  TGNumberEntry* fThresEntry;
162  TGNumberEntry* fDistance;
163  TGCheckButton* fGreyScale;
164  TGCheckButton* fMCOn;
165  TGRadioButton* fRawDraw;
166  TGRadioButton* fCalibDraw;
167  TGRadioButton* fRawCalibDraw;
168 
169  TGTextButton* fZoomInterest;
170  TGTextButton* fUnZoomInterest;
171  TGTextButton* fZoomBack;
172  TGCheckButton* fToggleAutoZoom;
173  TGRadioButton* fToggleZoom;
174  TGRadioButton* fToggleClusters;
175  TGRadioButton* fToggleSeeds;
176  TGTextView* fAngleInfo;
177 
178  TGTextButton* fFindEndpoint;
179  TGTextButton* fClearPPoints;
180  TGCheckButton* fToggleShowMarkers;
181  TGTextView* fXYZPosition;
182 
183  TGTextButton* fCalcAngle;
184  TGTextButton* fClear;
185 
186  //TGTextButton* fClearSeeds; ///<Clears the selected points in an eventually
187  TGTextButton* fClearLastSeed;
188 
189  //TGTextButton* fRefitSeeds; ///<Clears the selected points in an event
190 
191  TGTextButton* fRedraw;
192 
193  TGNumberEntry* fCryoInput;
194  TGNumberEntry* fTPCInput;
195  TGLabel* fTotalTPCLabel;
196 
197  int DrawLine(int plane,util::PxLine &pline);
198 
199  std::deque<util::PxPoint> ppoints;
200  std::deque<util::PxLine> pline;
201 
202  std::vector<util::PxLine> seedlines;
203 
205  std::vector<ZoomOptions> fPrevZoomOpt;
206 
208 
210 
212  void SetAutomaticZoomMode(bool bSet = true);
213 
215  static std::string TotalElementsString(unsigned int NElements);
216 
217 };
218 
219 }// namespace
220 
221 #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:17
const char * Description() const
TGTextButton * fCalcAngle
Calculate the 2D & 3D angles between lines.
TGTextButton * fZoomBack
Unzoom on iteresting region.
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.
std::map< int, double > wmax
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.
TGRadioButton * fToggleSeeds
Use the make seed setting.
Base class for define a detector display.
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.
std::vector< TQPad * > fPlaneQ
charge on each plane
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.
TGRadioButton * fRawDraw
Draw Raw information only.
TGTextButton * fUnZoomInterest
Unzoom on iteresting region.
TGNumberEntry * fPlaneEntry
Plane number displayed.
std::map< int, double > tmin
hist1 Draw("HIST")
TGCheckButton * fMCOn
Display MC truth information.
TGTextButton * fClearLastSeed
Clears the selected points in an event.
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.
util::DataProductChangeTracker_t * fLastEvent
keeps track of latest event
TGNumberEntry * fWireEntry
Wire number displayed.
std::map< int, double > wmin
std::map< int, double > tmax