9#include <ecl/modules/eclDisplay/EclPainterPolar.h>
19#include <ecl/modules/eclDisplay/geometry.h>
23using namespace ECLDisplayUtility;
32 m_hist =
new TH2F(obj_name,
"title",
33 60, 0.0, 1.0, 60, 0.0, 1.0);
35 Double_t deg2rad = TMath::Pi() / 180;
40 for (
int i = 0; i < 36; i++) {
41 m_segs[i] =
new TCrown(0.5, 0.5, 0.3, 0.4, (i - 9) * 10, (i - 8) * 10);
43 float x = 0.475 + 0.45 * TMath::Cos(deg2rad * (i - 9) * 10);
44 float y = 0.48 + 0.44 * TMath::Sin(deg2rad * (i - 9) * 10);
45 snprintf(label_txt, 32,
"%d", i * 10);
46 m_labels[i] =
new TText(x, y, label_txt);
61 for (
int i = 0; i < 36; i++) {
m_segs[i] = other.
m_segs[i]; }
70 else if (
m_type == THETA) {
74 return 3 + theta_id * 12 / 23;
76 return 21 + (theta_id - 23) * 12 / 23;
84 const char* name[2][2] = {
85 {
"Events per phi",
"Events per theta"},
86 {
"Energy per phi",
"Energy per theta"}
88 const char* zname[2] = {
"Event count",
"Energy (MeV)"};
95 m_hist->GetZaxis()->CenterTitle();
113 const int* ev_counts = data->getEventCounts();
114 const float* energy_sums = data->getEnergySums();
118 for (
int i = 0; i < 36; i++)
125 seg_val[id] += energy_sums[i];
127 seg_val[id] += ev_counts[i];
131 float min = seg_val[0];
132 for (
int i = 0; i < 36; i++) {
133 if (max < seg_val[i])
135 if (min > seg_val[i])
139 Double_t r[5] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
140 Double_t g[5] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
141 Double_t b[5] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
142 Double_t stop[5] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
144 int palette = TColor::CreateGradientColorTable(5, stop, r, g, b, 37);
146 m_hist->Fill(0.5, 0.05, 0.1);
151 for (
int i = 0; i < 36; i++) {
152 float val = 36.0 * TMath::Log(1 + seg_val[i]) / TMath::Log(1 + max);
153 segs[i]->SetFillColor(palette + val);
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
int getThetaId(int ch)
ECL CellId -> theta_id.
int getPhiId(int ch)
ECL CellId -> phi_id.
static int getCrystalCount()
Get number of crystals in ECL.
Painter for EclData, polar energy/event_count distribution.
Type m_type
Type for polar histogram.
Type
Type for polar histogram.
void setTitles()
Update titles of the histogram.
EclPainterPolar(EclData *data, Type type)
Constructor for EclPainter subclass.
int channelToSegId(int channel)
Convert ECL channel id to id of the phi (theta) segment.
void cloneFrom(const EclPainterPolar &other)
Clone attributes from other EclPainterPolar.
virtual void getInformation(int px, int py, MultilineWidget *panel) override
Sets the information to be displayed in the provided MultilineWidget.
Type getType()
Return subtype of ECLPainterPolar.
TText ** m_labels
Labels for phi segments.
TCrown ** m_segs
Phi (or theta) segments of the ECL.
TH2F * m_hist
Histogram that generates Z-axis.
~EclPainterPolar()
Destructor for EclPainter subclass.
virtual void Draw() override
Redraw the canvas.
Painter for EclData, parent class, created with EclPainterFactory.
EclData::EclSubsystem getDisplayedSubsystem()
Get currently displayed ECL subsystem.
virtual void getInformation(int px, int py, MultilineWidget *panel)
Sets the information to be displayed in the provided MultilineWidget.
EclData * getData()
Return currently displayed EclData.
TString getSubsystemTitle(EclData::EclSubsystem subsys)
Return title of ECL subsystem to use in painter.
void getNewRootObjectName(char *buf, int size)
Make unique name for next root object.
int GetMode()
Returns current displayed mode (0 shows event count, 1 shows total energy)
Abstract base class for different kinds of events.