CMS 3D CMS Logo

SummaryPlot Class Reference

Author:
R.Bainbridge, P.Kalavase
More...

#include <DQM/SiStripCommissioningSummary/interface/SummaryPlot.h>

List of all members.

Public Member Functions

const sistrip::Granularitygranularity () const
const boolisValid () const
const std::string & level () const
const sistrip::Monitorablemonitorable () const
const sistrip::Presentationpresentation () const
void print (std::stringstream &) const
void reset ()
 SummaryPlot ()
 SummaryPlot (const SummaryPlot &)
 SummaryPlot (const std::string &monitorable, const std::string &presentation, const std::string &granularity, const std::string &level)
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

Author:
R.Bainbridge, P.Kalavase

Class holding info that defines a summary plot.

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_, 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_.

00012                                                    :
00013   mon_( sistrip::UNKNOWN_MONITORABLE ),
00014   pres_( sistrip::UNKNOWN_PRESENTATION ),
00015   view_( sistrip::UNKNOWN_VIEW ),
00016   gran_( sistrip::UNKNOWN_GRAN ),
00017   level_(""),
00018   isValid_(false)
00019 {
00020   
00021   // Extract enums from strings 
00022   mon_ = SiStripEnumsAndStrings::monitorable( monitorable );
00023   pres_ = SiStripEnumsAndStrings::presentation( presentation );
00024   gran_ = SiStripEnumsAndStrings::granularity( granularity );
00025   level_ = level;
00026   
00027   // Extract view and perform checks
00028   check();
00029   isValid_ = true;
00030 
00031   // Checks on member data
00032   if ( mon_ == sistrip::UNKNOWN_MONITORABLE ||
00033        mon_ == sistrip::UNDEFINED_MONITORABLE ) {
00034     edm::LogWarning(mlSummaryPlots_) 
00035       << "[SummaryPlot::" << __func__ << "]"
00036       << " Unexpected monitorable \"" 
00037       << SiStripEnumsAndStrings::monitorable(mon_) 
00038       << "\" based on input string \""
00039       << monitorable << "\"";
00040     isValid_ = false;
00041   }
00042   
00043   if ( pres_ == sistrip::UNKNOWN_PRESENTATION ||
00044        pres_ == sistrip::UNDEFINED_PRESENTATION ) {
00045     edm::LogWarning(mlSummaryPlots_) 
00046       << "[SummaryPlot::" << __func__ << "]"
00047       << " Unexpected presentation \"" 
00048       << SiStripEnumsAndStrings::presentation(pres_)
00049       << "\" based on input string \""
00050       << presentation << "\"";
00051     isValid_ = false;
00052   }
00053 
00054   if ( view_ == sistrip::UNKNOWN_VIEW ||
00055        view_ == sistrip::UNDEFINED_VIEW ) {
00056     edm::LogWarning(mlSummaryPlots_) 
00057       << "[SummaryPlot::" << __func__ << "]"
00058       << " Unexpected view \"" 
00059       << SiStripEnumsAndStrings::view(level_)
00060       << "\" based on input string \""
00061       << level << "\"";
00062     isValid_ = false;
00063   }
00064   
00065   if ( level_.empty() ||
00066        level_.find(sistrip::unknownView_) != std::string::npos ||
00067        level_.find(sistrip::undefinedView_) != std::string::npos ) {
00068     edm::LogWarning(mlSummaryPlots_) 
00069       << "[SummaryPlot::" << __func__ << "]"
00070       << " Unexpected top-level directory: \"" 
00071       << level_ << "\"";
00072     isValid_ = false;
00073   } 
00074   
00075   if ( gran_ == sistrip::UNKNOWN_GRAN ||
00076        ( gran_ == sistrip::UNDEFINED_GRAN && 
00077          pres_ != sistrip::HISTO_1D ) ) {
00078     edm::LogWarning(mlSummaryPlots_) 
00079       << "[SummaryPlot::" << __func__ << "]"
00080       << " Unexpected granularity: \"" 
00081       << SiStripEnumsAndStrings::granularity(gran_)
00082       << "\" based on input string \""
00083       << granularity << "\"";
00084     isValid_ = false;
00085   }
00086 
00087 }

SummaryPlot::SummaryPlot ( const SummaryPlot input  ) 

Definition at line 91 of file SummaryPlot.cc.

00091                                                    :
00092   mon_( input.monitorable() ),
00093   pres_( input.presentation() ),
00094   view_( input.view() ),
00095   gran_( input.granularity() ),
00096   level_( input.level() ),
00097   isValid_( input.isValid() )
00098 {;}

