Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hdv_optionsframe.cc
Go to the documentation of this file.
1 
2 #include <iostream>
3 #include <iomanip>
4 #include <sstream>
5 #include <cmath>
6 #include <fstream>
7 using namespace std;
8 
9 #include <pthread.h>
10 
11 #include <TRACKING/DMCThrown.h>
12 #include "hdv_optionsframe.h"
13 #include "hdview2.h"
14 #include "MyProcessor.h"
15 #include "FDC/DFDCGeometry.h"
16 #include "FCAL/DFCALGeometry.h"
17 #include "DVector2.h"
18 #include "HDGEOMETRY/DGeometry.h"
19 #include "PID/DNeutralParticle.h"
20 
21 #include <TPolyMarker.h>
22 #include <TLine.h>
23 #include <TMarker.h>
24 #include <TBox.h>
25 #include <TVector3.h>
26 #include <TGeoVolume.h>
27 #include <TGeoManager.h>
28 #include <TGLabel.h>
29 #include <TGComboBox.h>
30 #include <TGButton.h>
31 #include <TGButtonGroup.h>
32 #include <TGTextEntry.h>
33 #include <TArrow.h>
34 #include <TLatex.h>
35 #include <TColor.h>
36 #include <TG3DLine.h>
37 
38 extern JApplication *japp;
39 //TGeoVolume *MOTHER = NULL;
40 //TGeoCombiTrans *MotherRotTrans = NULL;
41 
42 extern int GO;
43 
44 
45 //-------------------
46 // Constructor
47 //-------------------
48 hdv_optionsframe::hdv_optionsframe(hdv_mainframe *hdvmf, const TGWindow *p, UInt_t w, UInt_t h):TGMainFrame(p,w,h)
49 {
50  this->hdvmf = hdvmf;
51 
52  // First, define all of the of the graphics objects. Below that, make all
53  // of the connections to the methods so these things will work!
54 
55  // The main GUI window is divided into three sections, top, middle, and bottom.
56  // Create those frames here.
57  TGLayoutHints *lhints = new TGLayoutHints(kLHintsNormal, 2,2,2,2);
58  TGLayoutHints *chints = new TGLayoutHints(kLHintsCenterY|kLHintsCenterX, 2,2,2,2);
59  TGHorizontalFrame *topframe = new TGHorizontalFrame(this, w, h);
60  TGHorizontalFrame *botframe = new TGHorizontalFrame(this, w, h);
61  AddFrame(topframe, lhints);
62  AddFrame(botframe, chints);
63 
64  TGGroupFrame *hitdrawopts = new TGGroupFrame(topframe, "Extra Drawing Options", kVerticalFrame);
65  topframe->AddFrame(hitdrawopts, lhints);
66 
67  checkbuttons["fdcintersection"] = new TGCheckButton(hitdrawopts, "FDC Intersection");
68  TGHorizontal3DLine *separator0 = new TGHorizontal3DLine(hitdrawopts, 250);
69  checkbuttons["bcaltruth"] = new TGCheckButton(hitdrawopts, "BCALTruth");
70  checkbuttons["thrown_charged_bcal"] = new TGCheckButton(hitdrawopts, "Draw thrown charged track projections on BCAL");
71  checkbuttons["recon_charged_bcal"] = new TGCheckButton(hitdrawopts, "Draw reconstructed charged track projections on BCAL");
72  checkbuttons["thrown_photons_bcal"] = new TGCheckButton(hitdrawopts, "Draw thrown photon projections on BCAL");
73  checkbuttons["recon_photons_bcal"] = new TGCheckButton(hitdrawopts, "Draw reconstructed photon projections on BCAL");
74  TGHorizontal3DLine *separator1 = new TGHorizontal3DLine(hitdrawopts, 250);
75  checkbuttons["fcaltruth"] = new TGCheckButton(hitdrawopts, "FCALTruth");
76  checkbuttons["thrown_charged_fcal"] = new TGCheckButton(hitdrawopts, "Draw thrown charged track projections on FCAL");
77  checkbuttons["recon_charged_fcal"] = new TGCheckButton(hitdrawopts, "Draw reconstructed charged track projections on FCAL");
78  checkbuttons["thrown_photons_fcal"] = new TGCheckButton(hitdrawopts, "Draw thrown photon projections on FCAL");
79  checkbuttons["recon_photons_fcal"] = new TGCheckButton(hitdrawopts, "Draw reconstructed photon projections on FCAL");
80  checkbuttons["recon_photons_ccal"] = new TGCheckButton(hitdrawopts, "Draw reconstructed photon projections on CCAL");
81  TGHorizontal3DLine *separator2 = new TGHorizontal3DLine(hitdrawopts, 250);
82  checkbuttons["recon_photons_track_match"] = new TGCheckButton(hitdrawopts, "Draw reconstructed photons matched to charged tracks");
83  TGHorizontal3DLine *separator3 = new TGHorizontal3DLine(hitdrawopts, 250);
84  checkbuttons["trajectories_photon"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw photon tracks");
85  checkbuttons["trajectories_electron"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw electron tracks");
86  checkbuttons["trajectories_positron"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw positron tracks");
87  checkbuttons["trajectories_proton"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw proton tracks");
88  checkbuttons["trajectories_neutron"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw neutron tracks");
89  checkbuttons["trajectories_piplus"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw piplus tracks");
90  checkbuttons["trajectories_piminus"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw piminus tracks");
91  checkbuttons["trajectories_other"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw all other tracks");
92  checkbuttons["trajectories_lines"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw lines between points");
93  checkbuttons["trajectories_colors"] = new TGCheckButton(hitdrawopts, "When drawing DMCTrajectoryPoint, draw color based on charge");
94 
95  hitdrawopts->AddFrame(checkbuttons["fdcintersection"], lhints);
96  hitdrawopts->AddFrame(separator0, chints);
97  hitdrawopts->AddFrame(checkbuttons["bcaltruth"], lhints);
98  hitdrawopts->AddFrame(checkbuttons["thrown_charged_bcal"], lhints);
99  hitdrawopts->AddFrame(checkbuttons["recon_charged_bcal"], lhints);
100  hitdrawopts->AddFrame(checkbuttons["thrown_photons_bcal"], lhints);
101  hitdrawopts->AddFrame(checkbuttons["recon_photons_bcal"], lhints);
102  hitdrawopts->AddFrame(separator1, chints);
103  hitdrawopts->AddFrame(checkbuttons["fcaltruth"], lhints);
104  hitdrawopts->AddFrame(checkbuttons["thrown_charged_fcal"], lhints);
105  hitdrawopts->AddFrame(checkbuttons["recon_charged_fcal"], lhints);
106  hitdrawopts->AddFrame(checkbuttons["thrown_photons_fcal"], lhints);
107  hitdrawopts->AddFrame(checkbuttons["recon_photons_fcal"], lhints);
108  hitdrawopts->AddFrame(separator2, chints);
109  hitdrawopts->AddFrame(checkbuttons["recon_photons_ccal"], lhints);
110  hitdrawopts->AddFrame(separator2, chints);
111  hitdrawopts->AddFrame(checkbuttons["recon_photons_track_match"], lhints);
112  hitdrawopts->AddFrame(separator3, chints);
113  hitdrawopts->AddFrame(checkbuttons["trajectories_photon"], lhints);
114  hitdrawopts->AddFrame(checkbuttons["trajectories_electron"], lhints);
115  hitdrawopts->AddFrame(checkbuttons["trajectories_positron"], lhints);
116  hitdrawopts->AddFrame(checkbuttons["trajectories_proton"], lhints);
117  hitdrawopts->AddFrame(checkbuttons["trajectories_neutron"], lhints);
118  hitdrawopts->AddFrame(checkbuttons["trajectories_piplus"], lhints);
119  hitdrawopts->AddFrame(checkbuttons["trajectories_piminus"], lhints);
120  hitdrawopts->AddFrame(checkbuttons["trajectories_other"], lhints);
121  hitdrawopts->AddFrame(checkbuttons["trajectories_lines"], lhints);
122  hitdrawopts->AddFrame(checkbuttons["trajectories_colors"], lhints);
123 
124  //========== Done Button ===========
125  TGTextButton *done = new TGTextButton(botframe, "Done");
126  botframe->AddFrame(done, chints);
127 
128  //&&&&&&&&&&&&&&&& Connections
129  map<string, TGCheckButton*>::iterator iter = checkbuttons.begin();
130  for(; iter!=checkbuttons.end(); iter++){
131  iter->second->Connect("Clicked()","hdv_mainframe", hdvmf, "DoMyRedraw()");
132  }
133 
134  // Add out checkbuttons to the list kept in hdv_mainframe
136 
137  // Finish up and map the window
138  SetWindowName("Hall-D Event Viewer Options");
139  SetIconName("HDView");
140 
141  done->Connect("Clicked()","hdv_optionsframe", this, "DoDone()");
142  this->Connect("CloseWindow()", "hdv_optionsframe", this, "DoDone()");
143  this->DontCallClose();
144 
145  MapSubwindows();
146  Resize(GetDefaultSize());
147  //MapWindow();
148  //LowerWindow();
149 }
150 
151 //-------------------
152 // DoDone
153 //-------------------
155 {
156  //LowerWindow();
157  UnmapWindow();
158 }
159 
160 
hdv_optionsframe(hdv_mainframe *hdvmf, const TGWindow *p, UInt_t w, UInt_t h)
JApplication * japp
map< string, TGCheckButton * > checkbuttons
hdv_mainframe * hdvmf
int GO
Definition: hdview2.cc:10
hdv_mainframe * hdvmf
void AddCheckButtons(map< string, TGCheckButton * > &checkbuttons)