CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
SummaryGenerator Class Reference

: Fills summary histograms. More...

#include <SummaryGenerator.h>

Inheritance diagram for SummaryGenerator:
SummaryGeneratorControlView SummaryGeneratorReadoutView

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 &)
 
void clearMap ()
 
void fillMap (const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
 
void format (const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const sistrip::Granularity &, TH1 &)
 
void histo1D (TH1 &)
 
void histo2DScatter (TH1 &)
 
void histo2DSum (TH1 &)
 
const std::string & myName () const
 
uint32_t nBins () const
 
void printMap ()
 
void profile1D (TH1 &)
 
uint32_t size () const
 
 SummaryGenerator (std::string name)
 
virtual ~SummaryGenerator ()
 

Static Public Member Functions

static TH1 * histogram (const sistrip::Presentation &, const uint32_t &xbins)
 
static SummaryGeneratorinstance (const sistrip::View &)
 
static std::string name (const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory)
 

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)
 

Protected Attributes

float entries_
 
std::string label_
 
HistoData map_
 
float max_
 
float min_
 

Private Attributes

std::string myName_
 

Detailed Description

: Fills summary histograms.

Author
M.Wingham, R.Bainbridge

Definition at line 19 of file SummaryGenerator.h.

Member Typedef Documentation

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

Definition at line 28 of file SummaryGenerator.h.

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

Definition at line 27 of file SummaryGenerator.h.

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

Definition at line 29 of file SummaryGenerator.h.

Constructor & Destructor Documentation

SummaryGenerator::SummaryGenerator ( std::string  name)

Definition at line 16 of file SummaryGenerator.cc.

17  : map_(), entries_(-1.), max_(-1. * sistrip::invalid_), min_(1. * sistrip::invalid_), label_(""), myName_(name) {
18  // TH1::SetDefaultSumw2(true); // use square of weights to calc error
19 }
static std::string name(const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory)
static const uint16_t invalid_
Definition: Constants.h:16
virtual SummaryGenerator::~SummaryGenerator ( )
inlinevirtual

Definition at line 24 of file SummaryGenerator.h.

24 { ; }

Member Function Documentation

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

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

Definition at line 184 of file SummaryGenerator.cc.

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

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

184  {
185  HistoData::iterator iter = map_.begin();
186  for (; iter != map_.end(); iter++) {
187  iter->second.clear();
188  }
189  map_.clear();
190  entries_ = -1.;
191  max_ = -1. * sistrip::invalid_;
192  min_ = 1. * sistrip::invalid_;
193 }
void clear()
Definition: HistoData.h:95
static const uint16_t invalid_
Definition: Constants.h:16
void SummaryGenerator::fill ( const std::string &  top_level_dir,
const sistrip::Granularity gran,
const uint32_t &  key,
const float &  value,
const float &  error 
)
protectedvirtual

Fills the map used to generate the histogram.

Reimplemented in SummaryGeneratorControlView, and SummaryGeneratorReadoutView.

Definition at line 250 of file SummaryGenerator.cc.

References LogTrace, and sistrip::mlSummaryPlots_.

Referenced by fillMap().

