Belle II Software  release-08-01-10
ARICHChannelHist.h
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 
9 #pragma once
10 
11 #include <TH2Poly.h>
12 #include <TLine.h>
13 #include <TText.h>
14 
15 namespace Belle2 {
27  class ARICHChannelHist: public TH2Poly {
28 
29  public:
30 
35 
42  ARICHChannelHist(const char* name, const char* title, int type = 0,
43  const std::vector<unsigned>& moduleIDs = std::vector<unsigned>());
44 
50  void fillBin(unsigned hapdID, unsigned chID, double weight = 1.);
51 
58  void setBinContent(unsigned hapdID, unsigned chID, double value);
59 
64  void fillBin(unsigned hapdID, double weight = 1.);
65 
71  void setBinContent(unsigned hapdID, double value);
72 
77  void Draw(Option_t* option = "") override;
78 
88  void fillFromTH1(TH1* hist);
89 
93  void setPoly(TH2Poly* poly);
94 
95  protected:
96 
97  TLine lines[6];
98  TText labels[6];
99  int m_type = 0;
100  std::vector<unsigned> m_hapd2binMap;
103  };
104 
106 } // end namespace Belle2
ARICH histogram with HAPD plane 3 options for bin segmentation are available type 0 - one bin per HAP...
void fillFromTH1(TH1 *hist)
Fill the channelHist from the histogram Type 0 channelHist has to be filled with 420*144bin TH1 (each...
void Draw(Option_t *option="") override
Draw the histogram.
void setBinContent(unsigned hapdID, unsigned chID, double value)
Set content of bin corresponding to hapd hapdID and channel chID.
ClassDefOverride(ARICHChannelHist, 2)
ClassDef.
std::vector< unsigned > m_hapd2binMap
map of bins
ARICHChannelHist()
Default constructor.
void fillBin(unsigned hapdID, unsigned chID, double weight=1.)
Add entry to bin corresponding to hapd hapdID and channel chID.
int m_type
histogram type
void setPoly(TH2Poly *poly)
Fill pure TH2Poly from ARICHChannelHist, makes bins and fills content.
Abstract base class for different kinds of events.