CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/DQM/SiStripCommissioningSummary/src/SummaryPlotFactory.cc

Go to the documentation of this file.
00001 #include "DQM/SiStripCommissioningSummary/interface/SummaryPlotFactory.h"
00002 #include "DQM/SiStripCommissioningSummary/interface/SummaryGenerator.h"
00003 #include <iostream>
00004 
00005 using namespace sistrip;
00006 
00007 // -----------------------------------------------------------------------------
00008 //
00009 template<class T> 
00010 uint32_t SummaryPlotFactory<T>::init( const sistrip::Monitorable& mon, 
00011                                       const sistrip::Presentation& pres,
00012                                       const sistrip::View& view, 
00013                                       const std::string& level, 
00014                                       const sistrip::Granularity& gran,
00015                                       const std::map<uint32_t,T>& data ) {
00016   
00017   // Some initialisation
00018   SummaryPlotFactoryBase::init( mon, pres, view, level, gran );
00019   
00020   // Transfer appropriate monitorables info to generator object
00021   if ( !SummaryPlotFactoryBase::generator_ ) { return 0; }
00022   typename std::map<uint32_t,T>::const_iterator iter = data.begin();
00023   for ( ; iter != data.end(); iter++ ) {
00024     static float value = static_cast<float>(iter->second);
00025     SummaryPlotFactoryBase::generator_->fillMap( SummaryPlotFactoryBase::level_, 
00026                                                  SummaryPlotFactoryBase::gran_,
00027                                                  iter->first,
00028                                                  value );
00029   }
00030   
00031   return SummaryPlotFactoryBase::generator_->nBins();
00032   
00033 }
00034 
00035 // -----------------------------------------------------------------------------
00036 //
00037 template<class T> 
00038 void SummaryPlotFactory<T>::fill( TH1& summary_histo ) {
00039   
00040   // Some initialisation
00041   SummaryPlotFactoryBase::fill( summary_histo );
00042   
00043 }
00044 
00045 // -----------------------------------------------------------------------------
00046 //
00047 template class SummaryPlotFactory<uint32_t>;
00048 template class SummaryPlotFactory<uint16_t>;
00049 template class SummaryPlotFactory<int32_t>;
00050 template class SummaryPlotFactory<int16_t>;
00051 template class SummaryPlotFactory<double>;
00052 template class SummaryPlotFactory<float>;
00053