Cat
Public Member Functions | Private Attributes | List of all members
Histo2D Class Reference

#include <Histo2D.h>

Inheritance diagram for Histo2D:
Object Attrib

Public Member Functions

 Histo2D (TH2D *histo)
 
 ~Histo2D ()
 
double minX ()
 
double maxX ()
 
double minY ()
 
double maxY ()
 
double minZ ()
 
double maxZ ()
 
std::vector< double > bins ()
 
std::vector< double > xbins ()
 
std::vector< double > ybins ()
 
unsigned long nxbins ()
 
unsigned long nybins ()
 
void statistics (double &, double &, double &)
 
- Public Member Functions inherited from Object
 Object ()
 Standard constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
std::string name () const
 
std::string type ()
 
unsigned char id ()
 
std::string title ()
 
void msgSvc (int level, std::string msg, std::string name)
 
void msg (std::string mymsg)
 
void verbose (std::string mymsg)
 
void debug (std::string mymsg)
 
void info (std::string mymsg)
 
void warning (std::string mymsg)
 
void error (std::string mymsg)
 
void fatal (std::string mymsg)
 
void msg (std::string mymsg, std::string name)
 
void verbose (std::string mymsg, std::string name)
 
void debug (std::string mymsg, std::string name)
 
void info (std::string mymsg, std::string name)
 
void warning (std::string mymsg, std::string name)
 
void error (std::string mymsg, std::string name)
 
void fatal (std::string mymsg, std::string name)
 
void setName (std::string name)
 
void setType (std::string type)
 
void setId (unsigned char id)
 
void setTitle (std::string title)
 
void setDllName (std::string dllName)
 
std::string dllName ()
 
- Public Member Functions inherited from Attrib
 Attrib ()
 Standard constructor. More...
 
virtual ~Attrib ()
 Destructor. More...
 
bool is (int attribut)
 
void add (int attribut)
 
void remove (int attribut)
 
std::string attributs ()
 

Private Attributes

double m_zero
 
double m_infini
 
unsigned long m_nxbins
 
unsigned long m_nybins
 
std::vector< double > m_bins
 
std::vector< double > m_xcenters
 
std::vector< double > m_ycenters
 
double m_minX
 
double m_maxX
 
double m_minY
 
double m_maxY
 
double m_minZ
 
double m_maxZ
 
double m_overflow
 
double m_underflow
 
double m_content
 
double m_mean
 
double m_rms
 

Additional Inherited Members

- Public Types inherited from Attrib
enum  Attribut {
  UNDEFINED, PASSIVE, ACTIVE, INTERFACE,
  IO, IODATA, ELEMENT, HARDWARE,
  PROCESSUS, SOFTWARE
}
 
- Protected Attributes inherited from Attrib
std::string m_attribString [10]
 

Detailed Description

Definition at line 28 of file Histo2D.h.

Constructor & Destructor Documentation

◆ Histo2D()

Histo2D::Histo2D ( TH2D *  histo)

Definition at line 22 of file Histo2D.cpp.

References m_bins, m_content, m_maxX, m_maxY, m_maxZ, m_mean, m_minX, m_minY, m_minZ, m_nxbins, m_nybins, m_rms, m_xcenters, m_ycenters, and Object::setTitle().

