Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TClonesArray Class Reference

An array of clone (identical) objects.

Memory for the objects stored in the array is allocated only once in the lifetime of the clones array. All objects must be of the same class. For the rest this class has the same properties as TObjArray.

To reduce the very large number of new and delete calls in large loops like this (O(100000) x O(10000) times new/delete):

TObjArray a(10000);
while (TEvent *ev = (TEvent *)next()) { // O(100000) events
for (int i = 0; i < ev->Ntracks; i++) { // O(10000) tracks
a[i] = new TTrack(x,y,z,...);
...
...
}
...
a.Delete();
}
#define a(i)
Definition RSha256.hxx:99
TObjArray(Int_t s=TCollection::kInitCapacity, Int_t lowerBound=0)
Create an object array.
Definition TObjArray.cxx:63
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17

One better uses a TClonesArray which reduces the number of new/delete calls to only O(10000):

TClonesArray a("TTrack", 10000);
while (TEvent *ev = (TEvent *)next()) { // O(100000) events
for (int i = 0; i < ev->Ntracks; i++) { // O(10000) tracks
new(a[i]) TTrack(x,y,z,...);
...
...
}
...
a.Delete(); // or a.Clear() or a.Clear("C")
}
TClonesArray()
Default Constructor.

To reduce the number of call to the constructor (especially useful if the user class requires memory allocation), the object can be added (and constructed when needed) using ConstructedAt which only calls the constructor once per slot.

TClonesArray a("TTrack", 10000);
while (TEvent *ev = (TEvent *)next()) { // O(100000) events
for (int i = 0; i < ev->Ntracks; i++) { // O(10000) tracks
TTrack *track = (TTrack*)a.ConstructedAt(i);
track->Set(x,y,z,....);
...
...
}
...
a.Clear(); // or a.Clear("C");
}

Note: the only supported way to add objects to a TClonesArray is via the new with placement method or the ConstructedAt method. The other Add() methods ofTObjArray and its base classes are not allowed.

Considering that a new/delete costs about 70 mus on a 300 MHz HP, O(10^9) new/deletes will save about 19 hours.

NOTE 1

C/C++ offers the possibility of allocating and deleting memory. Forgetting to delete allocated memory is a programming error called a "memory leak", i.e. the memory of your process grows and eventually your program crashes. Even if you always delete the allocated memory, the recovered space may not be efficiently reused. The process knows that there are portions of free memory, but when you allocate it again, a fresh piece of memory is grabbed. Your program is free from semantic errors, but the total memory of your process still grows, because your program's memory is full of "holes" which reduce the efficiency of memory access; this is called "memory fragmentation". Moreover new / delete are expensive operations in terms of CPU time.

Without entering into technical details, TClonesArray allows you to "reuse" the same portion of memory for new/delete avoiding memory fragmentation and memory growth and improving the performance by orders of magnitude. Every time the memory of the TClonesArray has to be reused, the Clear() method is used. To provide its benefits, each TClonesArray must be allocated once per process and disposed of (deleted) only when not needed any more.

So a job should see only one deletion for each TClonesArray, which should be Clear()ed during the job several times. Deleting a TClonesArray is a double waste. Not only you do not avoid memory fragmentation, but you worsen it because the TClonesArray itself is a rather heavy structure, and there is quite some code in the destructor, so you have more memory fragmentation and slower code.

NOTE 2

When investigating misuse of TClonesArray, please make sure of the following:

  • Use Clear() or Clear("C") instead of Delete(). This will improve program execution time.
  • TClonesArray object classes containing pointers allocate memory. To avoid causing memory leaks, special Clear("C") must be used for clearing TClonesArray. When option "C" is specified, ROOT automatically executes the Clear() method (by default it is empty contained in TObject). This method must be overridden in the relevant TClonesArray object class, implementing the reset procedure for pointer objects.
  • If the objects are added using the placement new then the Clear must deallocate the memory.
  • If the objects are added using TClonesArray::ConstructedAt then the heap-based memory can stay allocated and reused as the constructor is not called for already constructed/added object.
  • To reduce memory fragmentation, please make sure that the TClonesArrays are not destroyed and created on every event. They must only be constructed/destructed at the beginning/end of the run.

Definition at line 29 of file TClonesArray.h.

Public Types

enum  { kInitCapacity = 16 , kInitHashTableCapacity = 17 }
enum  { kSingleKey = (1ULL << (0)) , kOverwrite = (1ULL << (1)) , kWriteDelete = (1ULL << (2)) }
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << (3)) }
enum  EStatusBits { kBypassStreamer = (1ULL << (12)) , kForgetBits = (1ULL << (15)) }
typedef TObjArrayIter Iterator_t

Public Member Functions

 TClonesArray ()
 Default Constructor.
 TClonesArray (const char *classname, Int_t size=1000, Bool_t call_dtor=kFALSE)
 Create an array of clone objects of classname.
 TClonesArray (const TClass *cl, Int_t size=1000, Bool_t call_dtor=kFALSE)
 Create an array of clone objects of class cl.
 TClonesArray (const TClonesArray &tc)
 Copy ctor.
virtual ~TClonesArray ()
 Delete a clones array.
void AbsorbObjects (TClonesArray *tc)
 Directly move the object pointers from tc without cloning (copying).
void AbsorbObjects (TClonesArray *tc, Int_t idx1, Int_t idx2)
 Directly move the range of object pointers from tc without cloning (copying).
void AbstractMethod (const char *method) const
 Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.
void Add (TObject *obj) override
void Add (TObject *obj, Option_t *) override
void AddAfter (const TObject *, TObject *) override
void AddAfter (const TObject *, TObject *, Option_t *) override
virtual void AddAll (const TCollection *col)
 Add all objects from collection col to this collection.
void AddAt (TObject *, Int_t) override
void AddAt (TObject *, Int_t, Option_t *) override
void AddAtAndExpand (TObject *, Int_t) override
 Add object at position idx.
Int_t AddAtFree (TObject *) override
 Return the position of the new object.
void AddBefore (const TObject *, TObject *) override
void AddBefore (const TObject *, TObject *, Option_t *) override
void AddFirst (TObject *) override
void AddFirst (TObject *, Option_t *) override
void AddLast (TObject *) override
void AddLast (TObject *, Option_t *) override
TObjectAddrAt (Int_t idx)
void AddVector (TObject *obj1,...)
 Add all arguments to the collection.
TObjectAfter (const TObject *obj) const override
 Return the object after obj. Returns 0 if obj is last object.
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
Bool_t AssertClass (TClass *cl) const
 Make sure all objects in this collection inherit from class cl.
TObjectAt (Int_t idx) const override
TObjectBefore (const TObject *obj) const override
 Return the object before obj. Returns 0 if obj is first object.
TIter begin () const
virtual Int_t BinarySearch (TObject *obj, Int_t upto=kMaxInt)
 Find object using a binary search.
void Browse (TBrowser *b) override
 Browse this collection (called by TBrowser).
void BypassStreamer (Bool_t bypass=kTRUE)
 When the kBypassStreamer bit is set, the automatically generated Streamer can call directly TClass::WriteBuffer.
Bool_t CanBypassStreamer () const
Int_t Capacity () const
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
void Clear (Option_t *option="") override
 Clear the clones array.
TObjectClone (const char *newname="") const override
 Make a clone of an collection using the Streamer facility.
Int_t Compare (const TObject *obj) const override
 Compare two TCollection objects.
void Compress () override
 Remove empty slots from array.
TObjectConstructedAt (Int_t idx)
 Get an object at index 'idx' that is guaranteed to have been constructed.
TObjectConstructedAt (Int_t idx, Option_t *clear_options)
 Get an object at index 'idx' that is guaranteed to have been constructed.
Bool_t Contains (const char *name) const
Bool_t Contains (const TObject *obj) const
virtual void Copy (TObject &object) const
 Copy this to obj.
void Delete (Option_t *option="") override
 Clear the clones array.
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object.
void Draw (Option_t *option="") override
 Draw all objects in this collection.
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
void Dump () const override
 Dump all objects in this collection.
TIter end () const
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py).
void Expand (Int_t newSize) override
 Expand or shrink the array to newSize elements.
virtual void ExpandCreate (Int_t n)
 Expand or shrink the array to n elements and create the clone objects by calling their default ctor.
virtual void ExpandCreateFast (Int_t n)
 Expand or shrink the array to n elements and create the clone objects by calling their default ctor.
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
TObjectFindObject (const char *name) const override
 Find an object in this collection using its name.
TObjectFindObject (const TObject *obj) const override
 Find an object in this collection using the object's IsEqual() member function.
TObjectFirst () const override
 Return the object in the first slot.
