test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SummaryHistogramFactory< T > Class Template Reference

#include <SummaryHistogramFactory.h>

Public Member Functions

uint32_t extract (const std::map< uint32_t, T > &data)
 
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 &)
 
 SummaryHistogramFactory ()
 
 ~SummaryHistogramFactory ()
 

Private Attributes

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

Detailed Description

template<class T>
class SummaryHistogramFactory< T >

Definition at line 13 of file SummaryHistogramFactory.h.

Constructor & Destructor Documentation

template<class T >
SummaryHistogramFactory< T >::~SummaryHistogramFactory ( )

Definition at line 27 of file SummaryHistogramFactory.cc.

References LogTrace, and sistrip::mlSummaryPlots_.

27  {
28  LogTrace(mlSummaryPlots_) << "[SummaryHistogramFactory::" << __func__ << "]";
29  if ( generator_ ) { delete generator_; }
30 }
#define LogTrace(id)
static const char mlSummaryPlots_[]

Member Function Documentation

template<class T >
uint32_t SummaryHistogramFactory< T >::extract ( const std::map< uint32_t, T > &  data)

Definition at line 59 of file SummaryHistogramFactory.cc.

References LogTrace, and sistrip::mlSummaryPlots_.

Referenced by BeautifulSoup.PageElement::_invert(), and BeautifulSoup.Tag::decompose().

59  {
60  LogTrace(mlSummaryPlots_) << "[SummaryHistogramFactory::" << __func__ << "]";
61 
62  // Check if data are present
63  if ( data.empty() ) {
64  edm::LogWarning(mlSummaryPlots_) << "[SummaryHistogramFactory::" << __func__ << "]"
65  << " No data in monitorables std::map!";
66  return 0;
67  }
68 
69  // Check if instance of generator class exists
70  if ( !generator_ ) {
71  edm::LogWarning(mlSummaryPlots_) << "[SummaryHistogramFactory::" << __func__ << "]"
72  << " NULL pointer to SummaryGenerator object!";
73  return 0;
74  }
75 
76  // Transfer appropriate monitorables info to generator object
78  typename std::map<uint32_t,T>::const_iterator iter = data.begin();
79  for ( ; iter != data.end(); iter++ ) {
80  generator_->fillMap( level_, // top-level directory
81  gran_, // granularity
82  iter->first, // device key
83  static_cast<float>(iter->second) ); // value
84  }
85 
86  return generator_->size();
87 }
void fillMap(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
uint32_t size() const
#define LogTrace(id)
static const char mlSummaryPlots_[]
template<class T >
void SummaryHistogramFactory< T >::fill ( TH1 &  summary_histo)

Definition at line 92 of file SummaryHistogramFactory.cc.

References sistrip::HISTO_1D, sistrip::HISTO_2D_SCATTER, sistrip::HISTO_2D_SUM, LogTrace, sistrip::mlSummaryPlots_, sistrip::PROFILE_1D, and sistrip::UNKNOWN_RUN_TYPE.

92  {
93  LogTrace(mlSummaryPlots_) << "[SummaryHistogramFactory::" << __func__ << "]";
94 
95  // Check if instance of generator class exists
96  if ( !generator_ ) {
97  edm::LogWarning(mlSummaryPlots_) << "[SummaryHistogramFactory::" << __func__ << "]"
98  << " NULL pointer to SummaryGenerator object!";
99  return;
100  }
101 
102  // Check if instance of generator class exists
103  if ( !(&summary_histo) ) {
104  edm::LogWarning(mlSummaryPlots_) << "[SummaryHistogramFactory::" << __func__ << "]"
105  << " NULL pointer to SummaryGenerator object!";
106  return;
107  }
108 
109  // Check if std::map is filled
110  if ( !generator_->size() ) {
111  edm::LogWarning(mlSummaryPlots_) << "[SummaryHistogramFactory::" << __func__ << "]"
112  << " No data in the monitorables std::map!";
113  return;
114  }
115 
116  // Generate appropriate summary histogram
117  if ( pres_ == sistrip::HISTO_1D ) {
118  generator_->histo1D( summary_histo );
119  } else if ( pres_ == sistrip::HISTO_2D_SUM ) {
120  generator_->histo2DSum( summary_histo );
121  } else if ( pres_ == sistrip::HISTO_2D_SCATTER ) {
122  generator_->histo2DScatter( summary_histo );
123  } else if ( pres_ == sistrip::PROFILE_1D ) {
124  generator_->profile1D( summary_histo );
125  } else { return; }
126 
127  // Histogram formatting
129 
130 }
void histo2DSum(TH1 &)
void histo2DScatter(TH1 &)
uint32_t size() const
#define LogTrace(id)
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_
template<class T >
void SummaryHistogramFactory< T >::init ( const sistrip::Monitorable mon,
const sistrip::Presentation pres,
const sistrip::View view,
const std::string &  top_level_dir,
const sistrip::Granularity gran 
)

Definition at line 35 of file SummaryHistogramFactory.cc.

References SummaryGenerator::instance(), LogTrace, sistrip::mlSummaryPlots_, and LaserDQM_cfi::mon.

39  {
40  LogTrace(mlSummaryPlots_) << "[SummaryHistogramFactory::" << __func__ << "]";
41  mon_ = mon;
42  pres_ = pres;
43  view_ = view;
44  level_ = top_level_dir;
45  gran_ = gran;
46 
47  // Retrieve utility class used to generate summary histograms
48  if ( generator_ ) {
49  delete generator_;
50  generator_ = 0;
52  }
53 
54 }
static SummaryGenerator * instance(const sistrip::View &)
#define LogTrace(id)
static const char mlSummaryPlots_[]
sistrip::Presentation pres_

Member Data Documentation

template<class T >
SummaryGenerator* SummaryHistogramFactory< T >::generator_
private
template<class T >
sistrip::Granularity SummaryHistogramFactory< T >::gran_
private
template<class T >
std::string SummaryHistogramFactory< T >::level_
private
template<class T >
sistrip::Monitorable SummaryHistogramFactory< T >::mon_
private
template<class T >
sistrip::Presentation SummaryHistogramFactory< T >::pres_
private
template<class T >
sistrip::View SummaryHistogramFactory< T >::view_
private