CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SummaryPlot Class Reference

Class holding info that defines a summary plot. More...

#include <SummaryPlot.h>

Public Member Functions

const sistrip::Granularitygranularity () const
 
const bool & isValid () const
 
const std::string & level () const
 
const sistrip::Monitorablemonitorable () const
 
const sistrip::Presentationpresentation () const
 
void print (std::stringstream &) const
 
void reset ()
 
 SummaryPlot (const std::string &monitorable, const std::string &presentation, const std::string &granularity, const std::string &level)
 
 SummaryPlot (const SummaryPlot &)
 
 SummaryPlot ()
 
const sistrip::Viewview () const
 
 ~SummaryPlot ()
 

Private Member Functions

void check ()
 

Private Attributes

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

Detailed Description

Class holding info that defines a summary plot.

Author
R.Bainbridge, P.Kalavase

Definition at line 19 of file SummaryPlot.h.

Constructor & Destructor Documentation

◆ SummaryPlot() [1/3]

SummaryPlot::SummaryPlot ( const std::string &  monitorable,
const std::string &  presentation,
const std::string &  granularity,
const std::string &  level 
)

Definition at line 9 of file SummaryPlot.cc.

References check(), gran_, SiStripEnumsAndStrings::granularity(), granularity(), sistrip::HISTO_1D, isValid_, level(), level_, sistrip::mlSummaryPlots_, mon_, SiStripEnumsAndStrings::monitorable(), monitorable(), pres_, SiStripEnumsAndStrings::presentation(), 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_.

17  level_(""),
18  isValid_(false) {
19  // Extract enums from strings
23  level_ = level;
24 
25  // Extract view and perform checks
26  check();
27  isValid_ = true;
28 
29  // Checks on member data
31  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlot::" << __func__ << "]"
32  << " Unexpected monitorable \"" << SiStripEnumsAndStrings::monitorable(mon_)
33  << "\" based on input string \"" << monitorable << "\"";
34  isValid_ = false;
35  }
36 
38  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlot::" << __func__ << "]"
39  << " Unexpected presentation \"" << SiStripEnumsAndStrings::presentation(pres_)
40  << "\" based on input string \"" << presentation << "\"";
41  isValid_ = false;
42  }
43 
45  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlot::" << __func__ << "]"
46  << " Unexpected view \"" << SiStripEnumsAndStrings::view(level_)
47  << "\" based on input string \"" << level << "\"";
48  isValid_ = false;
49  }
50 
51  if (level_.empty() || level_.find(sistrip::unknownView_) != std::string::npos ||
52  level_.find(sistrip::undefinedView_) != std::string::npos) {
53  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlot::" << __func__ << "]"
54  << " Unexpected top-level directory: \"" << level_ << "\"";
55  isValid_ = false;
56  }
57 
59  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlot::" << __func__ << "]"
60  << " Unexpected granularity: \"" << SiStripEnumsAndStrings::granularity(gran_)
61  << "\" based on input string \"" << granularity << "\"";
62  isValid_ = false;
63  }
64 }
static const char unknownView_[]
static std::string monitorable(const sistrip::Monitorable &)
sistrip::Presentation pres_
Definition: SummaryPlot.h:76
sistrip::Monitorable mon_
Definition: SummaryPlot.h:74
void check()
Definition: SummaryPlot.cc:103
static std::string granularity(const sistrip::Granularity &)
std::string level_
Definition: SummaryPlot.h:82
sistrip::View view_
Definition: SummaryPlot.h:78
static const char undefinedView_[]
static std::string view(const sistrip::View &)
const sistrip::Granularity & granularity() const
Definition: SummaryPlot.h:92
const sistrip::Presentation & presentation() const
Definition: SummaryPlot.h:90
sistrip::Granularity gran_
Definition: SummaryPlot.h:80
const std::string & level() const
Definition: SummaryPlot.h:93
static const char mlSummaryPlots_[]
static std::string presentation(const sistrip::Presentation &)
bool isValid_
Definition: SummaryPlot.h:84
Log< level::Warning, false > LogWarning
const sistrip::Monitorable & monitorable() const
Definition: SummaryPlot.h:89

◆ SummaryPlot() [2/3]

SummaryPlot::SummaryPlot ( const SummaryPlot input)

Definition at line 68 of file SummaryPlot.cc.

69  : mon_(input.monitorable()),
70  pres_(input.presentation()),
71  view_(input.view()),
72  gran_(input.granularity()),
73  level_(input.level()),
74  isValid_(input.isValid()) {
75  ;
76 }
sistrip::Presentation pres_
Definition: SummaryPlot.h:76
sistrip::Monitorable mon_
Definition: SummaryPlot.h:74
std::string level_
Definition: SummaryPlot.h:82
sistrip::View view_
Definition: SummaryPlot.h:78
static std::string const input
Definition: EdmProvDump.cc:50
sistrip::Granularity gran_
Definition: SummaryPlot.h:80
bool isValid_
Definition: SummaryPlot.h:84

◆ SummaryPlot() [3/3]

SummaryPlot::SummaryPlot ( )

◆ ~SummaryPlot()

SummaryPlot::~SummaryPlot ( )
inline

Definition at line 36 of file SummaryPlot.h.

36 { ; }

Member Function Documentation

◆ check()

void SummaryPlot::check ( )
private

Definition at line 103 of file SummaryPlot.cc.

References sistrip::dir_, level_, sistrip::mlSummaryPlots_, sistrip::root_, pickleFileParser::slash, AlCaHLTBitMon_QueryRunRegistry::string, sistrip::UNDEFINED_VIEW, sistrip::undefinedView_, sistrip::UNKNOWN_VIEW, sistrip::unknownView_, SiStripEnumsAndStrings::view(), and view_.

