#include <ROList.h>
Inheritance diagram for ROList:
An ROList stores pointers to RegO objects, and to other ROList objects. Its main purpose is to allow operations on all of the stored objects.
One possibility to operate on all objects is to use an HVisitor object, which will be called with all stored objects in turn (see Gamma, Helm, Johnson, Vlissides: Design Patterns for a discussion of the Visitor pattern). Special methods include Write(), which writes out all histograms to a file, and Draw(...), which draws histograms on a canvas.
A ROList is itself a RegO, which means that we can build trees of such lists (see the "Compound" pattern in Gamma, Helm, Johnson, Vlissides: Design Patterns).
To iterate over all entries, do something like this:
void iterate_over_ROList (const ROList& rol) { for (ROList::const_iterator iter = rol.begin(); iter != rol.end(); ++iter) { RegO *ro = rol.getEntry (iter); // do something with ro here... } *
An older way to iterate is this:
void iterate_over_ROList (const ROList& rol) { ROList::IndexType i = rol.getFirstEntry(); RegO *ro = rol.getEntry (i); while (ro) { // do something with ro here... ro = rol.getNextEntry (i); // updates i and ro! } *
Author: Jenny Böhme, Benno List
Changelog:
Definition at line 76 of file ROList.h.
Public Types | |
typedef unsigned long long | IndexType |
The type that is used to enumerate the objects internally. | |
typedef MapType::const_iterator | const_iterator |
typedef MapType::iterator | iterator |
typedef MapType::const_reverse_iterator | const_reverse_iterator |
typedef MapType::reverse_iterator | reverse_iterator |
Public Member Functions | |
ROList () | |
Default constructor: creates an empty ROList. | |
ROList (const ROListPoR &mother) | |
Creates an empty ROList and registers it with another list. | |
int | registerObject (RegO *h) |
Registers a RegO object. | |
int | registerObject (IndexType n, RegO *h) |
Registers a RegO object under a given number. | |
virtual void | Write () |
Writes out all histograms (if they are derived from TH1). | |
virtual ROList & | visit (HVisitor &v) |
Visits all histograms. | |
virtual ROList & | visit (const ConstHVisitor &v) |
Visits all histograms. | |
virtual int | Draw (TPad *pad, TVirtualPS *ps=0, Option_t *option=0, bool across=true, Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0, Int_t log=0, bool recursive=false, int izone=0) |
Draws all histograms (if they are derived from TH1). | |
virtual int | Draw (TPad *pad, TVirtualPS *ps, Option_t *option, bool across, Int_t nx, Int_t ny, Int_t log, bool recursive=false, int izone=0) |
virtual int | DrawFunc (TPad *pad, TVirtualPS *ps=0, Option_t *option=0, const char *fname="", bool across=true, Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0, Int_t log=0, bool recursive=false, int izone=0) |
Enable a specific Fit Function to be plotted with the Histogram. | |
virtual int | DrawFunc (TPad *pad, TVirtualPS *ps, Option_t *option, const char *fname, bool across, Int_t nx, Int_t ny, Int_t log, bool recursive=false, int izone=0) |
virtual void | DrawCutFlow (TPad *pad, TVirtualPS *ps=0, Option_t *option=0, Option_t *sameoption=0, bool across=true, Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0, Int_t log=0, bool recursive=false, bool backward=false) |
Draws all histograms (if they are derived from TH1), with the following histogram overlaid. | |
virtual void | DrawCutFlow (TPad *pad, TVirtualPS *ps, Option_t *option, Option_t *sameoption, bool across, Int_t nx, Int_t ny, Int_t log, bool recursive=false, bool backward=false) |
Draws all histograms (if they are derived from TH1). | |
IndexType | getEntries () const |
Return the number of entries in the list. | |
IndexType | getHighestEntry () const |
Returns the highest number plus 1 of any entry in the map. | |
IndexType | getFirstEntry () const |
Returns the lowest number of any entry in the map. | |
RegO * | getEntry (IndexType i) const |
Returns pointer to entry with number i, 0 if entry does not exist. | |
RegO * | getNextEntry (IndexType &i) const |
Returns pointer to next entry with number greater than i, 0 if entry does not exist. | |
RegO * | getEntry (const_iterator iter) const |
Returns pointer to entry with number i, 0 if entry does not exist. | |
RegO * | getNextEntry (const_iterator &i) const |
Returns pointer to next entry with number greater than i, 0 if entry does not exist. | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
iterator | lower_bound (IndexType i) |
const_iterator | lower_bound (IndexType i) const |
iterator | upper_bound (IndexType i) |
const_iterator | upper_bound (IndexType i) const |
IndexType | getIndex (iterator iter) const |
Get index that corresponds to an iterator. | |
IndexType | getIndex (const_iterator iter) const |
Private Types | |
typedef std::map< IndexType, RegO * > | MapType |
enum | { LINEAR = 0, LOGY = 1, LOGX = 2, LOGXY = 3 } |
Private Attributes | |
MapType | theMap |
the map of pointers to registered histos |
|
Creates an empty ROList and registers it with another list.
Definition at line 48 of file ROList.C. References ROListPoR::prol, and registerObject(). |
|
Registers a RegO object.
Definition at line 57 of file ROList.C. References getEntries(), getHighestEntry(), and theMap. Referenced by SetOfHProf::initHisto(), SetOfHistograms::initHisto(), SetOfH2F::initHisto(), MatrixOfHProf::initHisto(), MatrixOfHistograms::initHisto(), MatrixOfH2F::initHisto(), MatrixOfHistograms::MatrixOfHistograms(), RegO::RegO(), ROList(), and SetOfH::SetOfH(). |
|
Registers a RegO object under a given number.
Definition at line 69 of file ROList.C. References getEntries(), and theMap. |
|
Visits all histograms. Calls v(RegO& RegO) for each of the registered histograms See Gamma, Helm, Johnson, Vlissides: "Design Patterns" for a discussion of the Visitor pattern.
Definition at line 92 of file ROList.C. References HVisitor::visit(). |
|
Draws all histograms (if they are derived from TH1).
Definition at line 120 of file ROList.C. References getEntries(), and IndexType. Referenced by Draw(). |
|
Draws all histograms (if they are derived from TH1) start at zone izone
Definition at line 172 of file ROList.C. References Draw(). |
|
Enable a specific Fit Function to be plotted with the Histogram. If the Histogram was fitted with the Option "0", the Fit Function is globally disabled for drawing. This function enables it for the active drawing and disables it again afterwards. Note: The Draw is done via DrawCopy ! Inputs:
Definition at line 275 of file ROList.C. References getEntries(), and IndexType. Referenced by DrawFunc(). |
|
Draws all histograms (if they are derived from TH1) and the function fname start at zone izone
Definition at line 341 of file ROList.C. References DrawFunc(). |
|
Draws all histograms (if they are derived from TH1), with the following histogram overlaid.
Definition at line 180 of file ROList.C. References getEntries(), and IndexType. Referenced by DrawCutFlow(). |
|
Draws all histograms (if they are derived from TH1).
Definition at line 265 of file ROList.C. References DrawCutFlow(). |
|
Returns pointer to entry with number i, 0 if entry does not exist.
Definition at line 314 of file ROList.h. References theMap. Referenced by SetOfH::Add(), SFEffSetOfHistograms::Divide(), SetOfH::Divide(), SFEffSetOfHistograms::Draw(), SFSetOfHProf::Fill(), SFSetOfHistograms::Fill(), SFSetOfH2F::Fill(), SFROList::Fill(), SFMatrixOfHProf::Fill(), SFMatrixOfHistograms::Fill(), SFMatrixOfH2F::Fill(), SFEffSetOfHistograms::Fill(), SetOfHProf::getHisto(), SetOfHistograms::getHisto(), SetOfH2F::getHisto(), SetOfH::getHisto(), MatrixOfHProf::getHisto(), MatrixOfHistograms::getHisto(), MatrixOfH2F::getHisto(), MatrixOfH::getHisto(), EventLoop::loop(), and SetOfH::Multiply(). |
|
Returns pointer to next entry with number greater than i, 0 if entry does not exist.
Definition at line 320 of file ROList.h. References theMap. |
|
Returns pointer to entry with number i, 0 if entry does not exist.
|
|
Returns pointer to next entry with number greater than i, 0 if entry does not exist.
Definition at line 333 of file ROList.h. References theMap. |
|
Get index that corresponds to an iterator.
Definition at line 380 of file ROList.h. References getHighestEntry(), IndexType, and theMap. Referenced by SetOfH::Add(), SetOfH::Divide(), SetOfHistograms::getSummary(), and SetOfH::Multiply(). |
|
Definition at line 384 of file ROList.h. References getHighestEntry(), IndexType, and theMap. |