CMS 3D CMS Logo

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>

Inheritance diagram for HTH2D:
Histograms

List of all members.

Public Member Functions

virtual void Clear ()
virtual void Fill (const double &x, const double &y)
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)
virtual void Write ()
 ~HTH2D ()

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

                                                                     : Histograms(outputFile, dirName),
                                                                       tH2d_( new TH2D(name, title, xBins, xMin, xMax, yBins, yMin, yMax) ),
                                                                       tProfile_( new TProfile(name+"Prof", title+" profile", xBins, xMin, xMax, yMin, yMax) ) {}
HTH2D::~HTH2D ( ) [inline]

Definition at line 123 of file Histograms.h.

References tH2d_, and tProfile_.

           {
    delete tH2d_;
    delete tProfile_;
  }

Member Function Documentation

virtual void HTH2D::Clear ( ) [inline, virtual]

Implements Histograms.

Definition at line 136 of file Histograms.h.

References tH2d_, and tProfile_.

                       {
    tH2d_->Clear();
    tProfile_->Clear();
  }
virtual void HTH2D::Fill ( const double &  x,
const double &  y 
) [inline, virtual]

Reimplemented from Histograms.

Definition at line 127 of file Histograms.h.

References tH2d_, and tProfile_.

                                                          {
    tH2d_->Fill(x,y);
    tProfile_->Fill(x,y);
  }
TProfile* HTH2D::getProfile ( ) [inline]

Definition at line 149 of file Histograms.h.

References tProfile_.

{ return tProfile_; }
TH2D* HTH2D::operator-> ( ) [inline]

Definition at line 148 of file Histograms.h.

References tH2d_.

{ return tH2d_; }
virtual void HTH2D::SetXTitle ( const TString &  title) [inline, virtual]

Definition at line 140 of file Histograms.h.

References tH2d_, and tProfile_.

                                                {
    tH2d_->GetXaxis()->SetTitle(title);
    tProfile_->GetXaxis()->SetTitle(title);
  }
virtual void HTH2D::SetYTitle ( const TString &  title) [inline, virtual]

Definition at line 144 of file Histograms.h.

References tH2d_, and tProfile_.

                                                {
    tH2d_->GetYaxis()->SetTitle(title);
    tProfile_->GetYaxis()->SetTitle(title);
  }
virtual void HTH2D::Write ( ) [inline, virtual]

Implements Histograms.

Definition at line 131 of file Histograms.h.

References Histograms::histoDir_, tH2d_, and tProfile_.

                       {
    if(histoDir_ != 0) histoDir_->cd();
    tH2d_->Write();
    tProfile_->Write();
  }

Member Data Documentation

TH2D* HTH2D::tH2d_ [protected]

Definition at line 151 of file Histograms.h.

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

TProfile* HTH2D::tProfile_ [protected]

Definition at line 152 of file Histograms.h.

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