Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "ROOT/RMakeUnique.hxx"
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(list.GetName())
159{
160 add(list,kTRUE) ; // 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/// Add contents of a RooArgList to the set.
250 add(list);
251 if (_name.Length() == 0)
252 _name = list.GetName();
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Add element to non-owning set. The operation will fail if
257/// a similarly named object already exists in the set, or
258/// the set is specified to own its elements. Eventual error messages
259/// can be suppressed with the silent flag
260
262{
263 return checkForDup(var,silent)? kFALSE : RooAbsCollection::add(var,silent) ;
264}
265
266
267
268////////////////////////////////////////////////////////////////////////////////
269/// Add element to an owning set. The operation will fail if
270/// a similarly named object already exists in the set, or
271/// the set is not specified to own its elements. Eventual error messages
272/// can be suppressed with the silent flag
273
275{
276 return checkForDup(var,silent)? kFALSE : RooAbsCollection::addOwned(var,silent) ;
277}
278
279
280
281////////////////////////////////////////////////////////////////////////////////
282/// Add clone of specified element to an owning set. If sucessful, the
283/// set will own the clone, not the original. The operation will fail if
284/// a similarly named object already exists in the set, or
285/// the set is not specified to own its elements. Eventual error messages
286/// can be suppressed with the silent flag
287
289{
290 return checkForDup(var,silent)? 0 : RooAbsCollection::addClone(var,silent) ;
291}
292
293
294
295////////////////////////////////////////////////////////////////////////////////
296/// Get reference to an element using its name. Named element must exist in set.
297/// \throws invalid_argument if an element with the given name is not in the set.
298///
299/// Note that since most RooFit objects use an assignment operator that copies
300/// values, an expression like
301/// ```
302/// mySet["x"] = y;
303/// ```
304/// will not replace the element "x", it just assigns the values of y.
306{
307 RooAbsArg* arg = find(name) ;
308 if (!arg) {
309 coutE(InputArguments) << "RooArgSet::operator[](" << GetName() << ") ERROR: no element named " << name << " in set" << endl ;
310 throw std::invalid_argument((TString("No element named '") + name + "' in set " + GetName()).Data());
311 }
312 return *arg ;
313}
314
315
316
317////////////////////////////////////////////////////////////////////////////////
318/// Check if element with var's name is already in set
319
321{
322 RooAbsArg *other = find(var);
323 if (other) {
324 if (other != &var) {
325 if (!silent) {
326 // print a warning if this variable is not the same one we
327 // already have
328 coutE(InputArguments) << "RooArgSet::checkForDup: ERROR argument with name " << var.GetName() << " is already in this set" << endl;
329 }
330 }
331 // don't add duplicates
332 return kTRUE;
333 }
334 return kFALSE ;
335}
336
337
338
339
340
341
342
343////////////////////////////////////////////////////////////////////////////////
344/// Write contents of the argset to specified file.
345/// See writeToStream() for details
346
347void RooArgSet::writeToFile(const char* fileName) const
348{
349 ofstream ofs(fileName) ;
350 if (ofs.fail()) {
351 coutE(InputArguments) << "RooArgSet::writeToFile(" << GetName() << ") error opening file " << fileName << endl ;
352 return ;
353 }
354 writeToStream(ofs,kFALSE) ;
355}
356
357
358
359////////////////////////////////////////////////////////////////////////////////
360/// Read contents of the argset from specified file.
361/// See readFromStream() for details
362
363Bool_t RooArgSet::readFromFile(const char* fileName, const char* flagReadAtt, const char* section, Bool_t verbose)
364{
365 ifstream ifs(fileName) ;
366 if (ifs.fail()) {
367 coutE(InputArguments) << "RooArgSet::readFromFile(" << GetName() << ") error opening file " << fileName << endl ;
368 return kTRUE ;
369 }
370 return readFromStream(ifs,kFALSE,flagReadAtt,section,verbose) ;
371}
372
373
374
375
376////////////////////////////////////////////////////////////////////////////////
377/// Write the contents of the argset in ASCII form to given stream.
378///
379/// A line is written for each element contained in the form
380/// `<argName> = <argValue>`
381///
382/// The `<argValue>` part of each element is written by the arguments'
383/// writeToStream() function.
384/// \param os The stream to write to.
385/// \param compact Write only the bare values, separated by ' '.
386/// \note In compact mode, the stream cannot be read back into a RooArgSet,
387/// but only into a RooArgList, because the variable names are lost.
388/// \param section If non-null, add a section header like `[<section>]`.
389void RooArgSet::writeToStream(ostream& os, Bool_t compact, const char* section) const
390{
391 if (section && section[0] != '\0')
392 os << '[' << section << ']' << '\n';
393
394 if (compact) {
395 for (const auto next : _list) {
396 next->writeToStream(os, true);
397 os << " ";
398 }
399 os << endl;
400 } else {
401 for (const auto next : _list) {
402 os << next->GetName() << " = " ;
403 next->writeToStream(os,kFALSE) ;
404 os << endl ;
405 }
406 }
407}
408
409
410
411
412////////////////////////////////////////////////////////////////////////////////
413/// Read the contents of the argset in ASCII form from given stream.
414///
415/// The stream is read to end-of-file and each line is assumed to be
416/// of the form
417/// \code
418/// <argName> = <argValue>
419/// \endcode
420/// Lines starting with argNames not matching any element in the list
421/// will be ignored with a warning message. In addition limited C++ style
422/// preprocessing and flow control is provided. The following constructions
423/// are recognized:
424/// \code
425/// include "include.file"
426/// \endcode
427/// Include given file, recursive inclusion OK
428/// \code
429/// if (<boolean_expression>)
430/// <name> = <value>
431/// ....
432/// else if (<boolean_expression>)
433/// ....
434/// else
435/// ....
436/// endif
437/// \endcode
438///
439/// All expressions are evaluated by RooFormula, and may involve any of
440/// the sets variables.
441/// \code
442/// echo <Message>
443/// \endcode
444/// Print console message while reading from stream
445/// \code
446/// abort
447/// \endcode
448/// Force termination of read sequence with error status
449///
450/// The value of each argument is read by the arguments readFromStream
451/// function.
452
453Bool_t RooArgSet::readFromStream(istream& is, Bool_t compact, const char* flagReadAtt, const char* section, Bool_t verbose)
454{
455 if (compact) {
456 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << ") compact mode not supported" << endl ;
457 return kTRUE ;
458 }
459
460 RooStreamParser parser(is) ;
461 parser.setPunctuation("=") ;
462 TString token ;
463 Bool_t retVal(kFALSE) ;
464
465 // Conditional stack and related state variables
466 // coverity[UNINIT]
467 Bool_t anyCondTrue[100] ;
468 Bool_t condStack[100] ;
469 Bool_t lastLineWasElse=kFALSE ;
470 Int_t condStackLevel=0 ;
471 condStack[0]=kTRUE ;
472
473 // Prepare section processing
474 TString sectionHdr("[") ;
475 if (section) sectionHdr.Append(section) ;
476 sectionHdr.Append("]") ;
477 Bool_t inSection(section?kFALSE:kTRUE) ;
478
479 Bool_t reprocessToken = kFALSE ;
480 while (1) {
481
482 if (is.eof() || is.fail() || parser.atEOF()) {
483 break ;
484 }
485
486 // Read next token until memEnd of file
487 if (!reprocessToken) {
488 token = parser.readToken() ;
489 }
490 reprocessToken = kFALSE ;
491
492 // Skip empty lines
493 if (token.IsNull()) {
494 continue ;
495 }
496
497 // Process include directives
498 if (!token.CompareTo("include")) {
499 if (parser.atEOL()) {
500 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName()
501 << "): no filename found after include statement" << endl ;
502 return kTRUE ;
503 }
504 TString filename = parser.readLine() ;
505 ifstream incfs(filename) ;
506 if (!incfs.good()) {
507 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): cannot open include file " << filename << endl ;
508 return kTRUE ;
509 }
510 coutI(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): processing include file "
511 << filename << endl ;
512 if (readFromStream(incfs,compact,flagReadAtt,inSection?0:section,verbose)) return kTRUE ;
513 continue ;
514 }
515
516 // Process section headers if requested
517 if (*token.Data()=='[') {
518 TString hdr(token) ;
519 const char* last = token.Data() + token.Length() -1 ;
520 if (*last != ']') {
521 hdr.Append(" ") ;
522 hdr.Append(parser.readLine()) ;
523 }
524 // parser.putBackToken(token) ;
525 // token = parser.readLine() ;
526 if (section) {
527 inSection = !sectionHdr.CompareTo(hdr) ;
528 }
529 continue ;
530 }
531
532 // If section is specified, ignore all data outside specified section
533 if (!inSection) {
534 parser.zapToEnd(kTRUE) ;
535 continue ;
536 }
537
538 // Conditional statement evaluation
539 if (!token.CompareTo("if")) {
540
541 // Extract conditional expressions and check validity
542 TString expr = parser.readLine() ;
543 RooFormula form(expr,expr,*this) ;
544 if (!form.ok()) return kTRUE ;
545
546 // Evaluate expression
547 Bool_t status = form.eval()?kTRUE:kFALSE ;
548 if (lastLineWasElse) {
549 anyCondTrue[condStackLevel] |= status ;
550 lastLineWasElse=kFALSE ;
551 } else {
552 condStackLevel++ ;
553 anyCondTrue[condStackLevel] = status ;
554 }
555 condStack[condStackLevel] = status ;
556
557 if (verbose) cxcoutD(Eval) << "RooArgSet::readFromStream(" << GetName()
558 << "): conditional expression " << expr << " = "
559 << (condStack[condStackLevel]?"true":"false") << endl ;
560 continue ; // go to next line
561 }
562
563 if (!token.CompareTo("else")) {
564 // Must have seen an if statement before
565 if (condStackLevel==0) {
566 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): unmatched 'else'" << endl ;
567 }
568
569 if (parser.atEOL()) {
570 // simple else: process if nothing else was true
571 condStack[condStackLevel] = !anyCondTrue[condStackLevel] ;
572 parser.zapToEnd(kFALSE) ;
573 continue ;
574 } else {
575 // if anything follows it should be 'if'
576 token = parser.readToken() ;
577 if (token.CompareTo("if")) {
578 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): syntax error: 'else " << token << "'" << endl ;
579 return kTRUE ;
580 } else {
581 if (anyCondTrue[condStackLevel]) {
582 // No need for further checking, true conditional already processed
583 condStack[condStackLevel] = kFALSE ;
584 parser.zapToEnd(kFALSE) ;
585 continue ;
586 } else {
587 // Process as normal 'if' no true conditional was encountered
588 reprocessToken = kTRUE ;
589 lastLineWasElse=kTRUE ;
590 continue ;
591 }
592 }
593 }
594 }
595
596 if (!token.CompareTo("endif")) {
597 // Must have seen an if statement before
598 if (condStackLevel==0) {
599 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): unmatched 'endif'" << endl ;
600 return kTRUE ;
601 }
602
603 // Decrease stack by one
604 condStackLevel-- ;
605 continue ;
606 }
607
608 // If current conditional is true
609 if (condStack[condStackLevel]) {
610
611 // Process echo statements
612 if (!token.CompareTo("echo")) {
613 TString message = parser.readLine() ;
614 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): >> " << message << endl ;
615 continue ;
616 }
617
618 // Process abort statements
619 if (!token.CompareTo("abort")) {
620 TString message = parser.readLine() ;
621 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): USER ABORT" << endl ;
622 return kTRUE ;
623 }
624
625 // Interpret the rest as <arg> = <value_expr>
626 RooAbsArg *arg ;
627
628 if ((arg = find(token)) && !arg->getAttribute("Dynamic")) {
629 if (parser.expectToken("=",kTRUE)) {
630 parser.zapToEnd(kTRUE) ;
631 retVal=kTRUE ;
632 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName()
633 << "): missing '=' sign: " << arg << endl ;
634 continue ;
635 }
636 Bool_t argRet = arg->readFromStream(is,kFALSE,verbose) ;
637 if (!argRet && flagReadAtt) arg->setAttribute(flagReadAtt,kTRUE) ;
638 retVal |= argRet ;
639 } else {
640 if (verbose) {
641 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): argument "
642 << token << " not in list, ignored" << endl ;
643 }
644 parser.zapToEnd(kTRUE) ;
645 }
646 } else {
647 parser.readLine() ;
648 }
649 }
650
651 // Did we fully unwind the conditional stack?
652 if (condStackLevel!=0) {
653 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): missing 'endif'" << endl ;
654 return kTRUE ;
655 }
656
657 return retVal ;
658}
659
660
661Bool_t RooArgSet::isInRange(const char* rangeSpec)
662{
663 char buf[1024] ;
664 strlcpy(buf,rangeSpec,1024) ;
665 char* token = strtok(buf,",") ;
666
667 TIterator* iter = createIterator() ;
668
669 while(token) {
670
671 Bool_t accept=kTRUE ;
672 iter->Reset() ;
673 RooAbsArg* arg ;
674 while((arg=(RooAbsArg*)iter->Next())) {
675 RooAbsRealLValue* lvarg = dynamic_cast<RooAbsRealLValue*>(arg) ;
676 if (lvarg) {
677 if (!lvarg->inRange(token)) {
678 accept=kFALSE ;
679 break ;
680 }
681 }
682 // WVE MUST HANDLE RooAbsCategoryLValue ranges as well
683 }
684 if (accept) {
685 delete iter ;
686 return kTRUE ;
687 }
688
689 token = strtok(0,",") ;
690 }
691
692 delete iter ;
693 return kFALSE ;
694}
#define coutI(a)
#define cxcoutD(a)
#define coutW(a)
#define coutE(a)
#define TRACE_DESTROY
Definition RooTrace.h:24
#define TRACE_CREATE
Definition RooTrace.h:23
const Bool_t kFALSE
Definition RtypesCore.h:92
const Bool_t kTRUE
Definition RtypesCore.h:91
#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:1494
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.
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
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 addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
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.
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.
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:21
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:29
RooArgSet()
Default constructor.
~RooArgSet() override
Destructor.
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),...
Definition RooArgSet.h:102
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.
Bool_t isInRange(const char *rangeSpec)
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
void writeToFile(const char *fileName) const
Write contents of the argset to specified file.
static MemPool * memPool()
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.
MemPoolForRooSets< RooArgSet, 10 *600 > MemPool
Definition RooArgSet.h:138
void processArg(const RooAbsArg &var)
Definition RooArgSet.h:131
RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add clone of specified element to an owning set.
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.
RooAbsArg & operator[](const TString &str) const
Get reference to an element using its name.
Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to an owning set.
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.
Bool_t ok() const
Definition RooFormula.h:59
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
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:63
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:438
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