Logo ROOT  
Reference Guide
RooArgSet.cxx
Go to the documentation of this file.
1/***************************************************************************** * Project: RooFit *
2 * Package: RooFitCore *
3 * @(#)root/roofitcore:$Id$
4 * Authors: *
5 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
6 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
7 * *
8 * Copyright (c) 2000-2005, Regents of the University of California *
9 * and Stanford University. All rights reserved. *
10 * *
11 * Redistribution and use in source and binary forms, *
12 * with or without modification, are permitted according to the terms *
13 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
14 *****************************************************************************/
15
16//////////////////////////////////////////////////////////////////////////////
17/// \class RooArgSet
18/// RooArgSet is a container object that can hold multiple RooAbsArg objects.
19/// The container has set semantics which means that:
20///
21/// - Every object it contains must have a unique name returned by GetName().
22///
23/// - Contained objects are not ordered, although the set can be traversed
24/// using an iterator returned by createIterator(). The iterator does not
25/// necessarily follow the object insertion order.
26///
27/// - Objects can be retrieved by name only, and not by index.
28///
29///
30/// Ownership of contents
31/// -------------------------
32/// Unowned objects are inserted with the add() method. Owned objects
33/// are added with addOwned() or addClone(). A RooArgSet either owns all
34/// of it contents, or none, which is determined by the first `add`
35/// call. Once an ownership status is selected, inappropriate `add` calls
36/// will return error status. Clearing the list via removeAll() resets the
37/// ownership status. Arguments supplied in the constructor are always added
38/// as unowned elements.
39///
40///
41
42#include "RooArgSet.h"
43
44#include "TClass.h"
45#include "RooStreamParser.h"
46#include "RooFormula.h"
47#include "RooAbsRealLValue.h"
49#include "RooStringVar.h"
50#include "RooTrace.h"
51#include "RooArgList.h"
52#include "RooSentinel.h"
53#include "RooMsgService.h"
54#include "RooConstVar.h"
55#include "strlcpy.h"
56
57#include <iostream>
58#include <fstream>
59#include <iomanip>
60#include <stdexcept>
61
62using namespace std ;
63
64#if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
65char* operator+( streampos&, char* );
66#endif
67
69
70
71
72#ifndef USEMEMPOOLFORARGSET
74#else
75
76#include "MemPoolForRooSets.h"
77
80 static auto * memPool = new RooArgSet::MemPool();
81 return memPool;
82}
83
84////////////////////////////////////////////////////////////////////////////////
85/// Clear memory pool on exit to avoid reported memory leaks
86
88{
89 auto pool = memPool();
90 memPool()->teardown();
91
92 //Here, the pool might have to leak if RooArgSets are still alive.
93 if (pool->empty())
94 delete pool;
95}
96
97
98////////////////////////////////////////////////////////////////////////////////
99/// Overloaded new operator guarantees that all RooArgSets allocated with new
100/// have a unique address, a property that is exploited in several places
101/// in roofit to quickly index contents on normalization set pointers.
102/// The memory pool only allocates space for the class itself. The elements
103/// stored in the set are stored outside the pool.
104
105void* RooArgSet::operator new (size_t bytes)
106{
107 //This will fail if a derived class uses this operator
108 assert(sizeof(RooArgSet) == bytes);
109
110 return memPool()->allocate(bytes);
111}
112
113
114////////////////////////////////////////////////////////////////////////////////
115/// Overloaded new operator with placement does not guarante that all
116/// RooArgSets allocated with new have a unique address, but uses the global
117/// operator.
118
119void* RooArgSet::operator new (size_t bytes, void* ptr) noexcept
120{
121 return ::operator new (bytes, ptr);
122}
123
124
125////////////////////////////////////////////////////////////////////////////////
126/// Memory is owned by pool, we need to do nothing to release it
127
128void RooArgSet::operator delete (void* ptr)
129{
130 // Decrease use count in pool that ptr is on
131 if (memPool()->deallocate(ptr))
132 return;
133
134 std::cerr << __func__ << " " << ptr << " is not in any of the pools." << std::endl;
135
136 // Not part of any pool; use global op delete:
137 ::operator delete(ptr);
138}
139
140#endif
141
142
143////////////////////////////////////////////////////////////////////////////////
144/// Default constructor
145
148{
150}
151
152
153////////////////////////////////////////////////////////////////////////////////
154/// Constructor from a RooArgList. If the list contains multiple
155/// objects with the same name, only the first is store in the set.
156/// Warning messages will be printed for dropped items.
158 RooAbsCollection(coll.GetName())
159{
160 add(coll,true) ; // verbose to catch duplicate errors
162}
163
164
165////////////////////////////////////////////////////////////////////////////////
166/// Constructor from a RooArgSet / RooArgList and a pointer to another RooFit object.
167///
168/// \param[in] collection Collection of RooFit objects to be added. If a list contains multiple
169/// objects with the same name, only the first is stored in the set.
170/// Warning messages will be printed for dropped items.
171/// \param[in] var1 Further object to be added. If it is already in `collection`,
172/// nothing happens, and the warning message is suppressed.
173RooArgSet::RooArgSet(const RooAbsCollection& collection, const RooAbsArg* var1) :
174 RooAbsCollection(collection.GetName())
175{
176 if (var1 && !collection.contains(*var1)) {
177 add(*var1,kTRUE) ;
178 }
179 add(collection,kTRUE) ; // verbose to catch duplicate errors
181}
182
183
184////////////////////////////////////////////////////////////////////////////////
185/// Empty set constructor.
188{
190}
191
192
193////////////////////////////////////////////////////////////////////////////////
194/// Construct a set from two existing sets. The new set will not own its
195/// contents.
196RooArgSet::RooArgSet(const RooArgSet& set1, const RooArgSet& set2, const char *name) : RooAbsCollection(name)
197{
198 add(set1) ;
199 add(set2) ;
201}
202
203
204////////////////////////////////////////////////////////////////////////////////
205/// Constructor from a root TCollection. Elements in the collection that
206/// do not inherit from RooAbsArg will be skipped. A warning message
207/// will be printed for every skipped item.
208
209RooArgSet::RooArgSet(const TCollection& tcoll, const char* name) :
211{
212 TIterator* iter = tcoll.MakeIterator() ;
213 TObject* obj ;
214 while((obj=iter->Next())) {
215 if (!dynamic_cast<RooAbsArg*>(obj)) {
216 coutW(InputArguments) << "RooArgSet::RooArgSet(TCollection) element " << obj->GetName()
217 << " is not a RooAbsArg, ignored" << endl ;
218 continue ;
219 }
220 add(*(RooAbsArg*)obj) ;
221 }
222 delete iter ;
224}
225
226
227////////////////////////////////////////////////////////////////////////////////
228/// Copy constructor. Note that a copy of a set is always non-owning,
229/// even if the source set owns its contents. To create an owning copy of
230/// a set (owning or not), use the snapshot() method.
231RooArgSet::RooArgSet(const RooArgSet& other, const char *name)
232 : RooAbsCollection(other,name)
233{
235}
236
237
238////////////////////////////////////////////////////////////////////////////////
239/// Destructor
240
242{
244}
245
246
247////////////////////////////////////////////////////////////////////////////////
248
249////////////////////////////////////////////////////////////////////////////////
250/// Get reference to an element using its name. Named element must exist in set.
251/// \throws invalid_argument if an element with the given name is not in the set.
252///
253/// Note that since most RooFit objects use an assignment operator that copies
254/// values, an expression like
255/// ```
256/// mySet["x"] = y;
257/// ```
258/// will not replace the element "x", it just assigns the values of y.
260{
261 RooAbsArg* arg = find(name) ;
262 if (!arg) {
263 coutE(InputArguments) << "RooArgSet::operator[](" << GetName() << ") ERROR: no element named " << name << " in set" << endl ;
264 throw std::invalid_argument((TString("No element named '") + name + "' in set " + GetName()).Data());
265 }
266 return *arg ;
267}
268
269
270
271////////////////////////////////////////////////////////////////////////////////
272/// Check if element with var's name is already in set
273
275{
276 RooAbsArg *other = find(var);
277 if (other) {
278 if (other != &var) {
279 if (!silent) {
280 // print a warning if this variable is not the same one we
281 // already have
282 coutE(InputArguments) << "RooArgSet::checkForDup: ERROR argument with name " << var.GetName() << " is already in this set" << endl;
283 }
284 }
285 // don't add duplicates
286 return kTRUE;
287 }
288 return kFALSE ;
289}
290
291
292
293
294
295
296
297////////////////////////////////////////////////////////////////////////////////
298/// Write contents of the argset to specified file.
299/// See writeToStream() for details
300
301void RooArgSet::writeToFile(const char* fileName) const
302{
303 ofstream ofs(fileName) ;
304 if (ofs.fail()) {
305 coutE(InputArguments) << "RooArgSet::writeToFile(" << GetName() << ") error opening file " << fileName << endl ;
306 return ;
307 }
308 writeToStream(ofs,kFALSE) ;
309}
310
311
312
313////////////////////////////////////////////////////////////////////////////////
314/// Read contents of the argset from specified file.
315/// See readFromStream() for details
316
317Bool_t RooArgSet::readFromFile(const char* fileName, const char* flagReadAtt, const char* section, Bool_t verbose)
318{
319 ifstream ifs(fileName) ;
320 if (ifs.fail()) {
321 coutE(InputArguments) << "RooArgSet::readFromFile(" << GetName() << ") error opening file " << fileName << endl ;
322 return kTRUE ;
323 }
324 return readFromStream(ifs,kFALSE,flagReadAtt,section,verbose) ;
325}
326
327
328
329
330////////////////////////////////////////////////////////////////////////////////
331/// Write the contents of the argset in ASCII form to given stream.
332///
333/// A line is written for each element contained in the form
334/// `<argName> = <argValue>`
335///
336/// The `<argValue>` part of each element is written by the arguments'
337/// writeToStream() function.
338/// \param os The stream to write to.
339/// \param compact Write only the bare values, separated by ' '.
340/// \note In compact mode, the stream cannot be read back into a RooArgSet,
341/// but only into a RooArgList, because the variable names are lost.
342/// \param section If non-null, add a section header like `[<section>]`.
343void RooArgSet::writeToStream(ostream& os, Bool_t compact, const char* section) const
344{
345 if (section && section[0] != '\0')
346 os << '[' << section << ']' << '\n';
347
348 if (compact) {
349 for (const auto next : _list) {
350 next->writeToStream(os, true);
351 os << " ";
352 }
353 os << endl;
354 } else {
355 for (const auto next : _list) {
356 os << next->GetName() << " = " ;
357 next->writeToStream(os,kFALSE) ;
358 os << endl ;
359 }
360 }
361}
362
363
364
365
366////////////////////////////////////////////////////////////////////////////////
367/// Read the contents of the argset in ASCII form from given stream.
368///
369/// The stream is read to end-of-file and each line is assumed to be
370/// of the form
371/// \code
372/// <argName> = <argValue>
373/// \endcode
374/// Lines starting with argNames not matching any element in the list
375/// will be ignored with a warning message. In addition limited C++ style
376/// preprocessing and flow control is provided. The following constructions
377/// are recognized:
378/// \code
379/// include "include.file"
380/// \endcode
381/// Include given file, recursive inclusion OK
382/// \code
383/// if (<boolean_expression>)
384/// <name> = <value>
385/// ....
386/// else if (<boolean_expression>)
387/// ....
388/// else
389/// ....
390/// endif
391/// \endcode
392///
393/// All expressions are evaluated by RooFormula, and may involve any of
394/// the sets variables.
395/// \code
396/// echo <Message>
397/// \endcode
398/// Print console message while reading from stream
399/// \code
400/// abort
401/// \endcode
402/// Force termination of read sequence with error status
403///
404/// The value of each argument is read by the arguments readFromStream
405/// function.
406
407Bool_t RooArgSet::readFromStream(istream& is, Bool_t compact, const char* flagReadAtt, const char* section, Bool_t verbose)
408{
409 if (compact) {
410 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << ") compact mode not supported" << endl ;
411 return kTRUE ;
412 }
413
414 RooStreamParser parser(is) ;
415 parser.setPunctuation("=") ;
416 TString token ;
417 Bool_t retVal(kFALSE) ;
418
419 // Conditional stack and related state variables
420 // coverity[UNINIT]
421 Bool_t anyCondTrue[100] ;
422 Bool_t condStack[100] ;
423 Bool_t lastLineWasElse=kFALSE ;
424 Int_t condStackLevel=0 ;
425 condStack[0]=kTRUE ;
426
427 // Prepare section processing
428 TString sectionHdr("[") ;
429 if (section) sectionHdr.Append(section) ;
430 sectionHdr.Append("]") ;
431 Bool_t inSection(section?kFALSE:kTRUE) ;
432
433 Bool_t reprocessToken = kFALSE ;
434 while (1) {
435
436 if (is.eof() || is.fail() || parser.atEOF()) {
437 break ;
438 }
439
440 // Read next token until memEnd of file
441 if (!reprocessToken) {
442 token = parser.readToken() ;
443 }
444 reprocessToken = kFALSE ;
445
446 // Skip empty lines
447 if (token.IsNull()) {
448 continue ;
449 }
450
451 // Process include directives
452 if (!token.CompareTo("include")) {
453 if (parser.atEOL()) {
454 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName()
455 << "): no filename found after include statement" << endl ;
456 return kTRUE ;
457 }
458 TString filename = parser.readLine() ;
459 ifstream incfs(filename) ;
460 if (!incfs.good()) {
461 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): cannot open include file " << filename << endl ;
462 return kTRUE ;
463 }
464 coutI(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): processing include file "
465 << filename << endl ;
466 if (readFromStream(incfs,compact,flagReadAtt,inSection?0:section,verbose)) return kTRUE ;
467 continue ;
468 }
469
470 // Process section headers if requested
471 if (*token.Data()=='[') {
472 TString hdr(token) ;
473 const char* last = token.Data() + token.Length() -1 ;
474 if (*last != ']') {
475 hdr.Append(" ") ;
476 hdr.Append(parser.readLine()) ;
477 }
478 // parser.putBackToken(token) ;
479 // token = parser.readLine() ;
480 if (section) {
481 inSection = !sectionHdr.CompareTo(hdr) ;
482 }
483 continue ;
484 }
485
486 // If section is specified, ignore all data outside specified section
487 if (!inSection) {
488 parser.zapToEnd(kTRUE) ;
489 continue ;
490 }
491
492 // Conditional statement evaluation
493 if (!token.CompareTo("if")) {
494
495 // Extract conditional expressions and check validity
496 TString expr = parser.readLine() ;
497 RooFormula form(expr,expr,*this) ;
498 if (!form.ok()) return kTRUE ;
499
500 // Evaluate expression
501 Bool_t status = form.eval()?kTRUE:kFALSE ;
502 if (lastLineWasElse) {
503 anyCondTrue[condStackLevel] |= status ;
504 lastLineWasElse=kFALSE ;
505 } else {
506 condStackLevel++ ;
507 anyCondTrue[condStackLevel] = status ;
508 }
509 condStack[condStackLevel] = status ;
510
511 if (verbose) cxcoutD(Eval) << "RooArgSet::readFromStream(" << GetName()
512 << "): conditional expression " << expr << " = "
513 << (condStack[condStackLevel]?"true":"false") << endl ;
514 continue ; // go to next line
515 }
516
517 if (!token.CompareTo("else")) {
518 // Must have seen an if statement before
519 if (condStackLevel==0) {
520 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): unmatched 'else'" << endl ;
521 }
522
523 if (parser.atEOL()) {
524 // simple else: process if nothing else was true
525 condStack[condStackLevel] = !anyCondTrue[condStackLevel] ;
526 parser.zapToEnd(kFALSE) ;
527 continue ;
528 } else {
529 // if anything follows it should be 'if'
530 token = parser.readToken() ;
531 if (token.CompareTo("if")) {
532 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): syntax error: 'else " << token << "'" << endl ;
533 return kTRUE ;
534 } else {
535 if (anyCondTrue[condStackLevel]) {
536 // No need for further checking, true conditional already processed
537 condStack[condStackLevel] = kFALSE ;
538 parser.zapToEnd(kFALSE) ;
539 continue ;
540 } else {
541 // Process as normal 'if' no true conditional was encountered
542 reprocessToken = kTRUE ;
543 lastLineWasElse=kTRUE ;
544 continue ;
545 }
546 }
547 }
548 }
549
550 if (!token.CompareTo("endif")) {
551 // Must have seen an if statement before
552 if (condStackLevel==0) {
553 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): unmatched 'endif'" << endl ;
554 return kTRUE ;
555 }
556
557 // Decrease stack by one
558 condStackLevel-- ;
559 continue ;
560 }
561
562 // If current conditional is true
563 if (condStack[condStackLevel]) {
564
565 // Process echo statements
566 if (!token.CompareTo("echo")) {
567 TString message = parser.readLine() ;
568 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): >> " << message << endl ;
569 continue ;
570 }
571
572 // Process abort statements
573 if (!token.CompareTo("abort")) {
574 TString message = parser.readLine() ;
575 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): USER ABORT" << endl ;
576 return kTRUE ;
577 }
578
579 // Interpret the rest as <arg> = <value_expr>
580 RooAbsArg *arg ;
581
582 if ((arg = find(token)) && !arg->getAttribute("Dynamic")) {
583 if (parser.expectToken("=",kTRUE)) {
584 parser.zapToEnd(kTRUE) ;
585 retVal=kTRUE ;
586 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName()
587 << "): missing '=' sign: " << arg << endl ;
588 continue ;
589 }
590 Bool_t argRet = arg->readFromStream(is,kFALSE,verbose) ;
591 if (!argRet && flagReadAtt) arg->setAttribute(flagReadAtt,kTRUE) ;
592 retVal |= argRet ;
593 } else {
594 if (verbose) {
595 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): argument "
596 << token << " not in list, ignored" << endl ;
597 }
598 parser.zapToEnd(kTRUE) ;
599 }
600 } else {
601 parser.readLine() ;
602 }
603 }
604
605 // Did we fully unwind the conditional stack?
606 if (condStackLevel!=0) {
607 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): missing 'endif'" << endl ;
608 return kTRUE ;
609 }
610
611 return retVal ;
612}
613
614
615Bool_t RooArgSet::isInRange(const char* rangeSpec)
616{
617 char buf[1024] ;
618 strlcpy(buf,rangeSpec,1024) ;
619 char* token = strtok(buf,",") ;
620
621 TIterator* iter = createIterator() ;
622
623 while(token) {
624
625 Bool_t accept=kTRUE ;
626 iter->Reset() ;
627 RooAbsArg* arg ;
628 while((arg=(RooAbsArg*)iter->Next())) {
629 RooAbsRealLValue* lvarg = dynamic_cast<RooAbsRealLValue*>(arg) ;
630 if (lvarg) {
631 if (!lvarg->inRange(token)) {
632 accept=kFALSE ;
633 break ;
634 }
635 }
636 // WVE MUST HANDLE RooAbsCategoryLValue ranges as well
637 }
638 if (accept) {
639 delete iter ;
640 return kTRUE ;
641 }
642
643 token = strtok(0,",") ;
644 }
645
646 delete iter ;
647 return kFALSE ;
648}
649
650
651void RooArgSet::processArg(double value) { processArg(RooFit::RooConst(value)); }
#define coutI(a)
Definition: RooMsgService.h:30
#define cxcoutD(a)
Definition: RooMsgService.h:81
#define coutW(a)
Definition: RooMsgService.h:32
#define coutE(a)
Definition: RooMsgService.h:33
#define TRACE_DESTROY
Definition: RooTrace.h:24
#define TRACE_CREATE
Definition: RooTrace.h:23
int Int_t
Definition: RtypesCore.h:45
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassImp(name)
Definition: Rtypes.h:364
char name[80]
Definition: TGX11.cxx:110
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
Definition: TString.cxx:1499
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 and a "shape" in RooFi...
Definition: RooAbsArg.h:72
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.
Definition: RooAbsArg.cxx:291
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Definition: RooAbsArg.cxx:314
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
Bool_t contains(const RooAbsArg &var) const
Check if collection contains an argument with the same name as var.
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
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 Bool_t inRange(const char *name) const
Check if current value is inside range with given name.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:35
RooArgSet()
Default constructor.
Definition: RooArgSet.cxx:146
~RooArgSet() override
Destructor.
Definition: RooArgSet.cxx:241
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.
Definition: RooArgSet.cxx:317
Bool_t isInRange(const char *rangeSpec)
Definition: RooArgSet.cxx:615
virtual void writeToStream(std::ostream &os, bool compact, const char *section=0) const
Write the contents of the argset in ASCII form to given stream.
Definition: RooArgSet.cxx:343
void writeToFile(const char *fileName) const
Write contents of the argset to specified file.
Definition: RooArgSet.cxx:301
static MemPool * memPool()
MemPoolForRooSets< RooArgSet, 10 *600 > MemPool
Definition: RooArgSet.h:200
static void cleanup()
Definition: RooArgSet.cxx:73
Bool_t checkForDup(const RooAbsArg &arg, Bool_t silent) const
Check if element with var's name is already in set.
Definition: RooArgSet.cxx:274
virtual bool readFromStream(std::istream &is, bool compact, bool verbose=false)
Shortcut for readFromStream(std::istream&, Bool_t, const char*, const char*, Bool_t),...
Definition: RooArgSet.h:138
void processArg(const RooAbsArg &arg)
Definition: RooArgSet.h:183
RooAbsArg & operator[](const TString &str) const
Get reference to an element using its name.
Definition: RooArgSet.cxx:259
RooFormula internally uses ROOT's TFormula to compute user-defined expressions of RooAbsArgs.
Definition: RooFormula.h:34
Double_t eval(const RooArgSet *nset=0) const
Evalute all parameters/observables, and then evaluate formula.
Definition: RooFormula.cxx:342
Bool_t ok() const
Definition: RooFormula.h:59
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
Definition: RooSentinel.cxx:55
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...
Collection abstract base class.
Definition: TCollection.h:65
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
Iterator abstract base class.
Definition: TIterator.h:30
virtual void Reset()=0
virtual TObject * Next()=0
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Mother of all ROOT objects.
Definition: TObject.h:37
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
Basic string class.
Definition: TString.h:136
Ssiz_t Length() const
Definition: TString.h:410
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Definition: TString.cxx:442
const char * Data() const
Definition: TString.h:369
Bool_t IsNull() const
Definition: TString.h:407
TString & Append(const char *cs)
Definition: TString.h:564
RooConstVar & RooConst(Double_t val)
@ InputArguments
Definition: RooGlobalFunc.h:61