CMS 3D CMS Logo

List of all members | Protected Member Functions | Protected Attributes
SummaryPlotFactoryBase Class Reference

#include <SummaryPlotFactoryBase.h>

Inheritance diagram for SummaryPlotFactoryBase:
SummaryPlotFactory< T > SummaryPlotFactory< CommissioningAnalysis *> SummaryPlotFactory< CommissioningAnalysis *> SummaryPlotFactory< FedCablingAnalysis * > ApvTimingSummaryFactory CalibrationScanSummaryFactory CalibrationSummaryFactory DaqScopeModeSummaryFactory FastFedCablingSummaryFactory NoiseSummaryFactory OptoScanSummaryFactory PedestalsSummaryFactory PedsFullNoiseSummaryFactory PedsOnlySummaryFactory SamplingSummaryFactory VpspScanSummaryFactory ApvTimingSummaryFactory CalibrationScanSummaryFactory CalibrationSummaryFactory DaqScopeModeSummaryFactory FastFedCablingSummaryFactory NoiseSummaryFactory OptoScanSummaryFactory PedestalsSummaryFactory PedsFullNoiseSummaryFactory PedsOnlySummaryFactory SamplingSummaryFactory VpspScanSummaryFactory

Protected Member Functions

void fill (TH1 &summary_histo)
 
void init (const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &top_level_dir, const sistrip::Granularity &)
 
 SummaryPlotFactoryBase ()
 
 ~SummaryPlotFactoryBase ()
 

Protected Attributes

SummaryGeneratorgenerator_
 
sistrip::Granularity gran_
 
std::string level_
 
sistrip::Monitorable mon_
 
sistrip::Presentation pres_
 
sistrip::View view_
 

Detailed Description

Definition at line 9 of file SummaryPlotFactoryBase.h.

Constructor & Destructor Documentation

◆ SummaryPlotFactoryBase()

SummaryPlotFactoryBase::SummaryPlotFactoryBase ( )
protected

◆ ~SummaryPlotFactoryBase()

SummaryPlotFactoryBase::~SummaryPlotFactoryBase ( )
protected

Definition at line 23 of file SummaryPlotFactoryBase.cc.

References generator_.

23  {
24  if (generator_) {
25  delete generator_;
26  }
27 }
SummaryGenerator * generator_

Member Function Documentation

◆ fill()

void SummaryPlotFactoryBase::fill ( TH1 &  summary_histo)
protected

Definition at line 99 of file SummaryPlotFactoryBase.cc.

References SummaryGenerator::format(), generator_, gran_, SummaryGenerator::histo1D(), SummaryGenerator::histo2DScatter(), SummaryGenerator::histo2DSum(), sistrip::HISTO_1D, sistrip::HISTO_2D_SCATTER, sistrip::HISTO_2D_SUM, level_, sistrip::mlSummaryPlots_, mon_, SummaryGenerator::nBins(), pres_, SiStripEnumsAndStrings::presentation(), SummaryGenerator::profile1D(), sistrip::PROFILE_1D, sistrip::UNKNOWN_RUN_TYPE, and view_.

Referenced by SummaryPlotFactory< CommissioningAnalysis *>::fill().

99  {
100  // Check if instance of generator class exists
101  if (!generator_) {
102  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactoryBase::" << __func__ << "]"
103  << " NULL pointer to SummaryGenerator object!";
104  return;
105  }
106 
107  // Check if map is filled
108  if (!generator_->nBins()) {
109  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactoryBase::" << __func__ << "]"
110  << " Zero bins returned by SummaryGenerator!";
111  return;
112  }
113 
114  // Print contents of map for histogram
115  //generator_->printMap();
116 
117  // Generate appropriate summary histogram
118  if (pres_ == sistrip::HISTO_1D) {
119  generator_->histo1D(summary_histo);
120  } else if (pres_ == sistrip::HISTO_2D_SUM) {
121  generator_->histo2DSum(summary_histo);
122  } else if (pres_ == sistrip::HISTO_2D_SCATTER) {
123  generator_->histo2DScatter(summary_histo);
124  } else if (pres_ == sistrip::PROFILE_1D) {
125  generator_->profile1D(summary_histo);
126  } else {
127  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactoryBase::" << __func__ << "]"
128  << " Unexpected presentation type: "
130  return;
131  }
132 
133  // Histogram formatting
135  mon_,
136  pres_,
137  view_,
138  level_,
139  gran_,
140  summary_histo);
141 }
void histo2DSum(TH1 &)
sistrip::Monitorable mon_
void histo2DScatter(TH1 &)
sistrip::Granularity gran_
void format(const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const sistrip::Granularity &, TH1 &)
static const char mlSummaryPlots_[]
sistrip::Presentation pres_
static std::string presentation(const sistrip::Presentation &)
SummaryGenerator * generator_
Log< level::Warning, false > LogWarning
uint32_t nBins() const

