CMS 3D CMS Logo

Public Member Functions | Private Attributes

HistoParams< TH2F > Class Template Reference

#include <RunHistogramManager.h>

Inheritance diagram for HistoParams< TH2F >:
BaseHistoParams

List of all members.

Public Member Functions

virtual void beginRun (const unsigned int irun, TFileDirectory &subrun, const char *fillrun)
 HistoParams (TH2F **pointer, const std::string type, const std::string name, const std::string title, const unsigned int nbinx=-1, const double xmin=-1., const double xmax=-1., const unsigned int nbiny=-1, const double ymin=-1., const double ymax=-1.)
 ~HistoParams ()

Private Attributes

std::string _name
unsigned int _nbinx
unsigned int _nbiny
TH2F ** _pointer
std::map< unsigned int, TH2F * > _runpointers
std::string _title
std::string _type
double _xmax
double _xmin
double _ymax
double _ymin

Detailed Description

template<>
class HistoParams< TH2F >

Definition at line 87 of file RunHistogramManager.h.


Constructor & Destructor Documentation

HistoParams< TH2F >::HistoParams ( TH2F **  pointer,
const std::string  type,
const std::string  name,
const std::string  title,
const unsigned int  nbinx = -1,
const double  xmin = -1.,
const double  xmax = -1.,
const unsigned int  nbiny = -1,
const double  ymin = -1.,
const double  ymax = -1. 
) [inline]

Definition at line 91 of file RunHistogramManager.h.

                                                                                            :
    BaseHistoParams(),
    _pointer(pointer),
    _type(type), _name(name), _title(title), _nbinx(nbinx), _xmin(xmin), _xmax(xmax),
    _nbiny(nbiny), _ymin(ymin), _ymax(ymax), _runpointers() { }
HistoParams< TH2F >::~HistoParams ( ) [inline]

Definition at line 100 of file RunHistogramManager.h.

References HistoParams< T >::_name, HistoParams< T >::_pointer, and LogDebug.

                   {

      delete _pointer;
      LogDebug("TH2FDestructor") << "Destroy " << _name;

    }

Member Function Documentation

virtual void HistoParams< TH2F >::beginRun ( const unsigned int  irun,
TFileDirectory subrun,
const char *  fillrun 
) [inline, virtual]

Implements BaseHistoParams.

Definition at line 107 of file RunHistogramManager.h.

References HistoParams< T >::_name, HistoParams< T >::_nbinx, HistoParams< T >::_nbiny, HistoParams< T >::_pointer, HistoParams< T >::_runpointers, HistoParams< T >::_title, HistoParams< T >::_xmax, HistoParams< T >::_xmin, HistoParams< T >::_ymax, HistoParams< T >::_ymin, LogDebug, TFileDirectory::make(), and indexGen::title.

                                                                                                {
      
      if(_runpointers.find(irun)!=_runpointers.end()) {
        *_pointer = _runpointers[irun];
        LogDebug("TH2Fbooked") << "Histogram " << _name.c_str() << " already exists " << _runpointers[irun];
        
      }
      else {
        
        char title[400];
        sprintf(title,"%s %s %d",_title.c_str(),fillrun,irun);
        
        _runpointers[irun] = subrun.make<TH2F>(_name.c_str(),
                                                  title,
                                                  _nbinx,
                                                  _xmin,
                                                  _xmax,
                                                  _nbiny,
                                                  _ymin,
                                                  _ymax);
        
        *_pointer = _runpointers[irun];
        LogDebug("TH2Fbooked") << "Histogram " << _name.c_str() << " booked " << _runpointers[irun];
      }
      
      
    }

Member Data Documentation

std::string HistoParams< TH2F >::_name [private]

Definition at line 138 of file RunHistogramManager.h.

unsigned int HistoParams< TH2F >::_nbinx [private]

Definition at line 140 of file RunHistogramManager.h.

unsigned int HistoParams< TH2F >::_nbiny [private]

Definition at line 143 of file RunHistogramManager.h.

TH2F** HistoParams< TH2F >::_pointer [private]

Definition at line 136 of file RunHistogramManager.h.

std::map<unsigned int, TH2F*> HistoParams< TH2F >::_runpointers [private]

Definition at line 146 of file RunHistogramManager.h.

std::string HistoParams< TH2F >::_title [private]

Definition at line 139 of file RunHistogramManager.h.

std::string HistoParams< TH2F >::_type [private]

Definition at line 137 of file RunHistogramManager.h.

double HistoParams< TH2F >::_xmax [private]

Definition at line 142 of file RunHistogramManager.h.

double HistoParams< TH2F >::_xmin [private]

Definition at line 141 of file RunHistogramManager.h.

double HistoParams< TH2F >::_ymax [private]

Definition at line 145 of file RunHistogramManager.h.

double HistoParams< TH2F >::_ymin [private]

Definition at line 144 of file RunHistogramManager.h.