|
ROOT
Reference Guide |
|
Go to the documentation of this file.
64 #if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
72 #ifndef USEMEMPOOLFORARGSET
89 auto pool = memPool();
90 memPool()->teardown();
105 void* RooArgSet::operator
new (
size_t bytes)
110 return memPool()->allocate(bytes);
119 void* RooArgSet::operator
new (
size_t bytes,
void* ptr) noexcept
121 return ::operator
new (bytes, ptr);
128 void 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())) {
217 <<
" is not a RooAbsArg, ignored" << endl ;
310 throw std::invalid_argument((
TString(
"No element named '") +
name +
"' in set " +
GetName()).Data());
328 coutE(
InputArguments) <<
"RooArgSet::checkForDup: ERROR argument with name " << var.
GetName() <<
" is already in this set" << endl;
485 return ras->getVal() ;
519 ofstream ofs(fileName) ;
535 ifstream ifs(fileName) ;
561 if (section && section[0] !=
'\0')
562 os <<
'[' << section <<
']' <<
'\n';
565 for (
const auto next :
_list) {
566 next->writeToStream(os,
true);
571 for (
const auto next :
_list) {
572 os << next->GetName() <<
" = " ;
573 next->writeToStream(os,
kFALSE) ;
640 Int_t condStackLevel=0 ;
645 if (section) sectionHdr.
Append(section) ;
652 if (is.eof() || is.fail() || parser.
atEOF()) {
657 if (!reprocessToken) {
669 if (parser.
atEOL()) {
671 <<
"): no filename found after include statement" << endl ;
675 ifstream incfs(filename) ;
681 << filename << endl ;
687 if (*token.
Data()==
'[') {
689 const char* last = token.
Data() + token.
Length() -1 ;
718 if (lastLineWasElse) {
719 anyCondTrue[condStackLevel] |= status ;
723 anyCondTrue[condStackLevel] = status ;
725 condStack[condStackLevel] = status ;
728 <<
"): conditional expression " << expr <<
" = "
729 << (condStack[condStackLevel]?
"true":
"false") << endl ;
735 if (condStackLevel==0) {
739 if (parser.
atEOL()) {
741 condStack[condStackLevel] = !anyCondTrue[condStackLevel] ;
751 if (anyCondTrue[condStackLevel]) {
753 condStack[condStackLevel] =
kFALSE ;
758 reprocessToken =
kTRUE ;
759 lastLineWasElse=
kTRUE ;
768 if (condStackLevel==0) {
779 if (condStack[condStackLevel]) {
803 <<
"): missing '=' sign: " << arg << endl ;
812 << token <<
" not in list, ignored" << endl ;
822 if (condStackLevel!=0) {
834 strlcpy(buf,rangeSpec,1024) ;
835 char* token = strtok(buf,
",") ;
859 token = strtok(0,
",") ;
MemPoolForRooSets< RooArgSet, 10 *600 > MemPool
virtual Bool_t inRange(const char *name) const
Check if current value is inside range with given name.
void zapToEnd(Bool_t inclContLines=kFALSE)
Eat all characters up to and including then end of the current line.
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...
void writeToFile(const char *fileName) const
Write contents of the argset to specified file.
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 value_type getCurrentIndex() const
Return index number of current state.
virtual bool setLabel(const char *label, Bool_t printError=kTRUE)=0
Change category state by specifying a state name.
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.
Bool_t checkForDup(const RooAbsArg &arg, Bool_t silent) const
Check if element with var's name is already in set.
const char * Data() const
Bool_t isInRange(const char *rangeSpec)
RooArgSet()
Default constructor.
RooArgList is a container object that can hold multiple RooAbsArg objects.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
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.
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.
Bool_t atEOL()
If true, parser is at end of line in stream.
RooAbsArg * find(const char *name) const
Find object with given name in list.
void processArg(const RooAbsArg &var)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
~RooArgSet() override
Destructor.
TString readToken()
Read one token separated by any of the know punctuation characters This function recognizes and handl...
const char * GetName() const
Returns name of object.
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 const char * getCurrentLabel() const
Return label string of current state.
Iterator abstract base class.
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
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.
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
virtual const char * GetName() const
Returns name of object.
Bool_t contains(const RooAbsArg &var) const
Check if collection contains an argument with the same name as var.
virtual bool setIndex(value_type index, bool printError=true)=0
Change category state by specifying the index code of the desired state.
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
TString & Append(const char *cs)
static MemPool * memPool()
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
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.
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
RooAbsArg & operator[](const TString &str) const
Get reference to an element using its name.
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.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual TObject * Next()=0
Memory pool for RooArgSet and RooDataSet.
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),...
TString readLine()
Read an entire line from the stream and return as TString This method recognizes the use of '\' in th...
void setPunctuation(const TString &punct)
Change list of characters interpreted as punctuation.
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)=0
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
RooStringVar is a RooAbsArg implementing string values.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Mother of all ROOT objects.
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
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.
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Collection abstract base class.
virtual const char * GetName() const
Returns name of object.
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
const char * getStringValue(const char *name, const char *defVal="", Bool_t verbose=kFALSE) const
Get string value of a RooStringVar stored in set with given name.
virtual void setVal(Double_t value)=0
Set the current value of the object. Needs to be overridden by implementations.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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.
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.