Belle II Software  release-05-01-25
EclPainter1D Class Reference

Painter for EclData, 1D histograms. More...

#include <EclPainter1D.h>

Inheritance diagram for EclPainter1D:
Collaboration diagram for EclPainter1D:

Public Types

enum  Type {
  CHANNEL,
  SHAPER,
  CRATE,
  PHI,
  THETA
}
 Subtype of histogram to draw. More...
 

Public Member Functions

 EclPainter1D (EclData *data, Type type)
 Constructor for EclPainter subclass.
 
virtual ~EclPainter1D ()
 Destructor for EclPainter subclass.
 
virtual void getInformation (int px, int py, MultilineWidget *panel) override
 Sets the information to be displayed in the provided MultilineWidget. More...
 
Type getType ()
 Return subtype of ECLPainter1D.
 
virtual EclPainterhandleClick (int px, int py) override
 Creates sub-histogram for crates and shapers. More...
 
void setXRange (int xmin, int xmax) override
 Set XRange for histogram.
 
void setShaper (int crate, int shaper)
 Show data only from specific shaper. More...
 
void setCrate (int crate)
 Show data only from specific crate. More...
 
void Draw () override
 Redraw the canvas.
 
void setData (EclData *data)
 Set EclData to display in painter. More...
 
EclDatagetData ()
 Return currently displayed EclData.
 
const EclDatagetData () const
 Return currently displayed EclData.
 
void setMapper (ECL::ECLChannelMapper *mapper)
 Set ECLChannelMapper for CellID <-> (crate, shaper, chid) conversion.
 
ECL::ECLChannelMappergetMapper ()
 Return currently set ECLChannelMapper.
 
void setDisplayedSubsystem (EclData::EclSubsystem sys)
 Change between the displayed ECL subsystem (barrel, forward and backward endcaps).
 
EclData::EclSubsystem getDisplayedSubsystem ()
 Get currently displayed ECL subsystem.
 
TString getSubsystemTitle (EclData::EclSubsystem subsys)
 Return title of ECL subsystem to use in painter.
 

Protected Member Functions

void getNewRootObjectName (char *buf, int size)
 Make unique name for next root object.
 

Private Member Functions

int channelToSegId (int channel)
 Convert channel id to X bin number.
 
int getMaxX ()
 Returns number of X bins.
 
void initHisto ()
 Initialize histogram.
 
void setTitles ()
 Update titles of the histogram.
 
void cloneFrom (const EclPainter &other)
 Clone attributes from other EclPainter.
 

Private Attributes

Type m_type
 Display subtypes of this class.
 
TH1F * m_hist
 Displayed histogram.
 
int m_shaper
 ID of currently selected shaper.
 
int m_crate
 ID of currently selected crate.
 
EclDatam_ecl_data
 Data to draw.
 
ECL::ECLChannelMapperm_mapper
 mapper for CellID <-> (crate, shaper, chid) conversion.
 
EclData::EclSubsystem displayed_subsys
 Identifier of displayed ECL subsystem.
 

Static Private Attributes

static int m_obj_counter = 0
 Counter to make unique names for new root objects.
 

Detailed Description

Painter for EclData, 1D histograms.

Definition at line 26 of file EclPainter1D.h.

Member Enumeration Documentation

◆ Type

enum Type

Subtype of histogram to draw.

Enumerator
CHANNEL 

Events/energy per channel.

SHAPER 

Events/energy per ShaperDSP.

CRATE 

Events/energy per crate/ECLCollector.

Definition at line 29 of file EclPainter1D.h.

29  {
30  CHANNEL,
31  SHAPER,
32  CRATE,
33  PHI,
34  THETA
35  };

Member Function Documentation

◆ getInformation()

void getInformation ( int  px,
int  py,
MultilineWidget panel 
)
overridevirtual

Sets the information to be displayed in the provided MultilineWidget.

Parameters
pxX coordinate of mouse cursor.
pyY coordinate of mouse cursor.

Reimplemented from EclPainter.

Definition at line 126 of file EclPainter1D.cc.

127 {
128  EclPainter::getInformation(px, py, panel);
129 
130  char info[255];
131 
132  Float_t upx = gPad->AbsPixeltoX(px);
133  Float_t x = gPad->PadtoX(upx);
134  int binx = m_hist->GetXaxis()->FindBin(x) - 1;
135 
136  if (m_type == CHANNEL) {
137  sprintf(info, "channel_id = %d (%d)", binx,
138  getMapper()->getShaperChannel(binx));
139  panel->setLine(1, info);
140  sprintf(info, "shaper_id = %d", getMapper()->getShaperPosition(binx));
141  panel->setLine(2, info);
142  sprintf(info, "crate_id = %d", getMapper()->getCrateID(binx));
143  panel->setLine(3, info);
144  }
145  if (m_type == SHAPER) {
146  sprintf(info, "shaper_id = %d (%d)", binx, (binx - 1) % 12 + 1);
147  panel->setLine(1, info);
148  sprintf(info, "crate_id = %d", (binx - 1) / 12 + 1);
149  panel->setLine(2, info);
150  }
151  if (m_type == CRATE) {
152  sprintf(info, "crate_id = %d", binx);
153  panel->setLine(1, info);
154  }
155  if (m_type == PHI) {
156  sprintf(info, "phi_id = %d", binx);
157  panel->setLine(1, info);
158  }
159  if (m_type == THETA) {
160  sprintf(info, "theta_id = %d", binx);
161  panel->setLine(1, info);
162  }
163 }

◆ handleClick()

EclPainter * handleClick ( int  px,
int  py 
)
overridevirtual

Creates sub-histogram for crates and shapers.

This function is called upon click in EclFrame.

Reimplemented from EclPainter.

Definition at line 170 of file EclPainter1D.cc.

◆ setCrate()

void setCrate ( int  crate)

Show data only from specific crate.

Show data for all crates if param 'crate' < 0.

Definition at line 212 of file EclPainter1D.cc.

◆ setData()

void setData ( EclData data)
inlineinherited

Set EclData to display in painter.


Definition at line 46 of file EclPainter.h.

◆ setShaper()

void setShaper ( int  crate,
int  shaper 
)

Show data only from specific shaper.

Show data for all shapers if on of the arguments is negative.

Definition at line 206 of file EclPainter1D.cc.


The documentation for this class was generated from the following files:
Belle2::EclPainter1D::CHANNEL
@ CHANNEL
Events/energy per channel.
Definition: EclPainter1D.h:30
Belle2::EclPainter1D::SHAPER
@ SHAPER
Events/energy per ShaperDSP.
Definition: EclPainter1D.h:31
Belle2::MultilineWidget::setLine
void setLine(int line_id, const char *text)
Set content of the specified line to 'text'.
Definition: MultilineWidget.cc:68
Belle2::EclPainter1D::CRATE
@ CRATE
Events/energy per crate/ECLCollector.
Definition: EclPainter1D.h:32
Belle2::EclPainter1D::m_hist
TH1F * m_hist
Displayed histogram.
Definition: EclPainter1D.h:50
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::EclPainter1D::m_type
Type m_type
Display subtypes of this class.
Definition: EclPainter1D.h:48
Belle2::EclPainter::getMapper
ECL::ECLChannelMapper * getMapper()
Return currently set ECLChannelMapper.
Definition: EclPainter.cc:42