TClassGetClass () const
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
Int_t GetEntries () const override
 Return the number of objects in array (i.e.
Int_t GetEntriesFast () const
Int_t GetEntriesUnsafe () const
 Return the number of objects in array (i.e.
virtual const char * GetIconName () const
 Returns mime type name of object.
Int_t GetLast () const override
 Return index of last object in array.
const char * GetName () const override
 Return name of this collection.
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
TObject ** GetObjectRef () const
TObject ** GetObjectRef (const TObject *obj) const override
 Return address of pointer obj. If obj is 0 returns address of container.
virtual Option_tGetOption () const
virtual Int_t GetSize () const
 Return the capacity of the collection, i.e.
virtual const char * GetTitle () const
 Returns title of object.
virtual UInt_t GetUniqueID () const
 Return the unique object id.
virtual Int_t GrowBy (Int_t delta) const
 Increase the collection's capacity by delta slots.
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
ULong_t Hash () const override
 Return hash value for this object.
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
Int_t IndexOf (const TObject *obj) const override
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
void InvertBit (UInt_t f)
TClassIsA () const override
Bool_t IsArgNull (const char *where, const TObject *obj) const
 Returns true if object is a null pointer.
Bool_t IsDestructed () const
 IsDestructed.
Bool_t IsEmpty () const override
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
Bool_t IsFolder () const override
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Bool_t IsOnHeap () const
Bool_t IsOwner () const
Bool_t IsSortable () const override
virtual Bool_t IsSorted () const
Bool_t IsUsingRWLock () const
Bool_t IsZombie () const
TObjectLast () const override
 Return the object in the last filled slot. Returns 0 if no entries.
Int_t LastIndex () const
Int_t LowerBound () const
void ls (Option_t *option="") const override
 List (ls) all objects in this collection.
TIteratorMakeIterator (Bool_t dir=kIterForward) const override
 Returns an array iterator.
virtual TIteratorMakeReverseIterator () const
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
Long64_t Merge (TCollection *list)
 Merge this collection with all collections coming in the input list.
void MultiSort (Int_t nTCs, TClonesArray **tcs, Int_t upto=kMaxInt)
 Sort multiple TClonesArrays simultaneously with this array.
TObjectNew (Int_t idx)
 Create an object of type fClass with the default ctor at the specified index.
Bool_t Notify () override
 'Notify' all objects in this collection.
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
void operator delete (void *, size_t)
 Operator delete for sized deallocation.
void operator delete (void *ptr)
 Operator delete.
void operator delete (void *ptr, void *vp)
 Only called by placement new when throwing an exception.
void operator delete[] (void *, size_t)
 Operator delete [] for sized deallocation.
void operator delete[] (void *ptr)
 Operator delete [].
void operator delete[] (void *ptr, void *vp)
 Only called by placement new[] when throwing an exception.
void * operator new (size_t sz)
void * operator new (size_t sz, void *vp)
void * operator new[] (size_t sz)
void * operator new[] (size_t sz, void *vp)
TObjectoperator() (const char *name) const
 Find an object in this collection by name.
TClonesArrayoperator= (const TClonesArray &tc)
 Assignment operator.
TObjectoperator[] (Int_t idx) const override
 Return the object at position idx. Returns 0 if idx is out of bounds.
TObject *& operator[] (Int_t idx) override
 Return pointer to reserved area in which a new object of clones class can be constructed.
void Paint (Option_t *option="") override
 Paint all objects in this collection.
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
virtual void Print (Option_t *option, const char *wildcard, Int_t recurse=1) const
 Print the collection header and its elements that match the wildcard.
virtual void Print (Option_t *option, Int_t recurse) const
 Print the collection header and its elements.
virtual void Print (Option_t *option, TPRegexp &regexp, Int_t recurse=1) const
 Print the collection header and its elements that match the regexp.
void Print (Option_t *option="") const override
 Default print for collections, calls Print(option, 1).
virtual void Randomize (Int_t ntimes=1)
 Randomize objects inside the array, i.e.
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
void RecursiveRemove (TObject *obj) override
 Remove object from this collection and recursively remove the object from all other objects (and collections).
TObjectRemove (TObject *obj) override
 Remove object from array.
virtual void RemoveAfter (TObject *after)
void RemoveAll ()
virtual void RemoveAll (TCollection *col)
 Remove all objects in collection col from this collection.
TObjectRemoveAt (Int_t idx) override
 Remove object at index idx.
virtual void RemoveBefore (TObject *before)
virtual void RemoveFirst ()
virtual void RemoveLast ()
void RemoveRange (Int_t idx1, Int_t idx2) override
 Remove objects from index idx1 to idx2 included.
void ResetBit (UInt_t f)
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out".
void SetBit (UInt_t f)
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
void SetClass (const char *classname, Int_t size=1000)
 see TClonesArray::SetClass(const TClass*)
void SetClass (const TClass *cl, Int_t size=1000)
 Create an array of clone objects of class cl.
void SetCurrentCollection ()
 Set this collection to be the globally accessible collection.
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
void SetLast (Int_t last)
 Set index of last object in array, effectively truncating the array.
void SetName (const char *name)
void SetOwner (Bool_t enable=kTRUE) override
 A TClonesArray is always the owner of the object it contains.
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
std::size_t size () const
void Sort (Int_t upto=kMaxInt) override
 If objects in array are sortable (i.e.
void Streamer (TBuffer &) override
 Write all objects in array to the I/O buffer.
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
Bool_t TestBit (UInt_t f) const
Int_t TestBits (UInt_t f) const
TObjectUncheckedAt (Int_t i) const
void UnSort ()
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.
virtual bool UseRWLock (Bool_t enable=true)
 Set this collection to use a RW lock upon access, making it thread safe.
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const override
 Write all objects in this collection.
Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
 Write all objects in this collection.

Static Public Member Functions

static TClassClass ()
static const char * Class_Name ()
static constexpr Version_t Class_Version ()
static const char * DeclFileName ()
static void EmptyGarbageCollection ()
 Do the garbage collection.
static void GarbageCollect (TObject *obj)
 Add to the list of things to be cleaned up.
static TCollectionGetCurrentCollection ()
 Return the globally accessible collection.
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
static Bool_t GetObjectStat ()
 Get status of object stat flag.
static Int_t ObjCompare (TObject *a, TObject *b)
 Compare to objects in the collection. Use member Compare() of object a.
static void QSort (TObject **a, Int_t first, Int_t last)
 Sort array of TObject pointers using a quicksort algorithm.
static void QSort (TObject **a, Int_t nBs, TObject ***b, Int_t first, Int_t last)
 Sort array a of TObject pointers using a quicksort algorithm.
static void QSort (TObject **a, TObject **b, Int_t first, Int_t last)
static void SetDtorOnly (void *obj)
 Set destructor only flag.
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
static void StartGarbageCollection ()
 Set up for garbage collection.

Protected Types

enum  { kOnlyPrepStep = (1ULL << (3)) }

Protected Member Functions

Bool_t BoundsOk (const char *where, Int_t at) const
virtual void Changed ()
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
Int_t GetAbsLast () const
 Return absolute index to last object in array.
virtual const char * GetCollectionEntryName (TObject *entry) const
 For given collection entry return the string that is used to identify the object and, potentially, perform wildcard/regexp filtering on.
void Init (Int_t s, Int_t lowerBound)
 Initialize a TObjArray.
void MakeZombie ()
Bool_t OutOfBoundsError (const char *where, Int_t i) const
 Generate an out-of-bounds error. Always returns false.
virtual void PrintCollectionEntry (TObject *entry, Option_t *option, Int_t recurse) const
 Print the collection entry.
virtual void PrintCollectionHeader (Option_t *option) const
 Print the collection header.

Static Protected Member Functions

static void SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
 Save object constructor in the output stream "out".
static void SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr)
 Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
static TString SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
 Save array in the output stream "out" as vector.

Protected Attributes

TClassfClass
 !Pointer to the class of the elements
TObject ** fCont
 !Array contents
TObjArrayfKeep
 !Saved copies of pointers to objects
Int_t fLast
Int_t fLowerBound
TString fName
Int_t fSize
Bool_t fSorted

Static Private Member Functions

static void AddToTObjectTable (TObject *)
 Private helper function which will dispatch to TObjectTable::AddObj.

Private Attributes

UInt_t fBits
 bit field status word
UInt_t fUniqueID
 object unique identifier

Static Private Attributes

static TCollectionfgCurrentCollection = nullptr
static Longptr_t fgDtorOnly = 0
 object for which to call dtor only (i.e. no delete)
static Bool_t fgEmptyingGarbage = kFALSE
static TObjectTablefgGarbageCollection = nullptr
static Int_t fgGarbageStack = 0
static Bool_t fgObjectStat = kTRUE
 if true keep track of objects in TObjectTable

#include <TClonesArray.h>

Inheritance diagram for TClonesArray:
TObjArray TSeqCollection TCollection TObject

Member Typedef Documentation

◆ Iterator_t

Definition at line 47 of file TObjArray.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
kInitCapacity 
kInitHashTableCapacity 

Definition at line 159 of file TCollection.h.

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
kOnlyPrepStep 

Used to request that the class specific implementation of TObject::Write just prepare the objects to be ready to be written but do not actually write them into the TBuffer.

This is just for example by TBufferMerger to request that the TTree inside the file calls TTree::FlushBaskets (outside of the merging lock) and TBufferMerger will later ask for the write (inside the merging lock). To take advantage of this feature the class needs to overload TObject::Write and use this enum value accordingly. (See TTree::Write and TObject::Write) Do not use, this feature will be migrate to the Merge function (See TClass and TTree::Merge)

Definition at line 106 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kSingleKey 

write collection with single key

kOverwrite 

overwrite existing object with same name

kWriteDelete 

write object, then delete previous key with same name

Definition at line 99 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kIsOnHeap 

object is on heap

kNotDeleted 

object has not been deleted

kZombie 

object ctor failed

kInconsistent 

class overload Hash but does call RecursiveRemove in destructor

kBitMask 

Definition at line 89 of file TObject.h.

◆ EDeprecatedStatusBits

Enumerator
kObjInCanvas 

for backward compatibility only, use kMustCleanup

Definition at line 84 of file TObject.h.

◆ EStatusBits

Enumerator
kBypassStreamer 
kForgetBits 

Definition at line 36 of file TClonesArray.h.

Constructor & Destructor Documentation

◆ TClonesArray() [1/4]

TClonesArray::TClonesArray ( )

Default Constructor.

Definition at line 187 of file TClonesArray.cxx.

◆ TClonesArray() [2/4]

TClonesArray::TClonesArray ( const char * classname,
Int_t s = 1000,
Bool_t call_dtor = kFALSE )

Create an array of clone objects of classname.

The class must inherit from TObject. The second argument s indicates an approximate number of objects that will be entered in the array. If more than s objects are entered, the array will be automatically expanded.

The third argument is not used anymore and only there for backward compatibility reasons.

Definition at line 203 of file TClonesArray.cxx.

◆ TClonesArray() [3/4]

TClonesArray::TClonesArray ( const TClass * cl,
Int_t s = 1000,
Bool_t call_dtor = kFALSE )

Create an array of clone objects of class cl.

The class must inherit from TObject. The second argument, s, indicates an approximate number of objects that will be entered in the array. If more than s objects are entered, the array will be automatically expanded.

The third argument is not used anymore and only there for backward compatibility reasons.

Definition at line 219 of file TClonesArray.cxx.

◆ TClonesArray() [4/4]

TClonesArray::TClonesArray ( const TClonesArray & tc)

Copy ctor.

Definition at line 228 of file TClonesArray.cxx.

◆ ~TClonesArray()

TClonesArray::~TClonesArray ( )
virtual

Delete a clones array.

Definition at line 280 of file TClonesArray.cxx.

Member Function Documentation

◆ AbsorbObjects() [1/2]

void TClonesArray::AbsorbObjects ( TClonesArray * tc)

Directly move the object pointers from tc without cloning (copying).

This TClonesArray takes over ownership of all of tc's object pointers. The tc array is left empty upon return.

Definition at line 991 of file TClonesArray.cxx.

◆ AbsorbObjects() [2/2]

void TClonesArray::AbsorbObjects ( TClonesArray * tc,
Int_t idx1,
Int_t idx2 )

Directly move the range of object pointers from tc without cloning (copying).

This TClonesArray takes over ownership of all of tc's object pointers from idx1 to idx2. The tc array is re-arranged by return.

Definition at line 1004 of file TClonesArray.cxx.

◆ AbstractMethod()

void TObject::AbstractMethod ( const char * method) const
inherited

Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.

In other word, this method acts as a "runtime purely virtual" warning instead of a "compiler purely virtual" error.

Warning
This interface is a legacy function that is no longer recommended to be used by new development code.
Note
The name "AbstractMethod" does not imply that it's an abstract method in the strict C++ sense.

Definition at line 1149 of file TObject.cxx.

◆ Add() [1/2]

void TObjArray::Add ( TObject * obj)
inlineoverridevirtualinherited

Implements TCollection.

Definition at line 68 of file TObjArray.h.

◆ Add() [2/2]

void TObjArray::Add ( TObject * obj,
Option_t *  )
inlineoverridevirtualinherited

Reimplemented from TCollection.

Definition at line 69 of file TObjArray.h.

◆ AddAfter() [1/2]

void TClonesArray::AddAfter ( const TObject * ,
TObject *  )
inlineoverridevirtual

Implements TSeqCollection.

Definition at line 64 of file TClonesArray.h.

◆ AddAfter() [2/2]

void TClonesArray::AddAfter ( const TObject * ,
TObject * ,
Option_t *  )
inlineoverridevirtual

Reimplemented from TSeqCollection.

Definition at line 65 of file TClonesArray.h.

◆ AddAll()

void TCollection::AddAll ( const TCollection * col)
virtualinherited

Add all objects from collection col to this collection.

Reimplemented in THashTable.

Definition at line 226 of file TCollection.cxx.

◆ AddAt() [1/2]

void TClonesArray::AddAt ( TObject * ,
Int_t  )
inlineoverridevirtual

Implements TSeqCollection.

Definition at line 60 of file TClonesArray.h.

◆ AddAt() [2/2]

void TClonesArray::AddAt ( TObject * ,
Int_t ,
Option_t *  )
inlineoverridevirtual

Reimplemented from TSeqCollection.

Definition at line 61 of file TClonesArray.h.

◆ AddAtAndExpand()

void TClonesArray::AddAtAndExpand ( TObject * obj,
Int_t idx )
inlineoverridevirtual

Add object at position idx.

If idx is larger than the current size of the array, expand the array (double its size).

Reimplemented from TObjArray.

Definition at line 62 of file TClonesArray.h.

◆ AddAtFree()

Int_t TClonesArray::AddAtFree ( TObject * obj)
inlineoverridevirtual

Return the position of the new object.

Find the first empty cell or AddLast if there is no empty cell

Reimplemented from TObjArray.

Definition at line 63 of file TClonesArray.h.

◆ AddBefore() [1/2]

void TClonesArray::AddBefore ( const TObject * ,
TObject *  )
inlineoverridevirtual

Implements TSeqCollection.

Definition at line 66 of file TClonesArray.h.

◆ AddBefore() [2/2]

void TClonesArray::AddBefore ( const TObject * ,
TObject * ,
Option_t *  )
inlineoverridevirtual

Reimplemented from TSeqCollection.

Definition at line 67 of file TClonesArray.h.

◆ AddFirst() [1/2]

void TClonesArray::AddFirst ( TObject * )
inlineoverridevirtual

Implements TSeqCollection.

Definition at line 56 of file TClonesArray.h.

◆ AddFirst() [2/2]

void TClonesArray::AddFirst ( TObject * ,
Option_t *  )
inlineoverridevirtual

Reimplemented from TSeqCollection.

Definition at line 57 of file TClonesArray.h.

◆ AddLast() [1/2]

void TClonesArray::AddLast ( TObject * )
inlineoverridevirtual

Implements TSeqCollection.

Definition at line 58 of file TClonesArray.h.

◆ AddLast() [2/2]

void TClonesArray::AddLast ( TObject * ,
Option_t *  )
inlineoverridevirtual

Reimplemented from TSeqCollection.

Definition at line 59 of file TClonesArray.h.

◆ AddrAt()

TObject * TClonesArray::AddrAt ( Int_t idx)
inline

Definition at line 91 of file TClonesArray.h.

◆ AddToTObjectTable()

void TObject::AddToTObjectTable ( TObject * op)
staticprivateinherited

Private helper function which will dispatch to TObjectTable::AddObj.

Included here to avoid circular dependency between header files.

Definition at line 195 of file TObject.cxx.

◆ AddVector()

void TCollection::AddVector ( TObject * obj1,
... )
inherited

Add all arguments to the collection.

The list of objects must be terminated by 0, e.g.: l.AddVector(o1, o2, o3, o4, 0);

Definition at line 239 of file TCollection.cxx.

◆ After()

TObject * TObjArray::After ( const TObject * obj) const
overridevirtualinherited

Return the object after obj. Returns 0 if obj is last object.

Implements TSeqCollection.

Definition at line 289 of file TObjArray.cxx.

◆ AppendPad()

void TObject::AppendPad ( Option_t * option = "")
virtualinherited

Append graphics object to current pad.

In case no current pad is set yet, create a default canvas with the name "c1".

Definition at line 204 of file TObject.cxx.

◆ AssertClass()

Bool_t TCollection::AssertClass ( TClass * cl) const
inherited

Make sure all objects in this collection inherit from class cl.

Definition at line 254 of file TCollection.cxx.

◆ At()

TObject * TObjArray::At ( Int_t idx) const
inlineoverridevirtualinherited

Implements TSeqCollection.

Definition at line 170 of file TObjArray.h.

◆ Before()

TObject * TObjArray::Before ( const TObject * obj) const
overridevirtualinherited

Return the object before obj. Returns 0 if obj is first object.

Implements TSeqCollection.

Definition at line 304 of file TObjArray.cxx.

◆ begin()

TIter TCollection::begin ( ) const
inlineinherited

Definition at line 294 of file TCollection.h.

◆ BinarySearch()

Int_t TObjArray::BinarySearch ( TObject * op,
Int_t upto = kMaxInt )
virtualinherited

Find object using a binary search.

Array must first have been sorted. Search can be limited by setting upto to desired index.

Definition at line 840 of file TObjArray.cxx.

◆ BoundsOk()

Bool_t TObjArray::BoundsOk ( const char * where,
Int_t at ) const
inlineprotectedinherited

Definition at line 163 of file TObjArray.h.

◆ Browse()

void TCollection::Browse ( TBrowser * b)
overridevirtualinherited

Browse this collection (called by TBrowser).

If b=0, there is no Browse call TObject::Browse(0) instead. This means TObject::Inspect() will be invoked indirectly

Reimplemented from TObject.

Reimplemented in TRootIconList.

Definition at line 279 of file TCollection.cxx.

◆ BypassStreamer()

void TClonesArray::BypassStreamer ( Bool_t bypass = kTRUE)

When the kBypassStreamer bit is set, the automatically generated Streamer can call directly TClass::WriteBuffer.

Bypassing the Streamer improves the performance when writing/reading the objects in the TClonesArray. However there is a drawback: When a TClonesArray is written with split=0 bypassing the Streamer, the StreamerInfo of the class in the array being optimized, one cannot use later the TClonesArray with split>0. For example, there is a problem with the following scenario:

  1. A class Foo has a TClonesArray of Bar objects
  2. The Foo object is written with split=0 to Tree T1. In this case the StreamerInfo for the class Bar is created in optimized mode in such a way that data members of the same type are written as an array improving the I/O performance.
  3. In a new program, T1 is read and a new Tree T2 is created with the object Foo in split>1
  4. When the T2 branch is created, the StreamerInfo for the class Bar is created with no optimization (mandatory for the split mode). The optimized Bar StreamerInfo is going to be used to read the TClonesArray in T1. The result will be Bar objects with data member values not in the right sequence. The solution to this problem is to call BypassStreamer(kFALSE) for the TClonesArray. In this case, the normal Bar::Streamer function will be called. The Bar::Streamer function works OK independently if the Bar StreamerInfo had been generated in optimized mode or not.

Definition at line 320 of file TClonesArray.cxx.

◆ CanBypassStreamer()

Bool_t TClonesArray::CanBypassStreamer ( ) const
inline

Definition at line 69 of file TClonesArray.h.

◆ Capacity()

Int_t TCollection::Capacity ( ) const
inlineinherited

Definition at line 168 of file TCollection.h.

◆ Changed()

virtual void TSeqCollection::Changed ( )
inlineprotectedvirtualinherited

Definition at line 34 of file TSeqCollection.h.

◆ CheckedHash()

ULong_t TObject::CheckedHash ( )
inlineinherited

Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.

The intent is for this routine to be called instead of directly calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();

(*) The setup is consistent when all classes in the class hierarchy that overload TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor. i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.

Definition at line 332 of file TObject.h.

◆ Class()

TClass * TClonesArray::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

const char * TClonesArray::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

constexpr Version_t TClonesArray::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 88 of file TClonesArray.h.

◆ ClassName()

const char * TObject::ClassName ( ) const
virtualinherited

Returns name of class to which the object belongs.

Definition at line 227 of file TObject.cxx.

◆ Clear()

void TClonesArray::Clear ( Option_t * option = "")
overridevirtual

Clear the clones array.

Only use this routine when your objects don't allocate memory since it will not call the object dtors. However, if the class in the TClonesArray implements the function Clear(Option_t *option) and if option = "C" the function Clear() is called for all objects in the array. In the function Clear(), one can delete objects or dynamic arrays allocated in the class. This procedure is much faster than calling TClonesArray::Delete(). When the option starts with "C+", eg "C+xyz" the objects in the array are in turn cleared with the option "xyz"

Implements TCollection.

Definition at line 419 of file TClonesArray.cxx.

◆ Clone()

TObject * TCollection::Clone ( const char * newname = "") const
overridevirtualinherited

Make a clone of an collection using the Streamer facility.

If newname is specified, this will be the name of the new collection.

Reimplemented from TObject.

Definition at line 294 of file TCollection.cxx.

◆ Compare()

Int_t TCollection::Compare ( const TObject * obj) const
overridevirtualinherited

Compare two TCollection objects.

Returns 0 when equal, -1 when this is smaller and +1 when bigger (like strcmp()).

Reimplemented from TObject.

Definition at line 306 of file TCollection.cxx.

◆ Compress()

void TClonesArray::Compress ( )
overridevirtual

Remove empty slots from array.

Reimplemented from TObjArray.

Definition at line 331 of file TClonesArray.cxx.

◆ ConstructedAt() [1/2]

TObject * TClonesArray::ConstructedAt ( Int_t idx)

Get an object at index 'idx' that is guaranteed to have been constructed.

It might be either a freshly allocated object or one that had already been allocated (and assumingly used). In the later case, it is the callers responsibility to insure that the object is returned to a known state, usually by calling the Clear method on the TClonesArray.

Tests to see if the destructor has been called on the object. If so, or if the object has never been constructed the class constructor is called using New(). If not, return a pointer to the correct memory location. This explicitly to deal with TObject classes that allocate memory which will be reset (but not deallocated) in their Clear() functions.

Definition at line 376 of file TClonesArray.cxx.

◆ ConstructedAt() [2/2]

TObject * TClonesArray::ConstructedAt ( Int_t idx,
Option_t * clear_options )

Get an object at index 'idx' that is guaranteed to have been constructed.

It might be either a freshly allocated object or one that had already been allocated (and assumingly used). In the later case, the function Clear will be called and passed the value of 'clear_options'

Tests to see if the destructor has been called on the object. If so, or if the object has never been constructed the class constructor is called using New(). If not, return a pointer to the correct memory location. This explicitly to deal with TObject classes that allocate memory which will be reset (but not deallocated) in their Clear() functions.

Definition at line 398 of file TClonesArray.cxx.

◆ Contains() [1/2]

Bool_t TCollection::Contains ( const char * name) const
inlineinherited

Definition at line 172 of file TCollection.h.

◆ Contains() [2/2]

Bool_t TCollection::Contains ( const TObject * obj) const
inlineinherited

Definition at line 173 of file TCollection.h.

◆ Copy()

◆ DeclFileName()

const char * TClonesArray::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 88 of file TClonesArray.h.

◆ Delete()

void TClonesArray::Delete ( Option_t * option = "")
overridevirtual

Clear the clones array.

Use this routine when your objects allocate memory (e.g. objects inheriting from TNamed or containing TStrings allocate memory). If not you better use Clear() since if is faster.

Implements TCollection.

Definition at line 451 of file TClonesArray.cxx.

◆ DistancetoPrimitive()

◆ DoError()

void TObject::DoError ( int level,
const char * location,
const char * fmt,
va_list va ) const
protectedvirtualinherited

Interface to ErrorHandler (protected).

Reimplemented in TThread, and TTreeViewer.

Definition at line 1059 of file TObject.cxx.

◆ Draw()

void TCollection::Draw ( Option_t * option = "")
overridevirtualinherited

Draw all objects in this collection.

Reimplemented from TObject.

Definition at line 315 of file TCollection.cxx.

◆ DrawClass()

void TObject::DrawClass ( ) const
virtualinherited

Draw class inheritance tree of the class to which this object belongs.

If a class B inherits from a class A, description of B is drawn on the right side of description of A. Member functions overridden by B are shown in class A with a blue line crossing-out the corresponding member function. The following picture is the class inheritance tree of class TPaveLabel:

Reimplemented in TGFrame, TSystemDirectory, and TSystemFile.

Definition at line 308 of file TObject.cxx.

◆ DrawClone()

TObject * TObject::DrawClone ( Option_t * option = "") const
virtualinherited

Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).

If pad was not selected - gPad will be used.

Note
For histograms, use the more specialised TH1::DrawCopy().

Reimplemented in TAxis, TCanvas, TGFrame, TSystemDirectory, and TSystemFile.

Definition at line 319 of file TObject.cxx.

◆ Dump()

void TCollection::Dump ( ) const
overridevirtualinherited

Dump all objects in this collection.

Reimplemented from TObject.

Definition at line 328 of file TCollection.cxx.

◆ EmptyGarbageCollection()

void TCollection::EmptyGarbageCollection ( )
staticinherited

Do the garbage collection.

Definition at line 741 of file TCollection.cxx.

◆ end()

TIter TCollection::end ( ) const
inlineinherited

Definition at line 295 of file TCollection.h.

◆ Error()

void TObject::Error ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue error message.

Use "location" to specify the method where the error occurred. Accepts standard printf formatting arguments.

Reimplemented in TFitResult.

Definition at line 1098 of file TObject.cxx.

◆ Execute() [1/2]

void TObject::Execute ( const char * method,
const char * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with the given parameter string, e.g.

"3.14,1,\"text\"".

Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.

Definition at line 378 of file TObject.cxx.

◆ Execute() [2/2]

void TObject::Execute ( TMethod * method,
TObjArray * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with parameters stored in the TObjArray.

The TObjArray should contain an argv vector like:

argv[0] ... argv[n] = the list of TObjString parameters
Collectable string class.
Definition TObjString.h:28
const Int_t n
Definition legend1.C:16

Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.

Definition at line 398 of file TObject.cxx.

◆ ExecuteEvent()

◆ Expand()

void TClonesArray::Expand ( Int_t newSize)
overridevirtual

Expand or shrink the array to newSize elements.

Reimplemented from TObjArray.

Definition at line 479 of file TClonesArray.cxx.

◆ ExpandCreate()

void TClonesArray::ExpandCreate ( Int_t n)
virtual

Expand or shrink the array to n elements and create the clone objects by calling their default ctor.

If n is less than the current size the array is shrunk and the allocated space is freed. This routine is typically used to create a clonesarray into which one can directly copy object data without going via the "new (arr[i]) MyObj()" (i.e. the vtbl is already set correctly).

Definition at line 513 of file TClonesArray.cxx.

◆ ExpandCreateFast()

void TClonesArray::ExpandCreateFast ( Int_t n)
virtual

Expand or shrink the array to n elements and create the clone objects by calling their default ctor.

If n is less than the current size the array is shrunk but the allocated space is not freed. This routine is typically used to create a clonesarray into which one can directly copy object data without going via the "new (arr[i]) MyObj()" (i.e. the vtbl is already set correctly). This is a simplified version of ExpandCreate used in the TTree mechanism.

Definition at line 557 of file TClonesArray.cxx.

◆ Fatal()

void TObject::Fatal ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue fatal error message.

Use "location" to specify the method where the fatal error occurred. Accepts standard printf formatting arguments.

Definition at line 1126 of file TObject.cxx.

◆ FindObject() [1/2]

TObject * TObjArray::FindObject ( const char * name) const
overridevirtualinherited

Find an object in this collection using its name.

Requires a sequential scan till the object has been found. Returns 0 if object with specified name is not found.

Reimplemented from TCollection.

Definition at line 414 of file TObjArray.cxx.

◆ FindObject() [2/2]

TObject * TObjArray::FindObject ( const TObject * iobj) const
overridevirtualinherited

Find an object in this collection using the object's IsEqual() member function.

Requires a sequential scan till the object has been found. Returns 0 if object is not found. Typically this function is overridden by a more efficient version in concrete collection classes (e.g. THashTable).

Reimplemented from TCollection.

Definition at line 433 of file TObjArray.cxx.

◆ First()

TObject * TObjArray::First ( ) const
overridevirtualinherited

Return the object in the first slot.

Implements TSeqCollection.

Definition at line 495 of file TObjArray.cxx.

◆ GarbageCollect()

void TCollection::GarbageCollect ( TObject * obj)
staticinherited

Add to the list of things to be cleaned up.

Definition at line 756 of file TCollection.cxx.

◆ GetAbsLast()

Int_t TObjArray::GetAbsLast ( ) const
protectedinherited

Return absolute index to last object in array.

Returns -1 in case array is empty.

Definition at line 538 of file TObjArray.cxx.

◆ GetClass()

TClass * TClonesArray::GetClass ( ) const
inline

Definition at line 53 of file TClonesArray.h.

◆ GetCollectionEntryName()

const char * TCollection::GetCollectionEntryName ( TObject * entry) const
protectedvirtualinherited

For given collection entry return the string that is used to identify the object and, potentially, perform wildcard/regexp filtering on.

Definition at line 468 of file TCollection.cxx.

◆ GetCurrentCollection()

TCollection * TCollection::GetCurrentCollection ( )
staticinherited

Return the globally accessible collection.

Definition at line 711 of file TCollection.cxx.

◆ GetDrawOption()

Option_t * TObject::GetDrawOption ( ) const
virtualinherited

Get option used by the graphics system to draw this object.

Note that before calling object.GetDrawOption(), you must have called object.Draw(..) before in the current pad.

Reimplemented in TBrowser, TFitEditor, TGedFrame, TGFileBrowser, TRootBrowser, and TRootBrowserLite.

Definition at line 445 of file TObject.cxx.

◆ GetDtorOnly()

Longptr_t TObject::GetDtorOnly ( )
staticinherited

Return destructor only flag.

Definition at line 1196 of file TObject.cxx.

◆ GetEntries()

Int_t TObjArray::GetEntries ( ) const
overridevirtualinherited

Return the number of objects in array (i.e.

number of non-empty slots). Attention: use this method ONLY if you want to know the number of non-empty slots. This function loops over the complete array and is therefore very slow when applied in a loop. Most of the time you better use GetEntriesFast() (only in case when there are no empty slots).

Reimplemented from TCollection.

Definition at line 522 of file TObjArray.cxx.

◆ GetEntriesFast()

Int_t TObjArray::GetEntriesFast ( ) const
inlineinherited

Definition at line 58 of file TObjArray.h.

◆ GetEntriesUnsafe()

Int_t TObjArray::GetEntriesUnsafe ( ) const
inherited

Return the number of objects in array (i.e.

number of non-empty slots). This is a thread-unsafe version of GetEntriesFast. Use it only if sure it will not be invoked concurrently.

Definition at line 564 of file TObjArray.cxx.

◆ GetIconName()

const char * TObject::GetIconName ( ) const
virtualinherited

Returns mime type name of object.

Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.

Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TASImage, TBranch, TBranchElement, TGeoVolume, TGMainFrame, TKey, TMethodBrowsable, TSystemFile, and TVirtualBranchBrowsable.

Definition at line 472 of file TObject.cxx.

◆ GetLast()

Int_t TObjArray::GetLast ( ) const
overridevirtualinherited

Return index of last object in array.

Returns lowerBound-1 in case array is empty.

Reimplemented from TSeqCollection.

Definition at line 576 of file TObjArray.cxx.

◆ GetName()

const char * TCollection::GetName ( ) const
overridevirtualinherited

Return name of this collection.

if no name, return the collection class name.

Reimplemented from TObject.

Reimplemented in TQCommand, and TQConnection.

Definition at line 382 of file TCollection.cxx.

◆ GetObjectInfo()

char * TObject::GetObjectInfo ( Int_t px,
Int_t py ) const
virtualinherited

Returns string containing info about the object at position (px,py).

This method is typically overridden by classes of which the objects can report peculiarities for different positions. Returned string will be re-used (lock in MT environment).

Reimplemented in TASImage, TAxis3D, TColorWheel, TF1, TF2, TFileDrawMap, TGeoNode, TGeoTrack, TGeoVolume, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TGraph, TH1, THistPainter, TNode, TPaletteAxis, TParallelCoordVar, and TVirtualHistPainter.

Definition at line 491 of file TObject.cxx.

◆ GetObjectRef() [1/2]

TObject ** TObjArray::GetObjectRef ( ) const
inlineinherited

Definition at line 63 of file TObjArray.h.

◆ GetObjectRef() [2/2]

TObject ** TObjArray::GetObjectRef ( const TObject * obj) const
overridevirtualinherited

Return address of pointer obj. If obj is 0 returns address of container.

Implements TCollection.

Definition at line 586 of file TObjArray.cxx.

◆ GetObjectStat()

Bool_t TObject::GetObjectStat ( )
staticinherited

Get status of object stat flag.

Definition at line 1181 of file TObject.cxx.

◆ GetOption()

virtual Option_t * TObject::GetOption ( ) const
inlinevirtualinherited

◆ GetSize()

virtual Int_t TCollection::GetSize ( ) const
inlinevirtualinherited

Return the capacity of the collection, i.e.

the current total amount of space that has been allocated so far. Same as Capacity. Use GetEntries to get the number of elements currently in the collection.

Reimplemented in THashTable, TListOfEnumsWithLock, TListOfFunctions, TViewPubDataMembers, and TViewPubFunctions.

Definition at line 186 of file TCollection.h.

◆ GetTitle()

const char * TObject::GetTitle ( ) const
virtualinherited

Returns title of object.

This default method returns the class title (i.e. description). Classes that give objects a title should override this method.

Reimplemented in Axis2, TASImage, TAxis, TBaseClass, TClassMenuItem, TEveGeoNode, TEvePointSet, TGaxis, TGGroupFrame, TGLabel, TGLVEntry, TGTextButton, TGTextEntry, TGTextLBEntry, TKey, TMapFile, TNamed, TPad, TPair, TParallelCoordSelect, TParticle, TPaveLabel, TPrimary, TQCommand, TRootIconList, and TVirtualPad.

Definition at line 507 of file TObject.cxx.

◆ GetUniqueID()

UInt_t TObject::GetUniqueID ( ) const
virtualinherited

Return the unique object id.

Definition at line 480 of file TObject.cxx.

◆ GrowBy()

Int_t TCollection::GrowBy ( Int_t delta) const
virtualinherited

Increase the collection's capacity by delta slots.

Definition at line 391 of file TCollection.cxx.

◆ HandleTimer()

Bool_t TObject::HandleTimer ( TTimer * timer)
virtualinherited

Execute action in response of a timer timing out.

This method must be overridden if an object has to react to timers.

Reimplemented in TGCommandPlugin, TGDNDManager, TGFileContainer, TGHtml, TGLEventHandler, TGPopupMenu, TGraphTime, TGScrollBar, TGShutter, TGTextEdit, TGTextEditor, TGTextEntry, TGTextView, TGToolTip, TGuiBldDragManager, TGWindow, and TTreeViewer.

Definition at line 516 of file TObject.cxx.

◆ Hash()

ULong_t TCollection::Hash ( ) const
inlineoverridevirtualinherited

Return hash value for this object.

Note: If this routine is overloaded in a derived class, this derived class should also add

void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:406

Otherwise, when RecursiveRemove is called (by ~TObject or example) for this type of object, the transversal of THashList and THashTable containers will will have to be done without call Hash (and hence be linear rather than logarithmic complexity). You will also see warnings like

Error in <ROOT::Internal::TCheckHashRecursiveRemoveConsistency::CheckRecursiveRemove>: The class SomeName overrides
TObject::Hash but does not call TROOT::RecursiveRemove in its destructor.
ULong_t Hash() const override
Return hash value for this object.
Mother of all ROOT objects.
Definition TObject.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098
void RecursiveRemove(TObject *obj) override
Recursively remove this object from the list of Cleanups.
Definition TROOT.cxx:2651

Reimplemented from TObject.

Definition at line 188 of file TCollection.h.

◆ HasInconsistentHash()

Bool_t TObject::HasInconsistentHash ( ) const
inlineinherited

Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.

missing call to RecursiveRemove in destructor).

Note: Since the consistency is only tested for during inserts, this routine will return true for object that have never been inserted whether or not they have a consistent setup. This has no negative side-effect as searching for the object with the right or wrong Hash will always yield a not-found answer (Since anyway no hash can be guaranteed unique, there is always a check)

Definition at line 366 of file TObject.h.

◆ IndexOf()

Int_t TObjArray::IndexOf ( const TObject * obj) const
overridevirtualinherited
  • obj != 0 Return index of object in array. Returns lowerBound-1 in case array doesn't contain the obj.
  • obj == 0 Return the index of the first empty slot. Returns lowerBound-1 in case array doesn't contain any empty slot.

Reimplemented from TSeqCollection.

Definition at line 604 of file TObjArray.cxx.

◆ Info()

void TObject::Info ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue info message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1072 of file TObject.cxx.

◆ InheritsFrom() [1/2]

Bool_t TObject::InheritsFrom ( const char * classname) const
virtualinherited

Returns kTRUE if object inherits from class "classname".

Reimplemented in TClass.

Definition at line 549 of file TObject.cxx.

◆ InheritsFrom() [2/2]

Bool_t TObject::InheritsFrom ( const TClass * cl) const
virtualinherited

Returns kTRUE if object inherits from TClass cl.

Reimplemented in TClass.

Definition at line 557 of file TObject.cxx.

◆ Init()

void TObjArray::Init ( Int_t s,
Int_t lowerBound )
protectedinherited

Initialize a TObjArray.

Definition at line 626 of file TObjArray.cxx.

◆ Inspect()

void TObject::Inspect ( ) const
virtualinherited

Dump contents of this object in a graphics canvas.

Same action as Dump but in a graphical form. In addition pointers to other objects can be followed.

The following picture is the Inspect of a histogram object:

Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TGFrame, TInspectorObject, and TSystemFile.

Definition at line 570 of file TObject.cxx.

◆ InvertBit()

void TObject::InvertBit ( UInt_t f)
inlineinherited

Definition at line 206 of file TObject.h.

◆ IsA()

TClass * TClonesArray::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Definition at line 88 of file TClonesArray.h.

◆ IsArgNull()

Bool_t TCollection::IsArgNull ( const char * where,
const TObject * obj ) const
inherited

Returns true if object is a null pointer.

Definition at line 403 of file TCollection.cxx.

◆ IsDestructed()

Bool_t TObject::IsDestructed ( ) const
inlineinherited

IsDestructed.

Note
This function must be non-virtual as it can be used on destructed (but not yet modified) memory. This is used for example in TClonesArray to record the element that have been destructed but not deleted and thus are ready for re-use (by operator new with placement).
Returns
true if this object's destructor has been run.

Definition at line 186 of file TObject.h.

◆ IsEmpty()

Bool_t TObjArray::IsEmpty ( ) const
inlineoverridevirtualinherited

Reimplemented from TCollection.

Definition at line 65 of file TObjArray.h.

◆ IsEqual()

Bool_t TObject::IsEqual ( const TObject * obj) const
virtualinherited

Default equal comparison (objects are equal if they have the same address in memory).

More complicated classes might want to override this function.

Reimplemented in TGObject, TObjString, TPair, and TQCommand.

Definition at line 589 of file TObject.cxx.

◆ IsFolder()

Bool_t TCollection::IsFolder ( ) const
inlineoverridevirtualinherited

Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).

Reimplemented from TObject.

Reimplemented in TRootIconList.

Definition at line 191 of file TCollection.h.

◆ IsOnHeap()

Bool_t TObject::IsOnHeap ( ) const
inlineinherited

Definition at line 160 of file TObject.h.

◆ IsOwner()

Bool_t TCollection::IsOwner ( ) const
inlineinherited

Definition at line 192 of file TCollection.h.

◆ IsSortable()

Bool_t TCollection::IsSortable ( ) const
inlineoverridevirtualinherited

Reimplemented from TObject.

Definition at line 193 of file TCollection.h.

◆ IsSorted()

virtual Bool_t TSeqCollection::IsSorted ( ) const
inlinevirtualinherited

Reimplemented in TSortedList.

Definition at line 64 of file TSeqCollection.h.

◆ IsUsingRWLock()

Bool_t TCollection::IsUsingRWLock ( ) const
inlineinherited

Definition at line 214 of file TCollection.h.

◆ IsZombie()

Bool_t TObject::IsZombie ( ) const
inlineinherited

Definition at line 161 of file TObject.h.

◆ Last()

TObject * TObjArray::Last ( ) const
overridevirtualinherited

Return the object in the last filled slot. Returns 0 if no entries.

Implements TSeqCollection.

Definition at line 505 of file TObjArray.cxx.

◆ LastIndex()

Int_t TSeqCollection::LastIndex ( ) const
inlineinherited

Definition at line 61 of file TSeqCollection.h.

◆ LowerBound()

Int_t TObjArray::LowerBound ( ) const
inlineinherited

Definition at line 97 of file TObjArray.h.

◆ ls()

void TCollection::ls ( Option_t * option = "") const
overridevirtualinherited

List (ls) all objects in this collection.

Wildcarding supported, eg option="xxx*" lists only objects with names xxx*.

Reimplemented from TObject.

Reimplemented in TQCommand, TQConnection, TQConnectionList, and TQUndoManager.

Definition at line 413 of file TCollection.cxx.

◆ MakeIterator()

TIterator * TObjArray::MakeIterator ( Bool_t dir = kIterForward) const
overridevirtualinherited

Returns an array iterator.

Implements TCollection.

Definition at line 648 of file TObjArray.cxx.

◆ MakeReverseIterator()

virtual TIterator * TCollection::MakeReverseIterator ( ) const
inlinevirtualinherited

Definition at line 197 of file TCollection.h.

◆ MakeZombie()

void TObject::MakeZombie ( )
inlineprotectedinherited

Definition at line 55 of file TObject.h.

◆ MayNotUse()

void TObject::MayNotUse ( const char * method) const
inherited

Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).

