CMS 3D CMS Logo

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  :
31  _fillHistograms(fillHistograms),
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  :
26  _fillHistograms(fillHistograms),
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(), dumpFill::fillnum, edm::Run::getByToken(), edm::HandleBase::isValid(), edm::ConditionsInRunBlock::lhcFillNumber, 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
boost::uint32_t lhcFillNumber
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Run.h:342
bool isValid() const
Definition: HandleBase.h:74
bool failedToGet() const
Definition: HandleBase.h:78
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, compare_using_db::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, dataset::name, fftjetcommon_cfi::title, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

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

35  {
36 
37  TH1F** pointer =new TH1F*(nullptr);
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, dataset::name, fftjetcommon_cfi::title, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, Phase2TrackerMonitorDigi_cff::ymax, and Phase2TrackerMonitorDigi_cff::ymin.

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

72  {
73 
74  TH2F** pointer = new TH2F*(nullptr);
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, dataset::name, fftjetcommon_cfi::title, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

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

59  {
60 
61  TProfile** pointer =new TProfile*(nullptr);
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, dataset::name, fftjetcommon_cfi::title, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, Phase2TrackerMonitorDigi_cff::ymax, and Phase2TrackerMonitorDigi_cff::ymin.

Referenced by DigiBXCorrHistogramMaker< T >::book(), VertexHistogramMaker::book(), and MultiplicityCorrelatorHistogramMaker::MultiplicityCorrelatorHistogramMaker().

84  {
85 
86  TProfile2D** pointer = new TProfile2D*(nullptr);
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