201 const char* argName3,
const char* argName4,
202 const char* argName5,
const char* argName6,
203 const char* argName7,
const char* argName8)
238 return ret.Length() ? ret.Data() : 0 ;
297 void RooCmdConfig::defineMutex(
const char* argName1,
const char* argName2,
const char* argName3,
const char* argName4,
const char* argName5)
320 coutE(
InputArguments) <<
"RooCmdConfig::defintInt: name '" << name <<
"' already defined" << endl ;
342 coutE(
InputArguments) <<
"RooCmdConfig::defineDouble: name '" << name <<
"' already defined" << endl ;
366 coutE(
InputArguments) <<
"RooCmdConfig::defineString: name '" << name <<
"' already defined" << endl ;
392 coutE(
InputArguments) <<
"RooCmdConfig::defineObject: name '" << name <<
"' already defined" << endl ;
417 coutE(
InputArguments) <<
"RooCmdConfig::defineObject: name '" << name <<
"' already defined" << endl ;
441 cout << ri->
GetName() <<
"[Int_t] = " << *ri << endl ;
448 cout << rd->
GetName() <<
"[Double_t] = " << *rd << endl ;
455 cout << rs->
GetName() <<
"[string] = \"" << rs->
getVal() <<
"\"" << endl ;
462 cout << ro->
GetName() <<
"[TObject] = " ;
467 cout <<
"(null)" << endl ;
517 const char* opc = arg.
opcode() ;
536 cout <<
"RooCmdConfig::process: " << opc <<
" has unprocessed dependent " << dep->
GetTitle()
537 <<
", adding to required list" << endl ;
541 cout <<
"RooCmdConfig::process: " << opc <<
" dependent " << dep->
GetTitle() <<
" is already processed" << endl ;
550 cout <<
"RooCmdConfig::process: " << opc <<
" excludes " << mutex->
GetTitle()
551 <<
", adding to forbidden list" << endl ;
563 if (!TString(opc).CompareTo(ri->
GetTitle())) {
567 cout <<
"RooCmdConfig::process " << ri->
GetName() <<
"[Int_t]" <<
" set to " << *ri << endl ;
576 if (!TString(opc).CompareTo(rd->
GetTitle())) {
580 cout <<
"RooCmdConfig::process " << rd->
GetName() <<
"[Double_t]" <<
" set to " << *rd << endl ;
589 if (!TString(opc).CompareTo(rs->
GetTitle())) {
591 const char* oldStr = rs->
getVal() ;
593 if (oldStr && strlen(oldStr)>0 && rs->
getAttribute(
"RooCmdConfig::AppendMode")) {
600 cout <<
"RooCmdConfig::process " << rs->
GetName() <<
"[string]" <<
" set to " << rs->
getVal() << endl ;
609 if (!TString(opc).CompareTo(os->
GetTitle())) {
613 cout <<
"RooCmdConfig::process " << os->
GetName() <<
"[TObject]" <<
" set to " ;
617 cout <<
"(null)" << endl ;
627 if (!TString(opc).CompareTo(cs->
GetTitle())) {
631 cout <<
"RooCmdConfig::process " << cs->
GetName() <<
"[RooArgSet]" <<
" set to " ;
635 cout <<
"(null)" << endl ;
641 Bool_t multiArg = !TString(
"MultiArg").CompareTo(opc) ;
662 if (strlen(subArg->
GetName())>0) {
667 depRet |=
process(subArgCopy) ;
694 return ri ? (
Int_t)(*ri) : defVal ;
706 return rd ? (
Double_t)(*rd) : defVal ;
719 return rs ? ((convEmptyToNull && strlen(rs->
getVal())==0) ? 0 : ((
const char*)rs->
getVal()) ) : defVal ;
731 return ro ? ro->
obj() : defVal ;
754 return ro ? ro->
objList() : defaultDummy ;
785 if (!cmdsToPurge)
return ;
789 strlcpy(buf,cmdsToPurge,1024) ;
791 char*
name = strtok(buf,
",") ;
794 if (cmd) cmdList.
Remove(cmd) ;
795 name = strtok(0,
",") ;
809 if (!cmdNameList)
return filterList ;
813 strlcpy(buf,cmdNameList,1024) ;
815 char*
name = strtok(buf,
",") ;
819 if (removeFromInList) {
822 filterList.
Add(cmd) ;
824 name = strtok(0,
",") ;
842 pc.
defineInt(
"theInt",cmdArgName,intIdx,defVal) ;
846 return pc.
getInt(
"theInt") ;
860 static string retBuf =
"" ;
875 return retBuf.c_str() ;
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 UInt_t GetUniqueID() const
Return the unique object id.
const char * opcode() const
const char * getString(Int_t idx) const
virtual const char * getVal() const
Return value of object. Calculated if dirty, otherwise cached value is returned.
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
RooCmdConfig(const char *methodName)
Constructor taking descriptive name of owner/user which is used as prefix for any warning or error me...
Bool_t defineDouble(const char *name, const char *argName, Int_t doubleNum, Double_t defValue=0.)
Define Double_t property name 'name' mapped to Double_t in slot 'doubleNum' in RooCmdArg with name ar...
Collectable string class.
virtual Bool_t Remove(TObject *arg)
Remove object from collection.
Int_t getInt(Int_t idx) const
static const char * decodeStringOnTheFly(const char *callerID, const char *cmdArgName, Int_t intIdx, const char *defVal, const RooCmdArg &arg1, 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 RooCmdArg &arg9=RooCmdArg())
Static decoder function allows to retrieve string property from set of RooCmdArgs For use in base mem...
const char * getString(const char *name, const char *defaultValue="", Bool_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void setVal(const char *newVal)
Set value to given TString.
const TObject * getObject(Int_t idx) const
void defineRequiredArgs(const char *argName1, const char *argName2=0, const char *argName3=0, const char *argName4=0, const char *argName5=0, const char *argName6=0, const char *argName7=0, const char *argName8=0)
Add condition that any of listed arguments must be processed for parsing to be declared successful...
Bool_t defineSet(const char *name, const char *argName, Int_t setNum, const RooArgSet *set=0)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
RooInt is a minimal implementation of a TObject holding a Int_t value.
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
void allowUndefined(Bool_t flag=kTRUE)
TObject * getObject(const char *name, TObject *obj=0)
Return TObject property registered with name 'name'.
RooDouble is a minimal implementation of a TObject holding a Double_t value.
Iterator abstract base class.
~RooCmdConfig()
Destructor.
void setObj(TObject *inObj)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
The TNamed class is the base class for all named ROOT classes.
const RooLinkedList & objList() const
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...
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
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...
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
void stripCmdList(RooLinkedList &cmdList, const char *cmdsToPurge)
Utility function that strips command names listed (comma separated) in cmdsToPurge from cmdList...
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
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)
void defineMutex(const char *argName1, const char *argName2)
Define arguments named argName1 and argName2 mutually exclusive.
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name 'name'.
static TObject * decodeObjOnTheFly(const char *callerID, const char *cmdArgName, Int_t objIdx, TObject *defVal, const RooCmdArg &arg1, 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 RooCmdArg &arg9=RooCmdArg())
Static decoder function allows to retrieve object property from set of RooCmdArgs For use in base mem...
TObject * At(Int_t index) const
Return object stored in sequential position given by index.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
char * Form(const char *fmt,...)
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
static Int_t decodeIntOnTheFly(const char *callerID, const char *cmdArgName, Int_t intIdx, Int_t defVal, const RooCmdArg &arg1, 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 RooCmdArg &arg9=RooCmdArg())
Static decoder function allows to retrieve integer property from set of RooCmdArgs For use in base me...
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
RooArgSet * getSet(const char *name, RooArgSet *set=0)
Return RooArgSet property registered with name 'name'.
const char * missingArgs() const
Return string with names of arguments that were required, but not processed.
Double_t getDouble(Int_t idx) const
Double_t getDouble(const char *name, Double_t defaultValue=0)
Return Double_t property registered with name 'name'.
void print()
Print configuration of parser.
const RooLinkedList & getObjectList(const char *name)
Return list of objects registered with name 'name'.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Mother of all ROOT objects.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
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 Add(TObject *obj)
TIterator * MakeIterator(Bool_t dir=kTRUE) const
Return an iterator over this list.
virtual TObject * Next()=0
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 ...
RooInt is a minimal implementation of a TNamed holding a TObject.
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetSize() const
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
RooStringVar implements a string values RooAbsArg.
RooLinkedList filterCmdList(RooLinkedList &cmdInList, const char *cmdNameList, Bool_t removeFromInList=kTRUE)
Utility function to filter commands listed in cmdNameList from cmdInList.
const RooArgSet * getSet(Int_t idx) const
Return RooArgSet stored in slot idx.
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...