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< FedCablingAnalysis * > 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.

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

References generator_.

Member Function Documentation

◆ fill()

void SummaryPlotFactoryBase::fill ( TH1 &  summary_histo)
protected

Definition at line 99 of file SummaryPlotFactoryBase.cc.

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 }

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< FedCablingAnalysis * >::fill(), SummaryPlotFactory< T >::fill(), and SummaryPlotFactory< CommissioningAnalysis * >::fill().

◆ 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.

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 }

References SummaryGenerator::clearMap(), generator_, gran_, SiStripEnumsAndStrings::granularity(), sistrip::HISTO_1D, SummaryGenerator::instance(), personalPlayback::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< FedCablingAnalysis * >::init(), SummaryPlotFactory< T >::init(), and SummaryPlotFactory< CommissioningAnalysis * >::init().

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().

personalPlayback.level
level
Definition: personalPlayback.py:22
sistrip::UNKNOWN_MONITORABLE
Definition: ConstantsForMonitorable.h:201
sistrip::UNDEFINED_VIEW
Definition: ConstantsForView.h:28
SummaryPlotFactoryBase::mon_
sistrip::Monitorable mon_
Definition: SummaryPlotFactoryBase.h:25
sistrip::unknownView_
static const char unknownView_[]
Definition: ConstantsForView.h:17
sistrip::HISTO_2D_SUM
Definition: ConstantsForPresentation.h:32
sistrip::UNDEFINED_PRESENTATION
Definition: ConstantsForPresentation.h:30
sistrip::undefinedView_
static const char undefinedView_[]
Definition: ConstantsForView.h:18
sistrip::UNKNOWN_GRAN
Definition: ConstantsForGranularity.h:62
SummaryPlotFactoryBase::level_
std::string level_
Definition: SummaryPlotFactoryBase.h:28
SummaryGenerator::profile1D
void profile1D(TH1 &)
Definition: SummaryGenerator.cc:385
SummaryGenerator::clearMap
void clearMap()
Definition: SummaryGenerator.cc:184
SiStripEnumsAndStrings::presentation
static std::string presentation(const sistrip::Presentation &)
Definition: SiStripEnumsAndStrings.cc:1237
SiStripEnumsAndStrings::granularity
static std::string granularity(const sistrip::Granularity &)
Definition: SiStripEnumsAndStrings.cc:265
LaserDQM_cfi.mon
mon
Definition: LaserDQM_cfi.py:3
edm::LogWarning
Definition: MessageLogger.h:141
sistrip::HISTO_1D
Definition: ConstantsForPresentation.h:31
SummaryPlotFactoryBase::pres_
sistrip::Presentation pres_
Definition: SummaryPlotFactoryBase.h:26
SummaryPlotFactoryBase::generator_
SummaryGenerator * generator_
Definition: SummaryPlotFactoryBase.h:32
sistrip::HISTO_2D_SCATTER
Definition: ConstantsForPresentation.h:33
sistrip::UNKNOWN_RUN_TYPE
Definition: ConstantsForRunType.h:94
sistrip::PROFILE_1D
Definition: ConstantsForPresentation.h:34
SummaryPlotFactoryBase::view_
sistrip::View view_
Definition: SummaryPlotFactoryBase.h:27
SiStripEnumsAndStrings::view
static std::string view(const sistrip::View &)
Definition: SiStripEnumsAndStrings.cc:5
SummaryGenerator::histo2DSum
void histo2DSum(TH1 &)
Definition: SummaryGenerator.cc:309
sistrip::root_
static const char root_[]
Definition: ConstantsForDqm.h:30
SummaryGenerator::instance
static SummaryGenerator * instance(const sistrip::View &)
Definition: SummaryGenerator.cc:23
SiStripEnumsAndStrings::monitorable
static std::string monitorable(const sistrip::Monitorable &)
Definition: SiStripEnumsAndStrings.cc:547
sistrip::UNKNOWN_VIEW
Definition: ConstantsForView.h:27
SummaryPlotFactoryBase::gran_
sistrip::Granularity gran_
Definition: SummaryPlotFactoryBase.h:29
sistrip::UNDEFINED_MONITORABLE
Definition: ConstantsForMonitorable.h:202
sistrip::mlSummaryPlots_
static const char mlSummaryPlots_[]
Definition: ConstantsForLogger.h:26
SummaryGenerator::histo1D
void histo1D(TH1 &)
Definition: SummaryGenerator.cc:261
SummaryGenerator::nBins
uint32_t nBins() const
Definition: SummaryGenerator.h:134
sistrip::UNKNOWN_PRESENTATION
Definition: ConstantsForPresentation.h:29
SummaryGenerator::histo2DScatter
void histo2DScatter(TH1 &)
Definition: SummaryGenerator.cc:347
sistrip::UNDEFINED_GRAN
Definition: ConstantsForGranularity.h:61
SummaryGenerator::format
void format(const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const sistrip::Granularity &, TH1 &)
Definition: SummaryGenerator.cc:107