Belle II Software  release-08-01-10
EclFrame.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 /* Own header. */
10 #include <ecl/modules/eclDisplay/EclFrame.h>
11 
12 /* ECL headers. */
13 #include <ecl/mapper/ECLChannelMapper.h>
14 #include <ecl/modules/eclDisplay/geometry.h>
15 #include <ecl/modules/eclDisplay/MultilineWidget.h>
16 #include <ecl/modules/eclDisplay/EclPainter.h>
17 #include <ecl/modules/eclDisplay/EclPainter1D.h>
18 
19 /* ROOT headers. */
20 #include <TCanvas.h>
21 #include <TFile.h>
22 #include <TGComboBox.h>
23 #include <TGDoubleSlider.h>
24 #include <TGFileDialog.h>
25 #include <TGLabel.h>
26 #include <TGListTree.h>
27 #include <TGMenu.h>
28 #include <TGNumberEntry.h>
29 #include <TRootEmbeddedCanvas.h>
30 #include <TStyle.h>
31 #include <TSystem.h>
32 
33 using namespace Belle2;
34 using namespace ECL;
35 using namespace ECLDisplayUtility;
36 
37 const char* EclFrame::filetypes[] = {
38  "PDF", "*.pdf",
39  "PostScript", "*.ps",
40  "Encapsulated PostScript", "*.eps",
41  "SVG", "*.svg",
42  "TeX", "*.tex",
43  "GIF", "*.gif",
44  "ROOT macros", "*.C",
45  "ROOT files", "*.root",
46  "XML", "*.xml",
47  "PNG", "*.png",
48  "XPM", "*.xpm",
49  "JPEG", "*.jpg",
50  "TIFF", "*.tiff",
51  "XCF", "*.xcf",
52  0, 0
53 };
54 
55 EclFrame::EclFrame(int painter_type, EclData* data, bool auto_display, ECL::ECLChannelMapper* mapper)
56 {
57  m_open = true;
58  m_subsys = EclData::ALL;
59  m_ecl_data = data;
60  m_mapper = mapper;
61  m_painter_type = (EclPainterType)painter_type;
62  m_ecl_painter = EclPainterFactory::createPainter(m_painter_type, data,
63  m_mapper, m_subsys);
64  m_last_event = -1;
65 
66  for (int i = 1; i <= data->getCrystalCount(); i++) {
67  int phi_id = data->getPhiId(i);//GetPhiId(i);
68  int theta_id = data->getThetaId(i);//GetThetaId(i);
69 
70  if (phi_id == -1 || theta_id == -1)
71  data->excludeChannel(i);
72  }
73 
74  initGUI(1000, 700);
75 
76  m_auto_display = auto_display;
77 
78  gStyle->SetOptStat(0);
79 
80  doDraw();
81 }
82 
84 {
85  // TODO: Fix this, right now using this for testing.
86  Cleanup();
87 }
88 
89 void EclFrame::initGUI(int w, int h)
90 {
91  B2DEBUG(100, "EclFrame:: initializing GUI.");
92 
93  SetLayoutManager(new TGVerticalLayout(this));
94  TGCompositeFrame* frame_container = new TGCompositeFrame(this, w, h, kHorizontalFrame);
95 
96  /* Menu bar */
97 
98  TGPopupMenu* menu_file = new TGPopupMenu(gClient->GetRoot());
99  menu_file->AddEntry("&Open...", M_FILE_OPEN);
100  menu_file->AddEntry("&Export TTree...", M_FILE_EXPORT_TREE);
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);
109  menu_view->AddEntry("&Show events from ECL barrel", M_VIEW_DET_BARR);
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);
112 
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));
116 
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)");
121 
122  AddFrame(menubar, new TGLayoutHints(kLHintsExpandX | kLHintsTop, 0, 0, 1, 1));
123 
124  /* Settings */
125 
126  m_settings = new TGVerticalFrame(frame_container, w / 6, h);
127 
128  /* Zeroth subframe, diagram type selection */
129 
130  TGComboBox* diagram_type = new TGComboBox(m_settings, -1);
131  diagram_type->SetName("DiagramType");
132  const int types_count = EclPainterFactory::getTypeTitlesCount();
133  const char** types_names = EclPainterFactory::getTypeTitles();
134  for (int i = 0; i < types_count; i++)
135  diagram_type->AddEntry(types_names[i], i);
136  diagram_type->Select(m_painter_type);
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)");
141 
142  /* First settings subframe, information */
143 
144  m_frame1 = new MultilineWidget(m_settings, "Info");
145  m_frame1->setLineCount(4);
146 
147  m_settings->AddFrame(m_frame1, new TGLayoutHints(kLHintsExpandX));
148 
149  /* Second settings subframe, settings for range of events displayed */
150 
151  m_frame2 = new TGGroupFrame(m_settings, "Range of displayed events");
152  m_frame2->SetLayoutManager(new TGVerticalLayout(m_frame2));
153 
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));
163  m_frame2->AddFrame(frame2_1);
164 
165  m_ev_slider = new TGDoubleHSlider(m_frame2, w / 6, 2);
166  m_frame2->AddFrame(m_ev_slider, new TGLayoutHints(kLHintsExpandX, 5, 5, 3, 4));
167 
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));
176 
177  m_settings->AddFrame(m_frame2, new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
178 
179  /* Third settings subframe */
180 
181  // Contains TGTreeList object which allows user to choose which channels
182  // are going to be displayed.
183  m_frame3 = new TGGroupFrame(m_settings, "Displayed channels");
184  char temp[255];
185  TGCanvas* list_canvas = new TGCanvas(m_frame3, 1, 100);
186  m_list_tree = new TGListTree(list_canvas, kHorizontalFrame);
187  m_list_tree->Associate(m_frame3);
188  TGListTreeItem* root = m_list_tree->AddItem(0, "Detector");
189  m_list_tree->OpenItem(root);
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));
198  }
199  }
200 
201  m_list_tree->Connect("Clicked(TGListTreeItem*, Int_t)", "Belle2::EclFrame", this,
202  "changeRange(TGListTreeItem*, Int_t)");
203 
204  m_frame3->AddFrame(list_canvas, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
205  m_settings->AddFrame(m_frame3, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 2, 2, 2, 2));
206 
207  /* Fourth settings subframe, channel exclusion */
208 
209  m_frame4 = new TGGroupFrame(m_settings, "Channel exclusion");
210  m_frame4->SetLayoutManager(new TGHorizontalLayout(m_frame4));
211  m_channel_id = new TGNumberEntry(m_frame4, 0, 6, -1, TGNumberFormat::kNESInteger);
212  m_frame4->AddFrame(m_channel_id, new TGLayoutHints(kLHintsLeft, 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));
216 
217  m_settings->AddFrame(m_frame4, new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
218 
219  /* Fifth settings subframe, energy threshold */
220 
221  m_frame5 = new TGGroupFrame(m_settings, "Energy threshold");
222  TGHorizontalFrame* frame5_1 = new TGHorizontalFrame(m_frame5);
223  frame5_1->SetLayoutManager(new TGHorizontalLayout(frame5_1));
224  m_min_en_threshold = new TGNumberEntry(frame5_1, 2.5, 6, -1);
225  TGLabel* min_lab = new TGLabel(frame5_1, "MeV");
226  m_max_en_threshold = new TGNumberEntry(frame5_1, 150, 6, -1);
227  TGLabel* max_lab = new TGLabel(frame5_1, "MeV");
228  frame5_1->AddFrame(m_min_en_threshold, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
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));
231  frame5_1->AddFrame(m_max_en_threshold, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
232 
233  m_frame5->AddFrame(frame5_1);
234  m_threshold_switch = new TGCheckButton(m_frame5, "Enable energy threshold");
235  m_threshold_switch->SetState(kButtonDown);
236  m_frame5->AddFrame(m_threshold_switch);
237 
238  m_settings->AddFrame(m_frame5, new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
239 
240  /* Sixth settings subframe, "Draw" button */
241 
242  m_draw = new TGTextButton(m_settings, "&Draw");
243  m_draw->Connect("Clicked()", "Belle2::EclFrame", this, "doDraw()");
244  m_settings->AddFrame(m_draw, new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
245 
246  m_draw_all = new TGTextButton(m_settings, "&Draw All");
247  m_draw_all->Connect("Clicked()", "Belle2::EclFrame", this, "doDrawAll()");
248  m_settings->AddFrame(m_draw_all, new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
249 
250  /* Adding the entire subframe of settings */
251 
252  frame_container->AddFrame(m_settings);
253 
254  /* Canvas widget */
255 
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));
261 
262  m_ecanvas->GetCanvas()->
263  Connect("TCanvas", "ProcessedEvent(Int_t, Int_t, Int_t, TObject*)",
264  "Belle2::EclFrame", this, "updateInfo(Int_t, Int_t, Int_t, TObject*)");
265 
266  /* Adding frame container for settings and canvas to the main window */
267 
268  AddFrame(frame_container, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,
269  1, 1, 1, 1));
270 
271  B2DEBUG(100, "EclFrame:: GUI initialized.");
272 
273  frame_container->SetMinWidth(w / 2);
274  // Add this if Root still throws BadDrawable errors.
275  // frame_container->SetMinHeight(h);
276 
277  SetWindowName("ECL Data");
278  MapSubwindows();
279  Resize(w, h);
280  MapWindow();
281 
282  B2DEBUG(100, "EclFrame:: Initializing data.");
283  initData();
284  B2DEBUG(100, "EclFrame:: Data initialized.");
285 }
286 
288 {
289  m_events_min->SetLimits(TGNumberFormat::kNELLimitMinMax,
290  0, m_ecl_data->getLastEventId());
291  m_events_max->SetLimits(TGNumberFormat::kNELLimitMinMax,
292  0, m_ecl_data->getLastEventId());
293 
294  B2DEBUG(500, "Last event id: " << m_ecl_data->getLastEventId());
295  m_ev_slider->SetRange(0, m_ecl_data->getLastEventId());
296  m_ev_slider->SetPosition(0, 0);
297  m_ev_slider->Connect("TGDoubleHSlider", "PositionChanged()",
298  "Belle2::EclFrame", this, "updateEventRange()");
299  updateEventRange();
300 }
301 
303 {
304  static TString dir(".");
305  TGFileInfo fi;
306  TFile* file;
307 
308  switch (id) {
309  case M_FILE_OPEN:
310  fi.fFileTypes = 0;
311  fi.fIniDir = StrDup(dir);
312  new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
313  if (fi.fFilename) {
314  if (gSystem->AccessPathName(fi.fFilename, kFileExists) == 0) {
315  B2DEBUG(50, "ECLFrame:: Opening file " << fi.fFilename);
316  m_ecl_data->loadRootFile(fi.fFilename);
317  loadNewData();
318  }
319  }
320  // doDraw();
321  break;
322  case M_FILE_SAVE:
323  fi.fFileTypes = filetypes;
324  fi.fIniDir = StrDup(dir);
325  new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
326  B2DEBUG(50, "Save file: " << fi.fFilename
327  << "(dir: " << fi.fIniDir << ")");
328  m_ecanvas->GetCanvas()->SaveAs(fi.fFilename);
329  break;
330  case M_FILE_EXPORT_TREE:
331  static const char* filetypes_root[] = {"Root", "*.root", 0, 0};
332  fi.fFileTypes = filetypes_root;
333  fi.fIniDir = StrDup(dir);
334  new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
335  B2DEBUG(50, "Save file: " << fi.fFilename
336  << "(dir: " << fi.fIniDir << ")");
337  file = new TFile(fi.fFilename, "RECREATE");
338  m_ecl_data->getTree()->Write("tree");
339  file->Close();
340  break;
341  case M_FILE_EXIT:
342  CloseWindow();
343  break;
344  case M_VIEW_ENERGY:
345  SetMode(1);
346  changeType((EclPainterType)m_painter_type);
347  break;
348  case M_VIEW_EVENTS:
349  SetMode(0);
350  changeType((EclPainterType)m_painter_type);
351  break;
352  case M_VIEW_DET_FULL:
353  m_subsys = EclData::ALL;
354  m_ecl_painter->setDisplayedSubsystem(m_subsys);
355  doDraw();
356  break;
357  case M_VIEW_DET_BARR:
358  m_subsys = EclData::BARR;
359  m_ecl_painter->setDisplayedSubsystem(m_subsys);
360  doDraw();
361  break;
362  case M_VIEW_DET_FORW:
363  m_subsys = EclData::FORW;
364  m_ecl_painter->setDisplayedSubsystem(m_subsys);
365  doDraw();
366  break;
367  case M_VIEW_DET_BACK:
368  m_subsys = EclData::BACKW;
369  m_ecl_painter->setDisplayedSubsystem(m_subsys);
370  doDraw();
371  break;
372  default:
373  break;
374  }
375 }
376 
378 {
379  m_ev_slider->SetRange(0, m_ecl_data->getLastEventId());
380  m_events_min->SetLimits(TGNumberFormat::kNELLimitMinMax,
381  0, m_ecl_data->getLastEventId());
382  m_events_max->SetLimits(TGNumberFormat::kNELLimitMinMax,
383  0, m_ecl_data->getLastEventId());
384 
385  if (m_last_event < m_ecl_data->getLastEventId() &&
386  (m_auto_display || m_last_event == -1)) {
387  m_last_event++;
388  if (m_last_event <= 1) {
389  // Draw the first loaded event and update GUI.
390  doDraw();
391  m_settings->MapSubwindows();
392  MapSubwindows();
393 
394  m_ev_slider->SetPosition(0, 0);
395  }
396  updateEventRange();
397  }
398 }
399 
401 {
402  TCanvas* fCanvas = m_ecanvas->GetCanvas();
403 
404  fCanvas->SetLogz();
405  fCanvas->cd();
406  m_ecl_painter->Draw();
407  updateInfo(51, 0, 0, 0);
408  fCanvas->Update();
409 }
410 
412 {
413  Float_t ev_min, ev_max;
414  m_ev_slider->GetPosition(&ev_min, &ev_max);
415 
416  m_events_min->SetNumber(ev_min);
417  m_events_max->SetNumber(ev_max);
418 
419  m_ev_slider->MapWindow();
420  m_ev_slider->MapSubwindows();
421 }
422 
424 {
425  Float_t ev_min, ev_max, diff;
426 
427  ev_min = m_events_min->GetNumber();
428  ev_max = m_events_max->GetNumber();
429 
430  if (ev_min <= 0)
431  return;
432 
433  diff = ev_max - ev_min + 1;
434  ev_min -= diff;
435  ev_max -= diff;
436  if (ev_min < 0)
437  ev_max = 0;
438 
439  m_ev_slider->SetPosition(ev_min, ev_max);
440  updateEventRange();
441  doDraw();
442 }
443 
445 {
446  Float_t ev_min, ev_max, diff;
447 
448  ev_min = m_events_min->GetNumber();
449  ev_max = m_events_max->GetNumber();
450 
451  if (ev_max >= m_ecl_data->getLastEventId())
452  return;
453 
454  diff = ev_max - ev_min + 1;
455  ev_min += diff;
456  ev_max += diff;
457  if (ev_max > m_ecl_data->getLastEventId())
458  ev_max = m_ecl_data->getLastEventId();
459 
460  m_ev_slider->SetPosition(ev_min, ev_max);
461  updateEventRange();
462  doDraw();
463 }
464 
466 {
467  int ch = m_channel_id->GetNumber();
468  m_ecl_data->excludeChannel(ch, true);
469  doDraw();
470 }
471 
473 {
474  m_ecl_data->setEventRange(m_events_min->GetIntNumber(),
475  m_events_max->GetIntNumber());
476 
477  float en_min = m_min_en_threshold->GetNumber();
478  float en_max = m_max_en_threshold->GetNumber();
479  if (m_threshold_switch->GetState() == kButtonDown)
480  m_ecl_data->setEnergyThreshold(en_min, en_max);
481  else
482  m_ecl_data->setEnergyThreshold(0, -1);
483 
484  updateCanvas();
485 }
486 
488 {
489  m_ecl_data->setEventRange(0, m_ecl_data->getLastEventId());
490 
491  updateCanvas();
492 }
493 
494 void EclFrame::updateInfo(int event, int px, int py, TObject*)
495 {
496  if (event == 11) {
497  EclPainter* new_painter = m_ecl_painter->handleClick(px, py);
498 
499  if (new_painter != nullptr) {
500  delete m_ecl_painter;
501  m_ecl_painter = new_painter;
502  doDraw();
503 
504  Layout();
505  MapSubwindows();
506  }
507  }
508  // On mouse move
509  if (event == 51) {
510  m_ecl_painter->getInformation(px, py, m_frame1);
511 
512  m_frame1->Layout();
513  }
514 }
515 
516 void EclFrame::changeRange(TGListTreeItem* entry, int)
517 {
518  m_frame1->setLineCount(0);
519  Layout();
520  MapSubwindows();
521 
522  TGListTreeItem* parent = entry->GetParent();
523  if (!parent) {
524  // Root entry (detector) has been selected.
525  changeType(PAINTER_COLLECTOR);
526  } else {
527  TGListTreeItem* grandparent = parent->GetParent();
528  if (!grandparent) {
529  // Crate entry had been selected.
530  changeType(PAINTER_SHAPER, false);
531  long crate = (long)entry->GetUserData();
532  m_ecl_painter->setXRange(crate * 12, crate * 12 + 11);
533  doDraw();
534  } else {
535  // Shaper entry had been selected.
536  changeType(PAINTER_CHANNEL, false);
537  long shaper = (long)entry->GetUserData();
538  long crate = (long)parent->GetUserData();
539  shaper = 12 * crate + shaper;
540  ((EclPainter1D*)m_ecl_painter)->setShaper(crate + 1, shaper + 1);
541  doDraw();
542  }
543  }
544 }
545 
546 void EclFrame::changeType(int type, bool redraw)
547 {
548  EclPainter* new_painter =
550  m_mapper, m_subsys);
551 
552  if (new_painter) {
553  m_painter_type = (EclPainterType)type;
554 
555  delete m_ecl_painter;
556  m_ecl_painter = new_painter;
557  m_frame1->setLineCount(0);
558  m_ecanvas->GetCanvas()->Clear();
559 
560  updateInfo(51, 0, 0, 0);
561 
562  Layout();
563  MapSubwindows();
564  Layout();
565 
566  if (redraw)
567  doDraw();
568  }
569 }
This class provides access to ECL channel map that is either a) Loaded from the database (see ecl/dbo...
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
Definition: EclData.h:31
void initData()
Initialize data.
Definition: EclFrame.cc:287
void doDrawAll()
Draw all events on m_ecanvas.
Definition: EclFrame.cc:487
void updateInfo(int event, int px, int py, TObject *)
Update information on the cursor position in the histogram.
Definition: EclFrame.cc:494
static const char * filetypes[]
Possible export filetypes for histograms.
Definition: EclFrame.h:125
void showNextEvents()
Show next range of events.
Definition: EclFrame.cc:444
EclFrame(int painter_type, EclData *data, bool auto_display, ECL::ECLChannelMapper *mapper)
Definition: EclFrame.cc:55
void showPrevEvents()
Show previous range of events.
Definition: EclFrame.cc:423
void handleMenu(int id)
Apply action from menu.
Definition: EclFrame.cc:302
virtual ~EclFrame()
ECLFrame destructor.
Definition: EclFrame.cc:83
void changeType(int type, bool redraw=true)
Change EclPainter type when selected in drop-down menu.
Definition: EclFrame.cc:546
void initGUI(int w, int h)
Initialize GUI.
Definition: EclFrame.cc:89
void changeRange(TGListTreeItem *entry, int btn)
Opens shapers of specific crate/channels of specific shaper.
Definition: EclFrame.cc:516
void doDraw()
Get view parameters from GUI and call updateCanvas().
Definition: EclFrame.cc:472
void loadNewData()
Update view of the data.
Definition: EclFrame.cc:377
void updateCanvas()
Redraw m_ecanvas.
Definition: EclFrame.cc:400
void excludeChannel()
Exclude channel specified in the GUI.
Definition: EclFrame.cc:465
void updateEventRange()
Change event range and pass information to m_ecl_data.
Definition: EclFrame.cc:411
Painter for EclData, 1D histograms.
Definition: EclPainter1D.h:24
static EclPainter * createPainter(EclPainterType type, EclData *data, ECL::ECLChannelMapper *mapper, EclData::EclSubsystem subsys=EclData::ALL)
Creates EclPainter of the specified type.
static const char ** getTypeTitles()
Returns array of titles for each EclPainter type.
static int getTypeTitlesCount()
Size of array from getTypeTitles()
Painter for EclData, parent class, created with EclPainterFactory.
Definition: EclPainter.h:29
virtual EclPainter * handleClick(int px, int py)
Some EclPainters can shift to another view upon click.
Definition: EclPainter.cc:79
Widget which contains the dynamic amount of TGLabel objects.
void SetMode(int i)
Changes between display of events (0) and energy (1).
Definition: geometry.cc:15
EclPainterType
Enum for type of EclPainter to create.
@ PAINTER_CHANNEL
Event count/energy distribution per channel.
@ PAINTER_COLLECTOR
Event count/energy distribution per crate/ECLCollector.
@ PAINTER_SHAPER
Event count/energy distribution per shaperDSP.
Abstract base class for different kinds of events.