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 ;
335 parser.setPunctuation(
"=") ;
356 if (
is.eof() ||
is.fail() ||
parser.atEOF()) {
367 if (
token.IsNull()) {
372 if (!
token.CompareTo(
"include")) {
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")) {
417 auto form = RooFormulaUtils::makeFormulaEvaluator(
expr.Data(),
expr.Data(), *
this);
420 bool status = RooFormulaUtils::evalFormula(*
form, *
this) ?
true :
false;
431 cxcoutD(Eval) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): conditional expression " <<
expr <<
" = "
437 if (!
token.CompareTo(
"else")) {
440 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): unmatched 'else'" << std::endl ;
451 if (
token.CompareTo(
"if")) {
452 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): syntax error: 'else " <<
token <<
"'" << std::endl ;
470 if (!
token.CompareTo(
"endif")) {
473 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): unmatched 'endif'" << std::endl ;
486 if (!
token.CompareTo(
"echo")) {
488 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): >> " << message << std::endl ;
493 if (!
token.CompareTo(
"abort")) {
495 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): USER ABORT" << std::endl ;
503 if (
parser.expectToken(
"=",
true)) {
506 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName()
507 <<
"): missing '=' sign: " << arg << std::endl ;
515 coutE(InputArguments) <<
"RooArgSet::readFromStream(" <<
GetName() <<
"): argument "
516 <<
token <<
" not in list, ignored" << std::endl ;
527 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.
Collection abstract base class.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
RooConstVar & RooConst(double val)