62#if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
70#ifndef USEMEMPOOLFORARGSET
103void* RooArgSet::operator
new (
size_t bytes)
108 return memPool()->allocate(bytes);
117void* RooArgSet::operator
new (
size_t bytes,
void* ptr)
noexcept
119 return ::operator
new (bytes, ptr);
126void RooArgSet::operator
delete (
void* ptr)
129 if (memPool()->deallocate(ptr))
132 std::cerr << __func__ <<
" " << ptr <<
" is not in any of the pools." << std::endl;
135 ::operator
delete(ptr);
174 if (var1 && !list.
contains(*var1)) {
350 while((obj=iter->
Next())) {
353 <<
" is not a RooAbsArg, ignored" << endl ;
457 coutE(
InputArguments) <<
"RooArgSet::checkForDup: ERROR argument with name " << var.
GetName() <<
" is already in this set" << endl;
481 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getRealValue(" <<
GetName() <<
") ERROR object '" <<
name <<
"' is not of type RooAbsReal" << endl ;
502 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setRealValue(" <<
GetName() <<
") ERROR object '" <<
name <<
"' is not of type RooAbsRealLValue" << endl ;
524 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getCatLabel(" <<
GetName() <<
") ERROR object '" <<
name <<
"' is not of type RooAbsCategory" << endl ;
545 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setCatLabel(" <<
GetName() <<
") ERROR object '" <<
name <<
"' is not of type RooAbsCategory" << endl ;
567 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getCatLabel(" <<
GetName() <<
") ERROR object '" <<
name <<
"' is not of type RooAbsCategory" << endl ;
588 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setCatLabel(" <<
GetName() <<
") ERROR object '" <<
name <<
"' is not of type RooAbsCategory" << endl ;
610 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getStringValue(" <<
GetName() <<
") ERROR object '" <<
name <<
"' is not of type RooAbsString" << endl ;
631 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setStringValue(" <<
GetName() <<
") ERROR object '" <<
name <<
"' is not of type RooAbsString" << endl ;
646 ofstream ofs(fileName) ;
662 ifstream ifs(fileName) ;
699 os << next->
GetName() <<
" = " ;
768 Int_t condStackLevel=0 ;
772 TString sectionHdr(
"[") ;
773 if (section) sectionHdr.Append(section) ;
774 sectionHdr.Append(
"]") ;
780 if (is.eof() || is.fail() || parser.
atEOF()) {
785 if (!reprocessToken) {
791 if (token.IsNull()) {
796 if (!token.CompareTo(
"include")) {
797 if (parser.
atEOL()) {
799 <<
"): no filename found after include statement" << endl ;
802 TString filename = parser.
readLine() ;
803 ifstream incfs(filename) ;
809 << filename << endl ;
815 if (*token.Data()==
'[') {
817 const char* last = token.Data() + token.Length() -1 ;
825 inSection = !sectionHdr.CompareTo(hdr) ;
837 if (!token.CompareTo(
"if")) {
846 if (lastLineWasElse) {
847 anyCondTrue[condStackLevel] |= status ;
851 anyCondTrue[condStackLevel] = status ;
853 condStack[condStackLevel] = status ;
856 <<
"): conditional expression " << expr <<
" = "
857 << (condStack[condStackLevel]?
"true":
"false") << endl ;
861 if (!token.CompareTo(
"else")) {
863 if (condStackLevel==0) {
867 if (parser.
atEOL()) {
869 condStack[condStackLevel] = !anyCondTrue[condStackLevel] ;
875 if (token.CompareTo(
"if")) {
879 if (anyCondTrue[condStackLevel]) {
881 condStack[condStackLevel] =
kFALSE ;
886 reprocessToken =
kTRUE ;
887 lastLineWasElse=
kTRUE ;
894 if (!token.CompareTo(
"endif")) {
896 if (condStackLevel==0) {
907 if (condStack[condStackLevel]) {
910 if (!token.CompareTo(
"echo")) {
911 TString message = parser.
readLine() ;
917 if (!token.CompareTo(
"abort")) {
918 TString message = parser.
readLine() ;
931 <<
"): missing '=' sign: " << arg << endl ;
940 << token <<
" not in list, ignored" << endl ;
950 if (condStackLevel!=0) {
962 strlcpy(buf,rangeSpec,1024) ;
963 char* token = strtok(buf,
",") ;
987 token = strtok(0,
",") ;
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
Memory pool for RooArgSet and RooDataSet.
void teardown()
Set pool to teardown mode (at program end).
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)=0
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
virtual void writeToStream(std::ostream &os, Bool_t compact) const =0
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)=0
virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE)=0
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
virtual Int_t getIndex() const
Return index number of current state.
virtual const char * getLabel() const
Return label string of current state.
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
Bool_t contains(const RooAbsArg &var) const
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.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
const char * GetName() const
Returns name of object.
TIterator * createIterator(Bool_t dir=kIterForward) const
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual void setVal(Double_t value)=0
virtual Bool_t inRange(const char *name) const
Check if current value is inside range with given name.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Double_t getVal(const RooArgSet *set=0) const
Evaluate object. Returns either cached value or triggers a recalculation.
RooAbsString is the common abstract base class for objects that represent a string value.
virtual const char * getVal() const
Return value of object. Calculated if dirty, otherwise cached value is returned.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooAbsArg & operator[](const char *name) const
Array operator.
Int_t getCatIndex(const char *name, Int_t defVal=0, Bool_t verbose=kFALSE) const
Get index value of a RooAbsCategory stored in set with given name.
RooArgSet()
Default constructor.
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Shortcut for readFromStream(std::istream&, Bool_t, const char*, const char*, Bool_t),...
const char * getCatLabel(const char *name, const char *defVal="", Bool_t verbose=kFALSE) const
Get state name of a RooAbsCategory stored in set with given name.
virtual Bool_t addOwned(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
virtual ~RooArgSet()
Destructor.
Bool_t readFromFile(const char *fileName, const char *flagReadAtt=0, const char *section=0, Bool_t verbose=kFALSE)
Read contents of the argset from specified file.
Bool_t isInRange(const char *rangeSpec)
void writeToFile(const char *fileName) const
Write contents of the argset to specified file.
Bool_t setCatIndex(const char *name, Int_t newVal=0, Bool_t verbose=kFALSE)
Set index value of a RooAbsCategoryLValue stored in set with given name to newVal.
Double_t getRealValue(const char *name, Double_t defVal=0, Bool_t verbose=kFALSE) const
Get value of a RooAbsReal stored in set with given name.
static MemPool * memPool()
virtual void writeToStream(std::ostream &os, Bool_t compact, const char *section=0) const
Write the contents of the argset in ASCII form to given stream.
const char * getStringValue(const char *name, const char *defVal="", Bool_t verbose=kFALSE) const
Get string value of a RooAbsString stored in set with given name.
Bool_t setCatLabel(const char *name, const char *newVal="", Bool_t verbose=kFALSE)
Set state name of a RooAbsCategoryLValue stored in set with given name to newVal.
MemPoolForRooSets< RooArgSet, 10 *600 > MemPool
Bool_t setRealValue(const char *name, Double_t newVal=0, Bool_t verbose=kFALSE)
Set value of a RooAbsRealLValye stored in set with given name to newVal No error messages are printed...
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Bool_t checkForDup(const RooAbsArg &arg, Bool_t silent) const
Check if element with var's name is already in set.
Bool_t setStringValue(const char *name, const char *newVal="", Bool_t verbose=kFALSE)
Set string value of a RooStringVar stored in set with given name to newVal.
virtual void addClone(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
Bool_t atEOL()
If true, parser is at end of line in stream.
void setPunctuation(const TString &punct)
Change list of characters interpreted as punctuation.
void zapToEnd(Bool_t inclContLines=kFALSE)
Eat all characters up to and including then end of the current line.
Bool_t expectToken(const TString &expected, Bool_t zapOnError=kFALSE)
Read the next token and return kTRUE if it is identical to the given 'expected' token.
TString readLine()
Read an entire line from the stream and return as TString This method recognizes the use of '\' in th...
TString readToken()
Read one token separated by any of the know punctuation characters This function recognizes and handl...
RooStringVar implements a string values RooAbsArg.
virtual void setVal(const char *newVal)
Set value to given TString.
Collection abstract base class.
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
Iterator abstract base class.
virtual TObject * Next()=0
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
std::string GetName(const std::string &scope_name)