SummaryPlot::SummaryPlot (  ) 

Definition at line 102 of file SummaryPlot.cc.

00102                          :
00103   mon_( sistrip::UNKNOWN_MONITORABLE ),
00104   pres_( sistrip::UNKNOWN_PRESENTATION ),
00105   view_( sistrip::UNKNOWN_VIEW ),
00106   gran_( sistrip::UNKNOWN_GRAN ),
00107   level_(""),
00108   isValid_(false)
00109 {;}

SummaryPlot::~SummaryPlot (  )  [inline]

Definition at line 38 of file SummaryPlot.h.

00038 {;}


Member Function Documentation

void SummaryPlot::check (  )  [private]

Definition at line 124 of file SummaryPlot.cc.

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

Referenced by SummaryPlot().

00124                         {
00125 
00126   // Remove end "/" from level_ if it exists
00127   if ( !level_.empty() ) {
00128     std::string slash = level_.substr( level_.size()-1, 1 );
00129     if ( slash == sistrip::dir_ ) { level_ = level_.substr( 0, level_.size()-1 ); }
00130   }
00131   
00132   // Extract and check view 
00133   sistrip::View check = SiStripEnumsAndStrings::view( level_ );
00134   view_ = check;
00135   if ( check == sistrip::UNKNOWN_VIEW || 
00136        check == sistrip::UNDEFINED_VIEW ) {
00137     edm::LogWarning(mlSummaryPlots_)
00138       << "[SummaryPlot::" << __func__ << "]"
00139       << " Unexpected view \"" 
00140       << SiStripEnumsAndStrings::view( check )
00141       << "\"";
00142   }
00143   
00144   // Prepend sistrip::root_ to level_ if not found
00145   if ( level_.find( sistrip::root_ ) == std::string::npos ) { 
00146     if ( check == sistrip::UNKNOWN_VIEW ) {
00147       level_ = 
00148         sistrip::root_ + sistrip::dir_ + 
00149         sistrip::unknownView_ + sistrip::dir_ + 
00150         level_; 
00151     } else if ( check == sistrip::UNDEFINED_VIEW ) {
00152       level_ = 
00153         sistrip::root_ + sistrip::dir_ + 
00154         sistrip::undefinedView_ + sistrip::dir_ + 
00155         level_; 
00156     } else { 
00157       level_ = 
00158         sistrip::root_ + sistrip::dir_ + 
00159         level_; 
00160     }
00161   }
00162   
00163 }

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

Definition at line 96 of file SummaryPlot.h.

References gran_.

00096 { return gran_; }

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

Definition at line 98 of file SummaryPlot.h.

References isValid_.

00098 { return isValid_; }

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

Definition at line 97 of file SummaryPlot.h.

References level_.

00097 { return level_; }

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

Definition at line 93 of file SummaryPlot.h.

References mon_.

00093 { return mon_; }

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

Definition at line 94 of file SummaryPlot.h.

References pres_.

00094 { return pres_; }

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

Definition at line 167 of file SummaryPlot.cc.

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

Referenced by operator<<().

00167                                                    {
00168   ss << "[SummaryPlot::" << __func__ << "]" << std::endl
00169      << " Monitorable:  " <<  SiStripEnumsAndStrings::monitorable(mon_) << std::endl
00170      << " Presentation: " << SiStripEnumsAndStrings::presentation(pres_) << std::endl
00171      << " View:         " << SiStripEnumsAndStrings::view(view_) << std::endl
00172      << " TopLevelDir:  " << level_ << std::endl
00173      << " Granularity:  " << SiStripEnumsAndStrings::granularity(gran_) << std::endl;
00174 }

void SummaryPlot::reset ( void   ) 

Definition at line 113 of file SummaryPlot.cc.

References gran_, isValid_, level_, mon_, pres_, sistrip::UNKNOWN_GRAN, sistrip::UNKNOWN_MONITORABLE, sistrip::UNKNOWN_PRESENTATION, sistrip::UNKNOWN_VIEW, and view_.

00113                         {
00114   mon_ =  sistrip::UNKNOWN_MONITORABLE;
00115   pres_ =  sistrip::UNKNOWN_PRESENTATION;
00116   view_ = sistrip::UNKNOWN_VIEW;
00117   gran_ =  sistrip::UNKNOWN_GRAN;
00118   level_ = "";
00119   isValid_ = false;
00120 }

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

Definition at line 95 of file SummaryPlot.h.

References view_.

00095 { return view_; }


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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:33:00 2009 for CMSSW by  doxygen 1.5.4