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::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(), sistrip::HISTO_1D, isValid_, level(), level_, sistrip::mlSummaryPlots_, 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_.

12  :
17  level_(""),
18  isValid_(false)
19 {
20 
21  // Extract enums from strings
25  level_ = level;
26 
27  // Extract view and perform checks
28  check();
29  isValid_ = true;
30 
31  // Checks on member data
35  << "[SummaryPlot::" << __func__ << "]"
36  << " Unexpected monitorable \""
38  << "\" based on input string \""
39  << monitorable << "\"";
40  isValid_ = false;
41  }
42 
46  << "[SummaryPlot::" << __func__ << "]"
47  << " Unexpected presentation \""
49  << "\" based on input string \""
50  << presentation << "\"";
51  isValid_ = false;
52  }
53 
54  if ( view_ == sistrip::UNKNOWN_VIEW ||
57  << "[SummaryPlot::" << __func__ << "]"
58  << " Unexpected view \""
60  << "\" based on input string \""
61  << level << "\"";
62  isValid_ = false;
63  }
64 
65  if ( level_.empty() ||
66  level_.find(sistrip::unknownView_) != std::string::npos ||
67  level_.find(sistrip::undefinedView_) != std::string::npos ) {
69  << "[SummaryPlot::" << __func__ << "]"
70  << " Unexpected top-level directory: \""
71  << level_ << "\"";
72  isValid_ = false;
73  }
74 
75  if ( gran_ == sistrip::UNKNOWN_GRAN ||
77  pres_ != sistrip::HISTO_1D ) ) {
79  << "[SummaryPlot::" << __func__ << "]"
80  << " Unexpected granularity: \""
82  << "\" based on input string \""
83  << granularity << "\"";
84  isValid_ = false;
85  }
86 
87 }
static const char unknownView_[]
static std::string monitorable(const sistrip::Monitorable &)
const std::string & level() const
Definition: SummaryPlot.h:97
sistrip::Presentation pres_
Definition: SummaryPlot.h:79
sistrip::Monitorable mon_
Definition: SummaryPlot.h:77
void check()
Definition: SummaryPlot.cc:124
static std::string granularity(const sistrip::Granularity &)
std::string level_
Definition: SummaryPlot.h:85
const sistrip::Granularity & granularity() const
Definition: SummaryPlot.h:96
sistrip::View view_
Definition: SummaryPlot.h:81
static const char undefinedView_[]
static std::string view(const sistrip::View &)
sistrip::Granularity gran_
Definition: SummaryPlot.h:83
static const char mlSummaryPlots_[]
static std::string presentation(const sistrip::Presentation &)
const sistrip::Presentation & presentation() const
Definition: SummaryPlot.h:94
bool isValid_
Definition: SummaryPlot.h:87
const sistrip::Monitorable & monitorable() const
Definition: SummaryPlot.h:93
SummaryPlot::SummaryPlot ( const SummaryPlot input)

Definition at line 91 of file SummaryPlot.cc.

91  :
92  mon_( input.monitorable() ),
93  pres_( input.presentation() ),
94  view_( input.view() ),
95  gran_( input.granularity() ),
96  level_( input.level() ),
97  isValid_( input.isValid() )
98 {;}
const std::string & level() const
Definition: SummaryPlot.h:97
sistrip::Presentation pres_
Definition: SummaryPlot.h:79
sistrip::Monitorable mon_
Definition: SummaryPlot.h:77
std::string level_
Definition: SummaryPlot.h:85
const sistrip::Granularity & granularity() const
Definition: SummaryPlot.h:96
sistrip::View view_
Definition: SummaryPlot.h:81
const sistrip::View & view() const
Definition: SummaryPlot.h:95
sistrip::Granularity gran_
Definition: SummaryPlot.h:83
const bool & isValid() const
Definition: SummaryPlot.h:98
const sistrip::Presentation & presentation() const
Definition: SummaryPlot.h:94
bool isValid_
Definition: SummaryPlot.h:87
const sistrip::Monitorable & monitorable() const
Definition: SummaryPlot.h:93
SummaryPlot::SummaryPlot ( )

Definition at line 102 of file SummaryPlot.cc.

SummaryPlot::~SummaryPlot ( )
inline

Member Function Documentation

void SummaryPlot::check ( )
private

Definition at line 124 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(), and ~SummaryPlot().

