Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:11:41

0001 #include "DQM/SiStripCommissioningSummary/interface/SummaryPlotFactory.h"
0002 #include "DQM/SiStripCommissioningSummary/interface/SummaryGenerator.h"
0003 #include <iostream>
0004 
0005 using namespace sistrip;
0006 
0007 // -----------------------------------------------------------------------------
0008 //
0009 template <class T>
0010 uint32_t SummaryPlotFactory<T>::init(const sistrip::Monitorable& mon,
0011                                      const sistrip::Presentation& pres,
0012                                      const sistrip::View& view,
0013                                      const std::string& level,
0014                                      const sistrip::Granularity& gran,
0015                                      const std::map<uint32_t, T>& data) {
0016   // Some initialisation
0017   SummaryPlotFactoryBase::init(mon, pres, view, level, gran);
0018 
0019   // Transfer appropriate monitorables info to generator object
0020   if (!SummaryPlotFactoryBase::generator_) {
0021     return 0;
0022   }
0023   typename std::map<uint32_t, T>::const_iterator iter = data.begin();
0024   for (; iter != data.end(); iter++) {
0025     static float value = static_cast<float>(iter->second);
0026     SummaryPlotFactoryBase::generator_->fillMap(
0027         SummaryPlotFactoryBase::level_, SummaryPlotFactoryBase::gran_, iter->first, value);
0028   }
0029 
0030   return SummaryPlotFactoryBase::generator_->nBins();
0031 }
0032 
0033 // -----------------------------------------------------------------------------
0034 //
0035 template <class T>
0036 void SummaryPlotFactory<T>::fill(TH1& summary_histo) {
0037   // Some initialisation
0038   SummaryPlotFactoryBase::fill(summary_histo);
0039 }
0040 
0041 // -----------------------------------------------------------------------------
0042 //
0043 template class SummaryPlotFactory<uint32_t>;
0044 template class SummaryPlotFactory<uint16_t>;
0045 template class SummaryPlotFactory<int32_t>;
0046 template class SummaryPlotFactory<int16_t>;
0047 template class SummaryPlotFactory<double>;
0048 template class SummaryPlotFactory<float>;