In C++ the property the object can be taken from the class inheritance
list.
ROOT TH1 class is defined on http://root.cern.ch/root/html/TH1.html as
follows:
class TH1 : public TNamed, public TAttLine, public TAttFill, public
TAttMarker
One can "click" the "inheritance tree" get
http://root.cern.ch/root/html/TH_Tree.ps
to get just all methods of that class for a glance.
Actually this means the ROOT objects like "TH1" have something like
"private per
object properties" ( . . . Colors/Pattters/Makers per objects . . .) and
there are others
"collective properties" like the scale (because for example one needs a
scale to
compare two objects). This involves some assumptions ("model") of the way
the objects
of some particular class will be used. Anyway I don't think OO has a
single and only
true "OO line" if any.
> for(int i=0;i<2;i++) {
> hist[i]->Draw();
> }
What about "Draw" method. This method looks as follows:
(see: http://root.cern.ch/root/html/TObject.html#TObject:Draw )
//_________________________________
void TObject::Draw(Option_t *option){
// Default Draw method for all objects
AppendPad(option);
}
see: http://root.cern.ch/root/html/src/TObject.cxx.html#TObject:AppendPad
//_________________________________
void TObject::AppendPad(Option_t *option)
{
// Append graphics object to current pad. In case no current pad is set
// yet, create a default canvas with the name "c1".
if (!gPad) {
if (!gROOT->GetMakeDefCanvas()) return;
(gROOT->GetMakeDefCanvas())();
}
SetBit(kObjInCanvas);
gPad->GetListOfPrimitives()->Add(this,option);
gPad->Modified(kTRUE);
}
Namely it just "fills" the list of objects the TPad object will paint
later.
Hope this helps,
Valery