61 #if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3) 71 #define POOLSIZE 1048576 85 std::list<POOLDATA>::iterator iter = _memPoolList.begin() ;
86 while(iter!=_memPoolList.end()) {
91 _memPoolList.clear() ;
104 void* RooArgSet::operator
new (
size_t bytes)
108 if (!_poolBegin || _poolCur+(
sizeof(
RooArgSet)) >= _poolEnd) {
117 if (_memPoolList.size()>3) {
121 for (std::list<POOLDATA>::iterator poolIter = _memPoolList.begin() ; poolIter!=_memPoolList.end() ; ++poolIter) {
124 if ((*(
Int_t*)(poolIter->_base))==0) {
125 oocxcoutD((
TObject*)0,
Caching) <<
"RooArgSet::operator new(), pruning empty memory pool " << (
void*)(poolIter->_base) << endl ;
127 toFree = poolIter->_base ;
128 _memPoolList.erase(poolIter) ;
141 _poolBegin = (
char*)mem ;
143 _poolCur = _poolBegin+
sizeof(
Int_t) ;
147 *((
Int_t*)_poolBegin)=0 ;
151 _memPoolList.push_back(p) ;
156 char* ptr = _poolCur ;
160 (*((
Int_t*)_poolBegin))++ ;
172 void* RooArgSet::operator
new (
size_t bytes,
void* ptr) noexcept
174 return ::operator
new (bytes, ptr);
181 void RooArgSet::operator
delete (
void* ptr)
184 for (std::list<POOLDATA>::iterator poolIter = _memPoolList.begin() ; poolIter!=_memPoolList.end() ; ++poolIter) {
185 if ((
char*)ptr > (
char*)poolIter->_base && (
char*)ptr < (
char*)poolIter->_base +
POOLSIZE) {
186 (*(
Int_t*)(poolIter->_base))-- ;
191 ::operator
delete(ptr);
230 if (var1 && !list.
contains(*var1)) {
406 while((obj=iter->
Next())) {
407 if (!dynamic_cast<RooAbsArg*>(obj)) {
409 <<
" is not a RooAbsArg, ignored" << endl ;
513 coutE(
InputArguments) <<
"RooArgSet::checkForDup: ERROR argument with name " << var.
GetName() <<
" is already in this set" << endl;
532 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getRealValue(" <<
GetName() <<
") ERROR no object with name '" << name <<
"' found" << endl ;
537 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getRealValue(" <<
GetName() <<
") ERROR object '" << name <<
"' is not of type RooAbsReal" << endl ;
553 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setRealValue(" <<
GetName() <<
") ERROR no object with name '" << name <<
"' found" << endl ;
558 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setRealValue(" <<
GetName() <<
") ERROR object '" << name <<
"' is not of type RooAbsRealLValue" << endl ;
575 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getCatLabel(" <<
GetName() <<
") ERROR no object with name '" << name <<
"' found" << endl ;
580 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getCatLabel(" <<
GetName() <<
") ERROR object '" << name <<
"' is not of type RooAbsCategory" << endl ;
596 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setCatLabel(" <<
GetName() <<
") ERROR no object with name '" << name <<
"' found" << endl ;
601 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setCatLabel(" <<
GetName() <<
") ERROR object '" << name <<
"' is not of type RooAbsCategory" << endl ;
618 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getCatLabel(" <<
GetName() <<
") ERROR no object with name '" << name <<
"' found" << endl ;
623 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getCatLabel(" <<
GetName() <<
") ERROR object '" << name <<
"' is not of type RooAbsCategory" << endl ;
639 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setCatLabel(" <<
GetName() <<
") ERROR no object with name '" << name <<
"' found" << endl ;
644 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setCatLabel(" <<
GetName() <<
") ERROR object '" << name <<
"' is not of type RooAbsCategory" << endl ;
661 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getStringValue(" <<
GetName() <<
") ERROR no object with name '" << name <<
"' found" << endl ;
666 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::getStringValue(" <<
GetName() <<
") ERROR object '" << name <<
"' is not of type RooAbsString" << endl ;
682 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setStringValue(" <<
GetName() <<
") ERROR no object with name '" << name <<
"' found" << endl ;
687 if (verbose)
coutE(
InputArguments) <<
"RooArgSet::setStringValue(" <<
GetName() <<
") ERROR object '" << name <<
"' is not of type RooAbsString" << endl ;
702 ofstream ofs(fileName) ;
718 ifstream ifs(fileName) ;
748 os << next->
GetName() <<
" = " ;
815 Int_t condStackLevel=0 ;
819 TString sectionHdr(
"[") ;
820 if (section) sectionHdr.Append(section) ;
821 sectionHdr.Append(
"]") ;
827 if (is.eof() || is.fail() || parser.
atEOF()) {
832 if (!reprocessToken) {
838 if (token.IsNull()) {
843 if (!token.CompareTo(
"include")) {
844 if (parser.
atEOL()) {
846 <<
"): no filename found after include statement" << endl ;
849 TString filename = parser.
readLine() ;
850 ifstream incfs(filename) ;
856 << filename << endl ;
862 if (*token.Data()==
'[') {
864 const char* last = token.Data() + token.Length() -1 ;
872 inSection = !sectionHdr.CompareTo(hdr) ;
884 if (!token.CompareTo(
"if")) {
889 if (!form.
ok())
return kTRUE ;
893 if (lastLineWasElse) {
894 anyCondTrue[condStackLevel] |= status ;
898 anyCondTrue[condStackLevel] = status ;
900 condStack[condStackLevel] = status ;
903 <<
"): conditional expression " << expr <<
" = " 904 << (condStack[condStackLevel]?
"true":
"false") << endl ;
908 if (!token.CompareTo(
"else")) {
910 if (condStackLevel==0) {
914 if (parser.
atEOL()) {
916 condStack[condStackLevel] = !anyCondTrue[condStackLevel] ;
922 if (token.CompareTo(
"if")) {
926 if (anyCondTrue[condStackLevel]) {
928 condStack[condStackLevel] =
kFALSE ;
933 reprocessToken =
kTRUE ;
934 lastLineWasElse=
kTRUE ;
941 if (!token.CompareTo(
"endif")) {
943 if (condStackLevel==0) {
954 if (condStack[condStackLevel]) {
957 if (!token.CompareTo(
"echo")) {
958 TString message = parser.
readLine() ;
964 if (!token.CompareTo(
"abort")) {
965 TString message = parser.
readLine() ;
978 <<
"): missing '=' sign: " << arg << endl ;
982 if (!argRet && flagReadAtt) arg->
setAttribute(flagReadAtt,kTRUE) ;
987 << token <<
" not in list, ignored" << endl ;
997 if (condStackLevel!=0) {
1009 strlcpy(buf,rangeSpec,1024) ;
1010 char* token = strtok(buf,
",") ;
1034 token = strtok(0,
",") ;
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.
TIterator * createIterator(Bool_t dir=kIterForward) const
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.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
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...
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 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 RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsArg & operator[](const char *name) const
Array operator.
Double_t getVal(const RooArgSet *set=0) const
static const UInt_t kObjectAllocMemValue
virtual void setVal(const char *newVal)
Set value to given TString.
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)=0
static std::list< POOLDATA > _memPoolList
virtual Int_t getIndex() const
Return index number of current state.
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)=0
Bool_t checkForDup(const RooAbsArg &arg, Bool_t silent) const
Check if element with var's name is already in set.
Iterator abstract base class.
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.
Bool_t isInRange(const char *rangeSpec)
static char * _poolEnd
Next free slot in memory pool.
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
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...
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
TString readToken()
Read one token separated by any of the know punctuation characters This function recognizes and handl...
void writeToFile(const char *fileName) const
Write contents of the argset to specified file.
Collection abstract base class.
void zapToEnd(Bool_t inclContLines=kFALSE)
Eat all characters up to and including then end of the current line.
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...
static char * _poolCur
Start of memory pool.
virtual const char * getLabel() const
Return label string of current state.
TString readLine()
Read an entire line from the stream and return as TString This method recognizes the use of '\' in th...
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.
virtual void setVal(Double_t value)=0
virtual void writeToStream(std::ostream &os, Bool_t compact) const =0
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.
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
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.
static void destroySpecial(const char *name)
static void cleanup()
Clear memoery pool on exit to avoid reported memory leaks.
void setPunctuation(const TString &punct)
Change list of characters interpreted as punctuation.
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.
virtual Bool_t inRange(const char *name) const
Check if current value is inside range with given name.
virtual const char * getVal() const
Return value of object. Calculated if dirty, otherwise cached value is returned.
const char * GetName() const
Returns name of object.
static void createSpecial(const char *name, int size)
Mother of all ROOT objects.
RooAbsString is the common abstract base class for objects that represent a string value...
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects...
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
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.
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. ...
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.
virtual TObject * Next()=0
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
RooArgSet()
Default constructor.
Bool_t contains(const RooAbsArg &var) const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual const char * GetName() const
Returns name of object.
RooStringVar implements a string values RooAbsArg.
Bool_t atEOL()
If true, parser is at end of line in stream.
virtual ~RooArgSet()
Destructor.
virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE)=0