PandaRoot
EventDisplay.h
Go to the documentation of this file.
1 /* Copyright 2011, Technische Universitaet Muenchen,
2  Author: Karl Bicker
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
23 #ifndef genfit_EventDisplay_h
24 #define genfit_EventDisplay_h
25 
26 #include "Track.h"
27 #include "AbsKalmanFitter.h"
28 
29 #include <TEveBox.h>
30 #include <TVector3.h>
31 #include <string>
32 #include <vector>
33 
34 #include <TGButton.h>
35 #include <TGNumberEntry.h>
36 #include <TGButtonGroup.h>
37 
38 namespace genfit {
39 
41 
53 class EventDisplay : public TNamed {
54  private:
55  EventDisplay();
56 
57  public:
58  ~EventDisplay();
59  static EventDisplay *getInstance();
60 
62  void reset();
63 
71  void addEvent(std::vector<genfit::Track *> &tracks);
72  void addEvent(std::vector<const genfit::Track *> &tracks);
73 
79  void addEvent(const Track *tr);
80 
82  void next(unsigned int stp = 1);
83 
85  void prev(unsigned int stp = 1);
86 
88  void gotoEvent(unsigned int id);
89 
91  int getNEvents();
92 
129  void setOptions(std::string opts);
130 
132  void setErrScale(double errScale = 1.);
133 
135  double getErrScale();
136 
138  void open();
139 
140  void guiGoto();
141  void guiGoto2();
142  void guiSetDrawParams();
143  void guiSelectFitterId(int val);
144  void guiSelectMmHandling(int val);
145 
146  private:
148  void makeGui();
149 
151  void drawEvent(unsigned int id, bool resetCam = true);
152 
156  TEveBox *boxCreator(TVector3 o, TVector3 u, TVector3 v, float ud, float vd, float depth);
157 
158  void makeLines(const StateOnPlane *prevState, const StateOnPlane *state, const AbsTrackRep *rep, const Color_t &color, const Style_t &style, bool drawMarkers, bool drawErrors,
159  double lineWidth = 2, int markerPos = 1);
160 
161  static EventDisplay *eventDisplay_;
162  unsigned int eventId_;
163  double errorScale_;
164  std::vector<std::vector<genfit::Track *> *> events_;
165 
166  TGNumberEntry *guiEvent;
167  TGNumberEntry *guiEvent2;
168 
169  TGCheckButton *guiDrawGeometry_;
170  bool drawGeometry_;
171  TGCheckButton *guiDrawDetectors_;
172  bool drawDetectors_;
173  TGCheckButton *guiDrawHits_;
174  bool drawHits_;
175  TGCheckButton *guiDrawErrors_;
176  bool drawErrors_;
177 
178  TGCheckButton *guiDrawPlanes_;
179  bool drawPlanes_;
180  TGCheckButton *guiDrawTrackMarkers_;
181  bool drawTrackMarkers_;
182 
183  TGCheckButton *guiDrawTrack_;
184  bool drawTrack_;
185  TGCheckButton *guiDrawRefTrack_;
186  bool drawRefTrack_;
187  TGCheckButton *guiDrawForward_;
188  bool drawForward_;
189  TGCheckButton *guiDrawBackward_;
190  bool drawBackward_;
191 
192  TGCheckButton *guiDrawAutoScale_;
193  bool drawAutoScale_;
194  TGCheckButton *guiDrawScaleMan_;
195  bool drawScaleMan_;
196  TGNumberEntry *guiErrorScale_;
197 
198  bool drawSilent_;
199 
200  TGCheckButton *guiDrawCardinalRep_;
201  bool drawCardinalRep_;
202  TGNumberEntry *guiRepId_;
203  unsigned int repId_;
204 
205  TGCheckButton *guiDrawAllTracks_;
206  bool drawAllTracks_;
207  TGNumberEntry *guiTrackId_;
208  unsigned int trackId_;
209 
210  TGCheckButton *guiRefit_;
211  bool refit_;
212  TGNumberEntry *guiDebugLvl_;
213  unsigned int debugLvl_;
214  TGButtonGroup *guiFitterId_;
215  eFitterType fitterId_;
216  TGButtonGroup *guiMmHandling_;
217  eMultipleMeasurementHandling mmHandling_;
218 
219  TGCheckButton *guiSquareRootFormalism_;
220  bool squareRootFormalism_;
221  TGNumberEntry *guiDPVal_;
222  double dPVal_;
223  TGNumberEntry *guiRelChi2_;
224  double dRelChi2_;
225  TGNumberEntry *guiDChi2Ref_;
226  double dChi2Ref_;
227  TGNumberEntry *guiNMinIter_;
228  unsigned int nMinIter_;
229  TGNumberEntry *guiNMaxIter_;
230  unsigned int nMaxIter_;
231  TGNumberEntry *guiNMaxFailed_;
232  int nMaxFailed_;
233  TGCheckButton *guiResort_;
234  bool resort_;
235 
236  public:
237  ClassDef(EventDisplay, 1)
238 };
239 
240 } /* End of namespace genfit */
243 #endif // genfit_EventDisplay_h
double getErrScale()
Get the error scaling factor.
void open()
Open the event display.
void guiSelectFitterId(int val)
void addEvent(std::vector< genfit::Track *> &tracks)
Add new event.
Event display designed to run with Genfit.
Definition: EventDisplay.h:53
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition: Track.h:67
int getNEvents()
Get the total number of events stored.
Abstract base class for a track representation.
Definition: AbsTrackRep.h:62
void setOptions(std::string opts)
Set the display options.
__m128 v
Definition: P4_F32vec4.h:3
void setErrScale(double errScale=1.)
Set the scaling factor for the visualization of the errors.
A state with arbitrary dimension defined in a DetPlane.
Definition: StateOnPlane.h:44
void gotoEvent(unsigned int id)
Go to event with index id.
void reset()
Drop all events.
void guiSelectMmHandling(int val)
static EventDisplay * getInstance()
void next(unsigned int stp=1)
Go to the next event or step a certain number of events ahead.
void prev(unsigned int stp=1)
Go to the previous event or step a certain number of events back.
eMultipleMeasurementHandling
Matrix inversion tools.
Definition: AbsBField.h:28