124  {
125 
126  // Remove end "/" from level_ if it exists
127  if ( !level_.empty() ) {
128  std::string slash = level_.substr( level_.size()-1, 1 );
129  if ( slash == sistrip::dir_ ) { level_ = level_.substr( 0, level_.size()-1 ); }
130  }
131 
132  // Extract and check view
134  view_ = check;
135  if ( check == sistrip::UNKNOWN_VIEW ||
136  check == sistrip::UNDEFINED_VIEW ) {
138  << "[SummaryPlot::" << __func__ << "]"
139  << " Unexpected view \""
140  << SiStripEnumsAndStrings::view( check )
141  << "\"";
142  }
143 
144  // Prepend sistrip::root_ to level_ if not found
145  if ( level_.find( sistrip::root_ ) == std::string::npos ) {
146  if ( check == sistrip::UNKNOWN_VIEW ) {
147  level_ =
150  level_;
151  } else if ( check == sistrip::UNDEFINED_VIEW ) {
152  level_ =
155  level_;
156  } else {
157  level_ =
159  level_;
160  }
161  }
162 
163 }
static const char unknownView_[]
static const char dir_[]
void check()
Definition: SummaryPlot.cc:124
std::string level_
Definition: SummaryPlot.h:85
sistrip::View view_
Definition: SummaryPlot.h:81
static const char undefinedView_[]
static std::string view(const sistrip::View &)
static const char mlSummaryPlots_[]
static const char root_[]
const sistrip::Granularity & SummaryPlot::granularity ( ) const
inline

Definition at line 96 of file SummaryPlot.h.

References gran_.

Referenced by ~SummaryPlot().

96 { return gran_; }
sistrip::Granularity gran_
Definition: SummaryPlot.h:83
const bool & SummaryPlot::isValid ( void  ) const
inline

Definition at line 98 of file SummaryPlot.h.

References isValid_.

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

98 { return isValid_; }
bool isValid_
Definition: SummaryPlot.h:87
const std::string & SummaryPlot::level ( ) const
inline

Definition at line 97 of file SummaryPlot.h.

References level_.

Referenced by SummaryPlot(), and ~SummaryPlot().

97 { return level_; }
std::string level_
Definition: SummaryPlot.h:85
const sistrip::Monitorable & SummaryPlot::monitorable ( ) const
inline

Definition at line 93 of file SummaryPlot.h.

References mon_.

Referenced by ~SummaryPlot().

93 { return mon_; }
sistrip::Monitorable mon_
Definition: SummaryPlot.h:77
const sistrip::Presentation & SummaryPlot::presentation ( ) const
inline

Definition at line 94 of file SummaryPlot.h.

References pres_.

Referenced by ~SummaryPlot().

94 { return pres_; }
sistrip::Presentation pres_
Definition: SummaryPlot.h:79
void SummaryPlot::print ( std::stringstream &  ss) const

Definition at line 167 of file SummaryPlot.cc.

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

Referenced by operator<<(), and ~SummaryPlot().

167  {
168  ss << "[SummaryPlot::" << __func__ << "]" << std::endl
169  << " Monitorable: " << SiStripEnumsAndStrings::monitorable(mon_) << std::endl
170  << " Presentation: " << SiStripEnumsAndStrings::presentation(pres_) << std::endl
171  << " View: " << SiStripEnumsAndStrings::view(view_) << std::endl
172  << " TopLevelDir: " << level_ << std::endl
173  << " Granularity: " << SiStripEnumsAndStrings::granularity(gran_) << std::endl;
174 }
static std::string monitorable(const sistrip::Monitorable &)
sistrip::Presentation pres_
Definition: SummaryPlot.h:79
sistrip::Monitorable mon_
Definition: SummaryPlot.h:77
static std::string granularity(const sistrip::Granularity &)
std::string level_
Definition: SummaryPlot.h:85
sistrip::View view_
Definition: SummaryPlot.h:81
static std::string view(const sistrip::View &)
sistrip::Granularity gran_
Definition: SummaryPlot.h:83
static std::string presentation(const sistrip::Presentation &)
void SummaryPlot::reset ( void  )
const sistrip::View & SummaryPlot::view ( ) const
inline

Definition at line 95 of file SummaryPlot.h.

References view_.

Referenced by ~SummaryPlot().

95 { return view_; }
sistrip::View view_
Definition: SummaryPlot.h:81

Member Data Documentation

sistrip::Granularity SummaryPlot::gran_
private

Definition at line 83 of file SummaryPlot.h.

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

bool SummaryPlot::isValid_
private

Definition at line 87 of file SummaryPlot.h.

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

std::string SummaryPlot::level_
private

Definition at line 85 of file SummaryPlot.h.

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

sistrip::Monitorable SummaryPlot::mon_
private

Definition at line 77 of file SummaryPlot.h.

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

sistrip::Presentation SummaryPlot::pres_
private

Definition at line 79 of file SummaryPlot.h.

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

sistrip::View SummaryPlot::view_
private

Definition at line 81 of file SummaryPlot.h.

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