Belle II Software  release-08-01-10
EclPainterFactory.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 //This module
9 #include <ecl/modules/eclDisplay/EclPainterFactory.h>
10 
11 //ECL
12 #include <ecl/modules/eclDisplay/EclPainter1D.h>
13 #include <ecl/modules/eclDisplay/EclPainter2D.h>
14 #include <ecl/modules/eclDisplay/EclPainterPolar.h>
15 #include <ecl/modules/eclDisplay/EclPainterCommon.h>
16 
17 using namespace Belle2;
18 
19 const char* EclPainterFactory::titles[types_count] = {
20  "Distribution of phi segments",
21  "Energy per channel distribution",
22  "Energy per shaper distribution",
23  "Energy per crate distribution",
24  "Energy per phi_id distribution",
25  "Energy per theta_id distribution",
26  "Energy distribution",
27  "Total event energy distribution",
28  "Time distribution",
29  "Event display (channels)",
30  "Event display (shapers)"
31 };
32 
34 {
35 }
36 
38  ECL::ECLChannelMapper* mapper,
39  EclData::EclSubsystem subsys)
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;
52  case PAINTER_COLLECTOR:
53  painter = new EclPainter1D(data, EclPainter1D::CRATE);
54  break;
55  case PAINTER_1D_PHI:
56  painter = new EclPainter1D(data, EclPainter1D::PHI);
57  break;
58  case PAINTER_1D_THETA:
59  painter = new EclPainter1D(data, EclPainter1D::THETA);
60  break;
61  case PAINTER_ENERGY:
62  painter = new EclPainterCommon(data, EclPainterCommon::ENERGY);
63  break;
64  case PAINTER_ENERGY_SUM:
66  break;
67  case PAINTER_TIME:
68  painter = new EclPainterCommon(data, EclPainterCommon::TIME);
69  break;
70  case PAINTER_CHANNEL_2D:
71  painter = new EclPainter2D(data, EclPainter2D::CHANNEL_2D);
72  break;
73  case PAINTER_SHAPER_2D:
74  painter = new EclPainter2D(data, EclPainter2D::SHAPER_2D);
75  break;
76  }
77  painter->setMapper(mapper);
78  painter->setDisplayedSubsystem(subsys);
79  return painter;
80 }
81 
83 {
84  return titles;
85 }
86 
88 {
89  return types_count;
90 }
This class provides access to ECL channel map that is either a) Loaded from the database (see ecl/dbo...
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
Definition: EclData.h:31
EclSubsystem
Subsystems of ECL: ALL all subsystems BARR barrel only FORW forward endcap only BACKW backward endcap...
Definition: EclData.h:98
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.
static EclPainter * createPainter(EclPainterType type, EclData *data, ECL::ECLChannelMapper *mapper, EclData::EclSubsystem subsys=EclData::ALL)
Creates EclPainter of the specified type.
static const char * titles[types_count]
Titles for painter types.
static const char ** getTypeTitles()
Returns array of titles for each EclPainter type.
static const int types_count
Number of painter types.
static int getTypeTitlesCount()
Size of array from getTypeTitles()
EclPainterFactory()
Constructor for EclPainterFactory.
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
EclPainterType
Enum for type of EclPainter to create.
@ 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.
Abstract base class for different kinds of events.