CMS 3D CMS Logo

Public Member Functions | Protected Attributes

HFunctionResolutionVarianceCheck Class Reference

#include <Histograms.h>

Inheritance diagram for HFunctionResolutionVarianceCheck:
HFunctionResolution Histograms

List of all members.

Public Member Functions

virtual void Fill (const reco::Particle::LorentzVector &p4, const double &resValue, const int charge)
 HFunctionResolutionVarianceCheck (TFile *outputFile, const TString &name, const double ptMax=200)
void Write ()
 ~HFunctionResolutionVarianceCheck ()

Protected Attributes

TH1D *** histoVarianceCheck_

Detailed Description

Definition at line 1656 of file Histograms.h.


Constructor & Destructor Documentation

HFunctionResolutionVarianceCheck::HFunctionResolutionVarianceCheck ( TFile *  outputFile,
const TString &  name,
const double  ptMax = 200 
) [inline]

Definition at line 1659 of file Histograms.h.

References histoVarianceCheck_, i, j, mergeVDriftHistosByStation::name, HFunctionResolution::totBinsX_, and HFunctionResolution::totBinsY_.

                                                                                                       :
    HFunctionResolution(outputFile, name, ptMax)
  {
    histoVarianceCheck_ = new TH1D**[totBinsX_];
    for( int i=0; i<totBinsX_; ++i ) {
      histoVarianceCheck_[i] = new TH1D*[totBinsY_];
      for( int j=0; j<totBinsY_; ++j ) {
        std::stringstream namei;
        std::stringstream namej;
        namei << i;
        namej << j;
        histoVarianceCheck_[i][j] = new TH1D(name+"_"+namei.str()+"_"+namej.str(), name, 100, 0., 1.);
      }
    }
  }
HFunctionResolutionVarianceCheck::~HFunctionResolutionVarianceCheck ( ) [inline]

Definition at line 1674 of file Histograms.h.

References histoVarianceCheck_, i, j, HFunctionResolution::totBinsX_, and HFunctionResolution::totBinsY_.

                                      {
    for( int i=0; i<totBinsX_; ++i ) {
      for( int j=0; j<totBinsY_; ++j ) {
        delete histoVarianceCheck_[i][j];
      }
      delete[] histoVarianceCheck_;
    }
    delete[] histoVarianceCheck_;
  }

Member Function Documentation

virtual void HFunctionResolutionVarianceCheck::Fill ( const reco::Particle::LorentzVector p4,
const double &  resValue,
const int  charge 
) [inline, virtual]

Reimplemented from HFunctionResolution.

Definition at line 1683 of file Histograms.h.

References HFunctionResolution::getXindex(), HFunctionResolution::getYindex(), histoVarianceCheck_, HFunctionResolution::totBinsX_, and HFunctionResolution::totBinsY_.

                                                                                                     {
    if( resValue != resValue ) return;
    // Need to convert the (x,y) values to the array indeces
    int xIndex = getXindex(p4.Pt());
    int yIndex = getYindex(p4.Eta());
    // Only fill values if they are in the selected range
    if ( 0 <= xIndex && xIndex < totBinsX_ && 0 <= yIndex && yIndex < totBinsY_ ) {
      histoVarianceCheck_[xIndex][yIndex]->Fill(resValue);
    }
    // Call also the fill of the base class
    HFunctionResolution::Fill( p4, resValue, charge );
  }
void HFunctionResolutionVarianceCheck::Write ( ) [inline, virtual]

Reimplemented from HFunctionResolution.

Definition at line 1695 of file Histograms.h.

References Histograms::histoDir_, histoVarianceCheck_, HFunctionResolution::totBinsX_, and HFunctionResolution::totBinsY_.

               {
    if(histoDir_ != 0) histoDir_->cd();
    for( int xBin=0; xBin<totBinsX_; ++xBin ) {
      for( int yBin=0; yBin<totBinsY_; ++yBin ) {
        histoVarianceCheck_[xBin][yBin]->Write();
      }
    }
    HFunctionResolution::Write();
  }

Member Data Documentation