Referenced by SummaryPlot().

103  {
104  // Remove end "/" from level_ if it exists
105  if (!level_.empty()) {
106  std::string slash = level_.substr(level_.size() - 1, 1);
107  if (slash == sistrip::dir_) {
108  level_ = level_.substr(0, level_.size() - 1);
109  }
110  }
111 
112  // Extract and check view
114  view_ = check;
116  edm::LogWarning(mlSummaryPlots_) << "[SummaryPlot::" << __func__ << "]"
117  << " Unexpected view \"" << SiStripEnumsAndStrings::view(check) << "\"";
118  }
119 
120  // Prepend sistrip::root_ to level_ if not found
121  if (level_.find(sistrip::root_) == std::string::npos) {
122  if (check == sistrip::UNKNOWN_VIEW) {
124  } else if (check == sistrip::UNDEFINED_VIEW) {
126  } else {
128  }
129  }
130 }
static const char unknownView_[]
static const char dir_[]
void check()
Definition: SummaryPlot.cc:103
std::string level_
Definition: SummaryPlot.h:82
sistrip::View view_
Definition: SummaryPlot.h:78
static const char undefinedView_[]
static std::string view(const sistrip::View &)
static const char mlSummaryPlots_[]
static const char root_[]
Log< level::Warning, false > LogWarning

◆ granularity()

const sistrip::Granularity & SummaryPlot::granularity ( ) const
inline

Definition at line 92 of file SummaryPlot.h.

References gran_.

Referenced by SummaryPlot().

92 { return gran_; }
sistrip::Granularity gran_
Definition: SummaryPlot.h:80

◆ isValid()

const bool & SummaryPlot::isValid ( void  ) const
inline

Definition at line 94 of file SummaryPlot.h.

References isValid_.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

94 { return isValid_; }
bool isValid_
Definition: SummaryPlot.h:84

◆ level()

const std::string & SummaryPlot::level ( ) const
inline

Definition at line 93 of file SummaryPlot.h.

References level_.

Referenced by SummaryPlot().

93 { return level_; }
std::string level_
Definition: SummaryPlot.h:82

◆ monitorable()

const sistrip::Monitorable & SummaryPlot::monitorable ( ) const
inline

Definition at line 89 of file SummaryPlot.h.

References mon_.

Referenced by SummaryPlot().

89 { return mon_; }
sistrip::Monitorable mon_
Definition: SummaryPlot.h:74

◆ presentation()

const sistrip::Presentation & SummaryPlot::presentation ( ) const
inline

Definition at line 90 of file SummaryPlot.h.

References pres_.

Referenced by SummaryPlot().

90 { return pres_; }
sistrip::Presentation pres_
Definition: SummaryPlot.h:76

◆ print()

void SummaryPlot::print ( std::stringstream &  ss) const

Definition at line 134 of file SummaryPlot.cc.

References gran_, SiStripEnumsAndStrings::granularity(), level_, mon_, SiStripEnumsAndStrings::monitorable(), pres_, SiStripEnumsAndStrings::presentation(), contentValuesCheck::ss, SiStripEnumsAndStrings::view(), and view_.

134  {
135  ss << "[SummaryPlot::" << __func__ << "]" << std::endl
136  << " Monitorable: " << SiStripEnumsAndStrings::monitorable(mon_) << std::endl
137  << " Presentation: " << SiStripEnumsAndStrings::presentation(pres_) << std::endl
138  << " View: " << SiStripEnumsAndStrings::view(view_) << std::endl
139  << " TopLevelDir: " << level_ << std::endl
140  << " Granularity: " << SiStripEnumsAndStrings::granularity(gran_) << std::endl;
141 }
static std::string monitorable(const sistrip::Monitorable &)
sistrip::Presentation pres_
Definition: SummaryPlot.h:76
sistrip::Monitorable mon_
Definition: SummaryPlot.h:74
static std::string granularity(const sistrip::Granularity &)
std::string level_
Definition: SummaryPlot.h:82
sistrip::View view_
Definition: SummaryPlot.h:78
static std::string view(const sistrip::View &)
sistrip::Granularity gran_
Definition: SummaryPlot.h:80
static std::string presentation(const sistrip::Presentation &)

◆ reset()

void SummaryPlot::reset ( void  )

◆ view()

const sistrip::View & SummaryPlot::view ( ) const
inline

Definition at line 91 of file SummaryPlot.h.

References view_.

91 { return view_; }
sistrip::View view_
Definition: SummaryPlot.h:78

Member Data Documentation

◆ gran_

sistrip::Granularity SummaryPlot::gran_
private

Definition at line 80 of file SummaryPlot.h.

Referenced by granularity(), print(), reset(), and SummaryPlot().

◆ isValid_

bool SummaryPlot::isValid_
private

Definition at line 84 of file SummaryPlot.h.

Referenced by isValid(), reset(), and SummaryPlot().

◆ level_

std::string SummaryPlot::level_
private

Definition at line 82 of file SummaryPlot.h.

Referenced by check(), level(), print(), reset(), and SummaryPlot().

◆ mon_

sistrip::Monitorable SummaryPlot::mon_
private

Definition at line 74 of file SummaryPlot.h.

Referenced by monitorable(), print(), reset(), and SummaryPlot().

◆ pres_

sistrip::Presentation SummaryPlot::pres_
private

Definition at line 76 of file SummaryPlot.h.

Referenced by presentation(), print(), reset(), and SummaryPlot().

◆ view_

sistrip::View SummaryPlot::view_
private

Definition at line 78 of file SummaryPlot.h.

Referenced by check(), print(), reset(), SummaryPlot(), and view().