22  : m_zero ( 1.e-30 ) , m_infini(1.e30) {
23  //m_histo = histo;
24 
25  m_nxbins = histo->GetNbinsX();
26  m_nybins = histo->GetNbinsY();
27 
28  setTitle(std::string(histo -> GetTitle()));
29 
30  m_minX = histo->GetXaxis()->GetXmin();
31  m_maxX = histo->GetXaxis()->GetXmax();
32  m_minY = histo->GetYaxis()->GetXmin();
33  m_maxY = histo->GetYaxis()->GetXmax();
34 
35  m_minZ = histo->GetMinimum();
36  m_maxZ = histo->GetMaximum();
37 
38  unsigned long nxbin=0;
39  unsigned long nybin=0;
40  for (nybin=0;nxbin<m_nybins; ++nybin){
41  /*
42  std::vector<double> tmpbins;
43  std::vector<double> tmpxbin;
44  std::vector<double> tmpybin;
45  */
46  for (nxbin=0;nxbin<m_nxbins; ++nxbin){
47  m_bins.push_back(histo->GetBinContent(nybin*nxbin+1+2*(nybin-1)));
48  m_xcenters.push_back(histo->GetXaxis()->GetBinCenter(nxbin+1));
49  m_ycenters.push_back(histo->GetYaxis()->GetBinCenter(nybin+1));
50  }
51  /*
52  m_bins.push_back(tmpbins);
53  m_xcenters.push_back(tmpxbin);
54  m_ycenters.push_back(tmpybin);
55  */
56  }
57 
58  /*
59  m_underflow = histo->GetBinContent(0);
60  m_overflow = histo->GetBinContent(histo->GetNbinsX()+1);
61  */
62 
63  m_content = histo->GetEntries();
64  m_mean = histo->GetMean();
65  m_rms = histo->GetRMS();
66 }
double m_zero
Definition: Histo2D.h:106
unsigned long m_nybins
Definition: Histo2D.h:110
std::vector< double > m_xcenters
Definition: Histo2D.h:119
double m_maxZ
Definition: Histo2D.h:127
double m_content
Definition: Histo2D.h:132
std::vector< double > m_ycenters
Definition: Histo2D.h:120
unsigned long m_nxbins
Definition: Histo2D.h:109
double m_minZ
Definition: Histo2D.h:126
double m_maxX
Definition: Histo2D.h:123
double m_mean
Definition: Histo2D.h:133
double m_rms
Definition: Histo2D.h:134
void setTitle(std::string title)
Definition: Object.h:54
double m_minY
Definition: Histo2D.h:124
double m_infini
Definition: Histo2D.h:107
double m_maxY
Definition: Histo2D.h:125
double m_minX
Definition: Histo2D.h:122
std::vector< double > m_bins
Definition: Histo2D.h:118

◆ ~Histo2D()

Histo2D::~Histo2D ( )
inline

Definition at line 31 of file Histo2D.h.

31 { }

Member Function Documentation

◆ bins()

std::vector<double> Histo2D::bins ( )
inline

Definition at line 72 of file Histo2D.h.

References m_bins.

Referenced by export_proc().

72  {
73  return m_bins;
74  }
std::vector< double > m_bins
Definition: Histo2D.h:118

◆ maxX()

double Histo2D::maxX ( )
inline

Definition at line 39 of file Histo2D.h.

References m_maxX.

Referenced by export_proc().

39  {
40  return m_maxX;
41  }
double m_maxX
Definition: Histo2D.h:123

◆ maxY()

double Histo2D::maxY ( )
inline

Definition at line 47 of file Histo2D.h.

References m_maxY.

Referenced by export_proc().

47  {
48  return m_maxY;
49  }
double m_maxY
Definition: Histo2D.h:125

◆ maxZ()

double Histo2D::maxZ ( )
inline

Definition at line 55 of file Histo2D.h.

References m_maxZ.

Referenced by export_proc().

55  {
56  return m_maxZ;
57  }
double m_maxZ
Definition: Histo2D.h:127

◆ minX()

double Histo2D::minX ( )
inline

Definition at line 35 of file Histo2D.h.

References m_minX.

Referenced by export_proc().

35  {
36  return m_minX;
37  }
double m_minX
Definition: Histo2D.h:122

◆ minY()

double Histo2D::minY ( )
inline

Definition at line 43 of file Histo2D.h.

References m_minY.

Referenced by export_proc().

43  {
44  return m_minY;
45  }
double m_minY
Definition: Histo2D.h:124

◆ minZ()

double Histo2D::minZ ( )
inline

Definition at line 51 of file Histo2D.h.

References m_minZ.

Referenced by export_proc().

51  {
52  return m_minZ;
53  }
double m_minZ
Definition: Histo2D.h:126

◆ nxbins()

unsigned long Histo2D::nxbins ( )
inline

Definition at line 84 of file Histo2D.h.

References m_nxbins.

Referenced by export_proc().