254  {
255  LogTrace(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
256  << " Derived implementation does not exist!...";
257 }
#define LogTrace(id)
static const char mlSummaryPlots_[]
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 222 of file SummaryGenerator.cc.

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

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

226  {
227  // Check if value is valid
228  if (value > 1. * sistrip::valid_) {
229  return;
230  }
231 
232  // Calculate maximum and minimum values in std::map
233  if (value > max_) {
234  max_ = value;
235  }
236  if (value < min_) {
237  min_ = value;
238  }
239 
240  // Check if error is valid
241  if (error < 1. * sistrip::valid_) {
242  fill(top_level_dir, gran, device_key, value, error);
243  } else {
244  fill(top_level_dir, gran, device_key, value, 0.);
245  }
246 }
static const uint16_t valid_
Definition: Constants.h:17
virtual void fill(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error)
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 107 of file SummaryGenerator.cc.

References createBeamHaloJobs::directory, entries_, SiStripEnumsAndStrings::granularity(), sistrip::HISTO_1D, sistrip::HISTO_2D_SCATTER, sistrip::HISTO_2D_SUM, label_, sistrip::PROFILE_1D, AlCaHLTBitMon_QueryRunRegistry::string, and compareTotals::xtitle.

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

113  {
114  // Set name, title and entries
115  //std::stringstream ss;
116  //std::string name = SummaryGenerator::name( run_type, mon, pres, view, directory );
117  //summary_histo.SetName( name.c_str() );
118  //summary_histo.SetTitle( name.c_str() );
119  if (entries_ >= 0.) {
120  summary_histo.SetEntries(entries_);
121  }
122 
123  // X axis
124  summary_histo.GetXaxis()->SetLabelSize(0.03);
125  summary_histo.GetXaxis()->SetTitleSize(0.03);
126  summary_histo.GetXaxis()->SetTitleOffset(3.5);
127  //gPad->SetBottomMargin(0.2);
128 
129  // Y axis
130  summary_histo.GetYaxis()->SetLabelSize(0.03);
131  summary_histo.GetYaxis()->SetTitleSize(0.03);
132  summary_histo.GetYaxis()->SetTitleOffset(1.5);
133  //gPad->SetLeftMargin(0.2);
134 
135  // Axis label
136  if (pres == sistrip::HISTO_1D) {
137  std::string xtitle = label_ + " (for " + directory + ")";
138  summary_histo.GetXaxis()->SetTitle(xtitle.c_str());
139  summary_histo.GetYaxis()->SetTitle("Frequency");
140  summary_histo.GetXaxis()->SetTitleOffset(1.5); //@@ override value set above
141  } else {
142  std::string xtitle = SiStripEnumsAndStrings::granularity(gran) + " within " + directory;
143  summary_histo.GetXaxis()->SetTitle(xtitle.c_str());
144  summary_histo.GetYaxis()->SetTitle(label_.c_str());
145  //summary_histo.GetXaxis()->SetTitleOffset(1.5); //@@ override value set above (3.5?)
146  }
147 
148  // Formatting for 2D plots
149  if (pres == sistrip::HISTO_2D_SCATTER) {
150  // Markers (open circles)
151  summary_histo.SetMarkerStyle(2);
152  summary_histo.SetMarkerSize(0.6);
153  }
154 
155  // Semi-generic formatting
156  if (pres == sistrip::HISTO_2D_SUM || pres == sistrip::HISTO_2D_SCATTER || pres == sistrip::PROFILE_1D) {
157  /*
158  //put solid and dotted lines on summary to separate top- and
159  //2nd-from-top- level bin groups.
160 
161  uint16_t topLevel = 0, topLevelOld = 0, secondLevel = 0, secondLevelOld = 0;
162  std::string::size_type pos = 0;
163  for ( HistoData::iterator ibin = map_.begin(); ibin != map_.end(); ibin++) {
164 
165  //draw line if top and second level numbers change.
166  pos = ibin->first.find(sistrip::dot_,0);
167  if (pos != std::string::npos) {
168  if ((topLevel=atoi(std::string(ibin->first,0,pos).c_str())) != topLevelOld) {
169  topLevel = topLevelOld;
170  //
171  }
172  else if (ibin->first.find(sistrip::dot_,pos+1) != std::string::npos) {
173  if ((secondLevelOld=atoi(std::string(ibin->first,pos+1,(ibin->first.find(sistrip::dot_,pos+1)- (pos+1))).c_str())) != secondLevel) {
174  secondLevel = secondLevelOld;
175  //
176  }}}
177  }
178  */
179  }
180 }
static std::string granularity(const sistrip::Granularity &)
void SummaryGenerator::histo1D ( TH1 &  his)

Creates simple 1D histogram of the parameter values.

Definition at line 261 of file SummaryGenerator.cc.

References entries_, timingPdfMaker::histo, cuy::ii, map_, max_, min_, sistrip::mlSummaryPlots_, and sistrip::SpyUtilities::range().

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

261  {
262  // Check number of entries in map
263  if (map_.empty()) {
264  edm::LogWarning(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
265  << " No contents in std::map to histogram!";
266  return;
267  }
268 
269  // Retrieve histogram
270  TH1F* histo = dynamic_cast<TH1F*>(&his);
271  if (!histo) {
272  edm::LogWarning(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
273  << " NULL pointer to TH1F histogram!";
274  return;
275  }
276 
277  // Calculate bin range
278  int32_t high = static_cast<int32_t>(fabs(max_) > 20. ? max_ + 0.05 * fabs(max_) : max_ + 1.);
279  int32_t low = static_cast<int32_t>(fabs(min_) > 20. ? min_ - 0.05 * fabs(min_) : min_ - 1.);
280  int32_t range = high - low;
281 
282  // increase number of bins for floats
283  // if ( max_ - static_cast<int32_t>(max_) > 1.e-6 &&
284  // min_ - static_cast<int32_t>(min_) > 1.e-6 ) {
285  // range = 100 * range;
286  // }
287 
288  // Set histogram binning
289  histo->SetBins(range, static_cast<float>(low), static_cast<float>(high));
290 
291  // Iterate through std::map, set bin labels and fill histogram
292  entries_ = 0.;
293  HistoData::const_iterator ibin = map_.begin();
294  for (; ibin != map_.end(); ibin++) {
295  if (ibin->second.empty()) {
296  continue;
297  }
298  BinData::const_iterator ii = ibin->second.begin();
299  for (; ii != ibin->second.end(); ii++) {
300  // bin (value) and weight (error)
301  histo->Fill(ii->first); //, ii->second );
302  entries_++;
303  }
304  }
305 }
int ii
Definition: cuy.py:589
const uint16_t range(const Frame &aFrame)
static const char mlSummaryPlots_[]
Log< level::Warning, false > LogWarning
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 347 of file SummaryGenerator.cc.

References newFWLiteAna::bin, entries_, timingPdfMaker::histo, cuy::ii, map_, and sistrip::mlSummaryPlots_.

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

347  {
348  // Check number of entries in map
349  if (map_.empty()) {
350  edm::LogWarning(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
351  << " No contents in std::map to histogram!";
352  return;
353  }
354 
355  // Retrieve histogram
356  TH2F* histo = dynamic_cast<TH2F*>(&his);
357  if (!histo) {
358  edm::LogWarning(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
359  << " NULL pointer to TH2F histogram!";
360  return;
361  }
362 
363  // Iterate through std::map, set bin labels and fill histogram
364  entries_ = 0.;
365  uint16_t bin = 0;
366  HistoData::const_iterator ibin = map_.begin();
367  for (; ibin != map_.end(); ibin++) {
368  bin++;
369  histo->GetXaxis()->SetBinLabel(static_cast<Int_t>(bin), ibin->first.c_str());
370  if (ibin->second.empty()) {
371  continue;
372  }
373  BinData::const_iterator ii = ibin->second.begin();
374  for (; ii != ibin->second.end(); ii++) {
375  // x (bin), y (value) and weight (error)
376  histo->Fill(static_cast<Double_t>(bin - 0.5),
377  static_cast<Double_t>(ii->first)); // , ii->second );
378  entries_++;
379  }
380  }
381 }
int ii
Definition: cuy.py:589
static const char mlSummaryPlots_[]
Log< level::Warning, false > LogWarning
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 309 of file SummaryGenerator.cc.

References newFWLiteAna::bin, entries_, timingPdfMaker::histo, cuy::ii, map_, and sistrip::mlSummaryPlots_.

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

309  {
310  // Check number of entries in map
311  if (map_.empty()) {
312  edm::LogWarning(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
313  << " No contents in std::map to histogram!";
314  return;
315  }
316 
317  // Retrieve histogram
318  TH1F* histo = dynamic_cast<TH1F*>(&his);
319  if (!histo) {
320  edm::LogWarning(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
321  << " NULL pointer to TH1F histogram!";
322  return;
323  }
324 
325  // Iterate through map, set bin labels and fill histogram
326  entries_ = 0.;
327  uint16_t bin = 0;
328  HistoData::const_iterator ibin = map_.begin();
329  for (; ibin != map_.end(); ibin++) {
330  bin++;
331  histo->GetXaxis()->SetBinLabel(static_cast<Int_t>(bin), ibin->first.c_str());
332  if (ibin->second.empty()) {
333  continue;
334  }
335  BinData::const_iterator ii = ibin->second.begin();
336  for (; ii != ibin->second.end(); ii++) {
337  // x (bin), y (value) and weight (error)
338  histo->Fill(static_cast<Double_t>(bin - 0.5),
339  static_cast<Double_t>(ii->first)); //, ii->second );
340  entries_ += 1. * ii->first;
341  }
342  }
343 }
int ii
Definition: cuy.py:589
static const char mlSummaryPlots_[]
Log< level::Warning, false > LogWarning
TH1 * SummaryGenerator::histogram ( const sistrip::Presentation pres,
const uint32_t &  xbins 
)
static

Creates instance of derived class based on view parameter.

Definition at line 74 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 edmLumisInFiles::summary.

74  {
75  if (!xbins) {
76  return nullptr;
77  }
78 
79  TH1* summary = nullptr;
80  if (pres == sistrip::HISTO_1D) {
81  summary = new TH1F("", "", 1024, 0., static_cast<float>(1024));
82  } else if (pres == sistrip::HISTO_2D_SUM) {
83  summary = new TH1F("", "", xbins, 0., static_cast<float>(xbins));
84  } else if (pres == sistrip::HISTO_2D_SCATTER) {
85  summary = new TH2F("", "", 100 * xbins, 0., static_cast<float>(100 * xbins), 1025, 0., 1025.);
86  } else if (pres == sistrip::PROFILE_1D) {
87  summary = new TProfile("", "", xbins, 0., static_cast<float>(xbins), 0., 1025.);
88  } else {
89  summary = nullptr;
90  }
91 
92  if (summary) {
93  LogTrace(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
94  << " Histogram name: \"" << summary->GetName() << "\"";
95  } else {
96  edm::LogVerbatim(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
97  << " Unexpected presentation: \"" << SiStripEnumsAndStrings::presentation(pres)
98  << "\" Unable to build summary plot!"
99  << " Returning NULL pointer!";
100  }
101 
102  return summary;
103 }
Log< level::Info, true > LogVerbatim
const double xbins[]
#define LogTrace(id)
static const char mlSummaryPlots_[]
static std::string presentation(const sistrip::Presentation &)
SummaryGenerator * SummaryGenerator::instance ( const sistrip::View view)
static

Creates instance of derived class based on view parameter.

Definition at line 23 of file SummaryGenerator.cc.

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

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

23  {
24  SummaryGenerator* generator = nullptr;
25  if (view == sistrip::CONTROL_VIEW) {
26  generator = new SummaryGeneratorControlView();
27  } else if (view == sistrip::READOUT_VIEW) {
28  generator = new SummaryGeneratorReadoutView();
29  } else {
30  generator = nullptr;
31  }
32 
33  if (generator) {
34  LogTrace(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
35  << " Built \"" << generator->myName() << "\" object!";
36  } else {
37  edm::LogWarning(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
38  << " Unexpected view: \"" << SiStripEnumsAndStrings::view(view)
39  << "\" Unable to build Generator!"
40  << " Returning NULL pointer!";
41  }
42 
43  return generator;
44 }
: Fills summary histograms.
#define LogTrace(id)
static std::string view(const sistrip::View &)
Fills &quot;summary histograms&quot; in FEC or &quot;control&quot; view.
static const char mlSummaryPlots_[]
const std::string & myName() const
Fills &quot;summary histograms&quot; in FED or &quot;readout&quot; view.
Log< level::Warning, false > LogWarning
const std::string & SummaryGenerator::myName ( void  ) const
inline

Returns name of generator object.

Definition at line 133 of file SummaryGenerator.h.

References myName_.

Referenced by instance().

133 { 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 48 of file SummaryGenerator.cc.

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

Referenced by config.CFG::__str__(), geometryComparison.GeometryComparison::createScript(), validation.Sample::digest(), primaryVertexResolution.PrimaryVertexResolution::getRepMap(), primaryVertexValidation.PrimaryVertexValidation::getRepMap(), zMuMuValidation.ZMuMuValidation::getRepMap(), CommissioningHistograms::histogram(), and VIDSelectorBase.VIDSelectorBase::initialize().

52  {
53  std::stringstream ss;
59 
60  //LogTrace(mlSummaryPlots_)
61  //<< "[SummaryGenerator::" << __func__ << "]"
62  //<< " Histogram name: \"" << ss.str() << "\"";
63 
64  return ss.str();
65 }
static std::string monitorable(const sistrip::Monitorable &)
static const char summaryHisto_[]
static std::string view(const sistrip::View &)
static std::string runType(const sistrip::RunType &)
static const char sep_[]
static std::string presentation(const sistrip::Presentation &)
uint32_t SummaryGenerator::nBins ( ) const
inline

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

Definition at line 134 of file SummaryGenerator.h.

References map_.

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

134 { return map_.size(); }
void SummaryGenerator::printMap ( )

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

Definition at line 197 of file SummaryGenerator.cc.

References LogTrace, map_, max_, min_, sistrip::mlSummaryPlots_, and contentValuesCheck::ss.

197  {
198  std::stringstream ss;
199  ss << "[SummaryGenerator::" << __func__ << "]"
200  << " Printing contents of map: " << std::endl;
201 
202  HistoData::iterator iter = map_.begin();
203  for (; iter != map_.end(); iter++) {
204  ss << " bin/entries: " << iter->first << "/" << iter->second.size() << " ";
205  if (!iter->second.empty()) {
206  ss << " value/error: ";
207  std::vector<Data>::const_iterator jter = iter->second.begin();
208  for (; jter != iter->second.end(); jter++) {
209  ss << jter->first << "/" << jter->second << " ";
210  }
211  }
212  ss << std::endl;
213  }
214 
215  ss << " Max value: " << max_ << std::endl << " Min value: " << min_ << std::endl;
216 
217  LogTrace(mlSummaryPlots_) << ss.str();
218 }
#define LogTrace(id)
static const char mlSummaryPlots_[]
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 385 of file SummaryGenerator.cc.

References newFWLiteAna::bin, entries_, timingPdfMaker::histo, cuy::ii, map_, and sistrip::mlSummaryPlots_.

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

385  {
386  // Check number of entries in map
387  if (map_.empty()) {
388  edm::LogWarning(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
389  << " No contents in std::map to histogram!";
390  return;
391  }
392 
393  // Retrieve histogram
394  TProfile* histo = dynamic_cast<TProfile*>(&his);
395  if (!histo) {
396  edm::LogWarning(mlSummaryPlots_) << "[SummaryGenerator::" << __func__ << "]"
397  << " NULL pointer to TProfile histogram!";
398  return;
399  }
400 
401  // Iterate through std::map, set bin labels and fill histogram
402  entries_ = 0.;
403  uint16_t bin = 0;
404  HistoData::const_iterator ibin = map_.begin();
405  for (; ibin != map_.end(); ibin++) {
406  bin++;
407  histo->GetXaxis()->SetBinLabel(static_cast<Int_t>(bin), ibin->first.c_str());
408  if (ibin->second.empty()) {
409  continue;
410  }
411  BinData::const_iterator ii = ibin->second.begin();
412  for (; ii != ibin->second.end(); ii++) {
413  // x (bin), y (value) and weight (error)
414  histo->Fill(static_cast<Double_t>(bin - .5),
415  static_cast<Double_t>(ii->first)); //, ii->second );
416  entries_++;
417  }
418  }
419 }
int ii
Definition: cuy.py:589
static const char mlSummaryPlots_[]
Log< level::Warning, false > LogWarning
uint32_t SummaryGenerator::size ( void  ) const
inline

Member Data Documentation

float SummaryGenerator::entries_
protected
std::string SummaryGenerator::label_
protected
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 117 of file SummaryGenerator.h.

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

float SummaryGenerator::max_
protected

Definition at line 121 of file SummaryGenerator.h.

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

float SummaryGenerator::min_
protected

Definition at line 123 of file SummaryGenerator.h.

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

std::string SummaryGenerator::myName_
private

Definition at line 130 of file SummaryGenerator.h.

Referenced by myName().