Definition at line 1160 of file TObject.cxx.

◆ Merge()

Long64_t TSeqCollection::Merge ( TCollection * list)
inherited

Merge this collection with all collections coming in the input list.

The input list must contain other collections of objects compatible with the ones in this collection and ordered in the same manner. For example, if this collection contains a TH1 object and a tree, all collections in the input list have to contain a histogram and a tree. In case the list contains collections, the objects in the input lists must also be collections with the same structure and number of objects. If some objects inside the collection are instances of a class that do not have a Merge function (like TObjString), rather than merging, a copy of each instance (via a call to Clone) is appended to the output.

Example

this list
____________ ---------------------|
| A (TH1F) | __________ | L1 (TSeqCollection)|- [A1, B1(C1,D1,E1)]
| B (TList)|-| C (TTree)| | L1 (TSeqCollection)|- [A2, B2(C2,D2,E2)]
|__________| | D (TH1F) | | ... |- [...]
| E (TH1F) | |____________________|
|__________|
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:878
A doubly linked list.
Definition TList.h:38
A TTree represents a columnar dataset.
Definition TTree.h:89

Definition at line 184 of file TSeqCollection.cxx.

◆ MultiSort()

void TClonesArray::MultiSort ( Int_t nTCs,
TClonesArray ** tcs,
Int_t upto = kMaxInt )

