CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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_
 

Additional Inherited Members

- Public Attributes inherited from Histograms
dqm::reco::MonitorElementlumiVsLS
 
dqm::reco::MonitorElementnumberOfPixelClustersVsLS
 
dqm::reco::MonitorElementnumberOfPixelClustersVsLumi
 
dqm::reco::MonitorElementpixelLumiVsLS
 
dqm::reco::MonitorElementpixelLumiVsLumi
 
dqm::reco::MonitorElementpuVsLS
 

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 137 of file Histograms.h.

Constructor & Destructor Documentation

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 139 of file Histograms.h.

149  : Histograms(outputFile, dirName),
150  tH2d_(new TH2D(name, title, xBins, xMin, xMax, yBins, yMin, yMax)),
151  tProfile_(new TProfile(name + "Prof", title + " profile", xBins, xMin, xMax, yMin, yMax)) {}
TProfile * tProfile_
Definition: Histograms.h:183
TH2D * tH2d_
Definition: Histograms.h:182
HTH2D::~HTH2D ( )
inlineoverride

Definition at line 152 of file Histograms.h.

References tH2d_, and tProfile_.

152  {
153  delete tH2d_;
154  delete tProfile_;
155  }
TProfile * tProfile_
Definition: Histograms.h:183
TH2D * tH2d_
Definition: Histograms.h:182

Member Function Documentation

void HTH2D::Clear ( )
inlineoverride

Definition at line 166 of file Histograms.h.

References tH2d_, and tProfile_.

166  {
167  tH2d_->Clear();
168  tProfile_->Clear();
169  }
TProfile * tProfile_
Definition: Histograms.h:183
TH2D * tH2d_
Definition: Histograms.h:182
void HTH2D::Fill ( const double &  x,
const double &  y 
)
inlineoverride

Definition at line 156 of file Histograms.h.

References tH2d_, and tProfile_.

156  {
157  tH2d_->Fill(x, y);
158  tProfile_->Fill(x, y);
159  }
TProfile * tProfile_
Definition: Histograms.h:183
TH2D * tH2d_
Definition: Histograms.h:182
TProfile* HTH2D::getProfile ( )
inline

Definition at line 179 of file Histograms.h.

References tProfile_.

179 { return tProfile_; }
TProfile * tProfile_
Definition: Histograms.h:183
TH2D* HTH2D::operator-> ( )
inline

Definition at line 178 of file Histograms.h.

References tH2d_.

178 { return tH2d_; }
TH2D * tH2d_
Definition: Histograms.h:182
virtual void HTH2D::SetXTitle ( const TString &  title)
inlinevirtual

Definition at line 170 of file Histograms.h.

References tH2d_, and tProfile_.

170  {
171  tH2d_->GetXaxis()->SetTitle(title);
172  tProfile_->GetXaxis()->SetTitle(title);
173  }
TProfile * tProfile_
Definition: Histograms.h:183
TH2D * tH2d_
Definition: Histograms.h:182
virtual void HTH2D::SetYTitle ( const TString &  title)
inlinevirtual

Definition at line 174 of file Histograms.h.

References tH2d_, and tProfile_.

174  {
175  tH2d_->GetYaxis()->SetTitle(title);
176  tProfile_->GetYaxis()->SetTitle(title);
177  }
TProfile * tProfile_
Definition: Histograms.h:183
TH2D * tH2d_
Definition: Histograms.h:182
void HTH2D::Write ( )
inlineoverride

Definition at line 160 of file Histograms.h.

References tH2d_, and tProfile_.

160  {
161  if (histoDir_ != nullptr)
162  histoDir_->cd();
163  tH2d_->Write();
164  tProfile_->Write();
165  }
TProfile * tProfile_
Definition: Histograms.h:183
TH2D * tH2d_
Definition: Histograms.h:182

Member Data Documentation

TH2D* HTH2D::tH2d_
protected

Definition at line 182 of file Histograms.h.

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

TProfile* HTH2D::tProfile_
protected

Definition at line 183 of file Histograms.h.

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