FairRoot/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 
39 namespace genfit {
40 
46 };
47 
59 class EventDisplay : public TNamed {
60  private:
61  EventDisplay();
62 
63  public:
64  ~EventDisplay();
65  static EventDisplay* getInstance();
66 
68  void reset();
69 
77  void addEvent(std::vector<genfit::Track*>& tracks);
78  void addEvent(std::vector<const genfit::Track*>& tracks);
79 
85  void addEvent(const Track* tr);
86 
88  void next(unsigned int stp = 1);
89 
91  void prev(unsigned int stp = 1);
92 
94  void gotoEvent(unsigned int id);
95 
97  int getNEvents();
98 
135  void setOptions(std::string opts);
136 
138  void setErrScale(double errScale = 1.);
139 
141  double getErrScale();
142 
144  void open();
145 
146  void guiGoto();
147  void guiGoto2();
148  void guiSetDrawParams();
149  void guiSelectFitterId(int val);
150  void guiSelectMmHandling(int val);
151 
152  private:
154  void makeGui();
155 
157  void drawEvent(unsigned int id, bool resetCam = true);
158 
162  TEveBox* boxCreator(TVector3 o, TVector3 u, TVector3 v, float ud, float vd, float depth);
163 
164  void makeLines(const StateOnPlane* prevState, const StateOnPlane* state, const AbsTrackRep* rep,
165  const Color_t& color, const Style_t& style, bool drawMarkers, bool drawErrors, double lineWidth = 2, int markerPos = 1);
166 
167 
169  unsigned int eventId_;
170  double errorScale_;
171  std::vector< std::vector<genfit::Track*>* > events_;
172 
173 
174  TGNumberEntry* guiEvent;
175  TGNumberEntry* guiEvent2;
176 
177  TGCheckButton* guiDrawGeometry_;
179  TGCheckButton* guiDrawDetectors_;
181  TGCheckButton* guiDrawHits_;
182  bool drawHits_;
183  TGCheckButton* guiDrawErrors_;
185 
186  TGCheckButton* guiDrawPlanes_;
188  TGCheckButton* guiDrawTrackMarkers_;
190 
191  TGCheckButton* guiDrawTrack_;
193  TGCheckButton* guiDrawRefTrack_;
195  TGCheckButton* guiDrawForward_;
197  TGCheckButton* guiDrawBackward_;
199 
200  TGCheckButton* guiDrawAutoScale_;
202  TGCheckButton* guiDrawScaleMan_;
204  TGNumberEntry* guiErrorScale_;
205 
207 
208  TGCheckButton* guiDrawCardinalRep_;
210  TGNumberEntry* guiRepId_;
211  unsigned int repId_;
212 
213  TGCheckButton* guiDrawAllTracks_;
215  TGNumberEntry* guiTrackId_;
216  unsigned int trackId_;
217 
218  TGCheckButton* guiRefit_;
219  bool refit_;
220  TGNumberEntry* guiDebugLvl_;
221  unsigned int debugLvl_;
222  TGButtonGroup* guiFitterId_;
224  TGButtonGroup* guiMmHandling_;
226 
227  TGCheckButton* guiSquareRootFormalism_;
229  TGNumberEntry* guiDPVal_;
230  double dPVal_;
231  TGNumberEntry* guiRelChi2_;
232  double dRelChi2_;
233  TGNumberEntry* guiDChi2Ref_;
234  double dChi2Ref_;
235  TGNumberEntry* guiNMinIter_;
236  unsigned int nMinIter_;
237  TGNumberEntry* guiNMaxIter_;
238  unsigned int nMaxIter_;
239  TGNumberEntry* guiNMaxFailed_;
241  TGCheckButton* guiResort_;
242  bool resort_;
243 
244 
245  public:
246  ClassDef(EventDisplay,1)
247 
248 };
249 
250 } /* End of namespace genfit */
253 #endif // genfit_EventDisplay_h
254 
TGNumberEntry * guiEvent2
Definition: EventDisplay.h:175
double getErrScale()
Get the error scaling factor.
void open()
Open the event display.
static EventDisplay * eventDisplay_
Definition: EventDisplay.h:168
void drawEvent(unsigned int id, bool resetCam=true)
Draw an event.
TGCheckButton * guiDrawAutoScale_
Definition: EventDisplay.h:200
TGCheckButton * guiDrawDetectors_
Definition: EventDisplay.h:179
unsigned int nMaxIter_
Definition: EventDisplay.h:238
void guiSelectFitterId(int val)
Event display designed to run with Genfit.
Definition: EventDisplay.h:59
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
TGCheckButton * guiDrawRefTrack_
Definition: EventDisplay.h:193
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition: Track.h:71
int getNEvents()
Get the total number of events stored.
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
eFitterType fitterId_
Definition: EventDisplay.h:223
TGCheckButton * guiRefit_
Definition: EventDisplay.h:218
eMultipleMeasurementHandling
void makeLines(const StateOnPlane *prevState, const StateOnPlane *state, const AbsTrackRep *rep, const Color_t &color, const Style_t &style, bool drawMarkers, bool drawErrors, double lineWidth=2, int markerPos=1)
TGCheckButton * guiDrawForward_
Definition: EventDisplay.h:195
eMultipleMeasurementHandling mmHandling_
Definition: EventDisplay.h:225
void setOptions(std::string opts)
Set the display options.
__m128 v
Definition: P4_F32vec4.h:4
void setErrScale(double errScale=1.)
Set the scaling factor for the visualization of the errors.
TGNumberEntry * guiDPVal_
Definition: EventDisplay.h:229
TGNumberEntry * guiNMaxIter_
Definition: EventDisplay.h:237
TGNumberEntry * guiRepId_
Definition: EventDisplay.h:210
unsigned int eventId_
Definition: EventDisplay.h:169
A state with arbitrary dimension defined in a DetPlane.
Definition: StateOnPlane.h:45
void gotoEvent(unsigned int id)
Go to event with index id.
unsigned int repId_
Definition: EventDisplay.h:211
TGCheckButton * guiDrawTrack_
Definition: EventDisplay.h:191
unsigned int debugLvl_
Definition: EventDisplay.h:221
TGCheckButton * guiDrawHits_
Definition: EventDisplay.h:181
TGNumberEntry * guiEvent
Definition: EventDisplay.h:174
TGCheckButton * guiDrawErrors_
Definition: EventDisplay.h:183
unsigned int trackId_
Definition: EventDisplay.h:216
void style()
TEveBox * boxCreator(TVector3 o, TVector3 u, TVector3 v, float ud, float vd, float depth)
Create a box around o, oriented along u and v with widths ud, vd and depth and return a pointer to th...
std::vector< std::vector< genfit::Track * > * > events_
Definition: EventDisplay.h:171
unsigned int nMinIter_
Definition: EventDisplay.h:236
TGNumberEntry * guiDChi2Ref_
Definition: EventDisplay.h:233
void reset()
Drop all events.
TGNumberEntry * guiErrorScale_
Definition: EventDisplay.h:204
void addEvent(std::vector< genfit::Track * > &tracks)
Add new event.
void guiSelectMmHandling(int val)
TGCheckButton * guiDrawBackward_
Definition: EventDisplay.h:197
TGCheckButton * guiDrawAllTracks_
Definition: EventDisplay.h:213
TGCheckButton * guiDrawCardinalRep_
Definition: EventDisplay.h:208
void makeGui()
Build the buttons for event navigation.
TGCheckButton * guiDrawTrackMarkers_
Definition: EventDisplay.h:188
TGNumberEntry * guiTrackId_
Definition: EventDisplay.h:215
TGNumberEntry * guiNMaxFailed_
Definition: EventDisplay.h:239
TGCheckButton * guiDrawPlanes_
Definition: EventDisplay.h:186
TGCheckButton * guiSquareRootFormalism_
Definition: EventDisplay.h:227
TGCheckButton * guiResort_
Definition: EventDisplay.h:241
TGButtonGroup * guiMmHandling_
Definition: EventDisplay.h:224
static EventDisplay * getInstance()
TGNumberEntry * guiNMinIter_
Definition: EventDisplay.h:235
TGNumberEntry * guiRelChi2_
Definition: EventDisplay.h:231
void next(unsigned int stp=1)
Go to the next event or step a certain number of events ahead.
TGButtonGroup * guiFitterId_
Definition: EventDisplay.h:222
void prev(unsigned int stp=1)
Go to the previous event or step a certain number of events back.
TGCheckButton * guiDrawScaleMan_
Definition: EventDisplay.h:202
TGCheckButton * guiDrawGeometry_
Definition: EventDisplay.h:177
Matrix inversion tools.
Definition: AbsBField.h:29
TGNumberEntry * guiDebugLvl_
Definition: EventDisplay.h:220