 |
Belle II Software
release-05-01-25
|
12 #include <ecl/modules/eclDisplay/EclPainter1D.h>
19 #include <ecl/modules/eclDisplay/geometry.h>
20 #include <ecl/utility/ECLChannelMapper.h>
21 #include <ecl/modules/eclDisplay/MultilineWidget.h>
24 using namespace ECLDisplayUtility;
32 m_hist->GetXaxis()->CenterTitle();
33 m_hist->GetXaxis()->SetTitleOffset(1.1);
34 m_hist->GetYaxis()->SetTitleOffset(1.1);
93 const char* name[3][5] = {
95 "Events per channel",
"Events per shaper",
"Events per collector",
96 "Events per phi_id",
"Events per theta_id"
100 "Energy per channel (MeV)",
"Energy per shaper (MeV)",
"Energy per collector (MeV)"
101 "Energy per phi_id (MeV)",
"Energy per theta_id (MeV)"
105 "Time per channel (ns)",
"Time per shaper (ns)",
"Time per collector (ns)",
106 "Time per phi_id (ns)",
"Time per theta_id (ns)"
109 const char* xname[3] = {
110 "Channel id",
"Shaper id",
"Collector id"
112 const char* yname[3] = {
113 "Events",
"Energy",
"Time"
116 TString title = TString(name[GetMode()][(
int)
m_type]) +
" (" +
118 const char* xtitle = xname[(int)
m_type];
119 const char* ytitle = yname[GetMode()];
122 m_hist->SetXTitle(xtitle);
123 m_hist->SetYTitle(ytitle);
132 Float_t upx = gPad->AbsPixeltoX(px);
133 Float_t x = gPad->PadtoX(upx);
134 int binx =
m_hist->GetXaxis()->FindBin(x) - 1;
137 sprintf(info,
"channel_id = %d (%d)", binx,
140 sprintf(info,
"shaper_id = %d",
getMapper()->getShaperPosition(binx));
142 sprintf(info,
"crate_id = %d",
getMapper()->getCrateID(binx));
146 sprintf(info,
"shaper_id = %d (%d)", binx, (binx - 1) % 12 + 1);
148 sprintf(info,
"crate_id = %d", (binx - 1) / 12 + 1);
152 sprintf(info,
"crate_id = %d", binx);
156 sprintf(info,
"phi_id = %d", binx);
160 sprintf(info,
"theta_id = %d", binx);
172 Float_t upx = gPad->AbsPixeltoX(px);
173 Float_t x = gPad->PadtoX(upx);
174 int binx =
m_hist->GetXaxis()->FindBin(x) - 1;
176 Float_t upy = gPad->AbsPixeltoY(py);
177 Float_t y = gPad->PadtoY(upy);
179 if (y < 0)
return NULL;
186 ret->setShaper((binx - 1) / 12 + 1, (binx - 1) % 12 + 1);
193 ret->setXRange((binx - 1) * 12 + 1, (binx - 1) * 12 + 12);
203 m_hist->GetXaxis()->SetRange(xmin + 1, xmax + 1);
223 const int* ev_counts = data->getEventCounts();
224 const float* energy_sums = data->getEnergySums();
245 m_hist->Fill(
id, energy_sums[i]);
247 m_hist->Fill(
id, ev_counts[i]);
@ CHANNEL
Events/energy per channel.
@ SHAPER
Events/energy per ShaperDSP.
int getMaxX()
Returns number of X bins.
void setTitles()
Update titles of the histogram.
virtual ~EclPainter1D()
Destructor for EclPainter subclass.
@ CRATE
Events/energy per crate/ECLCollector.
void initHisto()
Initialize histogram.
int getCrateID(int iCOPPERNode, int iFINESSE)
get crate number by given COPPER node number and FINESSE number
int getShaperPosition(int cellID)
get position of the shaper in the crate by given CellId
TH1F * m_hist
Displayed histogram.
EclData * getData()
Return currently displayed EclData.
void Draw() override
Redraw the canvas.
EclData::EclSubsystem getDisplayedSubsystem()
Get currently displayed ECL subsystem.
int m_shaper
ID of currently selected shaper.
void setXRange(int xmin, int xmax) override
Set XRange for histogram.
int getPhiId(int ch)
ECL CellId -> phi_id.
virtual void getInformation(int px, int py, MultilineWidget *panel)
Sets the information to be displayed in the provided MultilineWidget.
Type getType()
Return subtype of ECLPainter1D.
Painter for EclData, parent class, created with EclPainterFactory.
Type m_type
Display subtypes of this class.
virtual EclPainter * handleClick(int px, int py) override
Creates sub-histogram for crates and shapers.
virtual void getInformation(int px, int py, MultilineWidget *panel) override
Sets the information to be displayed in the provided MultilineWidget.
Abstract base class for different kinds of events.
void getNewRootObjectName(char *buf, int size)
Make unique name for next root object.
static int getCrystalCount()
Get number of crystals in ECL.
TString getSubsystemTitle(EclData::EclSubsystem subsys)
Return title of ECL subsystem to use in painter.
ECL::ECLChannelMapper * getMapper()
Return currently set ECLChannelMapper.
int getThetaId(int ch)
ECL CellId -> theta_id.
Type
Subtype of histogram to draw.
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
int channelToSegId(int channel)
Convert channel id to X bin number.
int m_crate
ID of currently selected crate.
EclPainter1D(EclData *data, Type type)
Constructor for EclPainter subclass.
Painter for EclData, 1D histograms.
void setCrate(int crate)
Show data only from specific crate.
void setShaper(int crate, int shaper)
Show data only from specific shaper.