Belle II Software  release-05-01-25
EclPainter2D.h
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 
11 #pragma once
12 
13 //ECL
14 #include <ecl/modules/eclDisplay/EclPainter.h>
15 
16 class TH2C;
17 class TH2F;
18 class TPad;
19 
20 namespace Belle2 {
28  class EclPainter2D : public EclPainter {
29  public:
31  enum Type {
34  NONE
35  };
36 
40  EclPainter2D(EclData* data, Type type);
41 
45  EclPainter2D(const EclPainter2D& other) : EclPainter(other) { cloneFrom(other); }
49  EclPainter2D& operator=(const EclPainter2D& other) { cloneFrom(other); return *this; }
50 
54  ~EclPainter2D();
55 
56  private:
60  TH2F* m_hist;
61 
63  TH2C* hgrid;
65  TPad* grid;
66 
70  void cloneFrom(const EclPainter2D& other);
74  void setTitles();
78  int getMaxX();
82  int getMaxY();
86  int channelToSegIdX(int channel);
90  int channelToSegIdY(int channel);
94  void initGrid();
98  void drawGrid();
99 
100  public:
106  virtual void getInformation(int px, int py, MultilineWidget* panel) override;
107 
111  Type getType();
112 
116  virtual void Draw() override;
117  };
119 }
Belle2::EclPainter2D::CHANNEL_2D
@ CHANNEL_2D
(theta_id:phi_id) histogram.
Definition: EclPainter2D.h:32
Belle2::EclPainter2D::m_type
Type m_type
Display subtypes of this class.
Definition: EclPainter2D.h:58
Belle2::EclPainter2D::Type
Type
Subtype of histogram to draw.
Definition: EclPainter2D.h:31
Belle2::EclPainter2D::getType
Type getType()
Return subtype of ECLPainter2D.
Definition: EclPainter2D.cc:210
Belle2::EclPainter2D::m_hist
TH2F * m_hist
Displayed histogram.
Definition: EclPainter2D.h:60
Belle2::EclPainter2D::getMaxX
int getMaxX()
Returns number of X bins.
Definition: EclPainter2D.cc:97
Belle2::EclPainter2D::setTitles
void setTitles()
Update histogram titles.
Definition: EclPainter2D.cc:70
Belle2::EclPainter2D::grid
TPad * grid
Grid pad, drawn in drawGrid().
Definition: EclPainter2D.h:65
Belle2::EclPainter
Painter for EclData, parent class, created with EclPainterFactory.
Definition: EclPainter.h:31
Belle2::EclPainter2D
Painter for EclData, 2D histograms.
Definition: EclPainter2D.h:28
Belle2::EclPainter2D::operator=
EclPainter2D & operator=(const EclPainter2D &other)
Assignment operator.
Definition: EclPainter2D.h:49
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::EclPainter2D::getMaxY
int getMaxY()
Returns number of Y bins.
Definition: EclPainter2D.cc:106
Belle2::MultilineWidget
Widget which contains the dynamic amount of TGLabel objects.
Definition: MultilineWidget.h:32
Belle2::EclPainter2D::~EclPainter2D
~EclPainter2D()
Destructor for EclPainter subclass.
Definition: EclPainter2D.cc:53
Belle2::EclPainter2D::initGrid
void initGrid()
Initialize grid for drawGrid().
Definition: EclPainter2D.cc:135
Belle2::EclPainter2D::Draw
virtual void Draw() override
Redraw the canvas.
Definition: EclPainter2D.cc:219
Belle2::EclPainter2D::cloneFrom
void cloneFrom(const EclPainter2D &other)
Clone attributes from other EclPainter2D.
Definition: EclPainter2D.cc:61
Belle2::EclPainter2D::hgrid
TH2C * hgrid
The grid itself, drawn in drawGrid().
Definition: EclPainter2D.h:63
Belle2::EclPainter2D::EclPainter2D
EclPainter2D(const EclPainter2D &other)
Copy constructor.
Definition: EclPainter2D.h:45
Belle2::EclPainter2D::channelToSegIdY
int channelToSegIdY(int channel)
Convert channel id to Y bin number.
Definition: EclPainter2D.cc:125
Belle2::EclData
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
Definition: EclData.h:41
Belle2::EclPainter2D::SHAPER_2D
@ SHAPER_2D
(shaper:crate) histogram.
Definition: EclPainter2D.h:33
Belle2::EclPainter2D::getInformation
virtual void getInformation(int px, int py, MultilineWidget *panel) override
Sets the information to be displayed in the provided MultilineWidget.
Definition: EclPainter2D.cc:180
Belle2::EclPainter2D::EclPainter2D
EclPainter2D(EclData *data, Type type)
Constructor for EclPainter subclass.
Definition: EclPainter2D.cc:30
Belle2::EclPainter2D::channelToSegIdX
int channelToSegIdX(int channel)
Convert channel id to X bin number.
Definition: EclPainter2D.cc:116
Belle2::EclPainter2D::drawGrid
void drawGrid()
Draw grid over histogram.
Definition: EclPainter2D.cc:146