 |
Belle II Software
release-05-01-25
|
11 #include <ecl/modules/eclDisplay/EclPainter2D.h>
19 #include <ecl/modules/eclDisplay/geometry.h>
20 #include <ecl/utility/ECLChannelMapper.h>
21 #include <ecl/modules/eclDisplay/MultilineWidget.h>
28 using namespace ECLDisplayUtility;
40 m_hist =
new TH2F(obj_name,
"title", max_x, 1, max_x + 1,
43 m_hist->GetXaxis()->CenterTitle();
44 m_hist->GetXaxis()->SetTitleOffset(1.1);
45 m_hist->GetYaxis()->CenterTitle();
46 m_hist->GetYaxis()->SetTitleOffset(-1.1);
47 m_hist->GetZaxis()->CenterTitle();
72 const char* name[3][3] = {
73 {
"Events per channel",
"Events per shaper"},
74 {
"Energy per channel (MeV)",
"Energy per shaper (MeV)"},
75 {
"Time per channel (ns)",
"Time per shaper (ns)"}
77 const char* zname[3] = {
78 "Events",
"Energy (MeV)",
"Time"
81 TString title = TString(name[GetMode()][(
int)
m_type]) +
" (" +
87 m_hist->GetXaxis()->SetTitle(
"Theta id");
88 m_hist->GetYaxis()->SetTitle(
"Phi id");
91 m_hist->GetXaxis()->SetTitle(
"Shaper id");
92 m_hist->GetYaxis()->SetTitle(
"Collector id");
94 m_hist->GetZaxis()->SetTitle(zname[GetMode()]);
138 grid =
new TPad(
"grid",
"", 0, 0, 1, 1);
140 grid->SetRightMargin(gPad->GetRightMargin());
142 grid->SetFillStyle(4000);
143 grid->SetFrameFillStyle(0);
148 TVirtualPad*
main = gPad;
161 while (max_y >= 100) {
167 hgrid->GetYaxis()->SetNdivisions(max_y);
169 hgrid->GetYaxis()->SetLabelOffset(1e3);
170 hgrid->GetXaxis()->SetLabelOffset(1e3);
172 hgrid->GetYaxis()->SetTickLength(0.);
173 hgrid->GetXaxis()->SetTickLength(0.);
186 Float_t upx = gPad->AbsPixeltoX(px);
187 Float_t x = gPad->PadtoX(upx);
188 int binx =
m_hist->GetXaxis()->FindBin(x);
190 Float_t upy = gPad->AbsPixeltoY(py);
191 Float_t y = gPad->PadtoY(upy);
192 int biny =
m_hist->GetYaxis()->FindBin(y);
195 sprintf(info,
"theta_id = %d", binx);
197 sprintf(info,
"phi_id = %d", biny);
199 sprintf(info,
"channel_id = %d",
getData()->getChannel(biny, binx));
203 sprintf(info,
"crate_id = %d", biny);
205 sprintf(info,
"shaper_id = %d (%d)", (biny - 1) * 12 + binx, binx);
225 const int* ev_counts = data->getEventCounts();
226 const float* energy_sums = data->getEnergySums();
235 m_hist->Fill(id_x, id_y, energy_sums[i]);
237 m_hist->Fill(id_x, id_y, ev_counts[i]);
240 gStyle->SetNumberContours(255);
241 gStyle->SetPalette(PALETTE_ID);
243 m_hist->GetXaxis()->SetTicks(
"+-");
244 m_hist->GetYaxis()->SetTicks(
"+-");
@ CHANNEL_2D
(theta_id:phi_id) histogram.
Type m_type
Display subtypes of this class.
Type
Subtype of histogram to draw.
int getCrateID(int iCOPPERNode, int iFINESSE)
get crate number by given COPPER node number and FINESSE number
Type getType()
Return subtype of ECLPainter2D.
int getShaperPosition(int cellID)
get position of the shaper in the crate by given CellId
EclData * getData()
Return currently displayed EclData.
TH2F * m_hist
Displayed histogram.
EclData::EclSubsystem getDisplayedSubsystem()
Get currently displayed ECL subsystem.
int getMaxX()
Returns number of X bins.
int getPhiId(int ch)
ECL CellId -> phi_id.
void setTitles()
Update histogram titles.
TPad * grid
Grid pad, drawn in drawGrid().
virtual void getInformation(int px, int py, MultilineWidget *panel)
Sets the information to be displayed in the provided MultilineWidget.
Painter for EclData, parent class, created with EclPainterFactory.
Painter for EclData, 2D histograms.
int main(int argc, char **argv)
Run all tests.
Abstract base class for different kinds of events.
void getNewRootObjectName(char *buf, int size)
Make unique name for next root object.
int getMaxY()
Returns number of Y bins.
~EclPainter2D()
Destructor for EclPainter subclass.
void initGrid()
Initialize grid for drawGrid().
static int getCrystalCount()
Get number of crystals in ECL.
virtual void Draw() override
Redraw the canvas.
void cloneFrom(const EclPainter2D &other)
Clone attributes from other EclPainter2D.
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.
TH2C * hgrid
The grid itself, drawn in drawGrid().
int channelToSegIdY(int channel)
Convert channel id to Y bin number.
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
@ SHAPER_2D
(shaper:crate) histogram.
virtual void getInformation(int px, int py, MultilineWidget *panel) override
Sets the information to be displayed in the provided MultilineWidget.
EclPainter2D(EclData *data, Type type)
Constructor for EclPainter subclass.
int channelToSegIdX(int channel)
Convert channel id to X bin number.
void drawGrid()
Draw grid over histogram.