Sort multiple TClonesArrays simultaneously with this array.

If objects in array are sortable (i.e. IsSortable() returns true for all objects) then sort array.

Definition at line 1060 of file TClonesArray.cxx.

◆ New()

TObject * TClonesArray::New ( Int_t idx)

Create an object of type fClass with the default ctor at the specified index.

Returns 0 in case of error.

Definition at line 967 of file TClonesArray.cxx.

◆ Notify()

Bool_t TCollection::Notify ( )
overridevirtualinherited

'Notify' all objects in this collection.

Reimplemented from TObject.

Reimplemented in TGTextEditHist.

Definition at line 438 of file TCollection.cxx.

◆ ObjCompare()

Int_t TSeqCollection::ObjCompare ( TObject * a,
TObject * b )
staticinherited

Compare to objects in the collection. Use member Compare() of object a.

Definition at line 55 of file TSeqCollection.cxx.

◆ Obsolete()

void TObject::Obsolete ( const char * method,
const char * asOfVers,
const char * removedFromVers ) const
inherited

Use this method to declare a method obsolete.

Specify as of which version the method is obsolete and as from which version it will be removed.

Definition at line 1169 of file TObject.cxx.

◆ operator delete() [1/3]

void TObject::operator delete ( void * ptr,
size_t size )
inherited

