Belle II Software  release-05-02-19
EclPainterFactory.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Milkail Remnev, Dmitry Matvienko *
7  * *
8  * This software is provided "as is" without any warranty. *
9  ***************************************************************************/
10 //This module
11 #include <ecl/modules/eclDisplay/EclPainterFactory.h>
12 
13 //ECL
14 #include <ecl/modules/eclDisplay/EclPainter1D.h>
15 #include <ecl/modules/eclDisplay/EclPainter2D.h>
16 #include <ecl/modules/eclDisplay/EclPainterPolar.h>
17 #include <ecl/modules/eclDisplay/EclPainterCommon.h>
18 
19 using namespace Belle2;
20 
21 const char* EclPainterFactory::titles[types_count] = {
22  "Distribution of phi segments",
23  "Energy per channel distribution",
24  "Energy per shaper distribution",
25  "Energy per crate distribution",
26  "Energy per phi_id distribution",
27  "Energy per theta_id distribution",
28  "Energy distribution",
29  "Total event energy distribution",
30  "Time distribution",
31  "Event display (channels)",
32  "Event display (shapers)"
33 };
34 
36 {
37 }
38 
40  ECL::ECLChannelMapper* mapper,
41  EclData::EclSubsystem subsys)
42 {
43  EclPainter* painter = 0;
44  switch (type) {
45  case PAINTER_PHI:
46  painter = new EclPainterPolar(data, EclPainterPolar::PHI);
47  break;
48  case PAINTER_CHANNEL:
49  painter = new EclPainter1D(data, EclPainter1D::CHANNEL);
50  break;
51  case PAINTER_SHAPER:
52  painter = new EclPainter1D(data, EclPainter1D::SHAPER);
53  break;
54  case PAINTER_COLLECTOR:
55  painter = new EclPainter1D(data, EclPainter1D::CRATE);
56  break;
57  case PAINTER_1D_PHI:
58  painter = new EclPainter1D(data, EclPainter1D::PHI);
59  break;
60  case PAINTER_1D_THETA:
61  painter = new EclPainter1D(data, EclPainter1D::THETA);
62  break;
63  case PAINTER_ENERGY:
64  painter = new EclPainterCommon(data, EclPainterCommon::ENERGY);
65  break;
66  case PAINTER_ENERGY_SUM:
68  break;
69  case PAINTER_TIME:
70  painter = new EclPainterCommon(data, EclPainterCommon::TIME);
71  break;
72  case PAINTER_CHANNEL_2D:
73  painter = new EclPainter2D(data, EclPainter2D::CHANNEL_2D);
74  break;
75  case PAINTER_SHAPER_2D:
76  painter = new EclPainter2D(data, EclPainter2D::SHAPER_2D);
77  break;
78  }
79  painter->setMapper(mapper);
80  painter->setDisplayedSubsystem(subsys);
81  return painter;
82 }
83 
85 {
86  return titles;
87 }
88 
90 {
91  return types_count;
92 }
Belle2::EclPainter2D::CHANNEL_2D
@ CHANNEL_2D
(theta_id:phi_id) histogram.
Definition: EclPainter2D.h:32
Belle2::EclPainter1D::CHANNEL
@ CHANNEL
Events/energy per channel.
Definition: EclPainter1D.h:30
Belle2::EclPainter1D::SHAPER
@ SHAPER
Events/energy per ShaperDSP.
Definition: EclPainter1D.h:31
Belle2::EclPainterFactory::getTypeTitles
static const char ** getTypeTitles()
Returns array of titles for each EclPainter type.
Definition: EclPainterFactory.cc:84
Belle2::EclPainterType
EclPainterType
Enum for type of EclPainter to create.
Definition: EclPainterFactory.h:39
Belle2::EclPainter1D::CRATE
@ CRATE
Events/energy per crate/ECLCollector.
Definition: EclPainter1D.h:32
Belle2::EclPainterCommon::ENERGY
@ ENERGY
Energy per channel distribution.
Definition: EclPainterCommon.h:33
Belle2::EclPainter::setDisplayedSubsystem
void setDisplayedSubsystem(EclData::EclSubsystem sys)
Change between the displayed ECL subsystem (barrel, forward and backward endcaps).
Definition: EclPainter.cc:47
Belle2::PAINTER_COLLECTOR
@ PAINTER_COLLECTOR
Event count/energy distribution per crate/ECLCollector.
Definition: EclPainterFactory.h:43
Belle2::PAINTER_CHANNEL_2D
@ PAINTER_CHANNEL_2D
(theta_id:phi_id) histogram.
Definition: EclPainterFactory.h:49
Belle2::EclPainterPolar
Painter for EclData, polar energy/event_count distribution.
Definition: EclPainterPolar.h:28
Belle2::EclPainterCommon::TIME
@ TIME
Time distribution.
Definition: EclPainterCommon.h:35
Belle2::PAINTER_TIME
@ PAINTER_TIME
Time distribution.
Definition: EclPainterFactory.h:48
Belle2::EclPainter
Painter for EclData, parent class, created with EclPainterFactory.
Definition: EclPainter.h:31
Belle2::EclPainterFactory::getTypeTitlesCount
static int getTypeTitlesCount()
Size of array from getTypeTitles()
Definition: EclPainterFactory.cc:89
Belle2::EclData::EclSubsystem
EclSubsystem
Subsystems of ECL: ALL all subsystems BARR barrel only FORW forward endcap only BACKW backward endcap...
Definition: EclData.h:108
Belle2::EclPainterCommon::ENERGY_SUM
@ ENERGY_SUM
Energy per event distribution.
Definition: EclPainterCommon.h:34
Belle2::EclPainterFactory::createPainter
static EclPainter * createPainter(EclPainterType type, EclData *data, ECL::ECLChannelMapper *mapper, EclData::EclSubsystem subsys=EclData::ALL)
Creates EclPainter of the specified type.
Definition: EclPainterFactory.cc:39
Belle2::EclPainterFactory::titles
static const char * titles[types_count]
Titles for painter types.
Definition: EclPainterFactory.h:62
Belle2::EclPainterFactory::types_count
static const int types_count
Number of painter types.
Definition: EclPainterFactory.h:60
Belle2::PAINTER_PHI
@ PAINTER_PHI
Event count/energy polar angle distribution.
Definition: EclPainterFactory.h:40
Belle2::ECL::ECLChannelMapper
This class provides access to ECL channel map that is either a) Loaded from the database (see ecl/dbo...
Definition: ECLChannelMapper.h:36
Belle2::EclPainter2D
Painter for EclData, 2D histograms.
Definition: EclPainter2D.h:28
Belle2::EclPainter::setMapper
void setMapper(ECL::ECLChannelMapper *mapper)
Set ECLChannelMapper for CellID <-> (crate, shaper, chid) conversion.
Definition: EclPainter.cc:37
Belle2::PAINTER_ENERGY
@ PAINTER_ENERGY
Channel energy distribution.
Definition: EclPainterFactory.h:46
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::EclPainterFactory::EclPainterFactory
EclPainterFactory()
Constructor for EclPainterFactory.
Definition: EclPainterFactory.cc:35
Belle2::PAINTER_SHAPER_2D
@ PAINTER_SHAPER_2D
(shaper:crate) histogram.
Definition: EclPainterFactory.h:50
Belle2::PAINTER_ENERGY_SUM
@ PAINTER_ENERGY_SUM
Event energy distribution.
Definition: EclPainterFactory.h:47
Belle2::PAINTER_1D_THETA
@ PAINTER_1D_THETA
Event count/energy distribution per theta_id.
Definition: EclPainterFactory.h:45
Belle2::EclData
This class contains data for ECLSimHit's and provides several relevant conversion functions for bette...
Definition: EclData.h:41
Belle2::EclPainter2D::SHAPER_2D
@ SHAPER_2D
(shaper:crate) histogram.
Definition: EclPainter2D.h:33
Belle2::EclPainterCommon
Painter for EclData that shows common event characteristics on 1D histograms.
Definition: EclPainterCommon.h:29
Belle2::PAINTER_SHAPER
@ PAINTER_SHAPER
Event count/energy distribution per shaperDSP.
Definition: EclPainterFactory.h:42
Belle2::PAINTER_CHANNEL
@ PAINTER_CHANNEL
Event count/energy distribution per channel.
Definition: EclPainterFactory.h:41
Belle2::PAINTER_1D_PHI
@ PAINTER_1D_PHI
Event count/energy distribution per phi_id.
Definition: EclPainterFactory.h:44
Belle2::EclPainter1D
Painter for EclData, 1D histograms.
Definition: EclPainter1D.h:26