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 210 of file RunHistogramManager.h.

Constructor & Destructor Documentation

◆ RunHistogramManager() [1/2]

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

Definition at line 28 of file RunHistogramManager.cc.

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

◆ RunHistogramManager() [2/2]

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

Definition at line 23 of file RunHistogramManager.cc.

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

◆ ~RunHistogramManager()

RunHistogramManager::~RunHistogramManager ( )

Definition at line 45 of file RunHistogramManager.cc.

References _histograms, trackingPlots::hp, and LogDebug.

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

Member Function Documentation

◆ beginRun() [1/4]

void RunHistogramManager::beginRun ( const edm::Run iRun)

◆ beginRun() [2/4]

void RunHistogramManager::beginRun ( const edm::Run iRun,
TFileDirectory subdir 
)

Definition at line 106 of file RunHistogramManager.cc.

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

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

◆ beginRun() [3/4]

void RunHistogramManager::beginRun ( const unsigned int  irun)

Definition at line 122 of file RunHistogramManager.cc.

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

122  {
124  beginRun(irun, tfserv->tFileDirectory());
125 }
TFileDirectory & tFileDirectory()
Definition: TFileService.h:42
void beginRun(const edm::Run &iRun)

◆ beginRun() [4/4]

void RunHistogramManager::beginRun ( const unsigned int  irun,
TFileDirectory subdir 
)

Definition at line 127 of file RunHistogramManager.cc.

References _fillHistograms, _histograms, BTVHLTOfflineSource_cfi::dirname, and mkLumiAveragedPlots::subdir.

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

◆ makeTH1F()

TH1F ** RunHistogramManager::makeTH1F ( const char *  name,
const char *  title,
const unsigned int  nbinx,
const double  xmin,
const double  xmax 
)

Definition at line 33 of file RunHistogramManager.cc.

References _histograms, trackingPlots::hp, LogDebug, mergeVDriftHistosByStation::name, runGCPTkAlMap::title, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

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

34  {
35  TH1F** pointer = new TH1F*(nullptr);
36 
37  BaseHistoParams* hp = new HistoParams<TH1F>(pointer, "TH1F", name, title, nbinx, xmin, xmax);
38  _histograms.push_back(hp);
39 
40  LogDebug("TH1Fmade") << "Histogram " << name << " " << title << " pre-booked:" << _histograms.size();
41 
42  return pointer;
43 }
std::vector< BaseHistoParams * > _histograms
#define LogDebug(id)

◆ makeTH2F()

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, trackingPlots::hp, LogDebug, mergeVDriftHistosByStation::name, runGCPTkAlMap::title, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

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

71  {
72  TH2F** pointer = new TH2F*(nullptr);
73 
74  BaseHistoParams* hp = new HistoParams<TH2F>(pointer, "TH2F", name, title, nbinx, xmin, xmax, nbiny, ymin, ymax);
75  _histograms.push_back(hp);
76 
77  LogDebug("TH2Fmade") << "Histogram " << name << " " << title << " pre-booked :" << _histograms.size();
78 
79  return pointer;
80 }
std::vector< BaseHistoParams * > _histograms
#define LogDebug(id)

◆ makeTProfile()

TProfile ** RunHistogramManager::makeTProfile ( const char *  name,
const char *  title,
const unsigned int  nbinx,
const double  xmin,
const double  xmax 
)

Definition at line 52 of file RunHistogramManager.cc.

References _histograms, trackingPlots::hp, LogDebug, mergeVDriftHistosByStation::name, runGCPTkAlMap::title, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

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

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

◆ makeTProfile2D()

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 82 of file RunHistogramManager.cc.

References _histograms, trackingPlots::hp, LogDebug, mergeVDriftHistosByStation::name, runGCPTkAlMap::title, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

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

89  {
90  TProfile2D** pointer = new TProfile2D*(nullptr);
91 
93  new HistoParams<TProfile2D>(pointer, "TProfile2D", name, title, nbinx, xmin, xmax, nbiny, ymin, ymax);
94  _histograms.push_back(hp);
95 
96  LogDebug("TProfile2Dmade") << "Histogram " << name << " " << title << " pre-booked :" << _histograms.size();
97 
98  return pointer;
99 }
std::vector< BaseHistoParams * > _histograms
#define LogDebug(id)

Member Data Documentation

◆ _conditionsInRunToken

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

Definition at line 244 of file RunHistogramManager.h.

Referenced by beginRun().

◆ _fillHistograms

bool RunHistogramManager::_fillHistograms
private

Definition at line 242 of file RunHistogramManager.h.

Referenced by beginRun().

◆ _histograms

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