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 edm::Run &iRun, TFileDirectory &subdir)
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 (const bool fillHistograms=false)
 ~RunHistogramManager ()

Private Attributes

bool _fillHistograms
std::vector< BaseHistoParams * > _histograms

Detailed Description

Definition at line 215 of file RunHistogramManager.h.


Constructor & Destructor Documentation

RunHistogramManager::RunHistogramManager ( const bool  fillHistograms = false)

Definition at line 26 of file RunHistogramManager.cc.

RunHistogramManager::~RunHistogramManager ( )

Definition at line 42 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)
void RunHistogramManager::beginRun ( const unsigned int  irun,
TFileDirectory subdir 
)

Definition at line 117 of file RunHistogramManager.cc.

References _fillHistograms, _histograms, and TFileDirectory::mkdir().

                                                                                   {
  
  // create/go to the run subdirectory
  
  char fillrun[30];

  if(!_fillHistograms) {
    sprintf(fillrun,"%s","run");
  }
  else {
    sprintf(fillrun,"%s","fill");
  }

  char dirname[300];
  sprintf(dirname,"%s_%d",fillrun,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,fillrun);
    
  }
}
void RunHistogramManager::beginRun ( const unsigned int  irun)

Definition at line 110 of file RunHistogramManager.cc.

References beginRun().

                                                           {

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

}
void RunHistogramManager::beginRun ( const edm::Run iRun,
TFileDirectory subdir 
)

Definition at line 97 of file RunHistogramManager.cc.

References _fillHistograms, beginRun(), edm::Run::getByLabel(), and edm::RunBase::run().

                                                                              {

  if(!_fillHistograms) {
    beginRun(iRun.run(),subdir);
  }
  else {
    edm::Handle<edm::ConditionsInRunBlock> cirb;
    iRun.getByLabel("conditionsInEdm",cirb);

    beginRun(cirb->lhcFillNumber,subdir);
  }
}
TH1F ** RunHistogramManager::makeTH1F ( const char *  name,
const char *  title,
const unsigned int  nbinx,
const double  xmin,
const double  xmax 
)

Definition at line 29 of file RunHistogramManager.cc.

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

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

                                                                                                                                        {

  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 66 of file RunHistogramManager.cc.

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

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

                                                                                                                                                                                                         {

  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 53 of file RunHistogramManager.cc.

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

Referenced by DigiInvestigatorHistogramMaker::book(), and MultiplicityCorrelatorHistogramMaker::MultiplicityCorrelatorHistogramMaker().

                                                                                                                                                {

  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 78 of file RunHistogramManager.cc.

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

Referenced by MultiplicityCorrelatorHistogramMaker::MultiplicityCorrelatorHistogramMaker().

                                                                                                                                                                                                                     {

  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

Definition at line 235 of file RunHistogramManager.h.

Referenced by beginRun().