CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
HTH2D Class Reference

A wrapper for the TH2D histogram to allow it to be put inside the same map as all the other classes in this file. More...

#include <Histograms.h>

Inherits Histograms.

Public Member Functions

void Clear () override
 
void Fill (const double &x, const double &y) override
 
TProfile * getProfile ()
 
 HTH2D (TFile *outputFile, const TString &name, const TString &title, const TString &dirName, const int xBins, const double &xMin, const double &xMax, const int yBins, const double &yMin, const double &yMax)
 
TH2D * operator-> ()
 
virtual void SetXTitle (const TString &title)
 
virtual void SetYTitle (const TString &title)
 
void Write () override
 
 ~HTH2D () override
 

Protected Attributes

TH2D * tH2d_
 
TProfile * tProfile_
 

Detailed Description

A wrapper for the TH2D histogram to allow it to be put inside the same map as all the other classes in this file.

Definition at line 135 of file Histograms.h.

Constructor & Destructor Documentation

◆ HTH2D()

HTH2D::HTH2D ( TFile *  outputFile,
const TString &  name,
const TString &  title,
const TString &  dirName,
const int  xBins,
const double &  xMin,
const double &  xMax,
const int  yBins,
const double &  yMin,
const double &  yMax 
)
inline

Definition at line 137 of file Histograms.h.

147  : Histograms(outputFile, dirName),
148  tH2d_(new TH2D(name, title, xBins, xMin, xMax, yBins, yMin, yMax)),
149  tProfile_(new TProfile(name + "Prof", title + " profile", xBins, xMin, xMax, yMin, yMax)) {}

◆ ~HTH2D()

HTH2D::~HTH2D ( )
inlineoverride

Definition at line 150 of file Histograms.h.

150  {
151  delete tH2d_;
152  delete tProfile_;
153  }

References tH2d_, and tProfile_.

Member Function Documentation

◆ Clear()

void HTH2D::Clear ( )
inlineoverride

Definition at line 164 of file Histograms.h.

164  {
165  tH2d_->Clear();
166  tProfile_->Clear();
167  }

References tH2d_, and tProfile_.

◆ Fill()

void HTH2D::Fill ( const double &  x,
const double &  y 
)
inlineoverride

Definition at line 154 of file Histograms.h.

154  {
155  tH2d_->Fill(x, y);
156  tProfile_->Fill(x, y);
157  }

References tH2d_, tProfile_, x, and y.

◆ getProfile()

TProfile* HTH2D::getProfile ( )
inline

Definition at line 177 of file Histograms.h.

177 { return tProfile_; }

References tProfile_.

◆ operator->()

TH2D* HTH2D::operator-> ( )
inline

Definition at line 176 of file Histograms.h.

176 { return tH2d_; }

References tH2d_.

◆ SetXTitle()

virtual void HTH2D::SetXTitle ( const TString &  title)
inlinevirtual

Definition at line 168 of file Histograms.h.

168  {
169  tH2d_->GetXaxis()->SetTitle(title);
170  tProfile_->GetXaxis()->SetTitle(title);
171  }

References tH2d_, runGCPTkAlMap::title, and tProfile_.

◆ SetYTitle()

virtual void HTH2D::SetYTitle ( const TString &  title)
inlinevirtual

Definition at line 172 of file Histograms.h.

172  {
173  tH2d_->GetYaxis()->SetTitle(title);
174  tProfile_->GetYaxis()->SetTitle(title);
175  }

References tH2d_, runGCPTkAlMap::title, and tProfile_.

◆ Write()

void HTH2D::Write ( )
inlineoverride

Definition at line 158 of file Histograms.h.

158  {
159  if (histoDir_ != nullptr)
160  histoDir_->cd();
161  tH2d_->Write();
162  tProfile_->Write();
163  }

References tH2d_, and tProfile_.

Member Data Documentation

◆ tH2d_

TH2D* HTH2D::tH2d_
protected

Definition at line 180 of file Histograms.h.

Referenced by Clear(), Fill(), operator->(), SetXTitle(), SetYTitle(), Write(), and ~HTH2D().

◆ tProfile_

TProfile* HTH2D::tProfile_
protected

Definition at line 181 of file Histograms.h.

Referenced by Clear(), Fill(), getProfile(), SetXTitle(), SetYTitle(), Write(), and ~HTH2D().

DDAxes::y
HTH2D::tH2d_
TH2D * tH2d_
Definition: Histograms.h:180
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
photonAnalyzer_cfi.yMin
yMin
Definition: photonAnalyzer_cfi.py:86
DDAxes::x
photonAnalyzer_cfi.xMin
xMin
Definition: photonAnalyzer_cfi.py:82
download_sqlite_cfg.outputFile
outputFile
Definition: download_sqlite_cfg.py:5
multiplicitycorr_cfi.yBins
yBins
Definition: multiplicitycorr_cfi.py:6
multiplicitycorr_cfi.xBins
xBins
Definition: multiplicitycorr_cfi.py:5
multiplicitycorr_cfi.yMax
yMax
Definition: multiplicitycorr_cfi.py:6
HTH2D::tProfile_
TProfile * tProfile_
Definition: Histograms.h:181
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
multiplicitycorr_cfi.xMax
xMax
Definition: multiplicitycorr_cfi.py:5