GENFIT  Rev:NoNumberAvailable
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 
genfit::EventDisplay::guiDrawPlanes_
TGCheckButton * guiDrawPlanes_
Definition: EventDisplay.h:186
genfit::EventDisplay::guiDrawScaleMan_
TGCheckButton * guiDrawScaleMan_
Definition: EventDisplay.h:202
genfit::EventDisplay::guiErrorScale_
TGNumberEntry * guiErrorScale_
Definition: EventDisplay.h:204
genfit::EventDisplay::drawErrors_
bool drawErrors_
Definition: EventDisplay.h:184
genfit::EventDisplay
Event display designed to run with Genfit.
Definition: EventDisplay.h:59
genfit::EventDisplay::boxCreator
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...
genfit::EventDisplay::guiFitterId_
TGButtonGroup * guiFitterId_
Definition: EventDisplay.h:222
genfit::Track
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition: Track.h:71
genfit::EventDisplay::guiGoto
void guiGoto()
genfit::RefKalman
Definition: EventDisplay.h:43
genfit::EventDisplay::guiResort_
TGCheckButton * guiResort_
Definition: EventDisplay.h:241
genfit::EventDisplay::guiDrawGeometry_
TGCheckButton * guiDrawGeometry_
Definition: EventDisplay.h:177
genfit::EventDisplay::debugLvl_
unsigned int debugLvl_
Definition: EventDisplay.h:221
genfit::EventDisplay::drawEvent
void drawEvent(unsigned int id, bool resetCam=true)
Draw an event.
genfit::EventDisplay::resort_
bool resort_
Definition: EventDisplay.h:242
genfit::EventDisplay::guiNMaxIter_
TGNumberEntry * guiNMaxIter_
Definition: EventDisplay.h:237
genfit::EventDisplay::guiDrawTrack_
TGCheckButton * guiDrawTrack_
Definition: EventDisplay.h:191
genfit::EventDisplay::guiRepId_
TGNumberEntry * guiRepId_
Definition: EventDisplay.h:210
genfit::EventDisplay::fitterId_
eFitterType fitterId_
Definition: EventDisplay.h:223
genfit::EventDisplay::guiDebugLvl_
TGNumberEntry * guiDebugLvl_
Definition: EventDisplay.h:220
genfit::EventDisplay::dChi2Ref_
double dChi2Ref_
Definition: EventDisplay.h:234
genfit::EventDisplay::guiDrawAllTracks_
TGCheckButton * guiDrawAllTracks_
Definition: EventDisplay.h:213
genfit::EventDisplay::drawSilent_
bool drawSilent_
Definition: EventDisplay.h:206
genfit::EventDisplay::guiSelectMmHandling
void guiSelectMmHandling(int val)
genfit::EventDisplay::guiSetDrawParams
void guiSetDrawParams()
genfit::EventDisplay::guiEvent2
TGNumberEntry * guiEvent2
Definition: EventDisplay.h:175
genfit::EventDisplay::drawTrack_
bool drawTrack_
Definition: EventDisplay.h:192
genfit::EventDisplay::drawRefTrack_
bool drawRefTrack_
Definition: EventDisplay.h:194
genfit::EventDisplay::EventDisplay
EventDisplay()
genfit::EventDisplay::guiDrawAutoScale_
TGCheckButton * guiDrawAutoScale_
Definition: EventDisplay.h:200
genfit::EventDisplay::refit_
bool refit_
Definition: EventDisplay.h:219
genfit
Defines for I/O streams used for error and debug printing.
Definition: AbsFinitePlane.cc:22
genfit::EventDisplay::guiRelChi2_
TGNumberEntry * guiRelChi2_
Definition: EventDisplay.h:231
genfit::EventDisplay::nMaxIter_
unsigned int nMaxIter_
Definition: EventDisplay.h:238
genfit::EventDisplay::drawScaleMan_
bool drawScaleMan_
Definition: EventDisplay.h:203
genfit::EventDisplay::guiEvent
TGNumberEntry * guiEvent
Definition: EventDisplay.h:174
genfit::EventDisplay::getInstance
static EventDisplay * getInstance()
genfit::EventDisplay::eventId_
unsigned int eventId_
Definition: EventDisplay.h:169
genfit::EventDisplay::setErrScale
void setErrScale(double errScale=1.)
Set the scaling factor for the visualization of the errors.
genfit::EventDisplay::guiDPVal_
TGNumberEntry * guiDPVal_
Definition: EventDisplay.h:229
genfit::EventDisplay::guiSquareRootFormalism_
TGCheckButton * guiSquareRootFormalism_
Definition: EventDisplay.h:227
genfit::EventDisplay::drawGeometry_
bool drawGeometry_
Definition: EventDisplay.h:178
genfit::EventDisplay::guiDrawDetectors_
TGCheckButton * guiDrawDetectors_
Definition: EventDisplay.h:179
genfit::AbsTrackRep
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
genfit::EventDisplay::drawTrackMarkers_
bool drawTrackMarkers_
Definition: EventDisplay.h:189
genfit::EventDisplay::dRelChi2_
double dRelChi2_
Definition: EventDisplay.h:232
genfit::EventDisplay::guiMmHandling_
TGButtonGroup * guiMmHandling_
Definition: EventDisplay.h:224
genfit::EventDisplay::drawBackward_
bool drawBackward_
Definition: EventDisplay.h:198
genfit::EventDisplay::~EventDisplay
~EventDisplay()
genfit::DafRef
Definition: EventDisplay.h:45
genfit::EventDisplay::addEvent
void addEvent(std::vector< genfit::Track * > &tracks)
Add new event.
genfit::EventDisplay::squareRootFormalism_
bool squareRootFormalism_
Definition: EventDisplay.h:228
genfit::EventDisplay::guiDChi2Ref_
TGNumberEntry * guiDChi2Ref_
Definition: EventDisplay.h:233
genfit::EventDisplay::mmHandling_
eMultipleMeasurementHandling mmHandling_
Definition: EventDisplay.h:225
AbsKalmanFitter.h
genfit::EventDisplay::repId_
unsigned int repId_
Definition: EventDisplay.h:211
genfit::EventDisplay::reset
void reset()
Drop all events.
genfit::EventDisplay::guiDrawCardinalRep_
TGCheckButton * guiDrawCardinalRep_
Definition: EventDisplay.h:208
genfit::EventDisplay::guiNMaxFailed_
TGNumberEntry * guiNMaxFailed_
Definition: EventDisplay.h:239
genfit::EventDisplay::guiTrackId_
TGNumberEntry * guiTrackId_
Definition: EventDisplay.h:215
genfit::EventDisplay::next
void next(unsigned int stp=1)
Go to the next event or step a certain number of events ahead.
genfit::EventDisplay::guiDrawHits_
TGCheckButton * guiDrawHits_
Definition: EventDisplay.h:181
genfit::EventDisplay::drawAutoScale_
bool drawAutoScale_
Definition: EventDisplay.h:201
genfit::StateOnPlane
A state with arbitrary dimension defined in a DetPlane.
Definition: StateOnPlane.h:45
genfit::EventDisplay::drawForward_
bool drawForward_
Definition: EventDisplay.h:196
genfit::EventDisplay::guiDrawRefTrack_
TGCheckButton * guiDrawRefTrack_
Definition: EventDisplay.h:193
genfit::EventDisplay::getNEvents
int getNEvents()
Get the total number of events stored.
genfit::EventDisplay::errorScale_
double errorScale_
Definition: EventDisplay.h:170
genfit::EventDisplay::drawAllTracks_
bool drawAllTracks_
Definition: EventDisplay.h:214
genfit::EventDisplay::eventDisplay_
static EventDisplay * eventDisplay_
Definition: EventDisplay.h:168
genfit::EventDisplay::guiGoto2
void guiGoto2()
genfit::EventDisplay::setOptions
void setOptions(std::string opts)
Set the display options.
genfit::EventDisplay::makeGui
void makeGui()
Build the buttons for event navigation.
genfit::EventDisplay::nMaxFailed_
int nMaxFailed_
Definition: EventDisplay.h:240
genfit::eFitterType
eFitterType
Definition: EventDisplay.h:41
genfit::EventDisplay::prev
void prev(unsigned int stp=1)
Go to the previous event or step a certain number of events back.
genfit::EventDisplay::drawPlanes_
bool drawPlanes_
Definition: EventDisplay.h:187
genfit::EventDisplay::events_
std::vector< std::vector< genfit::Track * > * > events_
Definition: EventDisplay.h:171
genfit::EventDisplay::guiDrawForward_
TGCheckButton * guiDrawForward_
Definition: EventDisplay.h:195
genfit::EventDisplay::drawCardinalRep_
bool drawCardinalRep_
Definition: EventDisplay.h:209
genfit::EventDisplay::guiRefit_
TGCheckButton * guiRefit_
Definition: EventDisplay.h:218
Track.h
genfit::DafSimple
Definition: EventDisplay.h:44
genfit::EventDisplay::trackId_
unsigned int trackId_
Definition: EventDisplay.h:216
genfit::EventDisplay::guiDrawTrackMarkers_
TGCheckButton * guiDrawTrackMarkers_
Definition: EventDisplay.h:188
genfit::EventDisplay::makeLines
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)
genfit::EventDisplay::nMinIter_
unsigned int nMinIter_
Definition: EventDisplay.h:236
genfit::EventDisplay::getErrScale
double getErrScale()
Get the error scaling factor.
genfit::EventDisplay::guiDrawErrors_
TGCheckButton * guiDrawErrors_
Definition: EventDisplay.h:183
genfit::EventDisplay::guiNMinIter_
TGNumberEntry * guiNMinIter_
Definition: EventDisplay.h:235
genfit::SimpleKalman
Definition: EventDisplay.h:42
genfit::eMultipleMeasurementHandling
eMultipleMeasurementHandling
Definition: AbsKalmanFitter.h:35
genfit::EventDisplay::gotoEvent
void gotoEvent(unsigned int id)
Go to event with index id.
genfit::EventDisplay::guiSelectFitterId
void guiSelectFitterId(int val)
genfit::EventDisplay::guiDrawBackward_
TGCheckButton * guiDrawBackward_
Definition: EventDisplay.h:197
genfit::EventDisplay::dPVal_
double dPVal_
Definition: EventDisplay.h:230
genfit::EventDisplay::open
void open()
Open the event display.
genfit::EventDisplay::drawDetectors_
bool drawDetectors_
Definition: EventDisplay.h:180
genfit::EventDisplay::drawHits_
bool drawHits_
Definition: EventDisplay.h:182