test
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 (edm::ConsumesCollector &&iC, const bool fillHistograms=false)
 
 RunHistogramManager (edm::ConsumesCollector &iC, const bool fillHistograms=false)
 
 ~RunHistogramManager ()
 

Private Attributes

edm::EDGetTokenT
< edm::ConditionsInRunBlock
_conditionsInRunToken
 
bool _fillHistograms
 
std::vector< BaseHistoParams * > _histograms
 

Detailed Description

Definition at line 217 of file RunHistogramManager.h.

Constructor & Destructor Documentation

RunHistogramManager::RunHistogramManager ( edm::ConsumesCollector &&  iC,
const bool  fillHistograms = false 
)

Definition at line 30 of file RunHistogramManager.cc.

30  :
32  _histograms(),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::ConditionsInRunBlock > _conditionsInRunToken
std::vector< BaseHistoParams * > _histograms
RunHistogramManager::RunHistogramManager ( edm::ConsumesCollector iC,
const bool  fillHistograms = false 
)

Definition at line 25 of file RunHistogramManager.cc.

25  :
27  _histograms(),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::ConditionsInRunBlock > _conditionsInRunToken
std::vector< BaseHistoParams * > _histograms
RunHistogramManager::~RunHistogramManager ( )

Definition at line 48 of file RunHistogramManager.cc.

References _histograms, AnalysisDataFormats_SUSYBSMObjects::hp, and LogDebug.

48  {
49 
50  for(std::vector<BaseHistoParams*>::const_iterator hp=_histograms.begin();hp!=_histograms.end();++hp) {
51 
52  delete *hp;
53 
54  }
55  LogDebug("Destructor") << "All BaseHistoParams destroyed ";
56 
57 }
#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 103 of file RunHistogramManager.cc.

References _conditionsInRunToken, _fillHistograms, beginRun(), edm::HandleBase::failedToGet(), edm::Run::getByToken(), edm::HandleBase::isValid(), and edm::RunBase::run().

103  {
104 
105  if(!_fillHistograms) {
106  beginRun(iRun.run(),subdir);
107  }
108  else {
109  unsigned int fillnum = 0;
110 
113 
114  if(!cirb.failedToGet() && cirb.isValid()) fillnum=cirb->lhcFillNumber;
115 
116  beginRun(fillnum,subdir);
117  }
118 }
edm::EDGetTokenT< edm::ConditionsInRunBlock > _conditionsInRunToken
RunNumber_t run() const
Definition: RunBase.h:40
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Run.h:258
bool isValid() const
Definition: HandleBase.h:75
bool failedToGet() const
Definition: HandleBase.h:79
void beginRun(const edm::Run &iRun)
void RunHistogramManager::beginRun ( const unsigned int  irun)

Definition at line 120 of file RunHistogramManager.cc.

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

120  {
121 
123  beginRun(irun, tfserv->tFileDirectory());
124 
125 }
TFileDirectory & tFileDirectory()
Definition: TFileService.h:42
void beginRun(const edm::Run &iRun)
void RunHistogramManager::beginRun ( const unsigned int  irun,
TFileDirectory subdir 
)

Definition at line 127 of file RunHistogramManager.cc.

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

127  {
128 
129  // create/go to the run subdirectory
130 
131  char fillrun[30];
132 
133  if(!_fillHistograms) {
134  sprintf(fillrun,"%s","run");
135  }
136  else {
137  sprintf(fillrun,"%s","fill");
138  }
139 
140  char dirname[300];
141  sprintf(dirname,"%s_%d",fillrun,irun);
142  TFileDirectory subrun = subdir.mkdir(dirname);
143 
144  // loop on the histograms and update the pointer references
145 
146  for(unsigned int ih=0;ih<_histograms.size();++ih) {
147 
148  _histograms[ih]->beginRun(irun,subrun,fillrun);
149 
150  }
151 }
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 35 of file RunHistogramManager.cc.

References _histograms, AnalysisDataFormats_SUSYBSMObjects::hp, LogDebug, mergeVDriftHistosByStation::name, indexGen::title, hlt_dqm_clientPB-live_cfg::xmax, and hlt_dqm_clientPB-live_cfg::xmin.

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

35  {
36 
37  TH1F** pointer =new TH1F*(0);
38 
39  BaseHistoParams* hp = new HistoParams<TH1F>(pointer,"TH1F",name,title,nbinx,xmin,xmax);
40  _histograms.push_back(hp);
41 
42  LogDebug("TH1Fmade") << "Histogram " << name << " " << title << " pre-booked:" << _histograms.size();
43 
44  return pointer;
45 
46 }
#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 72 of file RunHistogramManager.cc.

References _histograms, AnalysisDataFormats_SUSYBSMObjects::hp, LogDebug, mergeVDriftHistosByStation::name, indexGen::title, hlt_dqm_clientPB-live_cfg::xmax, hlt_dqm_clientPB-live_cfg::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

Referenced by VertexHistogramMaker::book(), BSvsPVHistogramMaker::book(), EventTimeDistribution::EventTimeDistribution(), L1ABCDebugger::L1ABCDebugger(), and MultiplicityCorrelatorHistogramMaker::MultiplicityCorrelatorHistogramMaker().

72  {
73 
74  TH2F** pointer = new TH2F*(0);
75 
76  BaseHistoParams* hp = new HistoParams<TH2F>(pointer,"TH2F",name,title,nbinx,xmin,xmax,nbiny,ymin,ymax);
77  _histograms.push_back(hp);
78 
79  LogDebug("TH2Fmade") << "Histogram " << name << " " << title << " pre-booked :" << _histograms.size();
80 
81  return pointer;
82 }
#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 59 of file RunHistogramManager.cc.

References _histograms, AnalysisDataFormats_SUSYBSMObjects::hp, LogDebug, mergeVDriftHistosByStation::name, indexGen::title, hlt_dqm_clientPB-live_cfg::xmax, and hlt_dqm_clientPB-live_cfg::xmin.

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

59  {
60 
61  TProfile** pointer =new TProfile*(0);
62 
63  BaseHistoParams* hp = new HistoParams<TProfile>(pointer,"TProfile",name,title,nbinx,xmin,xmax);
64  _histograms.push_back(hp);
65 
66  LogDebug("TProfilemade") << "Histogram " << name << " " << title << " pre-booked:" << _histograms.size();
67 
68  return pointer;
69 
70 }
#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 84 of file RunHistogramManager.cc.

References _histograms, AnalysisDataFormats_SUSYBSMObjects::hp, LogDebug, mergeVDriftHistosByStation::name, indexGen::title, hlt_dqm_clientPB-live_cfg::xmax, hlt_dqm_clientPB-live_cfg::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

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

84  {
85 
86  TProfile2D** pointer = new TProfile2D*(0);
87 
88  BaseHistoParams* hp = new HistoParams<TProfile2D>(pointer,"TProfile2D",name,title,nbinx,xmin,xmax,nbiny,ymin,ymax);
89  _histograms.push_back(hp);
90 
91  LogDebug("TProfile2Dmade") << "Histogram " << name << " " << title << " pre-booked :" << _histograms.size();
92 
93  return pointer;
94 }
#define LogDebug(id)
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
std::vector< BaseHistoParams * > _histograms

Member Data Documentation

edm::EDGetTokenT<edm::ConditionsInRunBlock> RunHistogramManager::_conditionsInRunToken
private

Definition at line 240 of file RunHistogramManager.h.

Referenced by beginRun().

bool RunHistogramManager::_fillHistograms
private

Definition at line 238 of file RunHistogramManager.h.

Referenced by beginRun().

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