Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
trk_mainframe.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: trk_mainframe.h
4 // Created: Wed Apr 9 08:11:16 EDT 2008
5 // Creator: davidl (on Darwin Amelia.local 8.11.1 i386)
6 //
7 
8 // This class is made into a ROOT dictionary ala rootcint.
9 // Therefore, do NOT include anything Hall-D specific here.
10 // It is OK to do that in the .cc file, just not here in the
11 // header.
12 
13 #ifndef _trk_mainframe_
14 #define _trk_mainframe_
15 
16 #include <iostream>
17 #include <cmath>
18 #include <string>
19 #include <vector>
20 #include <map>
21 
22 #include <TGClient.h>
23 #include <TGButton.h>
24 #include <TCanvas.h>
25 #include <TText.h>
26 #include <TRootEmbeddedCanvas.h>
27 #include <TTUBE.h>
28 #include <TNode.h>
29 #include <TGComboBox.h>
30 #include <TPolyLine.h>
31 #include <TEllipse.h>
32 #include <TMarker.h>
33 #include <TVector3.h>
34 #include <TGLabel.h>
35 #include <TTimer.h>
36 #include <TH1.h>
37 #include <TLatex.h>
38 
39 
40 #if !(defined(__CINT__) || defined(__CLING__))
41 
42 #include "hdv_mainframe.h"
43 
44 #else
45 
46 // This ugliness is due to rootcling incorrectly flagging the
47 // foward declaration of hdv_mainframe as an error. Since only
48 // pointers to the class with no internals being referenced here,
49 // a forward declaration should be allowed. This empty class
50 // definition is just to appease rootcling but should not be
51 // seen by the actual C++ compiler.
52 class hdv_mainframe{};
53 
54 #endif
55 
56 
57 class DCoordinateSystem;
59 class DCDCTrackHit;
60 
61 class trk_mainframe:public TGMainFrame{
62  public:
63  trk_mainframe(hdv_mainframe *hdvmf, const TGWindow *p, UInt_t w, UInt_t h);
64  virtual ~trk_mainframe();
65 
66  void DoNewEvent(void);
67  void DoMyRedraw(void);
68  void DoHitSelect(void);
69  void DoUpdateMenus(void);
70  void DoTagMenuUpdate(Int_t widgetId, Int_t id);
71  void DoTrackNumberMenuUpdate(Int_t widgetId, Int_t id);
72  void DoRequestFocus(Int_t id);
73 
74  void FillDataTypeComboBox(TGComboBox* cb, const string &def="DTrack");
75  void FillFactoryTagComboBox(TGComboBox* cb, TGComboBox* datanamecb, const string &def);
76  void FillTrackNumberComboBox(TGComboBox* cb, TGComboBox* datanamecb, TGComboBox* tagcb, bool add_best_match_option);
77 
78  protected:
79 
80 
81  private:
83 
84  TRootEmbeddedCanvas *canvas;
85  TRootEmbeddedCanvas *histocanvas;
86  TH1D *resi;
87  TLatex *resi_lab;
88  vector<TGComboBox*> datatype;
89  vector<TGComboBox*> factorytag;
90  vector<TGComboBox*> trackno;
91  TGCheckButton *slock;
92 
93  double slo, shi, resilo, resihi;
94 
95  vector<TObject*> graphics;
96 
97  void DrawAxes(TCanvas *c, vector<TObject*> &graphics, const char *xlab, const char *ylab);
98  void DrawHits(vector<TObject*> &graphics);
99  void DrawHitsForOneTrack(TVector3 &pos, TVector3 &mom, vector<TObject*> &graphics);
100  void DrawHitsForOneTrack(vector<TObject*> &graphics,
101  vector<pair<const DCoordinateSystem*,double> > &allhits,
103  int index,
104  vector<const DCDCTrackHit*> &cdctrackhits);
105 
106  bool WireInList(const DCoordinateSystem *wire, vector<const DCDCTrackHit*> &cdctrackhits);
107 
108  ClassDef(trk_mainframe,1)
109 };
110 
111 #endif // _trk_mainframe_
112 
vector< TGComboBox * > datatype
Definition: trk_mainframe.h:88
TRootEmbeddedCanvas * histocanvas
Definition: trk_mainframe.h:85
trk_mainframe(hdv_mainframe *hdvmf, const TGWindow *p, UInt_t w, UInt_t h)
virtual ~trk_mainframe()
TLatex * resi_lab
Definition: trk_mainframe.h:87
void DoTagMenuUpdate(Int_t widgetId, Int_t id)
TGCheckButton * slock
Definition: trk_mainframe.h:91
#define c
void DoTrackNumberMenuUpdate(Int_t widgetId, Int_t id)
static char index(char c)
Definition: base64.cpp:115
void DoHitSelect(void)
void DrawAxes(TCanvas *c, vector< TObject * > &graphics, const char *xlab, const char *ylab)
void DoMyRedraw(void)
vector< TGComboBox * > trackno
Definition: trk_mainframe.h:90
hdv_mainframe * hdvmf
Definition: trk_mainframe.h:82
vector< TObject * > graphics
Definition: trk_mainframe.h:95
vector< TGComboBox * > factorytag
Definition: trk_mainframe.h:89
void FillDataTypeComboBox(TGComboBox *cb, const string &def="DTrack")
TRootEmbeddedCanvas * canvas
Definition: trk_mainframe.h:84
void DrawHitsForOneTrack(TVector3 &pos, TVector3 &mom, vector< TObject * > &graphics)
void DoNewEvent(void)
void FillTrackNumberComboBox(TGComboBox *cb, TGComboBox *datanamecb, TGComboBox *tagcb, bool add_best_match_option)
void DoRequestFocus(Int_t id)
bool WireInList(const DCoordinateSystem *wire, vector< const DCDCTrackHit * > &cdctrackhits)
void DoUpdateMenus(void)
void DrawHits(vector< TObject * > &graphics)
void FillFactoryTagComboBox(TGComboBox *cb, TGComboBox *datanamecb, const string &def)