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 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.

24  :
25  _histograms() { }
std::vector< BaseHistoParams * > _histograms
RunHistogramManager::~RunHistogramManager ( )

Definition at line 40 of file RunHistogramManager.cc.

References _histograms, and LogDebug.

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

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().

88  {
89 
90  beginRun(iRun.run());
91 
92 }
RunNumber_t run() const
Definition: RunBase.h:44
void beginRun(const edm::Run &iRun)
void RunHistogramManager::beginRun ( const unsigned int  irun)

Definition at line 94 of file RunHistogramManager.cc.

References beginRun().

94  {
95 
97  beginRun(irun,*tfserv);
98 
99 }
void beginRun(const edm::Run &iRun)
void RunHistogramManager::beginRun ( const unsigned int  irun,
TFileDirectory subdir 
)

Definition at line 101 of file RunHistogramManager.cc.

References _histograms, and TFileDirectory::mkdir().

101  {
102 
103  // create/go to the run subdirectory
104 
105  char dirname[300];
106  sprintf(dirname,"run_%d",irun);
107  TFileDirectory subrun = subdir.mkdir(dirname);
108 
109  // loop on the histograms and update the pointer references
110 
111  for(unsigned int ih=0;ih<_histograms.size();++ih) {
112 
113  _histograms[ih]->beginRun(irun,subrun);
114 
115  }
116 }
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 27 of file RunHistogramManager.cc.

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

Referenced by EventTimeDistribution::EventTimeDistribution().

27  {
28 
29  TH1F** pointer =new TH1F*(0);
30 
31  BaseHistoParams* hp = new HistoParams<TH1F>(pointer,"TH1F",name,title,nbinx,xmin,xmax);
32  _histograms.push_back(hp);
33 
34  LogDebug("TH1Fmade") << "Histogram " << name << " " << title << " pre-booked:" << _histograms.size();
35 
36  return pointer;
37 
38 }
#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 64 of file RunHistogramManager.cc.

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

Referenced by EventTimeDistribution::EventTimeDistribution().

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

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

51  {
52 
53  TProfile** pointer =new TProfile*(0);
54 
55  BaseHistoParams* hp = new HistoParams<TProfile>(pointer,"TProfile",name,title,nbinx,xmin,xmax);
56  _histograms.push_back(hp);
57 
58  LogDebug("TProfilemade") << "Histogram " << name << " " << title << " pre-booked:" << _histograms.size();
59 
60  return pointer;
61 
62 }
#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 76 of file RunHistogramManager.cc.

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

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

Member Data Documentation

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