Operator delete for sized deallocation.

Definition at line 1234 of file TObject.cxx.

◆ operator delete() [2/3]

void TObject::operator delete ( void * ptr)
inherited

Operator delete.

Definition at line 1212 of file TObject.cxx.

◆ operator delete() [3/3]

void TObject::operator delete ( void * ptr,
void * vp )
inherited

Only called by placement new when throwing an exception.

Definition at line 1266 of file TObject.cxx.

◆ operator delete[]() [1/3]

void TObject::operator delete[] ( void * ptr,
size_t size )
inherited

Operator delete [] for sized deallocation.

Definition at line 1245 of file TObject.cxx.

◆ operator delete[]() [2/3]

void TObject::operator delete[] ( void * ptr)
inherited

Operator delete [].

Definition at line 1223 of file TObject.cxx.

◆ operator delete[]() [3/3]

void TObject::operator delete[] ( void * ptr,
void * vp )
inherited

Only called by placement new[] when throwing an exception.

Definition at line 1274 of file TObject.cxx.

◆ operator new() [1/2]

void * TObject::operator new ( size_t sz)
inlineinherited

Definition at line 189 of file TObject.h.

◆ operator new() [2/2]

void * TObject::operator new ( size_t sz,
void * vp )
inlineinherited

Definition at line 191 of file TObject.h.

