#include <HVisitor.h>
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).
Typically, an HVisitor object will use a dynamic_cast to check whether the RegO object at hand is a root histogram, e.g. a TH1, TH1F, TH2F, or whatever, and then apply some method(s) to the histogram.
The visitor can store information, like a number of entries a histogram should be normalized to, a line color or whatever. It can also be used to collect statistics, like the total number of entries in all histograms in a HList (useful if the HList is really a SetOfHistograms or a MatrixOfHistograms).
The visitor can perform rather complicated operations, like plotting a histogram with several fit functions overlaid, or performing a fit.
See file HVisitors.h for some examples of concrete HVisitor subclasses.
Author: Jenny Böhme, Benno List
Definition at line 36 of file HVisitor.h.
Public Member Functions | |
virtual void | visit (RegO &h)=0 |
The visitor. |
|
The visitor.
Referenced by ROList::visit(). |