BinnedHistogram< T > Class Template Reference
Inheritance diagram for BinnedHistogram< T >:
![]()
Collaboration diagram for BinnedHistogram< T >:
![]()
Detailed Descriptiontemplate<typename T>
|
BinnedHistogram | ( | ) | [inline] |
const BinnedHistogram< T > & addHistogram | ( | const T & | binMin, |
const T & | binMax, | ||
Histo1DPtr | histo | ||
) |
Add a histogram in the region between binMin and binMax to this set of BinnedHistograms.
Definition at line 11 of file BinnedHistogram.cc.
Referenced by CMS_2011_S8950903::init(), CMS_2012_I1090423::init(), CMS_2011_S8968497::init(), CDF_2007_S7057202::init(), CMS_2011_S9086218::init(), ATLAS_2011_I930220::init(), LHCF_2012_I1115479::init(), D0_2010_S8570965::init(), ATLAS_2014_I1268975::init(), ATLAS_2010_S8817804::init(), D0_1996_S3324664::init(), CDF_2008_S7828950::init(), LHCB_2011_I919315::init(), LHCB_2013_I1218996::init(), D0_2009_S8320160::init(), ATLAS_2011_S8971293::init(), ATLAS_2012_I1082936::init(), D0_2010_S8566488::init(), CDF_2001_S4517016::init(), CDF_1996_S3418421::init(), ATLAS_2012_I1094564::init(), ATLAS_2012_I1125575::initializeHistograms(), and ATLAS_2011_S9126244::initializePlots().
{ if (binMin > binMax) { throw Error ("Cannot add a binned histogram where the lower bin edge is above the upper edge"); } _histosByUpperBound[binMax] = histo; _histosByLowerBound[binMin] = histo; bool found = false; foreach (Histo1DPtr hist, _histos) { if (hist == histo) { found = true; break; } } if (!found){ _histos.push_back(histo); _binWidths[histo]=binMax-binMin; } return *this; }
Histo1DPtr fill | ( | const T & | bin, |
const T & | val, | ||
double | weight | ||
) |
Fill the histogram that lies in the same region as bin with the value val of weight weight.
Definition at line 39 of file BinnedHistogram.cc.
Referenced by CMS_2011_S8950903::analyze(), LHCF_2012_I1115479::analyze(), CMS_2012_I1090423::analyze(), CMS_2011_S8968497::analyze(), CMS_2011_S9086218::analyze(), CDF_2007_S7057202::analyze(), D0_1996_S3324664::analyze(), CDF_2008_S7828950::analyze(), CDF_2001_S4517016::analyze(), ATLAS_2011_I930220::analyze(), D0_2010_S8570965::analyze(), LHCB_2011_I919315::analyze(), D0_2010_S8566488::analyze(), CDF_1996_S3418421::analyze(), ATLAS_2011_S8971293::analyze(), D0_2009_S8320160::analyze(), ATLAS_2014_I1268975::analyze(), ATLAS_2010_S8817804::analyze(), ATLAS_2012_I1082936::analyze(), LHCB_2013_I1218996::analyze(), ATLAS_2012_I1094564::analyze(), ATLAS_2011_S9126244::analyzeJets(), ATLAS_2012_I1125575::fillHistograms(), and ATLAS_2012_I1204784::fillPlots().
{ typename map<T, Histo1DPtr>::iterator histIt = _histosByUpperBound.upper_bound(bin); //check that the bin is not out of range if (histIt == _histosByUpperBound.end()) { return Histo1DPtr(); } Histo1DPtr histo = histIt->second; histIt = _histosByLowerBound.lower_bound(bin); // No need to check going beyond the upper bound if we already passed above // (given that upper bound > lower bound is checked) // Check it is not before the start of the map if (histIt == _histosByLowerBound.begin()) { return Histo1DPtr(); } // By-lower-bound actually gives us the iterator one above the nearest element, // so decrement it. This is safe because we already checked we're not at the start! --histIt; if (histo != histIt->second) { return Histo1DPtr(); } histo->fill(val, weight); return histo; }
const vector<Histo1DPtr>& getHistograms | ( | ) | const [inline] |
Definition at line 43 of file BinnedHistogram.hh.
Referenced by CMS_2011_S8950903::finalize(), CMS_2011_S8968497::finalize(), CMS_2012_I1090423::finalize(), ATLAS_2011_S8971293::finalize(), CDF_1996_S3418421::finalize(), D0_2009_S8320160::finalize(), D0_1996_S3324664::finalize(), LHCB_2013_I1218996::finalize(), ATLAS_2011_S9126244::finalize(), ATLAS_2012_I1094564::finalize(), and ATLAS_2012_I1125575::finalizeHistograms().
{ return _histos; }
vector<Histo1DPtr>& getHistograms | ( | ) | [inline] |
Definition at line 44 of file BinnedHistogram.hh.
{ return _histos; }
Scale histograms taking into account its "external" binwidth, i.e. by scale/binWidth
Definition at line 74 of file BinnedHistogram.cc.
References Analysis::scale().
Referenced by CMS_2011_S9086218::finalize(), CDF_2008_S7828950::finalize(), LHCF_2012_I1115479::finalize(), CDF_2007_S7057202::finalize(), D0_2010_S8566488::finalize(), CDF_2001_S4517016::finalize(), LHCB_2011_I919315::finalize(), ATLAS_2014_I1268975::finalize(), ATLAS_2010_S8817804::finalize(), ATLAS_2012_I1082936::finalize(), ATLAS_2011_I930220::finalize(), and D0_2010_S8570965::finalize().
{ foreach (Histo1DPtr hist, getHistograms()) { ana->scale(hist, scale/_binWidths[hist]); } }
map<Histo1DPtr, T> _binWidths [private] |
Definition at line 52 of file BinnedHistogram.hh.
vector<Histo1DPtr> _histos [private] |
Definition at line 51 of file BinnedHistogram.hh.
Referenced by BinnedHistogram< double >::getHistograms().
map<T, Histo1DPtr> _histosByLowerBound [private] |
Definition at line 50 of file BinnedHistogram.hh.
map<T, Histo1DPtr> _histosByUpperBound [private] |
Definition at line 49 of file BinnedHistogram.hh.