CMS 3D CMS Logo

SummaryGenerator Class Reference

Author:
M.Wingham, R.Bainbridge
More...

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

Inheritance diagram for SummaryGenerator:

SummaryGeneratorControlView SummaryGeneratorReadoutView

List of all members.

Public Types

typedef std::vector< DataBinData
typedef std::pair< float, float > Data
typedef std::map< std::string,
BinData
HistoData

Public Member Functions

void axisLabel (const std::string &)
 Optionally set axis label.
void clearMap ()
 Clear the map that is used to generate the histogram(s).
void fillMap (const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
 Fills the map that is used to generate the histogram(s).
void format (const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const sistrip::Granularity &, TH1 &)
 Some generic formatting of histogram.
void histo1D (TH1 &)
 Creates simple 1D histogram of the parameter values.
void histo2DScatter (TH1 &)
 Creates a 2D scatter histogram, with individual values of the parameter (y-axis) binned as a function of position within the given logical structure, which is view-dependent (x-axis).
void histo2DSum (TH1 &)
 Creates a 1D histogram, with the weighted sum of the parameter (y-axis) binned as a function of position within the given logical structure, which is view-dependent (x-axis).
const std::string & myName () const
 Returns name of generator object.
uint32_t nBins () const
 Retrieve size of map (ie, number of bins).
void printMap ()
 Print contents of map used to generate the histogram(s).
void profile1D (TH1 &)
 Creates a profile histogram, with the mean and spread of the parameter (y-axis) binned as a function of position within the given logical structure, which is view-dependent (x-axis).
uint32_t size () const
 SummaryGenerator (std::string name)
virtual ~SummaryGenerator ()

Static Public Member Functions

static TH1 * histogram (const sistrip::Presentation &, const uint32_t &xbins)
 Creates instance of derived class based on view parameter.
static SummaryGeneratorinstance (const sistrip::View &)
 Creates instance of derived class based on view parameter.
static std::string name (const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory)
 Constructs the summary histogram name.

Protected Member Functions

virtual void fill (const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error)
 Fills the map used to generate the histogram.

Protected Attributes

float entries_
std::string label_
HistoData map_
 A map designed to holds a set of values.
float max_
float min_

Private Attributes

std::string myName_


Detailed Description

Author:
M.Wingham, R.Bainbridge

: Fills summary histograms.

Definition at line 19 of file SummaryGenerator.h.


Member Typedef Documentation

typedef std::vector<Data> SummaryGenerator::BinData

Definition at line 30 of file SummaryGenerator.h.

typedef std::pair<float,float> SummaryGenerator::Data

Definition at line 29 of file SummaryGenerator.h.

typedef std::map<std::string,BinData> SummaryGenerator::HistoData

Definition at line 31 of file SummaryGenerator.h.


Constructor & Destructor Documentation

SummaryGenerator::SummaryGenerator ( std::string  name  ) 

Definition at line 16 of file SummaryGenerator.cc.

00016                                                    : 
00017   map_(),
00018   entries_(-1.),
00019   max_(-1.*sistrip::invalid_),
00020   min_(1.*sistrip::invalid_),
00021   label_(""),
00022   myName_(name)
00023 {
00024   // TH1::SetDefaultSumw2(true); // use square of weights to calc error   
00025 }

virtual SummaryGenerator::~SummaryGenerator (  )  [inline, virtual]

Definition at line 26 of file SummaryGenerator.h.

00026 {;}


Member Function Documentation

void SummaryGenerator::axisLabel ( const std::string &  label  )  [inline]

Optionally set axis label.

Definition at line 142 of file SummaryGenerator.h.

References label_.

Referenced by SummaryHistogramFactory< DaqScopeModeAnalysis >::fill(), SummaryPlotFactory< FedCablingAnalysis * >::fill(), ApvTimingSummaryFactory::format(), PedsOnlySummaryFactory::format(), PedestalsSummaryFactory::format(), CalibrationSummaryFactory::format(), NoiseSummaryFactory::format(), SamplingSummaryFactory::format(), and FastFedCablingSummaryFactory::format().

00142 { label_ = label; }

void SummaryGenerator::clearMap (  ) 

Clear the map that is used to generate the histogram(s).

Definition at line 195 of file SummaryGenerator.cc.

References HistoData::clear(), entries_, sistrip::invalid_, iter, map_, max_, and min_.

Referenced by SummaryHistogramFactory< DaqScopeModeAnalysis >::extract(), SummaryHistogramFactory< FedTimingAnalysis >::extract(), SummaryHistogramFactory< T >::extract(), and SummaryPlotFactoryBase::init().

00195                                 {
00196   HistoData::iterator iter = map_.begin(); 
00197   for ( ; iter != map_.end(); iter++ ) { iter->second.clear(); }
00198   map_.clear();
00199   entries_ = -1.;
00200   max_ = -1.*sistrip::invalid_;
00201   min_ =  1.*sistrip::invalid_;
00202 }

void SummaryGenerator::fill ( const std::string &  top_level_dir,
const sistrip::Granularity gran,
const uint32_t &  key,
const float &  value,
const float &  error 
) [protected, virtual]

Fills the map used to generate the histogram.

Reimplemented in SummaryGeneratorControlView, and SummaryGeneratorReadoutView.

Definition at line 258 of file SummaryGenerator.cc.

References LogTrace, and sistrip::mlSummaryPlots_.

Referenced by fillMap().

00262                                                   {
00263   
00264   LogTrace(mlSummaryPlots_)
00265     << "[SummaryGenerator::" << __func__ << "]"
00266     << " Derived implementation does not exist!...";
00267 }

void SummaryGenerator::fillMap ( const std::string &  top_level_dir,
const sistrip::Granularity gran,
const uint32_t &  key,
const float &  value,
const float &  error = 0. 
)

Fills the map that is used to generate the histogram(s).

Definition at line 234 of file SummaryGenerator.cc.

References fill(), max_, min_, and sistrip::valid_.

Referenced by ApvTimingSummaryFactory::extract(), PedsOnlySummaryFactory::extract(), SamplingSummaryFactory::extract(), NoiseSummaryFactory::extract(), FastFedCablingSummaryFactory::extract(), OptoScanSummaryFactory::extract(), SummaryHistogramFactory< DaqScopeModeAnalysis >::extract(), CalibrationSummaryFactory::extract(), SummaryHistogramFactory< FedTimingAnalysis >::extract(), PedestalsSummaryFactory::extract(), VpspScanSummaryFactory::extract(), SummaryHistogramFactory< T >::extract(), SummaryPlotFactory< FedCablingAnalysis * >::init(), and SummaryPlotFactory< T >::init().

00238                                                      {
00239   
00240   // Check if value is valid
00241   if ( value > 1. * sistrip::valid_ ) { return; }
00242   
00243   // Calculate maximum and minimum values in std::map
00244   if ( value > max_ ) { max_ = value; }
00245   if ( value < min_ ) { min_ = value; }
00246   
00247   // Check if error is valid
00248   if ( error < 1. * sistrip::valid_ ) { 
00249     fill( top_level_dir, gran, device_key, value, error );
00250   } else { 
00251     fill( top_level_dir, gran, device_key, value, 0. ); 
00252   } 
00253   
00254 }

void SummaryGenerator::format ( const sistrip::RunType run_type,
const sistrip::Monitorable mon,
const sistrip::Presentation pres,
const sistrip::View view,
const std::string &  directory,
const sistrip::Granularity gran,
TH1 &  summary_histo 
)

Some generic formatting of histogram.

Definition at line 117 of file SummaryGenerator.cc.

References entries_, SiStripEnumsAndStrings::granularity(), sistrip::HISTO_1D, sistrip::HISTO_2D_SCATTER, sistrip::HISTO_2D_SUM, label_, and sistrip::PROFILE_1D.

Referenced by SummaryHistogramFactory< T >::fill(), SummaryHistogramFactory< DaqScopeModeAnalysis >::fill(), SummaryHistogramFactory< FedTimingAnalysis >::fill(), and SummaryPlotFactoryBase::fill().

00123                                                     {
00124   
00125   // Set name, title and entries
00126   //std::stringstream ss;
00127   //std::string name = SummaryGenerator::name( run_type, mon, pres, view, directory );
00128   //summary_histo.SetName( name.c_str() );
00129   //summary_histo.SetTitle( name.c_str() );
00130   if ( entries_ >= 0. ) { summary_histo.SetEntries( entries_ ); }
00131   
00132   // X axis
00133   summary_histo.GetXaxis()->SetLabelSize(0.03);
00134   summary_histo.GetXaxis()->SetTitleSize(0.03);
00135   summary_histo.GetXaxis()->SetTitleOffset(3.5); 
00136   //gPad->SetBottomMargin(0.2);
00137   
00138   // Y axis
00139   summary_histo.GetYaxis()->SetLabelSize(0.03);
00140   summary_histo.GetYaxis()->SetTitleSize(0.03);
00141   summary_histo.GetYaxis()->SetTitleOffset(1.5);
00142   //gPad->SetLeftMargin(0.2);
00143   
00144   // Axis label
00145   if ( pres == sistrip::HISTO_1D ) {
00146     std::string xtitle = label_ + " (for " + directory + ")";
00147     summary_histo.GetXaxis()->SetTitle( xtitle.c_str() );
00148     summary_histo.GetYaxis()->SetTitle( "Frequency" );
00149     summary_histo.GetXaxis()->SetTitleOffset(1.5); //@@ override value set above
00150   } else {
00151     std::string xtitle = SiStripEnumsAndStrings::granularity( gran ) + " within " + directory;
00152     summary_histo.GetXaxis()->SetTitle( xtitle.c_str() );
00153     summary_histo.GetYaxis()->SetTitle( label_.c_str() );
00154     //summary_histo.GetXaxis()->SetTitleOffset(1.5); //@@ override value set above (3.5?)
00155   }    
00156   
00157   // Formatting for 2D plots
00158   if ( pres == sistrip::HISTO_2D_SCATTER ) { 
00159     // Markers (open circles)
00160     summary_histo.SetMarkerStyle(2); 
00161     summary_histo.SetMarkerSize(0.6);
00162   }
00163 
00164   // Semi-generic formatting
00165   if ( pres == sistrip::HISTO_2D_SUM || 
00166        pres == sistrip::HISTO_2D_SCATTER ||
00167        pres == sistrip::PROFILE_1D ) {
00168     /*
00169     //put solid and dotted lines on summary to separate top- and
00170     //2nd-from-top- level bin groups.
00171 
00172     uint16_t topLevel = 0, topLevelOld = 0, secondLevel = 0, secondLevelOld = 0;
00173     std::string::size_type pos = 0;
00174     for ( HistoData::iterator ibin = map_.begin(); ibin != map_.end(); ibin++) {
00175 
00176       //draw line if top and second level numbers change.
00177       pos = ibin->first.find(sistrip::dot_,0);
00178       if (pos != std::string::npos) {
00179         if ((topLevel=atoi(std::string(ibin->first,0,pos).c_str())) != topLevelOld) {
00180           topLevel = topLevelOld;
00181           //
00182         }
00183         else if (ibin->first.find(sistrip::dot_,pos+1) != std::string::npos) {
00184             if ((secondLevelOld=atoi(std::string(ibin->first,pos+1,(ibin->first.find(sistrip::dot_,pos+1)- (pos+1))).c_str())) != secondLevel) {
00185               secondLevel = secondLevelOld;
00186               //
00187             }}}
00188     }
00189     */
00190   }
00191 }

void SummaryGenerator::histo1D ( TH1 &  his  ) 

Creates simple 1D histogram of the parameter values.

Definition at line 271 of file SummaryGenerator.cc.

References entries_, WenuSkim_TriggerBit_cff::high, histo, map_, max_, min_, sistrip::mlSummaryPlots_, and range.

Referenced by SummaryHistogramFactory< T >::fill(), SummaryHistogramFactory< DaqScopeModeAnalysis >::fill(), SummaryHistogramFactory< FedTimingAnalysis >::fill(), and SummaryPlotFactoryBase::fill().

00271                                          {
00272   
00273   // Check number of entries in map
00274   if ( map_.empty() ) { 
00275     edm::LogWarning(mlSummaryPlots_) 
00276       << "[SummaryGenerator::" << __func__ << "]" 
00277       << " No contents in std::map to histogram!";
00278     return; 
00279   }
00280   
00281   // Retrieve histogram  
00282   TH1F* histo = dynamic_cast<TH1F*>(&his);
00283   if ( !histo ) { 
00284     edm::LogWarning(mlSummaryPlots_)
00285       << "[SummaryGenerator::" << __func__ << "]"
00286       << " NULL pointer to TH1F histogram!";
00287     return;
00288   }
00289   
00290   // Calculate bin range
00291   int32_t high  = static_cast<int32_t>( fabs(max_) > 20. ? max_ + 0.05 * fabs(max_) : max_ + 1. );
00292   int32_t low   = static_cast<int32_t>( fabs(min_) > 20. ? min_ - 0.05 * fabs(min_) : min_ - 1. );
00293   int32_t range = high - low;
00294 
00295   // increase number of bins for floats
00296 //   if ( max_ - static_cast<int32_t>(max_) > 1.e-6 && 
00297 //        min_ - static_cast<int32_t>(min_) > 1.e-6 ) {
00298 //     range = 100 * range; 
00299 //   }
00300   
00301   // Set histogram binning
00302   histo->SetBins( range, static_cast<float>(low), static_cast<float>(high) );
00303   
00304   // Iterate through std::map, set bin labels and fill histogram
00305   entries_ = 0.;
00306   HistoData::const_iterator ibin = map_.begin();
00307   for ( ; ibin != map_.end(); ibin++ ) {
00308     if ( ibin->second.empty() ) { continue; }
00309     BinData::const_iterator ii = ibin->second.begin();
00310     for ( ; ii != ibin->second.end(); ii++ ) { 
00311       // bin (value) and weight (error)
00312       histo->Fill( ii->first ); //, ii->second ); 
00313       entries_++;
00314     }
00315   }
00316   
00317 }

void SummaryGenerator::histo2DScatter ( TH1 &  his  ) 

Creates a 2D scatter histogram, with individual values of the parameter (y-axis) binned as a function of position within the given logical structure, which is view-dependent (x-axis).

Definition at line 361 of file SummaryGenerator.cc.

References entries_, histo, map_, and sistrip::mlSummaryPlots_.

Referenced by SummaryHistogramFactory< T >::fill(), SummaryHistogramFactory< DaqScopeModeAnalysis >::fill(), SummaryHistogramFactory< FedTimingAnalysis >::fill(), and SummaryPlotFactoryBase::fill().

00361                                                 {
00362 
00363   // Check number of entries in map
00364   if ( map_.empty() ) { 
00365     edm::LogWarning(mlSummaryPlots_)
00366       << "[SummaryGenerator::" << __func__ << "]" 
00367       << " No contents in std::map to histogram!";
00368     return; 
00369   }
00370   
00371   // Retrieve histogram  
00372   TH2F* histo = dynamic_cast<TH2F*>(&his);
00373   if ( !histo ) { 
00374     edm::LogWarning(mlSummaryPlots_)
00375       << "[SummaryGenerator::" << __func__ << "]"
00376       << " NULL pointer to TH2F histogram!";
00377     return;
00378   }
00379   
00380   // Iterate through std::map, set bin labels and fill histogram
00381   entries_ = 0.;
00382   uint16_t bin = 0;
00383   HistoData::const_iterator ibin = map_.begin();
00384   for ( ; ibin != map_.end(); ibin++ ) {
00385     bin++;
00386     histo->GetXaxis()->SetBinLabel( static_cast<Int_t>(bin), ibin->first.c_str() );
00387     if ( ibin->second.empty() ) { continue; }
00388     BinData::const_iterator ii = ibin->second.begin();
00389     for ( ; ii != ibin->second.end(); ii++ ) { 
00390       // x (bin), y (value) and weight (error)
00391       histo->Fill( static_cast<Double_t>(bin-0.5), 
00392                    static_cast<Double_t>(ii->first) ); // , ii->second ); 
00393       entries_++;
00394     }
00395   }
00396   
00397 }

void SummaryGenerator::histo2DSum ( TH1 &  his  ) 

Creates a 1D histogram, with the weighted sum of the parameter (y-axis) binned as a function of position within the given logical structure, which is view-dependent (x-axis).

Definition at line 321 of file SummaryGenerator.cc.

References entries_, histo, map_, and sistrip::mlSummaryPlots_.

Referenced by SummaryHistogramFactory< T >::fill(), SummaryHistogramFactory< DaqScopeModeAnalysis >::fill(), SummaryHistogramFactory< FedTimingAnalysis >::fill(), and SummaryPlotFactoryBase::fill().

00321                                             {
00322   
00323   // Check number of entries in map
00324   if ( map_.empty() ) { 
00325     edm::LogWarning(mlSummaryPlots_)
00326       << "[SummaryGenerator::" << __func__ << "]" 
00327       << " No contents in std::map to histogram!";
00328     return; 
00329   }
00330   
00331   // Retrieve histogram  
00332   TH1F* histo = dynamic_cast<TH1F*>(&his);
00333   if ( !histo ) { 
00334     edm::LogWarning(mlSummaryPlots_)
00335       << "[SummaryGenerator::" << __func__ << "]"
00336       << " NULL pointer to TH1F histogram!";
00337     return;
00338   }
00339   
00340   // Iterate through map, set bin labels and fill histogram
00341   entries_ = 0.;
00342   uint16_t bin = 0;
00343   HistoData::const_iterator ibin = map_.begin();
00344   for ( ; ibin != map_.end(); ibin++ ) {
00345     bin++;
00346     histo->GetXaxis()->SetBinLabel( static_cast<Int_t>(bin), ibin->first.c_str() );
00347     if ( ibin->second.empty() ) { continue; }
00348     BinData::const_iterator ii = ibin->second.begin();
00349     for ( ; ii != ibin->second.end(); ii++ ) { 
00350       // x (bin), y (value) and weight (error)
00351       histo->Fill( static_cast<Double_t>(bin-0.5), 
00352                    static_cast<Double_t>(ii->first) ); //, ii->second ); 
00353       entries_ += 1. * ii->first;
00354     }
00355   }
00356   
00357 }

TH1 * SummaryGenerator::histogram ( const sistrip::Presentation pres,
const uint32_t &  xbins 
) [static]

Creates instance of derived class based on view parameter.

Definition at line 83 of file SummaryGenerator.cc.

References sistrip::HISTO_1D, sistrip::HISTO_2D_SCATTER, sistrip::HISTO_2D_SUM, LogTrace, sistrip::mlSummaryPlots_, SiStripEnumsAndStrings::presentation(), sistrip::PROFILE_1D, and summary.

00084                                                           {
00085   if ( !xbins ) { return 0; }
00086 
00087   TH1* summary = 0;
00088   if ( pres == sistrip::HISTO_1D ) { 
00089     summary = new TH1F( "", "", 1024, 0., static_cast<float>(1024) ); 
00090   } else if ( pres == sistrip::HISTO_2D_SUM ) { 
00091     summary = new TH1F( "", "", xbins, 0., static_cast<float>(xbins) ); 
00092   } else if ( pres == sistrip::HISTO_2D_SCATTER ) { 
00093     summary = new TH2F( "", "", 100*xbins, 0., static_cast<float>(100*xbins), 1025, 0., 1025. ); 
00094   } else if ( pres == sistrip::PROFILE_1D ) { 
00095     summary = new TProfile( "", "", xbins, 0., static_cast<float>(xbins), 0., 1025. ); 
00096   } else { summary = 0; }
00097   
00098   if ( summary ) {
00099     LogTrace(mlSummaryPlots_) 
00100       << "[SummaryGenerator::" << __func__ << "]"
00101       << " Histogram name: \"" << summary->GetName() << "\"";
00102   } else { 
00103     edm::LogVerbatim(mlSummaryPlots_) 
00104       << "[SummaryGenerator::" << __func__ << "]"
00105       << " Unexpected presentation: \"" 
00106       << SiStripEnumsAndStrings::presentation( pres )
00107       << "\" Unable to build summary plot!"
00108       << " Returning NULL pointer!";
00109   }
00110   
00111   return summary;
00112   
00113 }

SummaryGenerator * SummaryGenerator::instance ( const sistrip::View view  )  [static]

Creates instance of derived class based on view parameter.

Definition at line 29 of file SummaryGenerator.cc.

References sistrip::CONTROL_VIEW, MadGraph_SingleTop_LHEProducer_t_15_84_10TeV_cff::generator, LogTrace, sistrip::mlSummaryPlots_, myName(), sistrip::READOUT_VIEW, and SiStripEnumsAndStrings::view().

Referenced by SummaryHistogramFactory< DaqScopeModeAnalysis >::init(), SummaryHistogramFactory< FedTimingAnalysis >::init(), SummaryHistogramFactory< T >::init(), and SummaryPlotFactoryBase::init().

00029                                                                       {
00030 
00031   SummaryGenerator* generator = 0;
00032   if ( view == sistrip::CONTROL_VIEW ) {
00033     generator = new SummaryGeneratorControlView();
00034   } else if ( view == sistrip::READOUT_VIEW ) {
00035     generator = new SummaryGeneratorReadoutView();
00036   } else { generator = 0; }
00037   
00038   if ( generator ) {
00039     LogTrace(mlSummaryPlots_) 
00040       << "[SummaryGenerator::" << __func__ << "]"
00041       << " Built \"" << generator->myName() << "\" object!";
00042   } else {
00043     edm::LogWarning(mlSummaryPlots_) 
00044       << "[SummaryGenerator::" << __func__ << "]"
00045       << " Unexpected view: \"" 
00046       << SiStripEnumsAndStrings::view( view )
00047       << "\" Unable to build Generator!"
00048       << " Returning NULL pointer!";
00049   }
00050   
00051   return generator;
00052 
00053 }

const std::string & SummaryGenerator::myName ( void   )  const [inline]

Returns name of generator object.

Definition at line 140 of file SummaryGenerator.h.

References myName_.

Referenced by instance().

00140 { return myName_; }

std::string SummaryGenerator::name ( const sistrip::RunType run_type,
const sistrip::Monitorable mon,
const sistrip::Presentation pres,
const sistrip::View view,
const std::string &  directory 
) [static]

Constructs the summary histogram name.

Definition at line 57 of file SummaryGenerator.cc.

References SiStripEnumsAndStrings::monitorable(), SiStripEnumsAndStrings::presentation(), SiStripEnumsAndStrings::runType(), sistrip::sep_, ss, sistrip::summaryHisto_, and SiStripEnumsAndStrings::view().

Referenced by CommissioningHistograms::histogram().

00061                                                                  {
00062   std::stringstream ss;
00063   ss << sistrip::summaryHisto_ << sistrip::sep_; 
00064   ss << SiStripEnumsAndStrings::presentation( pres ) << sistrip::sep_; 
00065   ss << SiStripEnumsAndStrings::runType( run_type ) << sistrip::sep_;
00066   ss << SiStripEnumsAndStrings::view( view ) << sistrip::sep_;
00067   ss << SiStripEnumsAndStrings::monitorable( mon );
00068   
00069   //LogTrace(mlSummaryPlots_) 
00070   //<< "[SummaryGenerator::" << __func__ << "]"
00071   //<< " Histogram name: \"" << ss.str() << "\"";
00072   
00073   return ss.str();
00074 }

uint32_t SummaryGenerator::nBins (  )  const [inline]

Retrieve size of map (ie, number of bins).

Definition at line 141 of file SummaryGenerator.h.

References map_.

Referenced by SummaryPlotFactoryBase::fill(), SummaryPlotFactory< FedCablingAnalysis * >::init(), SummaryPlotFactory< CommissioningAnalysis * >::init(), SummaryPlotFactory< T >::init(), and size().

00141 { return map_.size(); }

void SummaryGenerator::printMap (  ) 

Print contents of map used to generate the histogram(s).

Definition at line 206 of file SummaryGenerator.cc.

References lat::endl(), iter, LogTrace, map_, max_, min_, sistrip::mlSummaryPlots_, and ss.

00206                                 {
00207 
00208   std::stringstream ss;
00209   ss << "[SummaryGenerator::" << __func__ << "]"
00210      << " Printing contents of map: " << std::endl;
00211   
00212   HistoData::iterator iter = map_.begin(); 
00213   for ( ; iter != map_.end(); iter++ ) { 
00214     ss << " bin/entries: " << iter->first << "/" << iter->second.size() << " ";
00215     if ( !iter->second.empty() ) {
00216       ss << " value/error: ";
00217       std::vector<Data>::const_iterator jter = iter->second.begin();
00218       for ( ; jter != iter->second.end(); jter++ ) { 
00219         ss << jter->first << "/" << jter->second << " ";
00220       }
00221     }
00222     ss << std::endl;
00223   }
00224   
00225   ss << " Max value: " << max_ << std::endl
00226      << " Min value: " << min_ << std::endl;
00227 
00228   LogTrace(mlSummaryPlots_) << ss.str();
00229   
00230 }

void SummaryGenerator::profile1D ( TH1 &  his  ) 

Creates a profile histogram, with the mean and spread of the parameter (y-axis) binned as a function of position within the given logical structure, which is view-dependent (x-axis).

Definition at line 401 of file SummaryGenerator.cc.

References entries_, histo, map_, and sistrip::mlSummaryPlots_.

Referenced by SummaryHistogramFactory< T >::fill(), SummaryHistogramFactory< DaqScopeModeAnalysis >::fill(), SummaryHistogramFactory< FedTimingAnalysis >::fill(), and SummaryPlotFactoryBase::fill().

00401                                            {
00402   
00403   // Check number of entries in map
00404   if ( map_.empty() ) { 
00405     edm::LogWarning(mlSummaryPlots_)
00406       << "[SummaryGenerator::" << __func__ << "]" 
00407       << " No contents in std::map to histogram!";
00408     return; 
00409   }
00410   
00411   // Retrieve histogram  
00412   TProfile* histo = dynamic_cast<TProfile*>(&his);
00413   if ( !histo ) { 
00414     edm::LogWarning(mlSummaryPlots_) 
00415       << "[SummaryGenerator::" << __func__ << "]"
00416       << " NULL pointer to TProfile histogram!";
00417     return;
00418   }
00419   
00420   // Iterate through std::map, set bin labels and fill histogram
00421   entries_ = 0.;
00422   uint16_t bin = 0;
00423   HistoData::const_iterator ibin = map_.begin();
00424   for ( ; ibin != map_.end(); ibin++ ) {
00425     bin++;
00426     histo->GetXaxis()->SetBinLabel( static_cast<Int_t>(bin), ibin->first.c_str() );
00427     if ( ibin->second.empty() ) { continue; }
00428     BinData::const_iterator ii = ibin->second.begin();
00429     for ( ; ii != ibin->second.end(); ii++ ) { 
00430       // x (bin), y (value) and weight (error)
00431       histo->Fill( static_cast<Double_t>(bin-.5), 
00432                    static_cast<Double_t>(ii->first) ); //, ii->second ); 
00433       entries_++;
00434     }
00435   }
00436   
00437 }

uint32_t SummaryGenerator::size ( void   )  const [inline]

Definition at line 98 of file SummaryGenerator.h.

References nBins().

Referenced by SummaryHistogramFactory< DaqScopeModeAnalysis >::extract(), SummaryHistogramFactory< FedTimingAnalysis >::extract(), SummaryHistogramFactory< T >::extract(), SummaryHistogramFactory< T >::fill(), SummaryHistogramFactory< DaqScopeModeAnalysis >::fill(), and SummaryHistogramFactory< FedTimingAnalysis >::fill().

00098 { return nBins(); } //@@ TEMPORARY!!!


Member Data Documentation

float SummaryGenerator::entries_ [protected]

Definition at line 124 of file SummaryGenerator.h.

Referenced by clearMap(), SummaryGeneratorReadoutView::fill(), SummaryGeneratorControlView::fill(), format(), histo1D(), histo2DScatter(), histo2DSum(), and profile1D().

std::string SummaryGenerator::label_ [protected]

Definition at line 130 of file SummaryGenerator.h.

Referenced by axisLabel(), and format().

HistoData SummaryGenerator::map_ [protected]

A map designed to holds a set of values.

The map containing these values should be indexed by a key.

Definition at line 122 of file SummaryGenerator.h.

Referenced by clearMap(), SummaryGeneratorReadoutView::fill(), SummaryGeneratorControlView::fill(), histo1D(), histo2DScatter(), histo2DSum(), nBins(), printMap(), and profile1D().

float SummaryGenerator::max_ [protected]

Definition at line 126 of file SummaryGenerator.h.

Referenced by clearMap(), fillMap(), histo1D(), and printMap().

float SummaryGenerator::min_ [protected]

Definition at line 128 of file SummaryGenerator.h.

Referenced by clearMap(), fillMap(), histo1D(), and printMap().

std::string SummaryGenerator::myName_ [private]

Definition at line 136 of file SummaryGenerator.h.

Referenced by myName().


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