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 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 ( )
protected
SummaryPlotFactoryBase::~SummaryPlotFactoryBase ( )
protected

Definition at line 22 of file SummaryPlotFactoryBase.cc.

References generator_.

22  {
23  if ( generator_ ) { delete generator_; }
24 }
SummaryGenerator * generator_

Member Function Documentation

void SummaryPlotFactoryBase::fill ( TH1 &  summary_histo)
protected

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

112  {
113 
114  // Check if instance of generator class exists
115  if ( !generator_ ) {
117  << "[SummaryPlotFactoryBase::" << __func__ << "]"
118  << " NULL pointer to SummaryGenerator object!";
119  return;
120  }
121 
122  // Check if map is filled
123  if ( !generator_->nBins() ) {
125  << "[SummaryPlotFactoryBase::" << __func__ << "]"
126  << " Zero bins returned by SummaryGenerator!";
127  return;
128  }
129 
130  // Print contents of map for histogram
131  //generator_->printMap();
132 
133  // Generate appropriate summary histogram
134  if ( pres_ == sistrip::HISTO_1D ) {
135  generator_->histo1D( summary_histo );
136  } else if ( pres_ == sistrip::HISTO_2D_SUM ) {
137  generator_->histo2DSum( summary_histo );
138  } else if ( pres_ == sistrip::HISTO_2D_SCATTER ) {
139  generator_->histo2DScatter( summary_histo );
140  } else if ( pres_ == sistrip::PROFILE_1D ) {
141  generator_->profile1D( summary_histo );
142  } else {
144  << "[SummaryPlotFactoryBase::" << __func__ << "]"
145  << " Unexpected presentation type: "
147  return;
148  }
149 
150  // Histogram formatting
152  mon_,
153  pres_,
154  view_,
155  level_,
156  gran_,
157  summary_histo );
158 
159 }
void histo2DSum(TH1 &)
sistrip::Monitorable mon_
void histo2DScatter(TH1 &)
uint32_t nBins() const
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_
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 28 of file SummaryPlotFactoryBase.cc.

References SummaryGenerator::clearMap(), generator_, gran_, SiStripEnumsAndStrings::granularity(), sistrip::HISTO_1D, SummaryGenerator::instance(), hcalDigis_cfi::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().

32  {
33 
34  // Create generator object
35  if ( generator_ ) { delete generator_; generator_ = nullptr; }
37 
38  // Check if generator object exists
39  if ( !generator_ ) {
41  << "[SummaryPlotFactoryBase::" << __func__ << "]"
42  << " NULL pointer to generator object!";
43  return;
44  }
45 
46  // Clear map used to build histogram
48 
49  // Set parameters
50  mon_ = mon;
51  pres_ = pres;
52  view_ = view;
53  level_ = level;
54  gran_ = gran;
55 
56  // Some checks
60  << "[SummaryPlotFactoryBase::" << __func__ << "]"
61  << " Unexpected monitorable: "
63  }
64 
68  << "[SummaryPlotFactoryBase::" << __func__ << "]"
69  << " Unexpected presentation: "
71  }
72 
73  if ( view_ == sistrip::UNKNOWN_VIEW ||
76  << "[SummaryPlotFactoryBase::" << __func__ << "]"
77  << " Unexpected view: "
79  }
80 
81  if ( level_.empty() ||
82  level_.find(sistrip::unknownView_) != std::string::npos ||
83  level_.find(sistrip::undefinedView_) != std::string::npos ) {
85  << "[SummaryPlotFactoryBase::" << __func__ << "]"
86  << " Unexpected top-level directory: \""
87  << level_ << "\"";
88  }
89 
90  if ( ( gran_ == sistrip::UNKNOWN_GRAN ||
92  pres != sistrip::HISTO_1D ) {
94  << "[SummaryPlotFactoryBase::" << __func__ << "]"
95  << " Unexpected granularity: "
97  }
98 
99 // ss << "[SummaryPlotFactoryBase::" << __func__ << "]"
100 // << " Dump of parameters defining summary plot:" << std::endl
101 // << " Monitorable : " << SiStripEnumsAndStrings::monitorable( mon_ ) << std::endl
102 // << " Presentation : " << SiStripEnumsAndStrings::presentation( pres_ ) << std::endl
103 // << " Logical view : " << SiStripEnumsAndStrings::view( view_ ) << std::endl
104 // << " Top level dir : " << level_ << std::endl
105 // << " Granularity : " << SiStripEnumsAndStrings::granularity( gran_ );
106 // LogTrace(mlSummaryPlots_) << ss.str();
107 
108 }
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_

Member Data Documentation

SummaryGenerator* SummaryPlotFactoryBase::generator_
protected
sistrip::Granularity SummaryPlotFactoryBase::gran_
protected
std::string SummaryPlotFactoryBase::level_
protected
sistrip::Monitorable SummaryPlotFactoryBase::mon_
protected
sistrip::Presentation SummaryPlotFactoryBase::pres_
protected

Definition at line 29 of file SummaryPlotFactoryBase.h.

Referenced by fill(), and init().

sistrip::View SummaryPlotFactoryBase::view_
protected

Definition at line 30 of file SummaryPlotFactoryBase.h.

Referenced by fill(), and init().