69using std::istream, std::ostream, std::ifstream, std::ofstream, std::endl;
140 coutW(InputArguments) <<
"RooArgSet::RooArgSet(TCollection) element " << obj->
GetName()
141 <<
" is not a RooAbsArg, ignored" << std::endl ;
183 coutE(InputArguments) <<
"RooArgSet::operator[](" <<
GetName() <<
") ERROR: no element named " <<
name <<
" in set" << std::endl ;
184 throw std::invalid_argument((
TString(
"No element named '") +
name +
"' in set " +
GetName()).Data());
202 coutE(InputArguments) <<
"RooArgSet::checkForDup: ERROR argument with name " << var.
GetName() <<
" is already in this set" << std::endl;
223 ofstream
ofs(fileName) ;
225 coutE(InputArguments) <<
"RooArgSet::writeToFile(" <<
GetName() <<
") error opening file " << fileName << std::endl ;
239 ifstream
ifs(fileName) ;
241 coutE(InputArguments) <<
"RooArgSet::readFromFile(" <<
GetName() <<
") error opening file " << fileName << std::endl ;
266 os <<
'[' <<
section <<
']' <<
'\n';
269 for (
const auto next :
_list) {
270 next->writeToStream(os,
true);
275 for (
const auto next :
_list) {
276 os << next->GetName() <<
" = " ;
277 next->writeToStream(os,
false) ;
330 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
") compact mode not supported" << std::endl ;
356 if (
is.eof() ||
is.fail() || parser.
atEOF()) {
367 if (
token.IsNull()) {
372 if (!
token.CompareTo(
"include")) {
373 if (parser.
atEOL()) {
374 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName()
375 <<
"): no filename found after include statement" << std::endl ;
381 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): cannot open include file " <<
filename << std::endl ;
384 coutI(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): processing include file "
391 if (*
token.Data()==
'[') {
393 const char* last =
token.Data() +
token.Length() -1 ;
413 if (!
token.CompareTo(
"if")) {
432 cxcoutD(Eval) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): conditional expression " <<
expr <<
" = "
438 if (!
token.CompareTo(
"else")) {
441 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): unmatched 'else'" << std::endl ;
444 if (parser.
atEOL()) {
452 if (
token.CompareTo(
"if")) {
453 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): syntax error: 'else " <<
token <<
"'" << std::endl ;
471 if (!
token.CompareTo(
"endif")) {
474 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): unmatched 'endif'" << std::endl ;
487 if (!
token.CompareTo(
"echo")) {
489 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): >> " << message << std::endl ;
494 if (!
token.CompareTo(
"abort")) {
496 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): USER ABORT" << std::endl ;
507 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName()
508 <<
"): missing '=' sign: " << arg << std::endl ;
516 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): argument "
517 <<
token <<
" not in list, ignored" << std::endl ;
528 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)