91 B2DEBUG(100,
"EclFrame:: initializing GUI.");
93 SetLayoutManager(
new TGVerticalLayout(
this));
94 TGCompositeFrame* frame_container =
new TGCompositeFrame(
this, w, h, kHorizontalFrame);
98 TGPopupMenu* menu_file =
new TGPopupMenu(gClient->GetRoot());
99 menu_file->AddEntry(
"&Open...", M_FILE_OPEN);
101 menu_file->AddEntry(
"&Save As...", M_FILE_SAVE);
102 menu_file->AddSeparator();
103 menu_file->AddEntry(
"&Exit", M_FILE_EXIT);
104 TGPopupMenu* menu_view =
new TGPopupMenu(gClient->GetRoot());
105 menu_view->AddEntry(
"&Show event counts in histograms",
M_VIEW_EVENTS);
106 menu_view->AddEntry(
"&Show energy in histograms",
M_VIEW_ENERGY);
107 menu_view->AddSeparator();
108 menu_view->AddEntry(
"&Show events from all ECL subsystems",
M_VIEW_DET_FULL);
110 menu_view->AddEntry(
"&Show events from ECL forward endcap",
M_VIEW_DET_FORW);
111 menu_view->AddEntry(
"&Show events from ECL backward endcap",
M_VIEW_DET_BACK);
113 TGMenuBar* menubar =
new TGMenuBar(
this, w, 30);
114 menubar->AddPopup(
"&File", menu_file,
new TGLayoutHints(kLHintsTop | kLHintsLeft));
115 menubar->AddPopup(
"&View", menu_view,
new TGLayoutHints(kLHintsTop | kLHintsLeft));
117 menu_file->Connect(
"Activated(Int_t)",
"Belle2::EclFrame",
118 this,
"handleMenu(Int_t)");
119 menu_view->Connect(
"Activated(Int_t)",
"Belle2::EclFrame",
120 this,
"handleMenu(Int_t)");
122 AddFrame(menubar,
new TGLayoutHints(kLHintsExpandX | kLHintsTop, 0, 0, 1, 1));
126 m_settings =
new TGVerticalFrame(frame_container, w / 6, h);
130 TGComboBox* diagram_type =
new TGComboBox(
m_settings, -1);
131 diagram_type->SetName(
"DiagramType");
134 for (
int i = 0; i < types_count; i++)
135 diagram_type->AddEntry(types_names[i], i);
137 diagram_type->SetHeight(16);
138 m_settings->AddFrame(diagram_type,
new TGLayoutHints(kLHintsExpandX));
139 diagram_type->Connect(
"Selected(Int_t)",
"Belle2::EclFrame",
this,
140 "changeType(Int_t)");
154 TGHorizontalFrame* frame2_1 =
new TGHorizontalFrame(
m_frame2);
155 TGLabel* ev_min_label =
new TGLabel(frame2_1,
"Min: ");
156 frame2_1->AddFrame(ev_min_label,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 2, 2, 2));
157 m_events_min =
new TGNumberEntry(frame2_1, 0, 6, -1, TGNumberFormat::kNESInteger);
158 frame2_1->AddFrame(
m_events_min,
new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
159 TGLabel* ev_max_label =
new TGLabel(frame2_1,
"Max: ");
160 frame2_1->AddFrame(ev_max_label,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 2, 2, 2));
161 m_events_max =
new TGNumberEntry(frame2_1, 0, 6, -1, TGNumberFormat::kNESInteger);
162 frame2_1->AddFrame(
m_events_max,
new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
168 TGHorizontalFrame* frame2_2 =
new TGHorizontalFrame(
m_frame2);
169 TGTextButton* prev =
new TGTextButton(frame2_2,
"&Prev");
170 prev->Connect(
"Clicked()",
"Belle2::EclFrame",
this,
"showPrevEvents()");
171 frame2_2->AddFrame(prev,
new TGLayoutHints(kLHintsLeft, 5, 5, 3, 4));
172 TGTextButton* next =
new TGTextButton(frame2_2,
"&Next");
173 next->Connect(
"Clicked()",
"Belle2::EclFrame",
this,
"showNextEvents()");
174 frame2_2->AddFrame(next,
new TGLayoutHints(kLHintsRight, 5, 5, 3, 4));
175 m_frame2->AddFrame(frame2_2,
new TGLayoutHints(kLHintsExpandX));
185 TGCanvas* list_canvas =
new TGCanvas(
m_frame3, 1, 100);
186 m_list_tree =
new TGListTree(list_canvas, kHorizontalFrame);
188 TGListTreeItem* root =
m_list_tree->AddItem(0,
"Detector");
190 for (
int i = 0; i < 52; i++) {
191 sprintf(temp,
"Collector %d", i);
192 TGListTreeItem* parent =
m_list_tree->AddItem(root, temp);
193 parent->SetUserData((
void*)((intptr_t)i));
194 for (
int j = 0; j < 12; j++) {
195 sprintf(temp,
"Shaper %d", i * 12 + j);
196 TGListTreeItem* item =
m_list_tree->AddItem(parent, temp);
197 item->SetUserData((
void*)((intptr_t)j));
201 m_list_tree->Connect(
"Clicked(TGListTreeItem*, Int_t)",
"Belle2::EclFrame",
this,
202 "changeRange(TGListTreeItem*, Int_t)");
204 m_frame3->AddFrame(list_canvas,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
205 m_settings->AddFrame(
m_frame3,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 2, 2, 2, 2));
213 TGTextButton* exclude =
new TGTextButton(
m_frame4,
"&Exclude");
214 exclude->Connect(
"Clicked()",
"Belle2::EclFrame",
this,
"excludeChannel()");
215 m_frame4->AddFrame(exclude,
new TGLayoutHints(kLHintsRight, 5, 5, 3, 4));
222 TGHorizontalFrame* frame5_1 =
new TGHorizontalFrame(
m_frame5);
223 frame5_1->SetLayoutManager(
new TGHorizontalLayout(frame5_1));
225 TGLabel* min_lab =
new TGLabel(frame5_1,
"MeV");
227 TGLabel* max_lab =
new TGLabel(frame5_1,
"MeV");
229 frame5_1->AddFrame(min_lab,
new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
230 frame5_1->AddFrame(max_lab,
new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
243 m_draw->Connect(
"Clicked()",
"Belle2::EclFrame",
this,
"doDraw()");
244 m_settings->AddFrame(
m_draw,
new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
247 m_draw_all->Connect(
"Clicked()",
"Belle2::EclFrame",
this,
"doDrawAll()");
256 m_ecanvas =
new TRootEmbeddedCanvas(
"Ecanvas", frame_container, w / 2, h / 2);
257 m_ecanvas->GetCanvas()->SetRightMargin(0.125);
258 m_ecanvas->GetCanvas()->SetLeftMargin(0.1);
259 frame_container->AddFrame(
m_ecanvas,
new TGLayoutHints(
260 kLHintsExpandX | kLHintsExpandY, 10, 10, 10, 1));
263 Connect(
"TCanvas",
"ProcessedEvent(Int_t, Int_t, Int_t, TObject*)",
264 "Belle2::EclFrame",
this,
"updateInfo(Int_t, Int_t, Int_t, TObject*)");
268 AddFrame(frame_container,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,
271 B2DEBUG(100,
"EclFrame:: GUI initialized.");
273 frame_container->SetMinWidth(w / 2);
277 SetWindowName(
"ECL Data");
282 B2DEBUG(100,
"EclFrame:: Initializing data.");
284 B2DEBUG(100,
"EclFrame:: Data initialized.");