CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
RunHistogramManager Class Reference

#include <RunHistogramManager.h>

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.

26  :
std::vector< BaseHistoParams * > _histograms
RunHistogramManager::~RunHistogramManager ( )

Definition at line 42 of file RunHistogramManager.cc.

References _histograms, and LogDebug.

42  {
43 
44  for(std::vector<BaseHistoParams*>::const_iterator hp=_histograms.begin();hp!=_histograms.end();++hp) {
45 
46  delete *hp;
47 
48  }
49  LogDebug("Destructor") << "All BaseHistoParams destroyed ";
50 
51 }
#define LogDebug(id)
std::vector< BaseHistoParams * > _histograms

Member Function Documentation

void RunHistogramManager::beginRun ( const edm::Run iRun)
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().

97  {
98 
99  if(!_fillHistograms) {
100  beginRun(iRun.run(),subdir);
101  }
102  else {
104  iRun.getByLabel("conditionsInEdm",cirb);
105 
106  beginRun(cirb->lhcFillNumber,subdir);
107  }
108 }
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Definition: Run.h:177
RunNumber_t run() const
Definition: RunBase.h:42
void beginRun(const edm::Run &iRun)
void RunHistogramManager::beginRun ( const unsigned int  irun)

Definition at line 110 of file RunHistogramManager.cc.

References beginRun().

110  {
111 
113  beginRun(irun,*tfserv);
114 
115 }
void 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, combineCards::dirname, and TFileDirectory::mkdir().

117  {
118 
119  // create/go to the run subdirectory
120 
121  char fillrun[30];
122 
123  if(!_fillHistograms) {
124  sprintf(fillrun,"%s","run");
125  }
126  else {
127  sprintf(fillrun,"%s","fill");
128  }
129 
130  char dirname[300];
131  sprintf(dirname,"%s_%d",fillrun,irun);
132  TFileDirectory subrun = subdir.mkdir(dirname);
133 
134  // loop on the histograms and update the pointer references
135 
136  for(unsigned int ih=0;ih<_histograms.size();++ih) {
137 
138  _histograms[ih]->beginRun(irun,subrun,fillrun);
139 
140  }
141 }
std::vector< BaseHistoParams * > _histograms
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
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().

29  {
30 
31  TH1F** pointer =new TH1F*(0);
32 
33  BaseHistoParams* hp = new HistoParams<TH1F>(pointer,"TH1F",name,title,nbinx,xmin,xmax);
34  _histograms.push_back(hp);
35 
36  LogDebug("TH1Fmade") << "Histogram " << name << " " << title << " pre-booked:" << _histograms.size();
37 
38  return pointer;
39 
40 }
#define LogDebug(id)
std::vector< BaseHistoParams * > _histograms
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().

66  {
67 
68  TH2F** pointer = new TH2F*(0);
69 
70  BaseHistoParams* hp = new HistoParams<TH2F>(pointer,"TH2F",name,title,nbinx,xmin,xmax,nbiny,ymin,ymax);
71  _histograms.push_back(hp);
72 
73  LogDebug("TH2Fmade") << "Histogram " << name << " " << title << " pre-booked :" << _histograms.size();
74 
75  return pointer;
76 }
#define LogDebug(id)
std::vector< BaseHistoParams * > _histograms
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().

53  {
54 
55  TProfile** pointer =new TProfile*(0);
56 
57  BaseHistoParams* hp = new HistoParams<TProfile>(pointer,"TProfile",name,title,nbinx,xmin,xmax);
58  _histograms.push_back(hp);
59 
60  LogDebug("TProfilemade") << "Histogram " << name << " " << title << " pre-booked:" << _histograms.size();
61 
62  return pointer;
63 
64 }
#define LogDebug(id)
std::vector< BaseHistoParams * > _histograms
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().

78  {
79 
80  TProfile2D** pointer = new TProfile2D*(0);
81 
82  BaseHistoParams* hp = new HistoParams<TProfile2D>(pointer,"TProfile2D",name,title,nbinx,xmin,xmax,nbiny,ymin,ymax);
83  _histograms.push_back(hp);
84 
85  LogDebug("TProfile2Dmade") << "Histogram " << name << " " << title << " pre-booked :" << _histograms.size();
86 
87  return pointer;
88 }
#define LogDebug(id)
std::vector< BaseHistoParams * > _histograms

Member Data Documentation

bool RunHistogramManager::_fillHistograms
private

Definition at line 235 of file RunHistogramManager.h.

Referenced by beginRun().

std::vector<BaseHistoParams*> RunHistogramManager::_histograms
private