54 #if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3) 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) {
237 while((0 != (orig= iterat.
next()))) {
249 while ((var=vIter.
next())) {
256 coutE(
ObjectHandling) <<
"RooAbsCollection::snapshot(): Errors occurred in deep clone process, snapshot not created" << endl ;
263 while ((var=vIter.
next())) {
284 while ((server=sIter.
next())) {
290 if (
_allRRV && dynamic_cast<RooRealVar*>(serverClone)==0) {
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() ;
409 if (
_allRRV && dynamic_cast<RooRealVar*>(&var)==0) {
437 if (
_allRRV && dynamic_cast<const RooRealVar*>(&var)==0) {
461 if (
_allRRV && dynamic_cast<const RooRealVar*>(&var)==0) {
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;
563 coutE(
ObjectHandling) <<
"RooAbsCollection: variable \"" << name <<
"\" is not in the list" 564 <<
" and cannot be replaced" << endl;
570 if (dynamic_cast<RooArgSet*>(
this)) {
572 if(other != 0 && other != &var1) {
574 <<
"\" with already existing \"" << var2.
GetName() <<
"\"" << endl;
584 if (
_allRRV && dynamic_cast<const RooRealVar*>(&var2)==0) {
610 if (matchByNameOnly) {
632 for(
Int_t index= 0; index <
n; index++) {
633 result |=
remove((
RooAbsArg&)*list.
_list.
At(index),silent,matchByNameOnly) ;
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())) {
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 ;
1023 pc.
defineInt(
"dummy",
"FormatArgs",0,0) ;
1028 cmdList.
Add(const_cast<RooCmdArg*>(&arg1)) ; cmdList.
Add(const_cast<RooCmdArg*>(&arg2)) ;
1029 cmdList.
Add(const_cast<RooCmdArg*>(&arg3)) ; cmdList.
Add(const_cast<RooCmdArg*>(&arg4)) ;
1030 cmdList.
Add(const_cast<RooCmdArg*>(&arg5)) ; cmdList.
Add(const_cast<RooCmdArg*>(&arg6)) ;
1031 cmdList.
Add(const_cast<RooCmdArg*>(&arg7)) ; cmdList.
Add(const_cast<RooCmdArg*>(&arg8)) ;
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) ;
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 ;
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
virtual const char * GetName() const
Returns name of object.
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, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
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.
RooAbsCollection()
Default constructor.
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 RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
virtual Bool_t Remove(TObject *arg)
Remove object from collection.
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
const char * getString(const char *name, const char *defaultValue="", Bool_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
virtual Bool_t replace(const RooAbsArg &var1, const RooAbsArg &var2)
Replace var1 with var2 and return kTRUE for success.
TObject * find(const char *name) const
Return pointer to object with given name in collection.
virtual void printValue(std::ostream &os) const
Print value of collection, i.e.
static void nameFieldLength(Int_t newLen)
Set length of field reserved from printing name of RooAbsArgs in multi-line collection printing to gi...
Regular expression class.
RooFIter fwdIterator() const
virtual ~RooAbsCollection()
Destructor.
Bool_t equals(const RooAbsCollection &otherColl) const
Check if this and other collection have identically named contents.
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
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'.
void copyCacheFast(const RooRealVar &other, Bool_t setValDirty=kTRUE)
virtual Bool_t inRange(const char *) const
virtual void syncCache(const RooArgSet *nset=0)=0
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
void safeDeleteList()
Examine client server dependencies in list and delete contents in safe order: any client is deleted b...
virtual const char * ClassName() const
Returns name of class to which the object belongs.
RooFIter serverMIterator() const
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods...
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
Bool_t allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range...
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...
Bool_t defineString(const char *name, const char *argName, Int_t stringNum, const char *defValue="", Bool_t appendMode=kFALSE)
Define Double_t property name 'name' mapped to Double_t in slot 'stringNum' in RooCmdArg with name ar...
static void create(const TObject *obj)
Register creation of object 'obj'.
void assignFast(const RooAbsCollection &other, Bool_t setValDirty=kTRUE)
Functional equivalent of operator=() but assumes this and other collection have same layout...
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
Bool_t defineInt(const char *name, const char *argName, Int_t intNum, Int_t defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
RooRealVar represents a fundamental (non-derived) real valued object.
Bool_t overlaps(const RooAbsCollection &otherColl) const
Check if this and other collection have common entries.
virtual void printName(std::ostream &os) const
Return collection name.
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
virtual void Add(TObject *arg)
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default RooPrinable print options for given Print() flag string For inline printing only show ...
void defineMutex(const char *argName1, const char *argName2)
Define arguments named argName1 and argName2 mutually exclusive.
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...
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name 'name'.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
std::string contentsString() const
Return comma separated list of contained object names as STL string.
RooAbsArg * at(Int_t idx) const
RooAbsArg * first() const
virtual void RecursiveRemove(TObject *obj)
If one of the TObject we have a referenced to is deleted, remove the reference.
TObject * At(Int_t index) const
Return object stored in sequential position given by index.
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
TString * format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
RooLinkedListIter iterator(Bool_t dir=kTRUE) const
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
RooCmdArg Index(RooCategory &icat)
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
virtual void printClassName(std::ostream &os) const
Return collection class name.
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements...
RooAbsArg * find(const char *name) const
Find object with given name in list.
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
void addArg(const RooCmdArg &arg)
Utility function to add nested RooCmdArg to payload of this RooCmdArg.
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...
const RooLinkedList & getObjectList(const char *name)
Return list of objects registered with name 'name'.
const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects...
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
virtual const char * GetTitle() const
Returns title of object.
Bool_t hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
virtual void printTitle(std::ostream &os) const
Return collection title.
RooLinkedListIter iterator(Bool_t dir=kIterForward) const
void makeTypedStructureTag()
void setName(const char *name)
Bool_t addServerClonesToList(const RooAbsArg &var)
Add clones of servers of given argument to list.
RooAbsArg * findArg(const RooAbsArg *) const
Return pointer to object with given name in collection.
static constexpr double pc
Bool_t defineObject(const char *name, const char *argName, Int_t setNum, const TObject *obj=0, Bool_t isArray=kFALSE)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
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 ...
RooAbsCollection & operator=(const RooAbsCollection &other)
The assignment operator sets the value of any argument in our set that also appears in the other set...
RooCmdArg LatexTableStyle(Bool_t flag=kTRUE)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
void setHashTableSize(Int_t i)
RooStringVar implements a string values RooAbsArg.
Bool_t redirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t isRecursionStep=kFALSE)
Iterator over _clientListValue.
Int_t getHashTableSize() const
RooLinkedListIter is the TIterator implementation for RooLinkedList.
Bool_t isConstant() const
virtual TObject * create(const char *newname) const =0
void dump() const
Base contents dumper for debugging purposes.
virtual const char * GetTitle() const
Returns title of object.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...