Silly Question

Is there a way to list all the objects of a certain class from the ROOT prompt?

Something similar to the “.ls” comand …

Thanks,
Carlo

Generally speaking, it does not make much sense because not all objects have a parent folder or vice-versa the same object can be registered to different folders/collections. In ROOT, we maintain in gROOT several top level collections, eg
-list of files
-list of canvases, etc (see TROOT.h)

For all TObject derived classes, we implement in general an ‘ls’ function.
This function is useful when called on a collection. For example you can do
gROOT->GetListOfFiles()->ls()
gPad->ls()
gFile->ls()
anycollection->ls()

We support a global table of classes that allows you to find how many objects of a particular class are currently alive.
gObjectTable->Print();
will print this table. Before using this function you should set the option
Root.ObjectStat: 1 (default is 0)
in the file $ROOTSYS/system.rootrc
see: root.cern.ch/root/htmldoc/TObjectTable.html

Rene