48 if (
auto arg =
dynamic_cast<RooAbsArg const *
>(obj))
49 return arg->namePtr();
51 return data->namePtr();
61 :
TObject(other), _hashThresh(other._hashThresh), _name(other._name), _useNptr(other._useNptr)
75 if (&other==
this)
return *this ;
93 coutE(InputArguments) <<
"RooLinkedList::setHashTable() ERROR size must be positive" << std::endl;
109 _htableName->reserve(
size);
136 _list.push_back(arg);
146 auto found = std::find(
_list.begin(),
_list.end(), arg);
147 if (found ==
_list.end())
180 auto found = std::find(
_list.begin(),
_list.end(), oldArg);
181 if (found ==
_list.end())
188 *found =
const_cast<TObject *
>(newArg);
227 std::vector<TObject *> objects = std::move(
_list);
240 auto found = std::find_if(
_list.begin(),
_list.end(), [&](
TObject *obj) { return namePtr(obj) == nptr; });
241 return found !=
_list.end() ? *found :
nullptr;
247 return const_cast<TObject *
>(found->second);
259 return nptr ? findByNamePtr(nptr) :
nullptr;
262 auto found = std::find_if(
_list.begin(),
_list.end(), [&](
TObject *obj) { return !strcmp(obj->GetName(), name); });
263 return found !=
_list.end() ? *found :
nullptr;
294 auto found = std::find(
_list.begin(),
_list.end(), arg);
295 return found !=
_list.end() ? found -
_list.begin() : -1;
304 auto found = std::find_if(
_list.begin(),
_list.end(), [&](
TObject *obj) { return !strcmp(obj->GetName(), name); });
305 return found !=
_list.end() ? found -
_list.begin() : -1;
315 std::cout << obj <<
" : ";
326 auto iterImpl = std::make_unique<RooLinkedListIterImpl>(
this, forward);
336 auto iterImpl = std::make_unique<RooLinkedListIterImpl>(
this, forward);
345 auto iterImpl = std::make_unique<RooFIterForLinkedList>(
this);
346 return RooFIter(std::move(iterImpl));
354 return {
this, -1,
true};
358 return {
this,
false};
362 return {
this, -1,
false};
371 [ascend](
TObject *
a,
TObject *
b) { return ascend ? a->Compare(b) < 0 : b->Compare(a) < 0; });
394 if (
v > 1 &&
v < 4) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
short Version_t
Class version identifier (short)
const char Option_t
Option string (const char)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Common abstract base class for objects that represent a value and a "shape" in RooFit.
const TNamed * namePtr() const
De-duplicated pointer to this object's name.
Abstract base class for binned and unbinned datasets.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
Implementation of the actual iterator on RooLinkedLists.
A wrapper around TIterator derivatives.
Collection class for internal use, storing a collection of TObject pointers in a vector.
RooLinkedListIterImpl rend() const
TObject * At(int index) const
Return object stored in sequential position given by index.
RooLinkedListIter iterator(bool forward=true) const
Create an iterator for this list.
std::vector< TObject * > _list
! The stored objects
~RooLinkedList() override
Destructor.
RooLinkedListIterImpl end() const
std::unique_ptr< HashTableByName > _htableName
! Hash table by name
void RecursiveRemove(TObject *obj) override
If one of the TObject we have a referenced to is deleted, remove the reference.
bool Replace(const TObject *oldArg, const TObject *newArg)
Replace object 'oldArg' in collection with new object 'newArg'.
RooLinkedList(Int_t htsize=0)
void Print(const char *opt) const override
Print contents of list, defers to Print() function of contained objects.
RooFIter fwdIterator() const
Create a one-time-use forward iterator for this list.
void Streamer(TBuffer &) override
Custom streaming handling schema evolution w.r.t past implementations.
RooLinkedListIterImpl rbegin() const
TClass * IsA() const override
virtual void Add(TObject *arg)
Insert object into collection.
Int_t _hashThresh
Size threshold for hashing.
RooAbsArg * findArg(const RooAbsArg *) const
Return pointer to object with given name in collection.
void Delete(Option_t *o=nullptr) override
Remove all elements in collection and delete all elements NB: Collection does not own elements,...
TObject * find(const char *name) const
Return pointer to object with given name in collection.
RooLinkedList & operator=(const RooLinkedList &other)
Assignment operator, copy contents from 'other'.
RooLinkedListIterImpl begin() const
void setHashTableSize(Int_t size)
Change the threshold for hash-table use to given size.
TObject * FindObject(const char *name) const override
Return pointer to object with given name.
TIterator * MakeIterator(bool forward=true) const
Create a TIterator for this list.
void Clear(Option_t *o=nullptr) override
Remove all elements from collection.
void Sort(bool ascend=true)
Sort the list with TObject::Compare(), keeping the order of equal elements.
Int_t IndexOf(const char *name) const
Return position of given object in list.
virtual bool Remove(TObject *arg)
Remove object from collection.
static const TNamed * known(const char *inStr)
If the name is already known, return its TNamed pointer. Otherwise return 0 (don't register the name)...
@ kRenamedArg
TNamed flag to indicate that some RooAbsArg has been renamed (flag set in new name)
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
Iterator abstract base class.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.