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