test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 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  // Check if instance of generator class exists
131  if ( !(&summary_histo) ) {
133  << "[SummaryPlotFactoryBase::" << __func__ << "]"
134  << " NULL pointer to TH1 object!";
135  return;
136  }
137 
138  // Print contents of map for histogram
139  //generator_->printMap();
140 
141  // Generate appropriate summary histogram
142  if ( pres_ == sistrip::HISTO_1D ) {
143  generator_->histo1D( summary_histo );
144  } else if ( pres_ == sistrip::HISTO_2D_SUM ) {
145  generator_->histo2DSum( summary_histo );
146  } else if ( pres_ == sistrip::HISTO_2D_SCATTER ) {
147  generator_->histo2DScatter( summary_histo );
148  } else if ( pres_ == sistrip::PROFILE_1D ) {
149  generator_->profile1D( summary_histo );
150  } else {
152  << "[SummaryPlotFactoryBase::" << __func__ << "]"
153  << " Unexpected presentation type: "
155  return;
156  }
157 
158  // Histogram formatting
160  mon_,
161  pres_,
162  view_,
163  level_,
164  gran_,
165  summary_histo );
166 
167 }
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(), testEve_cfg::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_ = 0; }
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_
tuple level
Definition: testEve_cfg.py:34

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