◆ operator new[]() [1/2]

void * TObject::operator new[] ( size_t sz)
inlineinherited

Definition at line 190 of file TObject.h.

◆ operator new[]() [2/2]

void * TObject::operator new[] ( size_t sz,
void * vp )
inlineinherited

Definition at line 192 of file TObject.h.

◆ operator()()

TObject * TCollection::operator() ( const char * name) const
inherited

Find an object in this collection by name.

Definition at line 356 of file TCollection.cxx.

◆ operator=()

TClonesArray & TClonesArray::operator= ( const TClonesArray & tc)

Assignment operator.

Definition at line 244 of file TClonesArray.cxx.

◆ operator[]() [1/2]

TObject * TClonesArray::operator[] ( Int_t idx) const
overridevirtual

Return the object at position idx. Returns 0 if idx is out of bounds.

Reimplemented from TObjArray.

Definition at line 953 of file TClonesArray.cxx.

◆ operator[]() [2/2]

TObject *& TClonesArray::operator[] ( Int_t idx)
overridevirtual

Return pointer to reserved area in which a new object of clones class can be constructed.

This operator should not be used for lefthand side assignments, like a[2] = xxx. Only like, new (a[2]) myClass, or xxx = a[2]. Of course right hand side usage is only legal after the object has been constructed via the new operator or via the New() method. To remove elements from the clones array use Remove() or RemoveAt().

Reimplemented from TObjArray.

Definition at line 919 of file TClonesArray.cxx.

◆ OutOfBoundsError()

Bool_t TObjArray::OutOfBoundsError ( const char * where,
Int_t i ) const
protectedinherited

Generate an out-of-bounds error. Always returns false.

Definition at line 657 of file TObjArray.cxx.

◆ Paint()

void TCollection::Paint ( Option_t * option = "")
overridevirtualinherited

Paint all objects in this collection.

Reimplemented from TObject.

Definition at line 448 of file TCollection.cxx.

◆ Pop()

void TObject::Pop ( )
virtualinherited

Pop on object drawn in a pad to the top of the display list.

I.e. it will be drawn last and on top of all other primitives.

Reimplemented in TFrame, TPad, and TVirtualPad.

Definition at line 640 of file TObject.cxx.

◆ Print() [1/4]

void TCollection::Print ( Option_t * option,
const char * wildcard,
Int_t recurse = 1 ) const
virtualinherited

Print the collection header and its elements that match the wildcard.

If recurse is non-zero, descend into printing of collection-entries with recurse - 1. This means, if recurse is negative, the recursion is infinite.

Option is passed recursively, but wildcard is only used on the first level.

Reimplemented in THashTable.

Definition at line 548 of file TCollection.cxx.

◆ Print() [2/4]

void TCollection::Print ( Option_t * option,
Int_t recurse ) const
virtualinherited

Print the collection header and its elements.

If recurse is non-zero, descend into printing of collection-entries with recurse - 1. This means, if recurse is negative, the recursion is infinite.

Option is passed recursively.

Reimplemented in THashTable.

Definition at line 521 of file TCollection.cxx.

◆ Print() [3/4]

void TCollection::Print ( Option_t * option,
TPRegexp & regexp,
Int_t recurse = 1 ) const
virtualinherited

Print the collection header and its elements that match the regexp.

If recurse is non-zero, descend into printing of collection-entries with recurse - 1. This means, if recurse is negative, the recursion is infinite.

Option is passed recursively, but regexp is only used on the first level.

Reimplemented in THashTable.

Definition at line 581 of file TCollection.cxx.

◆ Print() [4/4]

void TCollection::Print ( Option_t * option = "") const
overridevirtualinherited

Default print for collections, calls Print(option, 1).

This will print the collection header and Print() methods of all the collection entries.

If you want to override Print() for a collection class, first see if you can accomplish it by overriding the following protected methods:

void PrintCollectionHeader(Option_t* option) const;
const char* GetCollectionEntryName(TObject* entry) const;
void PrintCollectionEntry(TObject* entry, Option_t* option, Int_t recurse) const;
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
virtual void PrintCollectionEntry(TObject *entry, Option_t *option, Int_t recurse) const
Print the collection entry.
virtual const char * GetCollectionEntryName(TObject *entry) const
For given collection entry return the string that is used to identify the object and,...
virtual void PrintCollectionHeader(Option_t *option) const
Print the collection header.

Otherwise override the Print(Option_t *option, Int_t) variant. Remember to declare:

void Print(Option_t *option="") const override
Default print for collections, calls Print(option, 1).

