Belle II Software development
EclPainterFactory Class Reference

Class that implements Factory pattern to create objects inherited from EclPainter. More...

#include <EclPainterFactory.h>

Static Public Member Functions

static EclPaintercreatePainter (EclPainterType type, EclData *data, ECL::ECLChannelMapper *mapper, EclData::EclSubsystem subsys=EclData::ALL)
 Creates EclPainter of the specified type.
 
static const char ** getTypeTitles ()
 Returns array of titles for each EclPainter type.
 
static int getTypeTitlesCount ()
 Size of array from getTypeTitles()
 

Private Member Functions

 EclPainterFactory ()
 Constructor for EclPainterFactory.
 

Static Private Attributes

static const int types_count = PAINTER_SHAPER_2D + 1
 Number of painter types.
 
static const char * titles [types_count]
 Titles for painter types.
 

Detailed Description

Class that implements Factory pattern to create objects inherited from EclPainter.

Definition at line 47 of file EclPainterFactory.h.

Constructor & Destructor Documentation

◆ EclPainterFactory()

EclPainterFactory ( )
private

Constructor for EclPainterFactory.

Definition at line 33 of file EclPainterFactory.cc.

34{
35}

Member Function Documentation

◆ createPainter()

EclPainter * createPainter ( EclPainterType  type,
EclData data,
ECL::ECLChannelMapper mapper,
EclData::EclSubsystem  subsys = EclData::ALL 
)
static

Creates EclPainter of the specified type.

It will show data from EclData specific to its type.

Definition at line 37 of file EclPainterFactory.cc.

40{
41 EclPainter* painter = 0;
42 switch (type) {
43 case PAINTER_PHI:
44 painter = new EclPainterPolar(data, EclPainterPolar::PHI);
45 break;
46 case PAINTER_CHANNEL:
47 painter = new EclPainter1D(data, EclPainter1D::CHANNEL);
48 break;
49 case PAINTER_SHAPER:
50 painter = new EclPainter1D(data, EclPainter1D::SHAPER);
51 break;
53 painter = new EclPainter1D(data, EclPainter1D::CRATE);
54 break;
55 case PAINTER_1D_PHI:
56 painter = new EclPainter1D(data, EclPainter1D::PHI);
57 break;
59 painter = new EclPainter1D(data, EclPainter1D::THETA);
60 break;
61 case PAINTER_ENERGY:
62 painter = new EclPainterCommon(data, EclPainterCommon::ENERGY);
63 break;
66 break;
67 case PAINTER_TIME:
68 painter = new EclPainterCommon(data, EclPainterCommon::TIME);
69 break;
71 painter = new EclPainter2D(data, EclPainter2D::CHANNEL_2D);
72 break;
74 painter = new EclPainter2D(data, EclPainter2D::SHAPER_2D);
75 break;
76 }
77 painter->setMapper(mapper);
78 painter->setDisplayedSubsystem(subsys);
79 return painter;
80}
Painter for EclData, 1D histograms.
Definition: EclPainter1D.h:24
@ 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
Painter for EclData, 2D histograms.
Definition: EclPainter2D.h:26
@ CHANNEL_2D
(theta_id:phi_id) histogram.
Definition: EclPainter2D.h:30
@ SHAPER_2D
(shaper:crate) histogram.
Definition: EclPainter2D.h:31
Painter for EclData that shows common event characteristics on 1D histograms.
@ ENERGY_SUM
Energy per event distribution.
@ ENERGY
Energy per channel distribution.
@ TIME
Time distribution.
Painter for EclData, polar energy/event_count distribution.
Painter for EclData, parent class, created with EclPainterFactory.
Definition: EclPainter.h:29
void setMapper(ECL::ECLChannelMapper *mapper)
Set ECLChannelMapper for CellID <-> (crate, shaper, chid) conversion.
Definition: EclPainter.cc:36
void setDisplayedSubsystem(EclData::EclSubsystem sys)
Change between the displayed ECL subsystem (barrel, forward and backward endcaps).
Definition: EclPainter.cc:46
@ PAINTER_TIME
Time distribution.
@ PAINTER_CHANNEL
Event count/energy distribution per channel.
@ PAINTER_COLLECTOR
Event count/energy distribution per crate/ECLCollector.
@ PAINTER_CHANNEL_2D
(theta_id:phi_id) histogram.
@ PAINTER_ENERGY_SUM
Event energy distribution.
@ PAINTER_1D_THETA
Event count/energy distribution per theta_id.
@ PAINTER_SHAPER_2D
(shaper:crate) histogram.
@ PAINTER_SHAPER
Event count/energy distribution per shaperDSP.
@ PAINTER_PHI
Event count/energy polar angle distribution.
@ PAINTER_ENERGY
Channel energy distribution.
@ PAINTER_1D_PHI
Event count/energy distribution per phi_id.

◆ getTypeTitles()

const char ** getTypeTitles ( )
static

Returns array of titles for each EclPainter type.

Definition at line 82 of file EclPainterFactory.cc.

83{
84 return titles;
85}
static const char * titles[types_count]
Titles for painter types.

◆ getTypeTitlesCount()

int getTypeTitlesCount ( )
static

Size of array from getTypeTitles()

Definition at line 87 of file EclPainterFactory.cc.

88{
89 return types_count;
90}
static const int types_count
Number of painter types.

Member Data Documentation

◆ titles

const char * titles
staticprivate
Initial value:
= {
"Distribution of phi segments",
"Energy per channel distribution",
"Energy per shaper distribution",
"Energy per crate distribution",
"Energy per phi_id distribution",
"Energy per theta_id distribution",
"Energy distribution",
"Total event energy distribution",
"Time distribution",
"Event display (channels)",
"Event display (shapers)"
}

Titles for painter types.

Also see const char* titles definition in EclPainterFactory.cc

Definition at line 52 of file EclPainterFactory.h.

◆ types_count

const int types_count = PAINTER_SHAPER_2D + 1
staticprivate

Number of painter types.

Definition at line 50 of file EclPainterFactory.h.


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