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;
646 ofstream ofs(fileName) ;
662 ifstream ifs(fileName) ;
688 if (section && section[0] !=
'\0')
689 os <<
'[' << section <<
']' <<
'\n';
692 for (
const auto next :
_list) {
693 next->writeToStream(os,
true);
698 for (
const auto next :
_list) {
699 os << next->GetName() <<
" = " ;
700 next->writeToStream(os,
kFALSE) ;
767 Int_t condStackLevel=0 ;
772 if (section) sectionHdr.
Append(section) ;
779 if (is.eof() || is.fail() || parser.
atEOF()) {
784 if (!reprocessToken) {
796 if (parser.
atEOL()) {
798 <<
"): no filename found after include statement" << endl ;
802 ifstream incfs(filename) ;
808 << filename << endl ;
814 if (*token.
Data()==
'[') {
816 const char* last = token.
Data() + token.
Length() -1 ;
845 if (lastLineWasElse) {
846 anyCondTrue[condStackLevel] |= status ;
850 anyCondTrue[condStackLevel] = status ;
852 condStack[condStackLevel] = status ;
855 <<
"): conditional expression " << expr <<
" = "
856 << (condStack[condStackLevel]?
"true":
"false") << endl ;
862 if (condStackLevel==0) {
866 if (parser.
atEOL()) {
868 condStack[condStackLevel] = !anyCondTrue[condStackLevel] ;
878 if (anyCondTrue[condStackLevel]) {
880 condStack[condStackLevel] =
kFALSE ;
885 reprocessToken =
kTRUE ;
886 lastLineWasElse=
kTRUE ;
895 if (condStackLevel==0) {
906 if (condStack[condStackLevel]) {
930 <<
"): missing '=' sign: " << arg << endl ;
939 << token <<
" not in list, ignored" << endl ;
949 if (condStackLevel!=0) {
961 strlcpy(buf,rangeSpec,1024) ;
962 char* token = strtok(buf,
",") ;
986 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.
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 R__SUGGEST_ALTERNATIVE("begin()
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 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 *normalisationSet=nullptr) const
Evaluate object.
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.
RooArgList is a container object that can hold multiple RooAbsArg objects.
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.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
TString & Append(const char *cs)
std::string GetName(const std::string &scope_name)