somewhere close to the method declaration.

Reimplemented from TObject.

Reimplemented in THashTable.

Definition at line 507 of file TCollection.cxx.

◆ PrintCollectionEntry()

void TCollection::PrintCollectionEntry ( TObject * entry,
Option_t * option,
Int_t recurse ) const
protectedvirtualinherited

Print the collection entry.

Reimplemented in TMap, and TQUndoManager.

Definition at line 476 of file TCollection.cxx.

◆ PrintCollectionHeader()

void TCollection::PrintCollectionHeader ( Option_t * option) const
protectedvirtualinherited

Print the collection header.

Reimplemented in TQCommand, and TQConnection.

Definition at line 456 of file TCollection.cxx.

◆ QSort() [1/3]

void TSeqCollection::QSort ( TObject ** a,
Int_t first,
Int_t last )
staticinherited

Sort array of TObject pointers using a quicksort algorithm.

The algorithm used is a non stable sort (i.e. already sorted elements might switch/change places). Uses ObjCompare() to compare objects.

Definition at line 69 of file TSeqCollection.cxx.

◆ QSort() [2/3]

void TSeqCollection::QSort ( TObject ** a,
Int_t nBs,
TObject *** b,
Int_t first,
Int_t last )
staticinherited

Sort array a of TObject pointers using a quicksort algorithm.

Arrays b will be sorted just like a (a determines the sort). Argument nBs is the number of TObject** arrays in b. The algorithm used is a non stable sort (i.e. already sorted elements might switch/change places). Uses ObjCompare() to compare objects.

Definition at line 117 of file TSeqCollection.cxx.

◆ QSort() [3/3]

void TSeqCollection::QSort ( TObject ** a,
TObject ** b,
Int_t first,
Int_t last )
inlinestaticinherited

Definition at line 70 of file TSeqCollection.h.

◆ Randomize()

void TObjArray::Randomize ( Int_t ntimes = 1)
virtualinherited

Randomize objects inside the array, i.e.

permute randomly objects. With fLast being the index of the last entry in the array, the following algorithm is applied to the array:

  • for each entry j between 0 and fLast, another entry k is chosen randomly between 0 and fLast.
  • the objects at j and k are swapped.
  • this process is repeated ntimes (ntimes = 1 by default).

Definition at line 794 of file TObjArray.cxx.

◆ Read()

Int_t TObject::Read ( const char * name)
virtualinherited

Read contents of object with specified name from the current directory.

First the key with the given name is searched in the current directory, next the key buffer is deserialized into the object. The object must have been created before via the default constructor. See TObject::Write().

Reimplemented in TBuffer, TKey, TKeySQL, and TKeyXML.

Definition at line 673 of file TObject.cxx.

◆ RecursiveRemove()

void TObjArray::RecursiveRemove ( TObject * obj)
overridevirtualinherited

Remove object from this collection and recursively remove the object from all other objects (and collections).

Reimplemented from TCollection.

Definition at line 667 of file TObjArray.cxx.

◆ Remove()

TObject * TClonesArray::Remove ( TObject * obj)
overridevirtual

Remove object from array.

Implements TCollection.

Definition at line 607 of file TClonesArray.cxx.

◆ RemoveAfter()

virtual void TSeqCollection::RemoveAfter ( TObject * after)
inlinevirtualinherited

Definition at line 53 of file TSeqCollection.h.

◆ RemoveAll() [1/2]

void TCollection::RemoveAll ( )
inlineinherited

Definition at line 206 of file TCollection.h.

◆ RemoveAll() [2/2]

void TCollection::RemoveAll ( TCollection * col)
virtualinherited

Remove all objects in collection col from this collection.

Definition at line 625 of file TCollection.cxx.

◆ RemoveAt()

TObject * TClonesArray::RemoveAt ( Int_t idx)
overridevirtual

Remove object at index idx.

Reimplemented from TSeqCollection.

Definition at line 583 of file TClonesArray.cxx.

◆ RemoveBefore()

virtual void TSeqCollection::RemoveBefore ( TObject * before)
inlinevirtualinherited

Definition at line 54 of file TSeqCollection.h.

◆ RemoveFirst()

virtual void TSeqCollection::RemoveFirst ( )
inlinevirtualinherited

Definition at line 50 of file TSeqCollection.h.

◆ RemoveLast()

virtual void TSeqCollection::RemoveLast ( )
inlinevirtualinherited

Reimplemented in TList.

Definition at line 51 of file TSeqCollection.h.

◆ RemoveRange()

void TClonesArray::RemoveRange ( Int_t idx1,
Int_t idx2 )
overridevirtual

Remove objects from index idx1 to idx2 included.

Reimplemented from TObjArray.

Definition at line 630 of file TClonesArray.cxx.

◆ ResetBit()

void TObject::ResetBit ( UInt_t f)
inlineinherited

Definition at line 203 of file TObject.h.

◆ SaveAs()

void TObject::SaveAs ( const char * filename = "",
Option_t * option = "" ) const
virtualinherited

Save this object in the file specified by filename.

  • if "filename" contains ".root" the object is saved in filename as root binary file.
  • if "filename" contains ".xml" the object is saved in filename as a xml ascii file.
  • if "filename" contains ".cc" the object is saved in filename as C code independent from ROOT. The code is generated via SavePrimitive(). Specific code should be implemented in each object to handle this option. Like in TF1::SavePrimitive().
  • otherwise the object is written to filename as a CINT/C++ script. The C++ code to rebuild this object is generated via SavePrimitive(). The "option" parameter is passed to SavePrimitive. By default it is an empty string. It can be used to specify the Draw option in the code generated by SavePrimitive.

    The function is available via the object context menu.

Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TClassTree, TFolder, TGeoVolume, TGObject, TGraph, TH1, TPad, TPaveClass, TSpline3, TSpline5, TSpline, TTreePerfStats, and TVirtualPad.

Definition at line 708 of file TObject.cxx.

◆ SavePrimitive()

void TObject::SavePrimitive ( std::ostream & out,
Option_t * option = "" )
virtualinherited

Save a primitive as a C++ statement(s) on output stream "out".

Reimplemented in TAnnotation, TArc, TArrow, TASImage, TAxis3D, TBox, TButton, TCanvas, TChain, TCrown, TCurlyArc, TCurlyLine, TCutG, TDiamond, TEfficiency, TEllipse, TExec, TF12, TF1, TF2, TF3, TFrame, TGaxis, TGButton, TGButtonGroup, TGCanvas, TGCheckButton, TGColorSelect, TGColumnLayout, TGComboBox, TGCompositeFrame, TGContainer, TGDockableFrame, TGDoubleHSlider, TGDoubleVSlider, TGedMarkerSelect, TGedPatternSelect, TGeoArb8, TGeoBBox, TGeoBoolNode, TGeoCombiTrans, TGeoCompositeShape, TGeoCone, TGeoConeSeg, TGeoCtub, TGeoDecayChannel, TGeoElementRN, TGeoEltu, TGeoGtra, TGeoHalfSpace, TGeoHMatrix, TGeoHype, TGeoIdentity, TGeoIntersection, TGeoMaterial, TGeoMedium, TGeoMixture, TGeoPara, TGeoParaboloid, TGeoPatternCylPhi, TGeoPatternCylR, TGeoPatternParaX, TGeoPatternParaY, TGeoPatternParaZ, TGeoPatternSphPhi, TGeoPatternSphR, TGeoPatternSphTheta, TGeoPatternTrapZ, TGeoPatternX, TGeoPatternY, TGeoPatternZ, TGeoPcon, TGeoPgon, TGeoRotation, TGeoScaledShape, TGeoShapeAssembly, TGeoSphere, TGeoSubtraction, TGeoTessellated, TGeoTorus, TGeoTranslation, TGeoTrap, TGeoTrd1, TGeoTrd2, TGeoTube, TGeoTubeSeg, TGeoUnion, TGeoVolume, TGeoXtru, TGFileContainer, TGFont, TGFrame, TGFSComboBox, TGGC, TGGroupFrame, TGHButtonGroup, TGHorizontal3DLine, TGHorizontalFrame, TGHorizontalLayout, TGHProgressBar, TGHScrollBar, TGHSlider, TGHSplitter, TGHtml, TGIcon, TGLabel, TGLayoutHints, TGLineStyleComboBox, TGLineWidthComboBox, TGListBox, TGListDetailsLayout, TGListLayout, TGListTree, TGListView, TGLVContainer, TGMainFrame, TGMatrixLayout, TGMdiFrame, TGMdiMainFrame, TGMdiMenuBar, TGMenuBar, TGMenuTitle, TGNumberEntry, TGNumberEntryField, TGPictureButton, TGPopupMenu, TGProgressBar, TGRadioButton, TGraph2D, TGraph2DAsymmErrors, TGraph2DErrors, TGraph, TGraphAsymmErrors, TGraphBentErrors, TGraphEdge, TGraphErrors, TGraphMultiErrors, TGraphNode, TGraphPolar, TGraphPolargram, TGraphStruct, TGroupButton, TGRowLayout, TGShapedFrame, TGShutter, TGShutterItem, TGSplitFrame, TGStatusBar, TGTab, TGTabLayout, TGTableLayout, TGTableLayoutHints, TGTextButton, TGTextEdit, TGTextEntry, TGTextLBEntry, TGTextView, TGTileLayout, TGToolBar, TGTransientFrame, TGTripleHSlider, TGTripleVSlider, TGVButtonGroup, TGVertical3DLine, TGVerticalFrame, TGVerticalLayout, TGVFileSplitter, TGVProgressBar, TGVScrollBar, TGVSlider, TGVSplitter, TGXYLayout, TGXYLayoutHints, TH1, TH2Poly, THelix, THStack, TLatex, TLegend, TLine, TMacro, TMarker3DBox, TMarker, TMathText, TMultiGraph, TPad, TPaletteAxis, TParallelCoord, TParallelCoordVar, TPave, TPaveClass, TPaveLabel, TPaveStats, TPavesText, TPaveText, TPie, TPieSlice, TPolyLine3D, TPolyLine, TPolyMarker3D, TPolyMarker, TProfile2D, TProfile3D, TProfile, TRootContainer, TRootEmbeddedCanvas, TScatter2D, TScatter, TSlider, TSliderBox, TSpline3, TSpline5, TStyle, TText, TTreePerfStats, and TWbox.

