PandaRoot
EventDisplay.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* Copyright 2011, Technische Universitaet Muenchen,
14  Author: Karl Bicker
15 
16  This file is part of GENFIT.
17 
18  GENFIT is free software: you can redistribute it and/or modify
19  it under the terms of the GNU Lesser General Public License as published
20  by the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  GENFIT is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  GNU Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public License
29  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
30 */
35 #ifndef genfit_EventDisplay_h
36 #define genfit_EventDisplay_h
37 
38 #include "Track.h"
39 #include "AbsKalmanFitter.h"
40 
41 #include <TEveBox.h>
42 #include <TVector3.h>
43 #include <string>
44 #include <vector>
45 
46 #include <TGButton.h>
47 #include <TGNumberEntry.h>
48 #include <TGButtonGroup.h>
49 
50 namespace genfit {
51 
53 
65 class EventDisplay : public TNamed {
66  private:
67  EventDisplay();
68 
69  public:
70  ~EventDisplay();
71  static EventDisplay *getInstance();
72 
74  void reset();
75 
83  void addEvent(std::vector<genfit::Track *> &tracks);
84  void addEvent(std::vector<const genfit::Track *> &tracks);
85 
91  void addEvent(const Track *tr);
92 
94  void next(unsigned int stp = 1);
95 
97  void prev(unsigned int stp = 1);
98 
100  void gotoEvent(unsigned int id);
101 
103  int getNEvents();
104 
141  void setOptions(std::string opts);
142 
144  void setErrScale(double errScale = 1.);
145 
147  double getErrScale();
148 
150  void open();
151 
152  void guiGoto();
153  void guiGoto2();
154  void guiSetDrawParams();
155  void guiSelectFitterId(int val);
156  void guiSelectMmHandling(int val);
157 
158  private:
160  void makeGui();
161 
163  void drawEvent(unsigned int id, bool resetCam = true);
164 
168  TEveBox *boxCreator(TVector3 o, TVector3 u, TVector3 v, float ud, float vd, float depth);
169 
170  void makeLines(const StateOnPlane *prevState, const StateOnPlane *state, const AbsTrackRep *rep, const Color_t &color, const Style_t &style, bool drawMarkers, bool drawErrors,
171  double lineWidth = 2, int markerPos = 1);
172 
173  static EventDisplay *eventDisplay_;
174  unsigned int eventId_;
175  double errorScale_;
176  std::vector<std::vector<genfit::Track *> *> events_;
177 
178  TGNumberEntry *guiEvent;
179  TGNumberEntry *guiEvent2;
180 
181  TGCheckButton *guiDrawGeometry_;
182  bool drawGeometry_;
183  TGCheckButton *guiDrawDetectors_;
184  bool drawDetectors_;
185  TGCheckButton *guiDrawHits_;
186  bool drawHits_;
187  TGCheckButton *guiDrawErrors_;
188  bool drawErrors_;
189 
190  TGCheckButton *guiDrawPlanes_;
191  bool drawPlanes_;
192  TGCheckButton *guiDrawTrackMarkers_;
193  bool drawTrackMarkers_;
194 
195  TGCheckButton *guiDrawTrack_;
196  bool drawTrack_;
197  TGCheckButton *guiDrawRefTrack_;
198  bool drawRefTrack_;
199  TGCheckButton *guiDrawForward_;
200  bool drawForward_;
201  TGCheckButton *guiDrawBackward_;
202  bool drawBackward_;
203 
204  TGCheckButton *guiDrawAutoScale_;
205  bool drawAutoScale_;
206  TGCheckButton *guiDrawScaleMan_;
207  bool drawScaleMan_;
208  TGNumberEntry *guiErrorScale_;
209 
210  bool drawSilent_;
211 
212  TGCheckButton *guiDrawCardinalRep_;
213  bool drawCardinalRep_;
214  TGNumberEntry *guiRepId_;
215  unsigned int repId_;
216 
217  TGCheckButton *guiDrawAllTracks_;
218  bool drawAllTracks_;
219  TGNumberEntry *guiTrackId_;
220  unsigned int trackId_;
221 
222  TGCheckButton *guiRefit_;
223  bool refit_;
224  TGNumberEntry *guiDebugLvl_;
225  unsigned int debugLvl_;
226  TGButtonGroup *guiFitterId_;
227  eFitterType fitterId_;
228  TGButtonGroup *guiMmHandling_;
229  eMultipleMeasurementHandling mmHandling_;
230 
231  TGCheckButton *guiSquareRootFormalism_;
232  bool squareRootFormalism_;
233  TGNumberEntry *guiDPVal_;
234  double dPVal_;
235  TGNumberEntry *guiRelChi2_;
236  double dRelChi2_;
237  TGNumberEntry *guiDChi2Ref_;
238  double dChi2Ref_;
239  TGNumberEntry *guiNMinIter_;
240  unsigned int nMinIter_;
241  TGNumberEntry *guiNMaxIter_;
242  unsigned int nMaxIter_;
243  TGNumberEntry *guiNMaxFailed_;
244  int nMaxFailed_;
245  TGCheckButton *guiResort_;
246  bool resort_;
247 
248  public:
249  ClassDef(EventDisplay, 1)
250 };
251 
252 } /* End of namespace genfit */
255 #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:65
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition: Track.h:79
int getNEvents()
Get the total number of events stored.
Abstract base class for a track representation.
Definition: AbsTrackRep.h:74
void setOptions(std::string opts)
Set the display options.
__m128 v
Definition: P4_F32vec4.h:15
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:56
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:40