CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

SummaryPlot Class Reference

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

#include <SummaryPlot.h>

List of all members.

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

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_, granularity(), sistrip::HISTO_1D, isValid_, level(), level_, sistrip::mlSummaryPlots_, mon_, monitorable(), pres_, 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_, view(), and view_.

                                                   :
  mon_( sistrip::UNKNOWN_MONITORABLE ),
  pres_( sistrip::UNKNOWN_PRESENTATION ),
  view_( sistrip::UNKNOWN_VIEW ),
  gran_( sistrip::UNKNOWN_GRAN ),
  level_(""),
  isValid_(false)
{
  
  // Extract enums from strings 
  mon_ = SiStripEnumsAndStrings::monitorable( monitorable );
  pres_ = SiStripEnumsAndStrings::presentation( presentation );
  gran_ = SiStripEnumsAndStrings::granularity( granularity );
  level_ = level;
  
  // Extract view and perform checks
  check();
  isValid_ = true;

  // Checks on member data
  if ( mon_ == sistrip::UNKNOWN_MONITORABLE ||
       mon_ == sistrip::UNDEFINED_MONITORABLE ) {
    edm::LogWarning(mlSummaryPlots_) 
      << "[SummaryPlot::" << __func__ << "]"
      << " Unexpected monitorable \"" 
      << SiStripEnumsAndStrings::monitorable(mon_) 
      << "\" based on input string \""
      << monitorable << "\"";
    isValid_ = false;
  }
  
  if ( pres_ == sistrip::UNKNOWN_PRESENTATION ||
       pres_ == sistrip::UNDEFINED_PRESENTATION ) {
    edm::LogWarning(mlSummaryPlots_) 
      << "[SummaryPlot::" << __func__ << "]"
      << " Unexpected presentation \"" 
      << SiStripEnumsAndStrings::presentation(pres_)
      << "\" based on input string \""
      << presentation << "\"";
    isValid_ = false;
  }

  if ( view_ == sistrip::UNKNOWN_VIEW ||
       view_ == sistrip::UNDEFINED_VIEW ) {
    edm::LogWarning(mlSummaryPlots_) 
      << "[SummaryPlot::" << __func__ << "]"
      << " Unexpected view \"" 
      << SiStripEnumsAndStrings::view(level_)
      << "\" based on input string \""
      << level << "\"";
    isValid_ = false;
  }
  
  if ( level_.empty() ||
       level_.find(sistrip::unknownView_) != std::string::npos ||
       level_.find(sistrip::undefinedView_) != std::string::npos ) {
    edm::LogWarning(mlSummaryPlots_) 
      << "[SummaryPlot::" << __func__ << "]"
      << " Unexpected top-level directory: \"" 
      << level_ << "\"";
    isValid_ = false;
  } 
  
  if ( gran_ == sistrip::UNKNOWN_GRAN ||
       ( gran_ == sistrip::UNDEFINED_GRAN && 
         pres_ != sistrip::HISTO_1D ) ) {
    edm::LogWarning(mlSummaryPlots_) 
      << "[SummaryPlot::" << __func__ << "]"
      << " Unexpected granularity: \"" 
      << SiStripEnumsAndStrings::granularity(gran_)
      << "\" based on input string \""
      << granularity << "\"";
    isValid_ = false;
  }

}
SummaryPlot::SummaryPlot ( const SummaryPlot input)

Definition at line 91 of file SummaryPlot.cc.

                                                   :
  mon_( input.monitorable() ),
  pres_( input.presentation() ),
  view_( input.view() ),
  gran_( input.granularity() ),
  level_( input.level() ),
  isValid_( input.isValid() )
{;}
SummaryPlot::SummaryPlot ( )
SummaryPlot::~SummaryPlot ( ) [inline]

Definition at line 38 of file SummaryPlot.h.

{;}

Member Function Documentation

void SummaryPlot::check ( ) [private]

Definition at line 124 of file SummaryPlot.cc.

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

Referenced by SummaryPlot().

                        {

  // Remove end "/" from level_ if it exists
  if ( !level_.empty() ) {
    std::string slash = level_.substr( level_.size()-1, 1 );
    if ( slash == sistrip::dir_ ) { level_ = level_.substr( 0, level_.size()-1 ); }
  }
  
  // Extract and check view 
  sistrip::View check = SiStripEnumsAndStrings::view( level_ );
  view_ = check;
  if ( check == sistrip::UNKNOWN_VIEW || 
       check == sistrip::UNDEFINED_VIEW ) {
    edm::LogWarning(mlSummaryPlots_)
      << "[SummaryPlot::" << __func__ << "]"
      << " Unexpected view \"" 
      << SiStripEnumsAndStrings::view( check )
      << "\"";
  }
  
  // Prepend sistrip::root_ to level_ if not found
  if ( level_.find( sistrip::root_ ) == std::string::npos ) { 
    if ( check == sistrip::UNKNOWN_VIEW ) {
      level_ = 
        std::string(sistrip::root_) + sistrip::dir_ + 
        sistrip::unknownView_ + sistrip::dir_ + 
        level_; 
    } else if ( check == sistrip::UNDEFINED_VIEW ) {
      level_ = 
        std::string(sistrip::root_) + sistrip::dir_ + 
        sistrip::undefinedView_ + sistrip::dir_ + 
        level_; 
    } else { 
      level_ = 
        std::string(sistrip::root_) + sistrip::dir_ + 
        level_; 
    }
  }
  
}
const sistrip::Granularity & SummaryPlot::granularity ( ) const [inline]

Definition at line 96 of file SummaryPlot.h.

References gran_.

Referenced by print(), and SummaryPlot().

{ return gran_; }
const bool & SummaryPlot::isValid ( void  ) const [inline]

Definition at line 98 of file SummaryPlot.h.

References isValid_.

{ return isValid_; }
const std::string & SummaryPlot::level ( ) const [inline]

Definition at line 97 of file SummaryPlot.h.

References level_.

Referenced by SummaryPlot().

{ return level_; }
const sistrip::Monitorable & SummaryPlot::monitorable ( ) const [inline]

Definition at line 93 of file SummaryPlot.h.

References mon_.

Referenced by print(), and SummaryPlot().

{ return mon_; }
const sistrip::Presentation & SummaryPlot::presentation ( ) const [inline]

Definition at line 94 of file SummaryPlot.h.

References pres_.

Referenced by print(), and SummaryPlot().

{ return pres_; }
void SummaryPlot::print ( std::stringstream &  ss) const

Definition at line 167 of file SummaryPlot.cc.

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

Referenced by operator<<().

                                                   {
  ss << "[SummaryPlot::" << __func__ << "]" << std::endl
     << " Monitorable:  " <<  SiStripEnumsAndStrings::monitorable(mon_) << std::endl
     << " Presentation: " << SiStripEnumsAndStrings::presentation(pres_) << std::endl
     << " View:         " << SiStripEnumsAndStrings::view(view_) << std::endl
     << " TopLevelDir:  " << level_ << std::endl
     << " Granularity:  " << SiStripEnumsAndStrings::granularity(gran_) << std::endl;
}
void SummaryPlot::reset ( void  )
const sistrip::View & SummaryPlot::view ( ) const [inline]

Definition at line 95 of file SummaryPlot.h.

References view_.

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

{ return view_; }

Member Data Documentation

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

Definition at line 77 of file SummaryPlot.h.

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

Definition at line 79 of file SummaryPlot.h.

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

Definition at line 81 of file SummaryPlot.h.

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