why fgStatOverflows (for exapmle) is declared as static Bool_t
and not declared as TH1 status bit kStatOverflows = BIT(xx) ?
(except globalize this members)
or revrse: why kLogX is TH1 status bit, why not static Bool_t fgLogX ?
Bool_t fgStatOverflows is a class static variable.
This means that it applies to all histograms.
When using a TH1 status bit, you set the bit only for one histogram.
You can store up to 32 Bool_t equivalent in the TObject::fBits.
This is more efficient for I/O and space (1 bit instead of one byte,
or even worst 4 bytes on the MAC!
fBits has also the advantage that you can test multiple bits in
one single test.
See the TObject documentation, in particular: //----- Global bits (can be set for any object and should not be reused).
//----- Bits 0 - 13 are reserved as global bits. Bits 14 - 23 can be used
//----- in different class hierarchies (make sure there is no overlap in
//----- any given hierarchy).
enum EStatusBits {
kCanDelete = BIT(0), // if object in a list can be deleted
kMustCleanup = BIT(3), // if object destructor must call RecursiveRemove()
kObjInCanvas = BIT(3), // for backward compatibility only, use kMustCleanup
kIsReferenced = BIT(4), // if object is referenced by a TRef or TRefArray
kHasUUID = BIT(5), // if object has a TUUID (its fUniqueID=UUIDNumber)
kCannotPick = BIT(6), // if object in a pad cannot be picked
kNoContextMenu = BIT(8), // if object does not want context menu
kInvalidObject = BIT(13) // if object ctor succeeded but object should not be used
};
All bits up to 13 are reserved (and used) by ROOT itself. The “last bit” is use to indicate whether a canvas can delete the object or not.