Definition at line 858 of file TObject.cxx.

◆ SavePrimitiveConstructor()

void TObject::SavePrimitiveConstructor ( std::ostream & out,
TClass * cl,
const char * variable_name,
const char * constructor_agrs = "",
Bool_t empty_line = kTRUE )
staticprotectedinherited

Save object constructor in the output stream "out".

Can be used as first statement when implementing SavePrimitive() method for the object

Definition at line 777 of file TObject.cxx.

◆ SavePrimitiveDraw()

void TObject::SavePrimitiveDraw ( std::ostream & out,
const char * variable_name,
Option_t * option = nullptr )
staticprotectedinherited

Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.

Definition at line 845 of file TObject.cxx.

◆ SavePrimitiveVector()

TString TObject::SavePrimitiveVector ( std::ostream & out,
const char * prefix,
Int_t len,
Double_t * arr,
Int_t flag = 0 )
staticprotectedinherited

Save array in the output stream "out" as vector.

Create unique variable name based on prefix value Returns name of vector which can be used in constructor or in other places of C++ code If flag === kTRUE, just add empty line If flag === 111, check if array is empty and return nullptr or <vectorname>.data()

Definition at line 796 of file TObject.cxx.

◆ SetBit() [1/2]

void TObject::SetBit ( UInt_t f)
inlineinherited

Definition at line 202 of file TObject.h.

◆ SetBit() [2/2]

void TObject::SetBit ( UInt_t f,
Bool_t set )
inherited

Set or unset the user status bits as specified in f.

Definition at line 888 of file TObject.cxx.

◆ SetClass() [1/2]

void TClonesArray::SetClass ( const char * classname,
Int_t size = 1000 )

see TClonesArray::SetClass(const TClass*)

Definition at line 701 of file TClonesArray.cxx.

◆ SetClass() [2/2]

void TClonesArray::SetClass ( const TClass * cl,
Int_t s = 1000 )

Create an array of clone objects of class cl.

The class must inherit from TObject. The second argument s indicates an approximate number of objects that will be entered in the array. If more than s objects are entered, the array will be automatically expanded.

NB: This function should not be called in the TClonesArray is already initialized with a class.

Definition at line 664 of file TClonesArray.cxx.

◆ SetCurrentCollection()

void TCollection::SetCurrentCollection ( )
inherited

Set this collection to be the globally accessible collection.

Definition at line 719 of file TCollection.cxx.

◆ SetDrawOption()

void TObject::SetDrawOption ( Option_t * option = "")
virtualinherited

Set drawing option for object.

This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().

Reimplemented in RooPlot, TAxis, TBrowser, TGedFrame, TGFrame, TPad, TPaveStats, TRootBrowserLite, TSystemDirectory, and TSystemFile.

Definition at line 871 of file TObject.cxx.

◆ SetDtorOnly()

void TObject::SetDtorOnly ( void * obj)
staticinherited

Set destructor only flag.

Definition at line 1204 of file TObject.cxx.

◆ SetLast()

void TObjArray::SetLast ( Int_t last)
inherited

Set index of last object in array, effectively truncating the array.

Use carefully since whenever last position has to be recalculated, e.g. after a Remove() or Sort() it will be reset to the last non-empty slot. If last is -2 this will force the recalculation of the last used slot. If last is -1, this effectively truncate the array completely.

Definition at line 774 of file TObjArray.cxx.

◆ SetName()

void TCollection::SetName ( const char * name)
inlineinherited

Definition at line 208 of file TCollection.h.

◆ SetObjectStat()

void TObject::SetObjectStat ( Bool_t stat)
staticinherited

Turn on/off tracking of objects in the TObjectTable.

Definition at line 1188 of file TObject.cxx.

◆ SetOwner()

void TClonesArray::SetOwner ( Bool_t enable = kTRUE)
overridevirtual

A TClonesArray is always the owner of the object it contains.

However the collection its inherits from (TObjArray) does not. Hence this member function needs to be a nop for TClonesArray.

Reimplemented from TCollection.

Definition at line 712 of file TClonesArray.cxx.

◆ SetUniqueID()

void TObject::SetUniqueID ( UInt_t uid)
virtualinherited

Set the unique object id.

Definition at line 899 of file TObject.cxx.

◆ size()

std::size_t TCollection::size ( ) const
inlineinherited

Definition at line 181 of file TCollection.h.

◆ Sort()

void TClonesArray::Sort ( Int_t upto = kMaxInt)
overridevirtual

If objects in array are sortable (i.e.

IsSortable() returns true for all objects) then sort array.

Reimplemented from TObjArray.

Definition at line 721 of file TClonesArray.cxx.

◆ StartGarbageCollection()

void TCollection::StartGarbageCollection ( )
staticinherited

Set up for garbage collection.

Definition at line 727 of file TCollection.cxx.

◆ Streamer()

void TClonesArray::Streamer ( TBuffer & b)
overridevirtual

Write all objects in array to the I/O buffer.

ATTENTION: empty slots are also stored (using one byte per slot). If you don't want this use a TOrdCollection or TList.

Reimplemented from TObject.

Definition at line 744 of file TClonesArray.cxx.

◆ StreamerNVirtual()

void TClonesArray::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 88 of file TClonesArray.h.

◆ SysError()

void TObject::SysError ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue system error message.

Use "location" to specify the method where the system error occurred. Accepts standard printf formatting arguments.

Definition at line 1112 of file TObject.cxx.

◆ TestBit()

Bool_t TObject::TestBit ( UInt_t f) const
inlineinherited

Definition at line 204 of file TObject.h.

◆ TestBits()

Int_t TObject::TestBits ( UInt_t f) const
inlineinherited

Definition at line 205 of file TObject.h.

◆ UncheckedAt()

TObject * TObjArray::UncheckedAt ( Int_t i) const
inlineinherited

Definition at line 90 of file TObjArray.h.

◆ UnSort()

void TSeqCollection::UnSort ( )
inlineinherited

Definition at line 65 of file TSeqCollection.h.

◆ UseCurrentStyle()

void TObject::UseCurrentStyle ( )
virtualinherited

Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.

Reimplemented in TAxis3D, TCanvas, TFrame, TGraph, TH1, TPad, TPaveStats, TPaveText, and TTree.

Definition at line 909 of file TObject.cxx.

◆ UseRWLock()

bool TCollection::UseRWLock ( Bool_t enable = true)
virtualinherited

Set this collection to use a RW lock upon access, making it thread safe.

Return the previous state.

Note: To test whether the usage is enabled do: collection->TestBit(TCollection::kUseRWLock);

Reimplemented in THashList.

Definition at line 792 of file TCollection.cxx.

◆ Warning()

void TObject::Warning ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue warning message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1084 of file TObject.cxx.

◆ Write() [1/2]

Int_t TCollection::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 ) const
overridevirtualinherited

Write all objects in this collection.

By default all objects in the collection are written individually (each object gets its own key). Note, this is recursive, i.e. objects in collections in the collection are also written individually. To write all objects using a single key specify a name and set option to TObject::kSingleKey (i.e. 1).

Reimplemented from TObject.

Reimplemented in TMap.

Definition at line 679 of file TCollection.cxx.

◆ Write() [2/2]

Int_t TCollection::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 )
overridevirtualinherited

Write all objects in this collection.

By default all objects in the collection are written individually (each object gets its own key). Note, this is recursive, i.e. objects in collections in the collection are also written individually. To write all objects using a single key specify a name and set option to TObject::kSingleKey (i.e. 1).

Reimplemented from TObject.

Reimplemented in TMap.

Definition at line 703 of file TCollection.cxx.

Member Data Documentation

◆ fBits

UInt_t TObject::fBits
privateinherited

bit field status word

Definition at line 47 of file TObject.h.

◆ fClass

TClass* TClonesArray::fClass
protected

!Pointer to the class of the elements

Definition at line 32 of file TClonesArray.h.

◆ fCont

TObject** TObjArray::fCont
protectedinherited

!Array contents

Definition at line 37 of file TObjArray.h.

◆ fgCurrentCollection

TCollection * TCollection::fgCurrentCollection = nullptr
staticprivateinherited

Definition at line 134 of file TCollection.h.

◆ fgDtorOnly

Longptr_t TObject::fgDtorOnly = 0
staticprivateinherited

object for which to call dtor only (i.e. no delete)

Definition at line 49 of file TObject.h.

◆ fgEmptyingGarbage

Bool_t TCollection::fgEmptyingGarbage = kFALSE
staticprivateinherited

Definition at line 136 of file TCollection.h.

◆ fgGarbageCollection

TObjectTable * TCollection::fgGarbageCollection = nullptr
staticprivateinherited

Definition at line 135 of file TCollection.h.

◆ fgGarbageStack

Int_t TCollection::fgGarbageStack = 0
staticprivateinherited

Definition at line 137 of file TCollection.h.

◆ fgObjectStat

Bool_t TObject::fgObjectStat = kTRUE
staticprivateinherited

if true keep track of objects in TObjectTable

Definition at line 50 of file TObject.h.

◆ fKeep

TObjArray* TClonesArray::fKeep
protected

!Saved copies of pointers to objects

Definition at line 33 of file TClonesArray.h.

◆ fLast

Int_t TObjArray::fLast
protectedinherited

Definition at line 39 of file TObjArray.h.

◆ fLowerBound

Int_t TObjArray::fLowerBound
protectedinherited

Definition at line 38 of file TObjArray.h.

◆ fName

TString TCollection::fName
protectedinherited

Definition at line 149 of file TCollection.h.

◆ fSize

Int_t TCollection::fSize
protectedinherited

Definition at line 150 of file TCollection.h.

◆ fSorted

Bool_t TSeqCollection::fSorted
protectedinherited

Definition at line 31 of file TSeqCollection.h.

◆ fUniqueID

UInt_t TObject::fUniqueID
privateinherited

object unique identifier

Definition at line 46 of file TObject.h.


The documentation for this class was generated from the following files: