Belle II Software  release-05-01-25
EclPainter.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/EclPainter.h>
12 
13 //Root
14 #include <TString.h>
15 
16 //ECL
17 #include <ecl/utility/ECLChannelMapper.h>
18 #include <ecl/modules/eclDisplay/MultilineWidget.h>
19 
20 using namespace Belle2;
21 using namespace ECL;
22 
24 
26  m_mapper(0)
27 {
28  setData(data);
29  displayed_subsys = EclData::ALL;
30 }
31 
32 EclPainter::~EclPainter()
33 {
34 
35 }
36 
38 {
39  m_mapper = mapper;
40 }
41 
43 {
44  return m_mapper;
45 }
46 
48 {
49  displayed_subsys = sys;
50 }
51 
53 {
54  return displayed_subsys;
55 }
56 
58 {
59  switch (subsys) {
60  case EclData::BARR:
61  return TString("Barrel");
62  case EclData::FORW:
63  return TString("Forward endcap");
64  case EclData::BACKW:
65  return TString("Backward endcap");
66  case EclData::ALL:
67  return TString("Full ECL");
68  default:
69  return TString();
70  }
71 }
72 
74 {
75  char info[255];
76  sprintf(info, "energy emission = %.2f MeV", m_ecl_data->getEnergyTotal());
77  panel->setLine(0, info);
78 }
79 
81 {
82  return NULL;
83 }
84 
85 void EclPainter::setXRange(int, int)
86 {
87 }
88 
89 void EclPainter::getNewRootObjectName(char* buf, int n)
90 {
91  snprintf(buf, n, "ECL DATA_%d", m_obj_counter++);
92 }
93 
95 {
96  m_ecl_data = new EclData(*other.m_ecl_data);
97  m_mapper = other.m_mapper;
99 }
100 
Belle2::MultilineWidget::setLine
void setLine(int line_id, const char *text)
Set content of the specified line to 'text'.
Definition: MultilineWidget.cc:68
Belle2::EclPainter::displayed_subsys
EclData::EclSubsystem displayed_subsys
Identifier of displayed ECL subsystem.
Definition: EclPainter.h:117
Belle2::EclPainter::cloneFrom
void cloneFrom(const EclPainter &other)
Clone attributes from other EclPainter.
Definition: EclPainter.cc:94
Belle2::EclPainter::setData
void setData(EclData *data)
Set EclData to display in painter.
Definition: EclPainter.h:46
Belle2::EclPainter::setDisplayedSubsystem
void setDisplayedSubsystem(EclData::EclSubsystem sys)
Change between the displayed ECL subsystem (barrel, forward and backward endcaps).
Definition: EclPainter.cc:47
Belle2::EclPainter::getDisplayedSubsystem
EclData::EclSubsystem getDisplayedSubsystem()
Get currently displayed ECL subsystem.
Definition: EclPainter.cc:52
Belle2::EclPainter::getInformation
virtual void getInformation(int px, int py, MultilineWidget *panel)
Sets the information to be displayed in the provided MultilineWidget.
Definition: EclPainter.cc:73
Belle2::EclPainter::EclPainter
EclPainter(EclData *data)
Default constructor.
Definition: EclPainter.cc:25
Belle2::EclPainter
Painter for EclData, parent class, created with EclPainterFactory.
Definition: EclPainter.h:31
Belle2::EclData::EclSubsystem
EclSubsystem
Subsystems of ECL: ALL all subsystems BARR barrel only FORW forward endcap only BACKW backward endcap...
Definition: EclData.h:108
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::EclPainter::setMapper
void setMapper(ECL::ECLChannelMapper *mapper)
Set ECLChannelMapper for CellID <-> (crate, shaper, chid) conversion.
Definition: EclPainter.cc:37
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::EclPainter::getNewRootObjectName
void getNewRootObjectName(char *buf, int size)
Make unique name for next root object.
Definition: EclPainter.cc:89
Belle2::MultilineWidget
Widget which contains the dynamic amount of TGLabel objects.
Definition: MultilineWidget.h:32
Belle2::EclPainter::setXRange
virtual void setXRange(int x1, int x2)
Set XRange for histogram in EclPainter.
Definition: EclPainter.cc:85
Belle2::EclPainter::handleClick
virtual EclPainter * handleClick(int px, int py)
Some EclPainters can shift to another view upon click.
Definition: EclPainter.cc:80
Belle2::EclPainter::m_mapper
ECL::ECLChannelMapper * m_mapper
mapper for CellID <-> (crate, shaper, chid) conversion.
Definition: EclPainter.h:114
Belle2::EclPainter::getSubsystemTitle
TString getSubsystemTitle(EclData::EclSubsystem subsys)
Return title of ECL subsystem to use in painter.
Definition: EclPainter.cc:57
Belle2::EclPainter::getMapper
ECL::ECLChannelMapper * getMapper()
Return currently set ECLChannelMapper.
Definition: EclPainter.cc:42
Belle2::EclData
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
Definition: EclData.h:41
Belle2::EclPainter::m_obj_counter
static int m_obj_counter
Counter to make unique names for new root objects.
Definition: EclPainter.h:110
Belle2::EclData::getEnergyTotal
float getEnergyTotal()
Definition: EclData.cc:188
Belle2::EclPainter::m_ecl_data
EclData * m_ecl_data
Data to draw.
Definition: EclPainter.h:112