Belle II Software  release-06-01-15
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 
13 class TString;
14 
15 namespace 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 
80  virtual void getInformation(int px, int py, MultilineWidget* panel);
81 
88  virtual EclPainter* handleClick(int px, int py);
89 
93  virtual void setXRange(int x1, int x2);
94 
98  virtual void Draw() = 0;
99 
100  protected:
104  void getNewRootObjectName(char* buf, int size);
105 
106  private:
108  static int m_obj_counter;
113 
116 
120  void cloneFrom(const EclPainter& other);
121  };
123 }
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:112
EclData * getData()
Return currently displayed EclData.
Definition: EclPainter.h:46
EclData::EclSubsystem getDisplayedSubsystem()
Get currently displayed ECL subsystem.
Definition: EclPainter.cc:50
EclPainter & operator=(const EclPainter &other)
Assignment operator.
Definition: EclPainter.h:41
virtual void getInformation(int px, int py, MultilineWidget *panel)
Sets the information to be displayed in the provided MultilineWidget.
Definition: EclPainter.cc:71
void cloneFrom(const EclPainter &other)
Clone attributes from other EclPainter.
Definition: EclPainter.cc:92
void setMapper(ECL::ECLChannelMapper *mapper)
Set ECLChannelMapper for CellID <-> (crate, shaper, chid) conversion.
Definition: EclPainter.cc:35
virtual void Draw()=0
Redraw the canvas.
TString getSubsystemTitle(EclData::EclSubsystem subsys)
Return title of ECL subsystem to use in painter.
Definition: EclPainter.cc:55
const EclData * getData() const
Return currently displayed EclData.
Definition: EclPainter.h:48
void getNewRootObjectName(char *buf, int size)
Make unique name for next root object.
Definition: EclPainter.cc:87
static int m_obj_counter
Counter to make unique names for new root objects.
Definition: EclPainter.h:108
virtual EclPainter * handleClick(int px, int py)
Some EclPainters can shift to another view upon click.
Definition: EclPainter.cc:78
void setDisplayedSubsystem(EclData::EclSubsystem sys)
Change between the displayed ECL subsystem (barrel, forward and backward endcaps).
Definition: EclPainter.cc:45
EclPainter(EclData *data)
Default constructor.
Definition: EclPainter.cc:23
ECL::ECLChannelMapper * getMapper()
Return currently set ECLChannelMapper.
Definition: EclPainter.cc:40
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:83
EclData * m_ecl_data
Data to draw.
Definition: EclPainter.h:110
EclData::EclSubsystem displayed_subsys
Identifier of displayed ECL subsystem.
Definition: EclPainter.h:115
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.