|
ROOT
Reference Guide |
|
Go to the documentation of this file.
16 #ifndef ROO_ABS_COLLECTION
17 #define ROO_ABS_COLLECTION
26 #include <unordered_map>
83 template<
class forwardIt>
85 for (forwardIt it = rangeBegin; it != rangeEnd; ++it) {
86 static_assert(std::is_same<
87 typename std::iterator_traits<forwardIt>::value_type,
88 RooAbsArg*>::value,
"Can only remove lists of RooAbsArg*.");
89 auto castedElm =
static_cast<RooAbsArg*
>(*it);
90 remove(*castedElm, silent, matchByNameOnly);
104 return find(var) !=
nullptr;
140 return _list.begin();
147 Storage_t::const_reverse_iterator
rbegin()
const {
148 return _list.rbegin();
151 Storage_t::const_reverse_iterator
rend()
const {
155 Storage_t::size_type
size()
const {
160 return _list.empty();
164 _list.reserve(count);
179 return _list.front();
189 auto item = std::find(
_list.begin(),
_list.end(), arg);
190 return item !=
_list.end() ? item -
_list.begin() : -1;
207 virtual void printName(std::ostream& os)
const ;
208 virtual void printTitle(std::ostream& os)
const ;
210 virtual void printValue(std::ostream& os)
const ;
275 mutable std::unique_ptr<std::unordered_map<const TNamed*, Storage_t::value_type>>
_nameToItemMap;
virtual void RecursiveRemove(TObject *obj)
If one of the TObject we have a referenced to is deleted, remove the reference.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default RooPrinable print options for given Print() flag string For inline printing only show ...
TNamed * _typedStructureTag
Structure tag.
RooAbsArg * first() const
const char * Data() const
RooAbsCollection & assignValueOnly(const RooAbsCollection &other, Bool_t oneSafe=kFALSE)
The assignment operator sets the value of any argument in our set that also appears in the other set.
RooFIter fwdIterator() const
One-time forward iterator.
RooAbsArg * tryFastFind(const TNamed *namePtr) const
Perform a search in a hash map.
static void output(int code)
Storage_t::const_reverse_iterator rend() const
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
#define R__SUGGEST_ALTERNATIVE(ALTERNATIVE)
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual void printClassName(std::ostream &os) const
Return collection class name.
RooAbsArg * operator[](Storage_t::size_type i) const
static void indent(ostringstream &buf, int indent_level)
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Implement multiline printing of collection, one line for each contained object showing the requested ...
Storage_t::const_iterator const_iterator
void makeTypedStructureTag()
Bool_t addServerClonesToList(const RooAbsArg &var)
Add clones of servers of given argument to end of list.
const char * GetName() const
Returns name of object.
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
void useHashMapForFind(bool flag) const
Install an internal hash map for fast finding of elements by name.
virtual void printTitle(std::ostream &os) const
Return collection title.
RooAbsCollection & operator=(const RooAbsCollection &other)
The assignment operator sets the value of any argument in our set that also appears in the other set.
Bool_t containsInstance(const RooAbsArg &var) const
Check if this exact instance is in this collection.
Iterator abstract base class.
std::size_t _sizeThresholdForMapSearch
RooLinkedListIter iterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
const Bool_t kIterForward
void setName(const char *name)
RooAbsCollection * selectByName(const char *nameList, Bool_t verbose=kFALSE) const
Create a subset of the current collection, consisting only of those elements with names matching the ...
Bool_t contains(const RooAbsArg &var) const
Check if collection contains an argument with the same name as var.
A wrapper around TIterator derivatives.
Int_t getHashTableSize() const
Query the size at which the collection will automatically start using an extra lookup table instead o...
virtual TObject * create(const char *newname) const =0
RooAbsCollection()
Default constructor.
void dump() const
Base contents dumper for debugging purposes.
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
The TNamed class is the base class for all named ROOT classes.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
virtual Bool_t replace(const RooAbsArg &var1, const RooAbsArg &var2)
Replace var1 with var2 and return kTRUE for success.
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
void printLatex(const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg()) const
Output content of collection as LaTex table.
Storage_t::size_type size() const
virtual void printValue(std::ostream &os) const
Print value of collection, i.e.
const_iterator end() const
TNamed * typedStructureTag()
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual ~RooAbsCollection()
Destructor.
const_iterator begin() const
Bool_t equals(const RooAbsCollection &otherColl) const
Check if this and other collection have identically-named contents.
Storage_t::const_reverse_iterator rbegin() const
void forward(const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
apply the weights (and functions) in forward direction of the DNN
Mother of all ROOT objects.
void remove(forwardIt rangeBegin, forwardIt rangeEnd, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
#define ClassDef(name, id)
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
std::unique_ptr< std::unordered_map< const TNamed *, Storage_t::value_type > > _nameToItemMap
void setHashTableSize(Int_t number)
Set the size at which the collection will automatically start using an extra lookup table instead of ...
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
void safeDeleteList()
Examine client server dependencies in list and delete contents in safe order: any client is deleted b...
Bool_t allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range.
virtual StyleOption defaultPrintStyle(Option_t *opt) const
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
Int_t index(const RooAbsArg &arg) const
Returns index of given arg, or -1 if arg is not in the collection.
Bool_t overlaps(const RooAbsCollection &otherColl) const
Check if this and other collection have common entries.
std::vector< RooAbsArg * > Storage_t
RooAbsCollection * selectByAttrib(const char *name, Bool_t value) const
Create a subset of the current collection, consisting only of those elements with the specified attri...
virtual void printName(std::ostream &os) const
Return collection name.
TIterator and GenericRooFIter front end with STL back end.
std::unique_ptr< LegacyIterator_t > makeLegacyIterator(bool forward=true) const
Factory for legacy iterators.
void reserve(Storage_t::size_type count)
void sort(Bool_t reverse=false)
Sort collection using std::sort and name comparison.
void insert(RooAbsArg *)
Insert an element into the owned collections.
Int_t index(const RooAbsArg *arg) const
Returns index of given arg, or -1 if arg is not in the collection.
void assignFast(const RooAbsCollection &other, Bool_t setValDirty=kTRUE)
Functional equivalent of operator=() but assumes this and other collection have same layout.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents.
virtual TObject * clone(const char *newname) const =0
void setAttribAll(const Text_t *name, Bool_t value=kTRUE)
Set given attribute in each element of the collection by calling each elements setAttribute() functio...
void clear()
Clear contents. If the collection is owning, it will also delete the contents.
std::string contentsString() const
Return comma separated list of contained object names as STL string.
void clearStructureTags()
Typed structure tag.