Belle II Software development
EclPainter.h
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#pragma once
10
11#include <ecl/modules/eclDisplay/EclData.h>
12
13class TString;
14
15namespace Belle2 {
20 class MultilineWidget;
21
22 namespace ECL {
23 class ECLChannelMapper;
24 }
25
29 class EclPainter {
30 public:
35 explicit EclPainter(EclData* data);
37 EclPainter(const EclPainter& other) { cloneFrom(other); }
38 virtual ~EclPainter();
39
41 EclPainter& operator=(const EclPainter& other) { cloneFrom(other); return *this; }
42
44 void setData(EclData* data) { m_ecl_data = data; }
46 EclData* getData() { return m_ecl_data; }
48 const EclData* getData() const { return m_ecl_data; }
49
53 void setMapper(ECL::ECLChannelMapper* mapper);
58
68
73
81 virtual void getInformation(int px, int py, MultilineWidget* panel);
82
89 virtual EclPainter* handleClick(int px, int py);
90
94 virtual void setXRange(int x1, int x2);
95
99 virtual void Draw() = 0;
100
101 protected:
105 void getNewRootObjectName(char* buf, int size);
106
107 private:
109 static int m_obj_counter;
114
117
121 void cloneFrom(const EclPainter& other);
122 };
124}
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
EclSubsystem
Subsystems of ECL: ALL all subsystems BARR barrel only FORW forward endcap only BACKW backward endcap...
Definition: EclData.h:98
Painter for EclData, parent class, created with EclPainterFactory.
Definition: EclPainter.h:29
ECL::ECLChannelMapper * m_mapper
mapper for CellID <-> (crate, shaper, chid) conversion.
Definition: EclPainter.h:113
EclPainter & operator=(const EclPainter &other)
Assignment operator.
Definition: EclPainter.h:41
EclData::EclSubsystem getDisplayedSubsystem()
Get currently displayed ECL subsystem.
Definition: EclPainter.cc:51
virtual void getInformation(int px, int py, MultilineWidget *panel)
Sets the information to be displayed in the provided MultilineWidget.
Definition: EclPainter.cc:72
EclData * getData()
Return currently displayed EclData.
Definition: EclPainter.h:46
const EclData * getData() const
Return currently displayed EclData.
Definition: EclPainter.h:48
void cloneFrom(const EclPainter &other)
Clone attributes from other EclPainter.
Definition: EclPainter.cc:93
void setMapper(ECL::ECLChannelMapper *mapper)
Set ECLChannelMapper for CellID <-> (crate, shaper, chid) conversion.
Definition: EclPainter.cc:36
virtual void Draw()=0
Redraw the canvas.
TString getSubsystemTitle(EclData::EclSubsystem subsys)
Return title of ECL subsystem to use in painter.
Definition: EclPainter.cc:56
void getNewRootObjectName(char *buf, int size)
Make unique name for next root object.
Definition: EclPainter.cc:88
static int m_obj_counter
Counter to make unique names for new root objects.
Definition: EclPainter.h:109
virtual EclPainter * handleClick(int px, int py)
Some EclPainters can shift to another view upon click.
Definition: EclPainter.cc:79
void setDisplayedSubsystem(EclData::EclSubsystem sys)
Change between the displayed ECL subsystem (barrel, forward and backward endcaps).
Definition: EclPainter.cc:46
ECL::ECLChannelMapper * getMapper()
Return currently set ECLChannelMapper.
Definition: EclPainter.cc:41
void setData(EclData *data)
Set EclData to display in painter.
Definition: EclPainter.h:44
virtual void setXRange(int x1, int x2)
Set XRange for histogram in EclPainter.
Definition: EclPainter.cc:84
EclData * m_ecl_data
Data to draw.
Definition: EclPainter.h:111
EclData::EclSubsystem displayed_subsys
Identifier of displayed ECL subsystem.
Definition: EclPainter.h:116
EclPainter(const EclPainter &other)
Copy constructor.
Definition: EclPainter.h:37
Widget which contains the dynamic amount of TGLabel objects.
Abstract base class for different kinds of events.