64#if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
72#ifndef USEMEMPOOLFORARGSET
105void* RooArgSet::operator
new (
size_t bytes)
110 return memPool()->allocate(bytes);
119void* RooArgSet::operator
new (
size_t bytes,
void* ptr)
noexcept
121 return ::operator
new (bytes, ptr);
128void RooArgSet::operator
delete (
void* ptr)
131 if (memPool()->deallocate(ptr))
134 std::cerr << __func__ <<
" " << ptr <<
" is not in any of the pools." << std::endl;
137 ::operator
delete(ptr);
176 if (var1 && !collection.
contains(*var1)) {
214 while((obj=iter->
Next())) {
216 coutW(InputArguments) <<
"RooArgSet::RooArgSet(TCollection) element " << obj->
GetName()
217 <<
" is not a RooAbsArg, ignored" << endl ;
263 coutE(InputArguments) <<
"RooArgSet::operator[](" <<
GetName() <<
") ERROR: no element named " <<
name <<
" in set" << endl ;
264 throw std::invalid_argument((
TString(
"No element named '") +
name +
"' in set " +
GetName()).Data());
282 coutE(InputArguments) <<
"RooArgSet::checkForDup: ERROR argument with name " << var.
GetName() <<
" is already in this set" << endl;
303 ofstream ofs(fileName) ;
305 coutE(InputArguments) <<
"RooArgSet::writeToFile(" <<
GetName() <<
") error opening file " << fileName << endl ;
319 ifstream ifs(fileName) ;
321 coutE(InputArguments) <<
"RooArgSet::readFromFile(" <<
GetName() <<
") error opening file " << fileName << endl ;
345 if (section && section[0] !=
'\0')
346 os <<
'[' << section <<
']' <<
'\n';
349 for (
const auto next :
_list) {
350 next->writeToStream(os,
true);
355 for (
const auto next :
_list) {
356 os << next->GetName() <<
" = " ;
357 next->writeToStream(os,
kFALSE) ;
410 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
") compact mode not supported" << endl ;
424 Int_t condStackLevel=0 ;
429 if (section) sectionHdr.
Append(section) ;
436 if (is.eof() || is.fail() || parser.
atEOF()) {
441 if (!reprocessToken) {
453 if (parser.
atEOL()) {
454 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName()
455 <<
"): no filename found after include statement" << endl ;
459 ifstream incfs(filename) ;
461 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): cannot open include file " << filename << endl ;
464 coutI(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): processing include file "
465 << filename << endl ;
471 if (*token.
Data()==
'[') {
473 const char* last = token.
Data() + token.
Length() -1 ;
502 if (lastLineWasElse) {
503 anyCondTrue[condStackLevel] |= status ;
507 anyCondTrue[condStackLevel] = status ;
509 condStack[condStackLevel] = status ;
511 if (verbose)
cxcoutD(Eval) <<
"RooArgSet::readFromStream(" <<
GetName()
512 <<
"): conditional expression " << expr <<
" = "
513 << (condStack[condStackLevel]?
"true":
"false") << endl ;
519 if (condStackLevel==0) {
520 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): unmatched 'else'" << endl ;
523 if (parser.
atEOL()) {
525 condStack[condStackLevel] = !anyCondTrue[condStackLevel] ;
532 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): syntax error: 'else " << token <<
"'" << endl ;
535 if (anyCondTrue[condStackLevel]) {
537 condStack[condStackLevel] =
kFALSE ;
542 reprocessToken =
kTRUE ;
543 lastLineWasElse=
kTRUE ;
552 if (condStackLevel==0) {
553 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): unmatched 'endif'" << endl ;
563 if (condStack[condStackLevel]) {
568 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): >> " << message << endl ;
575 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): USER ABORT" << endl ;
586 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName()
587 <<
"): missing '=' sign: " << arg << endl ;
595 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): argument "
596 << token <<
" not in list, ignored" << endl ;
606 if (condStackLevel!=0) {
607 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): missing 'endif'" << endl ;
618 strlcpy(buf,rangeSpec,1024) ;
619 char* token = strtok(buf,
",") ;
643 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 and a "shape" in RooFi...
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.
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
Bool_t contains(const RooAbsArg &var) const
Check if collection contains an argument with the same name as var.
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
TIterator-style iteration over contained elements.
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 Bool_t inRange(const char *name) const
Check if current value is inside range with given name.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet()
Default constructor.
~RooArgSet() override
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)
virtual void writeToStream(std::ostream &os, bool compact, const char *section=0) const
Write the contents of the argset in ASCII form to given stream.
void writeToFile(const char *fileName) const
Write contents of the argset to specified file.
static MemPool * memPool()
MemPoolForRooSets< RooArgSet, 10 *600 > MemPool
Bool_t checkForDup(const RooAbsArg &arg, Bool_t silent) const
Check if element with var's name is already in set.
virtual bool readFromStream(std::istream &is, bool compact, bool verbose=false)
Shortcut for readFromStream(std::istream&, Bool_t, const char*, const char*, Bool_t),...
void processArg(const RooAbsArg &arg)
RooAbsArg & operator[](const TString &str) const
Get reference to an element using its name.
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...
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.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
TString & Append(const char *cs)
RooConstVar & RooConst(Double_t val)