CMS 3D CMS Logo

SummaryPlot.cc
Go to the documentation of this file.
4 
5 using namespace sistrip;
6 
7 // -----------------------------------------------------------------------------
8 //
11  const std::string& granularity,
12  const std::string& level)
15  view_(sistrip::UNKNOWN_VIEW),
16  gran_(sistrip::UNKNOWN_GRAN),
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 }
65 
66 // -----------------------------------------------------------------------------
67 //
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 }
77 
78 // -----------------------------------------------------------------------------
79 //
83  view_(sistrip::UNKNOWN_VIEW),
84  gran_(sistrip::UNKNOWN_GRAN),
85  level_(""),
86  isValid_(false) {
87  ;
88 }
89 
90 // -----------------------------------------------------------------------------
91 //
97  level_ = "";
98  isValid_ = false;
99 }
100 
101 // -----------------------------------------------------------------------------
102 //
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 }
131 
132 // -----------------------------------------------------------------------------
133 //
134 void SummaryPlot::print(std::stringstream& ss) const {
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 }
142 
143 // -----------------------------------------------------------------------------
144 //
145 std::ostream& operator<<(std::ostream& os, const SummaryPlot& summary) {
146  std::stringstream ss;
147  summary.print(ss);
148  os << ss.str();
149  return os;
150 }
personalPlayback.level
level
Definition: personalPlayback.py:22
sistrip::UNKNOWN_MONITORABLE
Definition: ConstantsForMonitorable.h:201
SummaryPlot::monitorable
const sistrip::Monitorable & monitorable() const
Definition: SummaryPlot.h:89
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
sistrip::View
View
Definition: ConstantsForView.h:26
SummaryPlot::print
void print(std::stringstream &) const
Definition: SummaryPlot.cc:134
sistrip::UNDEFINED_VIEW
Definition: ConstantsForView.h:28
SummaryPlot::view_
sistrip::View view_
Definition: SummaryPlot.h:78
sistrip::unknownView_
static const char unknownView_[]
Definition: ConstantsForView.h:17
SummaryPlot::level_
std::string level_
Definition: SummaryPlot.h:82
sistrip::dir_
static const char dir_[]
Definition: ConstantsForDqm.h:17
sistrip::UNDEFINED_PRESENTATION
Definition: ConstantsForPresentation.h:30
sistrip::undefinedView_
static const char undefinedView_[]
Definition: ConstantsForView.h:18
edm::hash_detail::isValid_
bool isValid_(value_type const &hash)
Definition: Hash.cc:63
SummaryPlot::mon_
sistrip::Monitorable mon_
Definition: SummaryPlot.h:74
sistrip::UNKNOWN_GRAN
Definition: ConstantsForGranularity.h:62
SummaryPlot::check
void check()
Definition: SummaryPlot.cc:103
operator<<
std::ostream & operator<<(std::ostream &os, const SummaryPlot &summary)
Definition: SummaryPlot.cc:145
SummaryPlot.h
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SummaryPlot::granularity
const sistrip::Granularity & granularity() const
Definition: SummaryPlot.h:92
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
SummaryPlot::SummaryPlot
SummaryPlot()
Definition: SummaryPlot.cc:80
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
sistrip::HISTO_1D
Definition: ConstantsForPresentation.h:31
presentation
Definition: presentation.py:1
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
SiStripEnumsAndStrings::view
static std::string view(const sistrip::View &)
Definition: SiStripEnumsAndStrings.cc:5
SummaryPlot::reset
void reset()
Definition: SummaryPlot.cc:92
sistrip::root_
static const char root_[]
Definition: ConstantsForDqm.h:30
SiStripEnumsAndStrings::monitorable
static std::string monitorable(const sistrip::Monitorable &)
Definition: SiStripEnumsAndStrings.cc:547
SummaryPlot::gran_
sistrip::Granularity gran_
Definition: SummaryPlot.h:80
sistrip::UNKNOWN_VIEW
Definition: ConstantsForView.h:27
SummaryPlot::isValid_
bool isValid_
Definition: SummaryPlot.h:84
sistrip::UNDEFINED_MONITORABLE
Definition: ConstantsForMonitorable.h:202
pickleFileParser.slash
slash
Definition: pickleFileParser.py:12
SummaryPlot::level
const std::string & level() const
Definition: SummaryPlot.h:93
sistrip::mlSummaryPlots_
static const char mlSummaryPlots_[]
Definition: ConstantsForLogger.h:26
SiStripEnumsAndStrings.h
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
sistrip::UNKNOWN_PRESENTATION
Definition: ConstantsForPresentation.h:29
sistrip::UNDEFINED_GRAN
Definition: ConstantsForGranularity.h:61
SummaryPlot::pres_
sistrip::Presentation pres_
Definition: SummaryPlot.h:76
SummaryPlot
Class holding info that defines a summary plot.
Definition: SummaryPlot.h:19