Belle II Software  release-08-01-10
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 24 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 27 of file EclPainter1D.h.

27  {
28  CHANNEL,
29  SHAPER,
30  CRATE,
31  PHI,
32  THETA
33  };
@ SHAPER
Events/energy per ShaperDSP.
Definition: EclPainter1D.h:29
@ CRATE
Events/energy per crate/ECLCollector.
Definition: EclPainter1D.h:30
@ CHANNEL
Events/energy per channel.
Definition: EclPainter1D.h:28

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.
panelMultilineWidget to display the information

Reimplemented from EclPainter.

Definition at line 124 of file EclPainter1D.cc.

125 {
126  EclPainter::getInformation(px, py, panel);
127 
128  char info[255];
129 
130  Float_t upx = gPad->AbsPixeltoX(px);
131  Float_t x = gPad->PadtoX(upx);
132  int binx = m_hist->GetXaxis()->FindBin(x) - 1;
133 
134  if (m_type == CHANNEL) {
135  sprintf(info, "channel_id = %d (%d)", binx,
136  getMapper()->getShaperChannel(binx));
137  panel->setLine(1, info);
138  sprintf(info, "shaper_id = %d", getMapper()->getShaperPosition(binx));
139  panel->setLine(2, info);
140  sprintf(info, "crate_id = %d", getMapper()->getCrateID(binx));
141  panel->setLine(3, info);
142  }
143  if (m_type == SHAPER) {
144  sprintf(info, "shaper_id = %d (%d)", binx, (binx - 1) % 12 + 1);
145  panel->setLine(1, info);
146  sprintf(info, "crate_id = %d", (binx - 1) / 12 + 1);
147  panel->setLine(2, info);
148  }
149  if (m_type == CRATE) {
150  sprintf(info, "crate_id = %d", binx);
151  panel->setLine(1, info);
152  }
153  if (m_type == PHI) {
154  sprintf(info, "phi_id = %d", binx);
155  panel->setLine(1, info);
156  }
157  if (m_type == THETA) {
158  sprintf(info, "theta_id = %d", binx);
159  panel->setLine(1, info);
160  }
161 }
Type m_type
Display subtypes of this class.
Definition: EclPainter1D.h:46
TH1F * m_hist
Displayed histogram.
Definition: EclPainter1D.h:48
virtual void getInformation(int px, int py, MultilineWidget *panel)
Sets the information to be displayed in the provided MultilineWidget.
Definition: EclPainter.cc:72
ECL::ECLChannelMapper * getMapper()
Return currently set ECLChannelMapper.
Definition: EclPainter.cc:41
void setLine(int line_id, const char *text)
Set content of the specified line to 'text'.

◆ 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 168 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 210 of file EclPainter1D.cc.

◆ setData()

void setData ( EclData data)
inlineinherited

Set EclData to display in painter.


Definition at line 44 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 204 of file EclPainter1D.cc.


The documentation for this class was generated from the following files: