KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
List of all members | Public Member Functions | Private Member Functions | Private Attributes | List of all members
KVNumberList Class Reference

Strings used to represent a set of ranges of values.

Handles lists of positive numbers such as "15-17 1-12 14" or "345,356-390". Strings with this format can be handled and analysed by this class. They can also be iterated over. Note that the numbers in the initializing string do not have to be in ascending order, or indeed unique. The resulting KVNumberList will contain only the unique values in ascending order.

Examples

Create a new list with one of the constructors:

KVNumberList a("1-20, 51, 52-56");
KVNumberList i{1,5,11,3,2}; // C++11 initializer list
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:83
auto * a

Change an existing list:

a.SetList("1001 1003-1005,1010")

Get first and last values of ranges in list (i.e. largest and smallest included values)

a.First() (would give 1001 for previous example)
a.Last() (would give 1010 for previous example)

Get a vector filled with all values corresponding to ranges defined in list:

std::vector<int> val = a.GetArray():

val[0] is same value as a.First(). val[n-1] is same value as a.Last().

Use AsString() or GetList() method to obtain list in its most compact form, using the "1-20, 51, 52-56" format.

IsEmpty() returns kTRUE if the list is empty ;-p

Iterating over all numbers in the list

Initialise first by calling Begin(), then loop until End() returns kTRUE:

KVNumberList r("1-10");
r.Begin();
while( !r.End() ){
Int_t next_val = r.Next();
...
}
int Int_t
ROOT::R::TRInterface & r

If list is empty, End() always returns kTRUE and Next() returns -1.

Methods begin() and end() return a std:iterator for the underlying std::vector<int>. This means (from C++11 onwards), range-based for loops can be used:

KVNumberList pl("1-3,6");
for(auto i : pl) cout << i << " ";
Examples
KVEvent_iterator_example.C, base_kvnumberlist.C, and db_sqlite_examples.C.

Definition at line 83 of file KVNumberList.h.

Public Member Functions

 KVNumberList ()
 Default constructor. More...
 
 KVNumberList (const Char_t *)
 
 KVNumberList (const KVNumberList &)
 Copy constructor. More...
 
 KVNumberList (Int_t deb, Int_t fin, Int_t pas)
 
 KVNumberList (Int_t)
 Initialise number list using single number. More...
 
 KVNumberList (std::initializer_list< int > L)
 Use an initializer list of integers to set up number list. More...
 
virtual ~KVNumberList ()
 
void Add (const IntArray &)
 Add all values in IntArray (=std::vector<int>) to the list. More...
 
void Add (const KVNumberList &)
 Add values in 'list' to this list. More...
 
void Add (Int_t)
 Add value 'n' to the list. More...
 
void Add (Int_t, Int_t *)
 Add n values from array arr to the list. More...
 
const Char_tAsHumanReadableString () const
 
const Char_tAsQuotedString () const
 
const Char_tAsString (Int_t maxchars=0) const
 
Int_t At (Int_t index) const
 
IntArrayIter begin () const
 
void Begin (void) const
 
void Clear (Option_t *="")
 Empty number list, reset it to initial state. More...
 
Bool_t Contains (Int_t val) const
 returns kTRUE if the value 'val' is contained in the ranges defined by the number list More...
 
void Copy (TObject &) const
 Copy content of this number list into 'o'. More...
 
TListCutInSubList (Int_t number)
 
IntArrayIter end () const
 
Bool_t End (void) const
 
Int_t First () const
 Returns smallest number included in list. More...
 
IntArray GetArray () const
 
KVNumberList GetComplementaryList () const
 
Int_t GetEntries () const
 
const Char_tGetExpandedList () const
 
const Char_tGetList () const
 
TString GetLogical (const Char_t *observable) const
 
virtual const char * GetName () const
 
Int_t GetNValues () const
 
Int_t GetRandom () const
 
Int_t GetRandomFast () const
 
TString GetSQL (const Char_t *column) const
 
KVNumberList GetSubList (Int_t vinf, Int_t vsup) const
 
void Inter (const KVNumberList &list)
 
Bool_t IsEmpty () const
 
Bool_t IsFull (Int_t vinf=-1, Int_t vsup=-1) const
 
Int_t Last () const
 Returns largest number included in list. More...
 
Int_t Next (void) const
 
 operator const char * () const
 
bool operator!= (const KVNumberList &) const
 Inequality test for number lists. More...
 
KVNumberList operator+ (const KVNumberList &) const
 Return sum of this list and the other one. More...
 
KVNumberList operator- (const KVNumberList &) const
 
bool operator== (const KVNumberList &) const
 Equality test for number lists. More...
 
Int_t operator[] (Int_t index) const
 
Bool_t PrepareRandomFast () const
 
void Print (Option_t *="") const
 
void PrintLimits () const
 
void Remove (const Char_t *)
 Remove values in 'list' to this list. More...
 
void Remove (const KVNumberList &)
 Remove values in 'list' from this list. More...
 
void Remove (Int_t n, Int_t *arr)
 Remove n values from array arr to the list. More...
 
void Remove (Int_t)
 Remove value 'n' from the list. More...
 
void Set (const TString &l)
 
void Set (Int_t min, Int_t max, Int_t pas=1)
 
void SetList (const TString &)
 
void SetMinMax (Int_t min, Int_t max, Int_t pas=1)
 Set list with all values from 'min' to 'max'. More...
 
virtual void SetName (const char *name)
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 
virtual ~TObject ()
 
void AbstractMethod (const char *method) const
 
virtual void AppendPad (Option_t *option="")
 
virtual void Browse (TBrowser *b)
 
ULong_t CheckedHash ()
 
virtual const char * ClassName () const
 
virtual TObjectClone (const char *newname="") const
 
virtual Int_t Compare (const TObject *obj) const
 
virtual void Delete (Option_t *option="")
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 
virtual void Draw (Option_t *option="")
 
virtual void DrawClass () const
 
virtual TObjectDrawClone (Option_t *option="") const
 
virtual void Dump () const
 
virtual void Error (const char *method, const char *msgfmt,...) const
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 
virtual TObjectFindObject (const char *name) const
 
virtual TObjectFindObject (const TObject *obj) const
 
virtual Option_tGetDrawOption () const
 
virtual const char * GetIconName () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 
virtual UInt_t GetUniqueID () const
 
virtual Bool_t HandleTimer (TTimer *timer)
 
virtual ULong_t Hash () const
 
Bool_t HasInconsistentHash () const
 
virtual void Info (const char *method, const char *msgfmt,...) const
 
virtual Bool_t InheritsFrom (const char *classname) const
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 
virtual void Inspect () const
 
void InvertBit (UInt_t f)
 
virtual Bool_t IsEqual (const TObject *obj) const
 
virtual Bool_t IsFolder () const
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 
void MayNotUse (const char *method) const
 
virtual Bool_t Notify ()
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 
void operator delete (void *ptr)
 
void operator delete[] (void *ptr)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 
virtual void Paint (Option_t *option="")
 
virtual void Pop ()
 
virtual Int_t Read (const char *name)
 
virtual void RecursiveRemove (TObject *obj)
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 
virtual void SetDrawOption (Option_t *option="")
 
virtual void SetUniqueID (UInt_t uid)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 

Private Member Functions

void AddLimits (Int_t min, Int_t max)
 
void AddLimits (TString &string)
 
void clear ()
 private method called by ParseList() More...
 
void init_numberlist ()
 Default initialisation used by ctors. More...
 
void ParseAndFindLimits (const TString &string, const Char_t delim)
 
void ParseList ()
 

Private Attributes

IntArrayIter fEndList
 used by Next() & End() to iterate over list More...
 
Int_t fFirstValue
 smallest value included in list More...
 
Bool_t fIsParsed
 
IntArrayIter fIterIndex
 used by Next() to iterate over list More...
 
Int_t fLastValue
 largest value included in list More...
 
TArrayI fLowerBounds
 
Int_t fMaxNLimits
 size of arrays More...
 
TString fName
 name of the list More...
 
Int_t fNLimits
 number of limits in arrays More...
 
Int_t fNValues
 total number of values included in ranges More...
 
IntArray fRandomFastArray
 used by GetRandomFast() More...
 
TString fString
 
TString fTMPSTR
 dummy string to compute AsString (non static) More...
 
TArrayI fUpperBounds
 
IntArray fValues
 used by Next() to iterate over list More...
 

Additional Inherited Members

- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 
- Static Public Member Functions inherited from TObject
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 
- Public Attributes inherited from TObject
 kBitMask
 
 kCanDelete
 
 kCannotPick
 
 kHasUUID
 
 kInconsistent
 
 kInvalidObject
 
 kIsOnHeap
 
 kIsReferenced
 
 kMustCleanup
 
 kNoContextMenu
 
 kNotDeleted
 
 kObjInCanvas
 
 kOverwrite
 
 kSingleKey
 
 kWriteDelete
 
 kZombie
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 
void MakeZombie ()
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 

#include <KVNumberList.h>

Inheritance diagram for KVNumberList:
Inheritance graph
[legend]

Constructor & Destructor Documentation

◆ KVNumberList() [1/6]

KVNumberList::KVNumberList ( )

Default constructor.

Definition at line 36 of file KVNumberList.cpp.

◆ KVNumberList() [2/6]

KVNumberList::KVNumberList ( const KVNumberList orig)

Copy constructor.

Definition at line 48 of file KVNumberList.cpp.

◆ KVNumberList() [3/6]

KVNumberList::KVNumberList ( const Char_t list)

Initialise number list using string and parse it to fill limits arrays Any number will only appear once.

Definition at line 62 of file KVNumberList.cpp.

◆ KVNumberList() [4/6]

KVNumberList::KVNumberList ( Int_t  x)

Initialise number list using single number.

Definition at line 75 of file KVNumberList.cpp.

◆ KVNumberList() [5/6]

KVNumberList::KVNumberList ( Int_t  deb,
Int_t  fin,
Int_t  pas 
)

Initialise number list using numbers from deb to fin with a step=pas i.e. deb,deb+pas,deb+2*pas,...,fin

Definition at line 89 of file KVNumberList.cpp.

◆ KVNumberList() [6/6]

KVNumberList::KVNumberList ( std::initializer_list< int >  L)

Use an initializer list of integers to set up number list.

Definition at line 103 of file KVNumberList.cpp.

◆ ~KVNumberList()

virtual KVNumberList::~KVNumberList ( )
inlinevirtual

Definition at line 121 of file KVNumberList.h.

Member Function Documentation

◆ Add() [1/4]

void KVNumberList::Add ( const IntArray v)

Add all values in IntArray (=std::vector<int>) to the list.

Definition at line 526 of file KVNumberList.cpp.

◆ Add() [2/4]

void KVNumberList::Add ( const KVNumberList list)

Add values in 'list' to this list.

Definition at line 464 of file KVNumberList.cpp.

◆ Add() [3/4]

void KVNumberList::Add ( Int_t  n)

Add value 'n' to the list.

Examples
KVEvent_iterator_example.C, and db_sqlite_examples.C.

Definition at line 436 of file KVNumberList.cpp.

◆ Add() [4/4]

void KVNumberList::Add ( Int_t  n,
Int_t arr 
)

Add n values from array arr to the list.

Definition at line 509 of file KVNumberList.cpp.

◆ AddLimits() [1/2]

void KVNumberList::AddLimits ( Int_t  min,
Int_t  max 
)
private

The numbers contained in the range [min,max] are added to the list.

Definition at line 240 of file KVNumberList.cpp.

◆ AddLimits() [2/2]

void KVNumberList::AddLimits ( TString string)
private

'string' should contain something like "34-59" i.e. two integers separated by a '-'. these two numbers are taken for new lower and upper limits, fNLimits is increased by one, if necessary the arrays' size is increased.

Definition at line 218 of file KVNumberList.cpp.

◆ AsHumanReadableString()

const Char_t * KVNumberList::AsHumanReadableString ( ) const

Definition at line 1045 of file KVNumberList.cpp.

◆ AsQuotedString()

const Char_t * KVNumberList::AsQuotedString ( ) const

Get a string containing the compact representation of the list, enclosed by single quotes, i.e. if AsString() returns "1 3 5-7", this method will return "'1 3 5-7'"

Definition at line 1028 of file KVNumberList.cpp.

◆ AsString()

const Char_t * KVNumberList::AsString ( Int_t  maxlen = 0) const

Get string containing list. This is most compact representation possible, i.e. all continuous ranges are represented as "minval-maxval". If maxlen>0, and if length of resulting string is longer than maxlen, we truncate the list to show only the beginning and the end of the list, with "..." in between, i.e. "6000-...-8910". Note that the minimum size of the resulting string is 5 i.e. "6...0". Returns empty string if list is empty.

Examples
KVEvent_iterator_example.C, base_kvnumberlist.C, and db_sqlite_examples.C.

Definition at line 995 of file KVNumberList.cpp.

◆ At()

Int_t KVNumberList::At ( Int_t  index) const

Returns value of number in list at position 'index' (index = 0, 1, .., GetNValues()-1) We check that 'index' is neither too big nor too small (otherwise we return -1). WARNING: the list is first sorted into ascending order (and any duplicate entries are removed), so the index does not necessarily correspond to the order in which numbers are added to the list.

Examples
base_kvnumberlist.C.

Definition at line 943 of file KVNumberList.cpp.

◆ begin()

IntArrayIter KVNumberList::begin ( ) const

Returns a std::iterator over all unique values in the list, ordered from smallest to largest. Allows use in range-based for loops:

KVNumberList pl("1-3,6");
for(auto i : pl) cout << i << " ";
//output:
//1 2 3 6

Definition at line 897 of file KVNumberList.cpp.

◆ Begin()

void KVNumberList::Begin ( void  ) const

Call before using Next(). Resets iterator to beginning of list. If list is empty, End() always returns kTRUE and Next() returns -1.

Definition at line 873 of file KVNumberList.cpp.

◆ clear()

void KVNumberList::clear ( )
private

private method called by ParseList()

Definition at line 148 of file KVNumberList.cpp.

◆ Clear()

void KVNumberList::Clear ( Option_t = "")
virtual

Empty number list, reset it to initial state.

Reimplemented from TObject.

Examples
db_sqlite_examples.C.

Definition at line 136 of file KVNumberList.cpp.

◆ Contains()

Bool_t KVNumberList::Contains ( Int_t  val) const

returns kTRUE if the value 'val' is contained in the ranges defined by the number list

Definition at line 341 of file KVNumberList.cpp.

◆ Copy()

void KVNumberList::Copy ( TObject o) const
virtual

Copy content of this number list into 'o'.

Reimplemented from TObject.

Definition at line 799 of file KVNumberList.cpp.

◆ CutInSubList()

TList * KVNumberList::CutInSubList ( Int_t  number)

Create sublist of KVNumberList with "number" values TList object has to be deleted after use by the user

Definition at line 1250 of file KVNumberList.cpp.

◆ end()

IntArrayIter KVNumberList::end ( ) const

Returns a std::iterator to element after end of list. Allows use in range-based for loops.

See also
begin()

Definition at line 924 of file KVNumberList.cpp.

◆ End()

Bool_t KVNumberList::End ( void  ) const
inline

Definition at line 197 of file KVNumberList.h.

◆ First()

Int_t KVNumberList::First ( ) const

Returns smallest number included in list.

Definition at line 358 of file KVNumberList.cpp.

◆ GetArray()

IntArray KVNumberList::GetArray ( ) const

Creates and fills a sorted array with all the unique values compatible with the ranges defined in the list. (Sorting is in increasing order).

Definition at line 386 of file KVNumberList.cpp.

◆ GetComplementaryList()

KVNumberList KVNumberList::GetComplementaryList ( ) const

Return the complementary of the list ie for "123-127 129" it will be returned "128"

Examples
base_kvnumberlist.C.

Definition at line 1171 of file KVNumberList.cpp.

◆ GetEntries()

Int_t KVNumberList::GetEntries ( ) const
inline

Definition at line 169 of file KVNumberList.h.

◆ GetExpandedList()

const Char_t * KVNumberList::GetExpandedList ( ) const

Get string containing list. Every unique value contained in the list will be represented. Returns empty string if list is empty.

Examples
base_kvnumberlist.C.

Definition at line 686 of file KVNumberList.cpp.

◆ GetList()

const Char_t * KVNumberList::GetList ( ) const

Get string containing list. This is most compact representation possible, i.e. all continuous ranges are represented as "minval-maxval" This string will become the new internal representation of the list. Returns empty string if list is empty.

Examples
base_kvnumberlist.C.

Definition at line 629 of file KVNumberList.cpp.

◆ GetLogical()

TString KVNumberList::GetLogical ( const Char_t observable) const

Get logical expression of 'this' list in the TTree:Draw condition format observable is one of the leaf of the TTree 12-15 20 --> ( 12<=observable&&observable<=15 || observable==20 ) return "" if 'this' list is empty

Examples
base_kvnumberlist.C.

Definition at line 724 of file KVNumberList.cpp.

◆ GetName()

virtual const char* KVNumberList::GetName ( ) const
inlinevirtual

Reimplemented from TObject.

Definition at line 126 of file KVNumberList.h.

◆ GetNValues()

Int_t KVNumberList::GetNValues ( ) const

Returns total number of unique entries in list Note that this calls GetArray() just in order to remove any duplicate entries in the list and make sure fNValues is the number of unique entries.

Definition at line 815 of file KVNumberList.cpp.

◆ GetRandom()

Int_t KVNumberList::GetRandom ( ) const

Draw number at random from list

Warning: this method is slow as each time it is called the number list will be sorted.

For a more efficient method, see GetRandomFast().

Definition at line 1071 of file KVNumberList.cpp.

◆ GetRandomFast()

Int_t KVNumberList::GetRandomFast ( ) const

Draw number at random from list

Unlike GetRandom(), the list is not sorted every time the method is called. Rather, this must be done once by calling PrepareRandomFast() first before calling this method.

Check that PrepareRandomFast() returns kTRUE: if not, the list is empty and calling GetRandomFast() will lead to segmentation violation...

Definition at line 1093 of file KVNumberList.cpp.

◆ GetSQL()

TString KVNumberList::GetSQL ( const Char_t column) const

Get equivalent for SQL 'WHERE' clause e.g. 12-15 20 --> column BETWEEN 12 AND 15 OR column=20 (column name will be correctly quoted in case it contains spaces) return "" if 'this' list is empty

Examples
db_sqlite_examples.C.

Definition at line 762 of file KVNumberList.cpp.

◆ GetSubList()

KVNumberList KVNumberList::GetSubList ( Int_t  vinf,
Int_t  vsup 
) const

Return the sublist of numbers between vinf and vsup i.e. put in the sublist val if vinf <= val <= vsup if vinf=-1, put no lower limit if vsup=-1, put no upper limit if vinf = vsup = -1, just clone the list i.e. "123-135 145-456",130,400 it will be returned "130-135 145-400"

Examples
base_kvnumberlist.C.

Definition at line 1194 of file KVNumberList.cpp.

◆ init_numberlist()

void KVNumberList::init_numberlist ( )
private

Default initialisation used by ctors.

Definition at line 18 of file KVNumberList.cpp.

◆ Inter()

void KVNumberList::Inter ( const KVNumberList list)

keep the AND logic operation result between 'list' and this list i.e. keep only numbers which appear in both lists

Definition at line 593 of file KVNumberList.cpp.

◆ IsEmpty()

Bool_t KVNumberList::IsEmpty ( ) const
inline

Definition at line 173 of file KVNumberList.h.

◆ IsFull()

Bool_t KVNumberList::IsFull ( Int_t  vinf = -1,
Int_t  vsup = -1 
) const

Return kTRUE if the list is in fact a continuous list of number ie "123-126" or "1,2,3,4" etc ... Use vinf et vsup if you want to test only a sub part of the list by default vinf=vsup=-1 and the whole list is considered in the test ie : for "123-127 129" it will be returned kFALSE for "123-127 129",-1,-1 it will be returned kFALSE for "123-127 129",123,127 it will be returned kTRUE for "123-127 129",-1,127 it will be returned kTRUE for "123-127 129",127,-1 it will be returned kFALSE

Definition at line 1141 of file KVNumberList.cpp.

◆ Last()

Int_t KVNumberList::Last ( ) const

Returns largest number included in list.

Definition at line 371 of file KVNumberList.cpp.

◆ Next()

Int_t KVNumberList::Next ( void  ) const

Use this method to iterate over all numbers in the list Initialise first by calling Begin(), then loop until End() returns kTRUE:

KVNumberList r("1-10"); r.Begin(); while( !r.End() ){ Int_t next_val = r.Next(); ... } If list is empty, End() always returns kTRUE and Next() returns -1.

Definition at line 841 of file KVNumberList.cpp.

◆ operator const char *()

KVNumberList::operator const char * ( ) const
inline

Definition at line 215 of file KVNumberList.h.

◆ operator!=()

bool KVNumberList::operator!= ( const KVNumberList other) const

Inequality test for number lists.

Definition at line 313 of file KVNumberList.cpp.

◆ operator+()

KVNumberList KVNumberList::operator+ ( const KVNumberList other) const

Return sum of this list and the other one.

Definition at line 543 of file KVNumberList.cpp.

◆ operator-()

KVNumberList KVNumberList::operator- ( const KVNumberList other) const

Returns difference between 'this' and 'other' i.e. 'this' list with any values in 'other' removed

Definition at line 1224 of file KVNumberList.cpp.

◆ operator==()

bool KVNumberList::operator== ( const KVNumberList other) const

Equality test for number lists.

Definition at line 301 of file KVNumberList.cpp.

◆ operator[]()

Int_t KVNumberList::operator[] ( Int_t  index) const

Returns value of number in list at position 'index' (index = 0, 1, .., GetNValues()-1) We check that 'index' is neither too big nor too small (otherwise we return -1). WARNING: the list is first sorted into ascending order (and any duplicate entries are removed), so the index does not necessarily correspond to the order in which numbers are added to the list.

Definition at line 972 of file KVNumberList.cpp.

◆ ParseAndFindLimits()

void KVNumberList::ParseAndFindLimits ( const TString string,
const Char_t  delim 
)
private

Takes a string and breaks it up into its constituent parts, which were initially separated by white space or a comma. Any part which contains "-" will be sent to AddLimits().

Definition at line 186 of file KVNumberList.cpp.

◆ ParseList()

void KVNumberList::ParseList ( )
private

PRIVATE METHOD Breaks string containing list down and fills limits arrays accordingly

Definition at line 119 of file KVNumberList.cpp.

◆ PrepareRandomFast()

Bool_t KVNumberList::PrepareRandomFast ( ) const

Call once before using GetRandomFast() in order to generate random numbers from the list.

If this method returns kFALSE, do not use GetRandomFast() as the list is empty (seg fault will occur).

Definition at line 1114 of file KVNumberList.cpp.

◆ Print()

void KVNumberList::Print ( Option_t = "") const
virtual

Reimplemented from TObject.

Examples
base_kvnumberlist.C.

Definition at line 1238 of file KVNumberList.cpp.

◆ PrintLimits()

void KVNumberList::PrintLimits ( ) const

Print detailed break-down of list remove duplicate entries, correct fList, then re-parse

Definition at line 266 of file KVNumberList.cpp.

◆ Remove() [1/4]

void KVNumberList::Remove ( const Char_t list)

Remove values in 'list' to this list.

Definition at line 496 of file KVNumberList.cpp.

◆ Remove() [2/4]

void KVNumberList::Remove ( const KVNumberList list)

Remove values in 'list' from this list.

Definition at line 478 of file KVNumberList.cpp.

◆ Remove() [3/4]

void KVNumberList::Remove ( Int_t  n,
Int_t arr 
)

Remove n values from array arr to the list.

Definition at line 558 of file KVNumberList.cpp.

◆ Remove() [4/4]

void KVNumberList::Remove ( Int_t  n)

Remove value 'n' from the list.

Definition at line 450 of file KVNumberList.cpp.

◆ Set() [1/2]

void KVNumberList::Set ( const TString l)
inline

Definition at line 133 of file KVNumberList.h.

◆ Set() [2/2]

void KVNumberList::Set ( Int_t  min,
Int_t  max,
Int_t  pas = 1 
)
inline

Definition at line 137 of file KVNumberList.h.

◆ SetList()

void KVNumberList::SetList ( const TString list)

Replace internal string representation of number list List will be parsed before any subsequent operations

Definition at line 327 of file KVNumberList.cpp.

◆ SetMinMax()

void KVNumberList::SetMinMax ( Int_t  min,
Int_t  max,
Int_t  pas = 1 
)

Set list with all values from 'min' to 'max'.

Definition at line 575 of file KVNumberList.cpp.

◆ SetName()

void KVNumberList::SetName ( const char *  name)
virtual

Change (i.e. set) the name of the KVNumberList. WARNING: if the object is a member of a THashTable or THashList container the container must be Rehash()'ed after SetName(). For example the list of objects in the current directory is a THashList.

Definition at line 169 of file KVNumberList.cpp.

Member Data Documentation

◆ fEndList

IntArrayIter KVNumberList::fEndList
mutableprivate

used by Next() & End() to iterate over list

Definition at line 97 of file KVNumberList.h.

◆ fFirstValue

Int_t KVNumberList::fFirstValue
private

smallest value included in list

Definition at line 90 of file KVNumberList.h.

◆ fIsParsed

Bool_t KVNumberList::fIsParsed
mutableprivate

Definition at line 101 of file KVNumberList.h.

◆ fIterIndex

IntArrayIter KVNumberList::fIterIndex
mutableprivate

used by Next() to iterate over list

Definition at line 96 of file KVNumberList.h.

◆ fLastValue

Int_t KVNumberList::fLastValue
private

largest value included in list

Definition at line 91 of file KVNumberList.h.

◆ fLowerBounds

TArrayI KVNumberList::fLowerBounds
private

Definition at line 86 of file KVNumberList.h.

◆ fMaxNLimits

Int_t KVNumberList::fMaxNLimits
private

size of arrays

Definition at line 89 of file KVNumberList.h.

◆ fName

TString KVNumberList::fName
private

name of the list

Definition at line 99 of file KVNumberList.h.

◆ fNLimits

Int_t KVNumberList::fNLimits
private

number of limits in arrays

Definition at line 88 of file KVNumberList.h.

◆ fNValues

Int_t KVNumberList::fNValues
mutableprivate

total number of values included in ranges

Definition at line 92 of file KVNumberList.h.

◆ fRandomFastArray

IntArray KVNumberList::fRandomFastArray
mutableprivate

used by GetRandomFast()

Definition at line 102 of file KVNumberList.h.

◆ fString

TString KVNumberList::fString
mutableprivate

Definition at line 85 of file KVNumberList.h.

◆ fTMPSTR

TString KVNumberList::fTMPSTR
mutableprivate

dummy string to compute AsString (non static)

Definition at line 94 of file KVNumberList.h.

◆ fUpperBounds

TArrayI KVNumberList::fUpperBounds
private

Definition at line 87 of file KVNumberList.h.

◆ fValues

IntArray KVNumberList::fValues
mutableprivate

used by Next() to iterate over list

Definition at line 98 of file KVNumberList.h.


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