CMS 3D CMS Logo

Public Member Functions | Private Attributes

RunHistogramManager Class Reference

#include <RunHistogramManager.h>

List of all members.

Public Member Functions

void beginRun (const edm::Run &iRun)
void beginRun (const unsigned int irun)
void beginRun (const unsigned int irun, TFileDirectory &subdir)
TH1F ** makeTH1F (const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
TH2F ** makeTH2F (const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax, const unsigned int nbiny, const double ymin, const double ymax)
TProfile ** makeTProfile (const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
TProfile2D ** makeTProfile2D (const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax, const unsigned int nbiny, const double ymin, const double ymax)
 RunHistogramManager ()
 ~RunHistogramManager ()

Private Attributes

std::vector< BaseHistoParams * > _histograms

Detailed Description

Definition at line 215 of file RunHistogramManager.h.


Constructor & Destructor Documentation

RunHistogramManager::RunHistogramManager ( )

Definition at line 24 of file RunHistogramManager.cc.

                                        :
  _histograms() { }
RunHistogramManager::~RunHistogramManager ( )

Definition at line 40 of file RunHistogramManager.cc.

References _histograms, and LogDebug.

                                          {

  for(std::vector<BaseHistoParams*>::const_iterator hp=_histograms.begin();hp!=_histograms.end();++hp) {

    delete *hp;

  }
  LogDebug("Destructor") << "All BaseHistoParams destroyed ";

}

Member Function Documentation

void RunHistogramManager::beginRun ( const edm::Run iRun)

Definition at line 88 of file RunHistogramManager.cc.

References edm::RunBase::run().

Referenced by EventTimeDistribution::beginRun(), and beginRun().

                                                      {

  beginRun(iRun.run());

}
void RunHistogramManager::beginRun ( const unsigned int  irun,
TFileDirectory subdir 
)

Definition at line 101 of file RunHistogramManager.cc.

References _histograms, and TFileDirectory::mkdir().

                                                                                   {
  
  // create/go to the run subdirectory
  
  char dirname[300];
  sprintf(dirname,"run_%d",irun);
  TFileDirectory subrun = subdir.mkdir(dirname);
  
  // loop on the histograms and update the pointer references
  
  for(unsigned int ih=0;ih<_histograms.size();++ih) {
    
    _histograms[ih]->beginRun(irun,subrun);
    
  }
}
void RunHistogramManager::beginRun ( const unsigned int  irun)

Definition at line 94 of file RunHistogramManager.cc.

References beginRun().

                                                           {

  edm::Service<TFileService> tfserv;
  beginRun(irun,*tfserv);

}
TH1F ** RunHistogramManager::makeTH1F ( const char *  name,
const char *  title,
const unsigned int  nbinx,
const double  xmin,
const double  xmax 
)

Definition at line 27 of file RunHistogramManager.cc.

References _histograms, LogDebug, AlCaRecoCosmics_cfg::name, and indexGen::title.

Referenced by EventTimeDistribution::EventTimeDistribution().

                                                                                                                                        {

  TH1F** pointer =new TH1F*(0);

  BaseHistoParams* hp = new HistoParams<TH1F>(pointer,"TH1F",name,title,nbinx,xmin,xmax);
  _histograms.push_back(hp);

  LogDebug("TH1Fmade") << "Histogram " << name << " " << title << " pre-booked:" << _histograms.size();

  return pointer;

}
TH2F ** RunHistogramManager::makeTH2F ( const char *  name,
const char *  title,
const unsigned int  nbinx,
const double  xmin,
const double  xmax,
const unsigned int  nbiny,
const double  ymin,
const double  ymax 
)

Definition at line 64 of file RunHistogramManager.cc.

References _histograms, LogDebug, AlCaRecoCosmics_cfg::name, and indexGen::title.

Referenced by EventTimeDistribution::EventTimeDistribution().

                                                                                                                                                                                                         {

  TH2F** pointer  = new TH2F*(0);

  BaseHistoParams* hp = new HistoParams<TH2F>(pointer,"TH2F",name,title,nbinx,xmin,xmax,nbiny,ymin,ymax);
  _histograms.push_back(hp);

  LogDebug("TH2Fmade") << "Histogram " << name << " " << title << " pre-booked :" << _histograms.size();

  return pointer;
}
TProfile ** RunHistogramManager::makeTProfile ( const char *  name,
const char *  title,
const unsigned int  nbinx,
const double  xmin,
const double  xmax 
)

Definition at line 51 of file RunHistogramManager.cc.

References _histograms, LogDebug, AlCaRecoCosmics_cfg::name, and indexGen::title.

                                                                                                                                                {

  TProfile** pointer =new TProfile*(0);

  BaseHistoParams* hp = new HistoParams<TProfile>(pointer,"TProfile",name,title,nbinx,xmin,xmax);
  _histograms.push_back(hp);

  LogDebug("TProfilemade") << "Histogram " << name << " " << title << " pre-booked:" << _histograms.size();

  return pointer;

}
TProfile2D ** RunHistogramManager::makeTProfile2D ( const char *  name,
const char *  title,
const unsigned int  nbinx,
const double  xmin,
const double  xmax,
const unsigned int  nbiny,
const double  ymin,
const double  ymax 
)

Definition at line 76 of file RunHistogramManager.cc.

References _histograms, LogDebug, AlCaRecoCosmics_cfg::name, and indexGen::title.

                                                                                                                                                                                                                     {

  TProfile2D** pointer  = new TProfile2D*(0);

  BaseHistoParams* hp = new HistoParams<TProfile2D>(pointer,"TProfile2D",name,title,nbinx,xmin,xmax,nbiny,ymin,ymax);
  _histograms.push_back(hp);

  LogDebug("TProfile2Dmade") << "Histogram " << name << " " << title << " pre-booked :" << _histograms.size();

  return pointer;
}

Member Data Documentation