CMS 3D CMS Logo

Public Member Functions | Private Attributes

HistoParams< T > Class Template Reference

#include <RunHistogramManager.h>

Inheritance diagram for HistoParams< T >:
BaseHistoParams

List of all members.

Public Member Functions

virtual void beginRun (const unsigned int irun, TFileDirectory &subrun, const char *fillrun)
 HistoParams (T **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
T ** _pointer
std::map< unsigned int, T * > _runpointers
std::string _title
std::string _type
double _xmax
double _xmin
double _ymax
double _ymin

Detailed Description

template<class T>
class HistoParams< T >

Definition at line 28 of file RunHistogramManager.h.


Constructor & Destructor Documentation

template<class T>
HistoParams< T >::HistoParams ( T **  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 32 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() { }
template<class T>
HistoParams< T >::~HistoParams ( ) [inline]

Definition at line 40 of file RunHistogramManager.h.

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

                   {

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

    }

Member Function Documentation

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

Implements BaseHistoParams.

Definition at line 47 of file RunHistogramManager.h.

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

                                                                                                {
      
      if(_runpointers.find(irun)!=_runpointers.end()) {
        *_pointer = _runpointers[irun];
        LogDebug("TH1Fbooked") << "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<T>(_name.c_str(),
                                                  title,
                                                  _nbinx,
                                                  _xmin,
                                                  _xmax);
        
        *_pointer = _runpointers[irun];
        LogDebug("TH1Fbooked") << "Histogram " << _name.c_str() << " booked " << _runpointers[irun];
      }
      
    }

Member Data Documentation

template<class T>
std::string HistoParams< T >::_name [private]
template<class T>
unsigned int HistoParams< T >::_nbinx [private]
template<class T>
unsigned int HistoParams< T >::_nbiny [private]
template<class T>
T** HistoParams< T >::_pointer [private]
template<class T>
std::map<unsigned int, T*> HistoParams< T >::_runpointers [private]
template<class T>
std::string HistoParams< T >::_title [private]
template<class T>
std::string HistoParams< T >::_type [private]

Definition at line 73 of file RunHistogramManager.h.

template<class T>
double HistoParams< T >::_xmax [private]
template<class T>
double HistoParams< T >::_xmin [private]
template<class T>
double HistoParams< T >::_ymax [private]
template<class T>
double HistoParams< T >::_ymin [private]