54#if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
95 _list(other._list.getHashTableSize()) ,
98 _allRRV(other._allRRV)
106 while((arg= iterat.
next())) {
143 std::vector<RooAbsArg*> tmp;
150 while ((arg = it.
next())) {
152 if (!arg->
dependsOn(*
this, arg)) tmp.push_back(arg);
156 std::sort(tmp.begin(), tmp.end());
158 for (std::vector<RooAbsArg*>::iterator it = tmp.begin(),
159 end = std::unique(tmp.begin(), tmp.end()); end != it; ++it) {
168 <<
") WARNING: unable to delete following elements in client-server order " ;
198 if (TString(
GetName()).Length()>0) {
199 snapName.Append(
"Snapshot of ") ;
203 if (deepCopy ||
getSize()>1000) {
204 output->setHashTableSize(1000) ;
211 output->setHashTableSize(0) ;
237 while((0 != (orig= iterat.
next()))) {
249 while ((var=vIter.
next())) {
250 error |=
output.addServerClonesToList(*var) ;
256 coutE(
ObjectHandling) <<
"RooAbsCollection::snapshot(): Errors occurred in deep clone process, snapshot not created" << endl ;
262 vIter =
output.fwdIterator() ;
263 while ((var=vIter.
next())) {
284 while ((server=sIter.
next())) {
308 if (&other==
this)
return *this ;
312 while((elem=iter.
next())) {
313 theirs= other.
find(*elem);
314 if(!theirs)
continue;
330 if (&other==
this)
return *this ;
341 while((elem=iter.
next())) {
342 theirs= other.
find(*elem);
343 if(!theirs)
continue;
358 if (&other==
this) return ;
377 while((elem=iter.
next())) {
381 theirs= iter2.next() ;
478 for(
Int_t index= 0; index <
n; index++) {
496 for(
Int_t index= 0; index <
n; index++) {
512 for(
Int_t index= 0; index <
n; index++) {
527 coutE(
ObjectHandling) <<
"RooAbsCollection: cannot replace variables in a copied list" << endl;
538 if(found)
replace(*found,*arg);
555 coutE(
ObjectHandling) <<
"RooAbsCollection: cannot replace variables in a copied list" << endl;
564 <<
" and cannot be replaced" << endl;
572 if(other != 0 && other != &var1) {
574 <<
"\" with already existing \"" << var2.
GetName() <<
"\"" << endl;
610 if (matchByNameOnly) {
632 for(
Int_t index= 0; index <
n; index++) {
667 while ((arg=iter.
next())) {
683 selName.Append(
"_selection") ;
689 while ((arg=iter.
next())) {
709 selName.Append(
"_selection") ;
715 while ((arg=iter.
next())) {
716 if (refColl.
find(*arg))
734 selName.Append(
"_selection") ;
737 const size_t bufSize = strlen(nameList) + 1;
738 char* buf =
new char[bufSize] ;
739 strlcpy(buf,nameList,bufSize) ;
740 char* wcExpr = strtok(buf,
",") ;
749 while((arg=iter.
next())) {
750 if (TString(arg->
GetName()).Index(rexp)>=0) {
757 wcExpr = strtok(0,
",") ;
778 while((arg=iter.
next())) {
779 if (!otherColl.
find(*arg)) {
796 while((arg=iter.
next())) {
797 if (otherColl.
find(*arg)) {
838 while((arg=iter.
next())) {
876 os << IsA()->GetName() ;
889 if (opt && TString(opt)==
"I") {
892 if (opt && TString(opt).Contains(
"v")) {
912 while((arg=iter.
next())) {
942 TString deeper(indent);
946 Int_t maxNameLen(1) ;
948 if (nameFieldLengthSaved==0) {
949 while((next=iterat.
next())) {
951 if (len>maxNameLen) maxNameLen = len ;
957 while((0 != (next= iterat.
next()))) {
958 os << indent << setw(3) << ++index <<
") ";
975 while((arg=iter.
next())) {
976 cout << arg <<
" " << arg->IsA()->
GetName() <<
"::" << arg->
GetName() <<
" (" << arg->
GetTitle() <<
")" << endl ;
1018 pc.defineInt(
"ncol",
"Columns",0,1) ;
1019 pc.defineString(
"outputFile",
"OutputFile",0,
"") ;
1020 pc.defineString(
"format",
"Format",0,
"NEYVU") ;
1021 pc.defineInt(
"sigDigit",
"Format",0,1) ;
1022 pc.defineObject(
"siblings",
"Sibling",0,0,
kTRUE) ;
1023 pc.defineInt(
"dummy",
"FormatArgs",0,0) ;
1024 pc.defineMutex(
"Format",
"FormatArgs") ;
1034 pc.process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
1039 const char* outFile =
pc.getString(
"outputFile") ;
1040 if (outFile && strlen(outFile)) {
1041 ofstream ofs(outFile) ;
1042 if (
pc.hasProcessed(
"FormatArgs")) {
1045 printLatex(ofs,
pc.getInt(
"ncol"),0,0,
pc.getObjectList(
"siblings"),formatCmd) ;
1047 printLatex(ofs,
pc.getInt(
"ncol"),
pc.getString(
"format"),
pc.getInt(
"sigDigit"),
pc.getObjectList(
"siblings")) ;
1050 if (
pc.hasProcessed(
"FormatArgs")) {
1053 printLatex(cout,
pc.getInt(
"ncol"),0,0,
pc.getObjectList(
"siblings"),formatCmd) ;
1055 printLatex(cout,
pc.getInt(
"ncol"),
pc.getString(
"format"),
pc.getInt(
"sigDigit"),
pc.getObjectList(
"siblings")) ;
1076 sibOption = option ;
1077 sibOption.ReplaceAll(
"N",
"") ;
1078 sibOption.ReplaceAll(
"n",
"") ;
1080 sibFormatCmd = *formatCmd ;
1081 TString tmp = formatCmd->
_s[0] ;
1082 tmp.ReplaceAll(
"N",
"") ;
1083 tmp.ReplaceAll(
"n",
"") ;
1084 static char buf[100] ;
1085 strlcpy(buf,tmp.Data(),100) ;
1086 sibFormatCmd.
_s[0] = buf ;
1108 while((arg=iter.
next())) {
1114 coutW(
InputArguments) <<
"RooAbsCollection::printLatex: can only print RooRealVar in LateX, skipping non-RooRealVar object named "
1118 coutW(
InputArguments) <<
"RooAbsCollection::printLatex: WARNING: naming and/or ordering of sibling list is different" << endl ;
1121 listListRRV.
Add(list) ;
1123 coutW(
InputArguments) <<
"RooAbsCollection::printLatex: ERROR: sibling list(s) must have same length as self" << endl ;
1133 TString subheader =
"l" ;
1134 for (k=0 ; k<nlist ; k++) subheader +=
"c" ;
1136 TString header =
"\\begin{tabular}{" ;
1137 for (j=0 ; j<ncol ; j++) {
1138 if (j>0) header +=
"|" ;
1139 header += subheader ;
1142 ofs << header << endl ;
1146 for (i=0 ; i<nrow ; i++) {
1147 for (j=0 ; j<ncol ; j++) {
1148 for (k=0 ; k<nlist ; k++) {
1152 TString* tmp = par->
format(sigDigit,(k==0)?option:sibOption.Data()) ;
1156 TString* tmp = par->
format((k==0)?*formatCmd:sibFormatCmd) ;
1161 if (!(j==ncol-1 && k==nlist-1)) {
1166 ofs <<
"\\\\" << endl ;
1169 ofs <<
"\\end{tabular}" << endl ;
1182 if (!rangeSpec)
return kTRUE ;
1185 vector<string> cutVec ;
1186 if (rangeSpec && strlen(rangeSpec)>0) {
1187 if (strchr(rangeSpec,
',')==0) {
1188 cutVec.push_back(rangeSpec) ;
1190 const size_t bufSize = strlen(rangeSpec)+1;
1191 char* buf =
new char[bufSize] ;
1192 strlcpy(buf,rangeSpec,bufSize) ;
1193 const char* oneRange = strtok(buf,
",") ;
1195 cutVec.push_back(oneRange) ;
1196 oneRange = strtok(0,
",") ;
1208 while((arg=iter.
next())) {
1211 for (icut=0 ; icut<cutVec.size() ; icut++) {
1212 if (arg->
inRange(cutVec[icut].c_str())) {
1213 selectThisArg =
kTRUE ;
1217 if (!selectThisArg) {
1223 return selectByRange ;
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Bool_t redirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t isRecursionStep=kFALSE)
Iterator over _clientListValue.
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
RooFIter serverMIterator() const
virtual void syncCache(const RooArgSet *nset=0)=0
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Bool_t isConstant() const
virtual Bool_t inRange(const char *) const
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
virtual TObject * create(const char *newname) const =0
RooAbsCollection()
Default constructor.
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.
virtual Bool_t replace(const RooAbsArg &var1, const RooAbsArg &var2)
Replace var1 with var2 and return kTRUE for success.
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.
Bool_t addServerClonesToList(const RooAbsArg &var)
Add clones of servers of given argument to list.
virtual void printName(std::ostream &os) const
Return collection name.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
RooFIter fwdIterator() const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual ~RooAbsCollection()
Destructor.
RooAbsArg * first() const
void assignFast(const RooAbsCollection &other, Bool_t setValDirty=kTRUE)
Functional equivalent of operator=() but assumes this and other collection have same layout.
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 overlaps(const RooAbsCollection &otherColl) const
Check if this and other collection have common entries.
Bool_t allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Implement multiline printin of collection, one line for each ontained object showing the requested co...
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
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 dump() const
Base contents dumper for debugging purposes.
virtual void printTitle(std::ostream &os) const
Return collection title.
Bool_t equals(const RooAbsCollection &otherColl) const
Check if this and other collection have identically named contents.
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...
const char * GetName() const
Returns name of object.
virtual void printClassName(std::ostream &os) const
Return collection class name.
std::string contentsString() const
Return comma separated list of contained object names as STL string.
void setName(const char *name)
RooAbsCollection & operator=(const RooAbsCollection &other)
The assignment operator sets the value of any argument in our set that also appears in the other set.
void safeDeleteList()
Examine client server dependencies in list and delete contents in safe order: any client is deleted b...
RooLinkedListIter iterator(Bool_t dir=kIterForward) const
virtual void RecursiveRemove(TObject *obj)
If one of the TObject we have a referenced to is deleted, remove the reference.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
void makeTypedStructureTag()
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual void printValue(std::ostream &os) const
Print value of collection, i.e.
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default RooPrinable print options for given Print() flag string For inline printing only show ...
RooAbsArg * at(Int_t idx) const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
void addArg(const RooCmdArg &arg)
Utility function to add nested RooCmdArg to payload of this RooCmdArg.
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
RooLinkedListIter is the TIterator implementation for RooLinkedList.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
RooLinkedListIter iterator(Bool_t dir=kTRUE) const
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
RooFIter fwdIterator() const
TObject * At(Int_t index) const
Return object stored in sequential position given by index.
RooAbsArg * findArg(const RooAbsArg *) const
Return pointer to object with given name in collection.
void Delete(Option_t *o=0)
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.
virtual void Add(TObject *arg)
void Clear(Option_t *o=0)
Remove all elements from collection.
Bool_t Replace(const TObject *oldArg, const TObject *newArg)
Replace object 'oldArg' in collection with new object 'newArg'.
virtual Bool_t Remove(TObject *arg)
Remove object from collection.
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
static void nameFieldLength(Int_t newLen)
Set length of field reserved from printing name of RooAbsArgs in multi-line collection printing to gi...
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,...
RooRealVar represents a fundamental (non-derived) real valued object.
TString * format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
void copyCacheFast(const RooRealVar &other, Bool_t setValDirty=kTRUE)
RooStringVar implements a string values RooAbsArg.
static void create(const TObject *obj)
Register creation of object 'obj'.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetTitle() const
Returns title of object.
Regular expression class.
RooCmdArg LatexTableStyle(Bool_t flag=kTRUE)
static constexpr double pc