84  {
85  return m_nxbins;
86  }
unsigned long m_nxbins
Definition: Histo2D.h:109

◆ nybins()

unsigned long Histo2D::nybins ( )
inline

Definition at line 88 of file Histo2D.h.

References m_nybins, and statistics().

Referenced by export_proc().

88  {
89  return m_nybins;
90  }
unsigned long m_nybins
Definition: Histo2D.h:110

◆ statistics()

void Histo2D::statistics ( double &  content,
double &  mean,
double &  rms 
)

Definition at line 77 of file Histo2D.cpp.

References m_content, m_mean, and m_rms.

Referenced by nybins().

79  {
80  content=m_content;
81  mean =m_mean;
82  rms =m_rms;
83 }
double m_content
Definition: Histo2D.h:132
double m_mean
Definition: Histo2D.h:133
double m_rms
Definition: Histo2D.h:134

◆ xbins()

std::vector<double> Histo2D::xbins ( )
inline

Definition at line 76 of file Histo2D.h.

References m_xcenters.

Referenced by export_proc().

76  {
77  return m_xcenters;
78  }
std::vector< double > m_xcenters
Definition: Histo2D.h:119

◆ ybins()

std::vector<double> Histo2D::ybins ( )
inline

Definition at line 80 of file Histo2D.h.

References m_ycenters.

Referenced by export_proc().

80  {
81  return m_ycenters;
82  }
std::vector< double > m_ycenters
Definition: Histo2D.h:120

Member Data Documentation

◆ m_bins

std::vector<double> Histo2D::m_bins
private

Definition at line 118 of file Histo2D.h.

Referenced by bins(), and Histo2D().

◆ m_content

double Histo2D::m_content
private

Definition at line 132 of file Histo2D.h.

Referenced by Histo2D(), and statistics().

◆ m_infini

double Histo2D::m_infini
private

Definition at line 107 of file Histo2D.h.

◆ m_maxX

double Histo2D::m_maxX
private

Definition at line 123 of file Histo2D.h.

Referenced by Histo2D(), and maxX().

◆ m_maxY

double Histo2D::m_maxY
private

Definition at line 125 of file Histo2D.h.

Referenced by Histo2D(), and maxY().

◆ m_maxZ

double Histo2D::m_maxZ
private

Definition at line 127 of file Histo2D.h.

Referenced by Histo2D(), and maxZ().

◆ m_mean

double Histo2D::m_mean
private

Definition at line 133 of file Histo2D.h.

Referenced by Histo2D(), and statistics().

◆ m_minX

double Histo2D::m_minX
private

Definition at line 122 of file Histo2D.h.

Referenced by Histo2D(), and minX().

◆ m_minY

double Histo2D::m_minY
private

Definition at line 124 of file Histo2D.h.

Referenced by Histo2D(), and minY().

◆ m_minZ

double Histo2D::m_minZ
private

Definition at line 126 of file Histo2D.h.

Referenced by Histo2D(), and minZ().

◆ m_nxbins

unsigned long Histo2D::m_nxbins
private

Definition at line 109 of file Histo2D.h.

Referenced by Histo2D(), and nxbins().

◆ m_nybins

unsigned long Histo2D::m_nybins
private

Definition at line 110 of file Histo2D.h.

Referenced by Histo2D(), and nybins().

◆ m_overflow

double Histo2D::m_overflow
private

Definition at line 129 of file Histo2D.h.

◆ m_rms

double Histo2D::m_rms
private

Definition at line 134 of file Histo2D.h.

Referenced by Histo2D(), and statistics().

◆ m_underflow

double Histo2D::m_underflow
private

Definition at line 130 of file Histo2D.h.

◆ m_xcenters

std::vector<double> Histo2D::m_xcenters
private

Definition at line 119 of file Histo2D.h.

Referenced by Histo2D(), and xbins().

◆ m_ycenters

std::vector<double> Histo2D::m_ycenters
private

Definition at line 120 of file Histo2D.h.

Referenced by Histo2D(), and ybins().

◆ m_zero

double Histo2D::m_zero
private

Definition at line 106 of file Histo2D.h.


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