70using std::istream, std::ostream, std::ifstream, std::ofstream, std::endl;
146 coutW(InputArguments) <<
"RooArgSet::RooArgSet(TCollection) element " << obj->
GetName()
147 <<
" is not a RooAbsArg, ignored" << std::endl ;
192 coutE(InputArguments) <<
"RooArgSet::operator[](" <<
GetName() <<
") ERROR: no element named " <<
name <<
" in set" << std::endl ;
193 throw std::invalid_argument((
TString(
"No element named '") +
name +
"' in set " +
GetName()).Data());
211 coutE(InputArguments) <<
"RooArgSet::checkForDup: ERROR argument with name " << var.
GetName() <<
" is already in this set" << std::endl;
232 ofstream
ofs(fileName) ;
234 coutE(InputArguments) <<
"RooArgSet::writeToFile(" <<
GetName() <<
") error opening file " << fileName << std::endl ;
248 ifstream
ifs(fileName) ;
250 coutE(InputArguments) <<
"RooArgSet::readFromFile(" <<
GetName() <<
") error opening file " << fileName << std::endl ;
275 os <<
'[' <<
section <<
']' <<
'\n';
278 for (
const auto next :
_list) {
279 next->writeToStream(os,
true);
284 for (
const auto next :
_list) {
285 os << next->GetName() <<
" = " ;
286 next->writeToStream(os,
false) ;
339 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
") compact mode not supported" << std::endl ;
365 if (
is.eof() ||
is.fail() || parser.
atEOF()) {
376 if (
token.IsNull()) {
381 if (!
token.CompareTo(
"include")) {
382 if (parser.
atEOL()) {
383 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName()
384 <<
"): no filename found after include statement" << std::endl ;
390 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): cannot open include file " <<
filename << std::endl ;
393 coutI(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): processing include file "
400 if (*
token.Data()==
'[') {
402 const char* last =
token.Data() +
token.Length() -1 ;
422 if (!
token.CompareTo(
"if")) {
441 cxcoutD(Eval) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): conditional expression " <<
expr <<
" = "
447 if (!
token.CompareTo(
"else")) {
450 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): unmatched 'else'" << std::endl ;
453 if (parser.
atEOL()) {
461 if (
token.CompareTo(
"if")) {
462 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): syntax error: 'else " <<
token <<
"'" << std::endl ;
480 if (!
token.CompareTo(
"endif")) {
483 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): unmatched 'endif'" << std::endl ;
496 if (!
token.CompareTo(
"echo")) {
498 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): >> " << message << std::endl ;
503 if (!
token.CompareTo(
"abort")) {
505 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): USER ABORT" << std::endl ;
516 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName()
517 <<
"): missing '=' sign: " << arg << std::endl ;
525 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): argument "
526 <<
token <<
" not in list, ignored" << std::endl ;
537 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): missing 'endif'" << std::endl ;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Common abstract base class for objects that represent a value and a "shape" in RooFit.
virtual bool readFromStream(std::istream &is, bool compact, bool verbose=false)=0
bool getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
void setAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
Abstract container object that can hold multiple RooAbsArg objects.
const char * GetName() const override
Returns name of object.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t _list
Actual object storage.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
bool isInRange(const char *rangeSpec)
bool checkForDup(const RooAbsArg &arg, bool silent) const
Check if element with var's name is already in set.
RooArgSet()
Default constructor.
~RooArgSet() override
Destructor.
void writeToFile(const char *fileName) const
Write contents of the argset to specified file.
bool readFromFile(const char *fileName, const char *flagReadAtt=nullptr, const char *section=nullptr, bool verbose=false)
Read contents of the argset from specified file.
virtual bool readFromStream(std::istream &is, bool compact, bool verbose=false)
Shortcut for readFromStream(std::istream&, bool, const char*, const char*, bool), setting flagReadAtt...
void processArg(const RooAbsArg &arg)
RooAbsArg & operator[](const TString &str) const
Get reference to an element using its name.
virtual void writeToStream(std::ostream &os, bool compact, const char *section=nullptr) const
Write the contents of the argset in ASCII form to given stream.
void setPunctuation(const TString &punct)
Change list of characters interpreted as punctuation.
bool expectToken(const TString &expected, bool zapOnError=false)
Read the next token and return true if it is identical to the given 'expected' token.
bool atEOL()
If true, parser is at end of line in stream.
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...
void zapToEnd(bool inclContLines=false)
Eat all characters up to and including then end of the current line.
Collection abstract base class.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
RooConstVar & RooConst(double val)