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, AnalysisDataFormats_SUSYBSMObjects::hp, 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)
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
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::HandleBase::failedToGet(), edm::Run::getByLabel(), edm::HandleBase::isValid(), and edm::RunBase::run().

97  {
98 
99  if(!_fillHistograms) {
100  beginRun(iRun.run(),subdir);
101  }
102  else {
103  unsigned int fillnum = 0;
104 
106  iRun.getByLabel("conditionsInEdm",cirb);
107 
108  if(!cirb.failedToGet() && cirb.isValid()) fillnum=cirb->lhcFillNumber;
109 
110  beginRun(fillnum,subdir);
111  }
112 }
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Definition: Run.h:200
RunNumber_t run() const
Definition: RunBase.h:42
bool isValid() const
Definition: HandleBase.h:76
bool failedToGet() const
Definition: HandleBase.h:80
void beginRun(const edm::Run &iRun)
void RunHistogramManager::beginRun ( const unsigned int  irun)

Definition at line 114 of file RunHistogramManager.cc.

References beginRun(), and TFileService::tFileDirectory().

114  {
115 
117  beginRun(irun, tfserv->tFileDirectory());
118 
119 }
TFileDirectory & tFileDirectory()
Definition: TFileService.h:42
void beginRun(const edm::Run &iRun)
void RunHistogramManager::beginRun ( const unsigned int  irun,
TFileDirectory subdir 
)

Definition at line 121 of file RunHistogramManager.cc.

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

121  {
122 
123  // create/go to the run subdirectory
124 
125  char fillrun[30];
126 
127  if(!_fillHistograms) {
128  sprintf(fillrun,"%s","run");
129  }
130  else {
131  sprintf(fillrun,"%s","fill");
132  }
133 
134  char dirname[300];
135  sprintf(dirname,"%s_%d",fillrun,irun);
136  TFileDirectory subrun = subdir.mkdir(dirname);
137 
138  // loop on the histograms and update the pointer references
139 
140  for(unsigned int ih=0;ih<_histograms.size();++ih) {
141 
142  _histograms[ih]->beginRun(irun,subrun,fillrun);
143 
144  }
145 }
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, AnalysisDataFormats_SUSYBSMObjects::hp, LogDebug, mergeVDriftHistosByStation::name, indexGen::title, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.

Referenced by APVCyclePhaseMonitor::APVCyclePhaseMonitor(), APVCyclePhaseProducerFromL1ABC::APVCyclePhaseProducerFromL1ABC(), APVCyclePhaseProducerFromL1TS::APVCyclePhaseProducerFromL1TS(), APVShotsAnalyzer::APVShotsAnalyzer(), BeamSpotHistogramMaker::book(), VertexHistogramMaker::book(), BSvsPVHistogramMaker::book(), EventTimeDistribution::EventTimeDistribution(), FEDBadModuleFilter::FEDBadModuleFilter(), MultiplicityCorrelatorHistogramMaker::MultiplicityCorrelatorHistogramMaker(), and OccupancyPlots::OccupancyPlots().

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)
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
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, AnalysisDataFormats_SUSYBSMObjects::hp, LogDebug, mergeVDriftHistosByStation::name, indexGen::title, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

Referenced by VertexHistogramMaker::book(), BSvsPVHistogramMaker::book(), 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)
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
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, AnalysisDataFormats_SUSYBSMObjects::hp, LogDebug, mergeVDriftHistosByStation::name, indexGen::title, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.

Referenced by APVCyclePhaseMonitor::APVCyclePhaseMonitor(), APVShotsAnalyzer::APVShotsAnalyzer(), DigiInvestigatorHistogramMaker::book(), BeamSpotHistogramMaker::book(), VertexHistogramMaker::book(), BSvsPVHistogramMaker::book(), FEDBadModuleFilter::FEDBadModuleFilter(), MultiplicityCorrelatorHistogramMaker::MultiplicityCorrelatorHistogramMaker(), OccupancyPlots::OccupancyPlots(), SiPixelQualityHistory::SiPixelQualityHistory(), and SiStripQualityHistory::SiStripQualityHistory().

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)
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
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, AnalysisDataFormats_SUSYBSMObjects::hp, LogDebug, mergeVDriftHistosByStation::name, indexGen::title, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

Referenced by VertexHistogramMaker::book(), and 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)
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
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