◆ init()

void SummaryPlotFactoryBase::init ( const sistrip::Monitorable mon,
const sistrip::Presentation pres,
const sistrip::View view,
const std::string &  top_level_dir,
const sistrip::Granularity gran 
)
protected

Definition at line 31 of file SummaryPlotFactoryBase.cc.

References SummaryGenerator::clearMap(), generator_, gran_, SiStripEnumsAndStrings::granularity(), sistrip::HISTO_1D, SummaryGenerator::instance(), gammaJetAnalysis_CHSJECs_cff::level, level_, sistrip::mlSummaryPlots_, LaserDQM_cfi::mon, mon_, SiStripEnumsAndStrings::monitorable(), pres_, SiStripEnumsAndStrings::presentation(), sistrip::UNDEFINED_GRAN, sistrip::UNDEFINED_MONITORABLE, sistrip::UNDEFINED_PRESENTATION, sistrip::UNDEFINED_VIEW, sistrip::undefinedView_, sistrip::UNKNOWN_GRAN, sistrip::UNKNOWN_MONITORABLE, sistrip::UNKNOWN_PRESENTATION, sistrip::UNKNOWN_VIEW, sistrip::unknownView_, SiStripEnumsAndStrings::view(), and view_.

Referenced by SummaryPlotFactory< CommissioningAnalysis *>::init().

35  {
36  // Create generator object
37  if (generator_) {
38  delete generator_;
39  generator_ = nullptr;
40  }
42 
43  // Check if generator object exists
44  if (!generator_) {
45  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactoryBase::" << __func__ << "]"
46  << " NULL pointer to generator object!";
47  return;
48  }
49 
50  // Clear map used to build histogram
52 
53  // Set parameters
54  mon_ = mon;
55  pres_ = pres;
56  view_ = view;
57  level_ = level;
58  gran_ = gran;
59 
60  // Some checks
62  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactoryBase::" << __func__ << "]"
63  << " Unexpected monitorable: " << SiStripEnumsAndStrings::monitorable(mon_);
64  }
65 
67  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactoryBase::" << __func__ << "]"
68  << " Unexpected presentation: " << SiStripEnumsAndStrings::presentation(pres_);
69  }
70 
72  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactoryBase::" << __func__ << "]"
73  << " Unexpected view: " << SiStripEnumsAndStrings::view(view_);
74  }
75 
76  if (level_.empty() || level_.find(sistrip::unknownView_) != std::string::npos ||
77  level_.find(sistrip::undefinedView_) != std::string::npos) {
78  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactoryBase::" << __func__ << "]"
79  << " Unexpected top-level directory: \"" << level_ << "\"";
80  }
81 
83  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlotFactoryBase::" << __func__ << "]"
84  << " Unexpected granularity: " << SiStripEnumsAndStrings::granularity(gran_);
85  }
86 
87  // ss << "[SummaryPlotFactoryBase::" << __func__ << "]"
88  // << " Dump of parameters defining summary plot:" << std::endl
89  // << " Monitorable : " << SiStripEnumsAndStrings::monitorable( mon_ ) << std::endl
90  // << " Presentation : " << SiStripEnumsAndStrings::presentation( pres_ ) << std::endl
91  // << " Logical view : " << SiStripEnumsAndStrings::view( view_ ) << std::endl
92  // << " Top level dir : " << level_ << std::endl
93  // << " Granularity : " << SiStripEnumsAndStrings::granularity( gran_ );
94  // LogTrace(mlSummaryPlots_) << ss.str();
95 }
static const char unknownView_[]
static std::string monitorable(const sistrip::Monitorable &)
sistrip::Monitorable mon_
static std::string granularity(const sistrip::Granularity &)
static SummaryGenerator * instance(const sistrip::View &)
static const char undefinedView_[]
static std::string view(const sistrip::View &)
sistrip::Granularity gran_
static const char mlSummaryPlots_[]
sistrip::Presentation pres_
static std::string presentation(const sistrip::Presentation &)
SummaryGenerator * generator_
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ generator_

SummaryGenerator* SummaryPlotFactoryBase::generator_
protected

◆ gran_

sistrip::Granularity SummaryPlotFactoryBase::gran_
protected

◆ level_

std::string SummaryPlotFactoryBase::level_
protected

◆ mon_

sistrip::Monitorable SummaryPlotFactoryBase::mon_
protected

◆ pres_

sistrip::Presentation SummaryPlotFactoryBase::pres_
protected

Definition at line 26 of file SummaryPlotFactoryBase.h.

Referenced by fill(), and init().

◆ view_

sistrip::View SummaryPlotFactoryBase::view_
protected

Definition at line 27 of file SummaryPlotFactoryBase.h.

Referenced by fill(), and init().