Belle II Software  release-08-01-10
EclPainter2D.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 //ECL
12 #include <ecl/modules/eclDisplay/EclPainter.h>
13 
14 class TH2C;
15 class TH2F;
16 class TPad;
17 
18 namespace Belle2 {
26  class EclPainter2D : public EclPainter {
27  public:
29  enum Type {
32  NONE
33  };
34 
38  EclPainter2D(EclData* data, Type type);
39 
43  EclPainter2D(const EclPainter2D& other) : EclPainter(other) { cloneFrom(other); }
47  EclPainter2D& operator=(const EclPainter2D& other) { cloneFrom(other); return *this; }
48 
52  ~EclPainter2D();
53 
54  private:
58  TH2F* m_hist;
59 
61  TH2C* hgrid;
63  TPad* grid;
64 
68  void cloneFrom(const EclPainter2D& other);
72  void setTitles();
76  int getMaxX();
80  int getMaxY();
84  int channelToSegIdX(int channel);
88  int channelToSegIdY(int channel);
92  void initGrid();
96  void drawGrid();
97 
98  public:
105  virtual void getInformation(int px, int py, MultilineWidget* panel) override;
106 
110  Type getType();
111 
115  virtual void Draw() override;
116  };
118 }
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
Definition: EclData.h:31
Painter for EclData, 2D histograms.
Definition: EclPainter2D.h:26
~EclPainter2D()
Destructor for EclPainter subclass.
Definition: EclPainter2D.cc:52
Type m_type
Display subtypes of this class.
Definition: EclPainter2D.h:56
void cloneFrom(const EclPainter2D &other)
Clone attributes from other EclPainter2D.
Definition: EclPainter2D.cc:60
int channelToSegIdX(int channel)
Convert channel id to X bin number.
Type
Subtype of histogram to draw.
Definition: EclPainter2D.h:29
@ CHANNEL_2D
(theta_id:phi_id) histogram.
Definition: EclPainter2D.h:30
@ SHAPER_2D
(shaper:crate) histogram.
Definition: EclPainter2D.h:31
int getMaxX()
Returns number of X bins.
Definition: EclPainter2D.cc:96
EclPainter2D & operator=(const EclPainter2D &other)
Assignment operator.
Definition: EclPainter2D.h:47
void setTitles()
Update histogram titles.
Definition: EclPainter2D.cc:69
TH2C * hgrid
The grid itself, drawn in drawGrid().
Definition: EclPainter2D.h:61
virtual void getInformation(int px, int py, MultilineWidget *panel) override
Sets the information to be displayed in the provided MultilineWidget.
void initGrid()
Initialize grid for drawGrid().
Type getType()
Return subtype of ECLPainter2D.
int channelToSegIdY(int channel)
Convert channel id to Y bin number.
TPad * grid
Grid pad, drawn in drawGrid().
Definition: EclPainter2D.h:63
void drawGrid()
Draw grid over histogram.
int getMaxY()
Returns number of Y bins.
EclPainter2D(EclData *data, Type type)
Constructor for EclPainter subclass.
Definition: EclPainter2D.cc:29
TH2F * m_hist
Displayed histogram.
Definition: EclPainter2D.h:58
EclPainter2D(const EclPainter2D &other)
Copy constructor.
Definition: EclPainter2D.h:43
virtual void Draw() override
Redraw the canvas.
Painter for EclData, parent class, created with EclPainterFactory.
Definition: EclPainter.h:29
Widget which contains the dynamic amount of TGLabel objects.
Abstract base class for different kinds of events.