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 "Riostream.h"
45#include "TClass.h"
46#include "RooErrorHandler.h"
47#include "RooStreamParser.h"
48#include "RooFormula.h"
49#include "RooAbsRealLValue.h"
51#include "RooStringVar.h"
52#include "RooTrace.h"
53#include "RooArgList.h"
54#include "RooSentinel.h"
55#include "RooMsgService.h"
56#include "ROOT/RMakeUnique.hxx"
57
58#include <iomanip>
59
60using namespace std ;
61
62#if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
63char* operator+( streampos&, char* );
64#endif
65
67
68
69
70#ifndef USEMEMPOOLFORARGSET
72#else
73
74#include "MemPoolForRooSets.h"
75
78 static auto * memPool = new RooArgSet::MemPool();
79 return memPool;
80}
81
82////////////////////////////////////////////////////////////////////////////////
83/// Clear memory pool on exit to avoid reported memory leaks
84
86{
87 auto pool = memPool();
88 memPool()->teardown();
89
90 //Here, the pool might have to leak if RooArgSets are still alive.
91 if (pool->empty())
92 delete pool;
93}
94
95
96////////////////////////////////////////////////////////////////////////////////
97/// Overloaded new operator guarantees that all RooArgSets allocated with new
98/// have a unique address, a property that is exploited in several places
99/// in roofit to quickly index contents on normalization set pointers.
100/// The memory pool only allocates space for the class itself. The elements
101/// stored in the set are stored outside the pool.
102
103void* RooArgSet::operator new (size_t bytes)
104{
105 //This will fail if a derived class uses this operator
106 assert(sizeof(RooArgSet) == bytes);
107
108 return memPool()->allocate(bytes);
109}
110
111
112////////////////////////////////////////////////////////////////////////////////
113/// Overloaded new operator with placement does not guarante that all
114/// RooArgSets allocated with new have a unique address, but uses the global
115/// operator.
116
117void* RooArgSet::operator new (size_t bytes, void* ptr) noexcept
118{
119 return ::operator new (bytes, ptr);
120}
121
122
123////////////////////////////////////////////////////////////////////////////////
124/// Memory is owned by pool, we need to do nothing to release it
125
126void RooArgSet::operator delete (void* ptr)
127{
128 // Decrease use count in pool that ptr is on
129 if (memPool()->deallocate(ptr))
130 return;
131
132 std::cerr << __func__ << " " << ptr << " is not in any of the pools." << std::endl;
133
134 // Not part of any pool; use global op delete:
135 ::operator delete(ptr);
136}
137
138#endif
139
140
141////////////////////////////////////////////////////////////////////////////////
142/// Default constructor
143
146{
148}
149
150
151
152////////////////////////////////////////////////////////////////////////////////
153/// Constructor from a RooArgList. If the list contains multiple
154/// objects with the same name, only the first is store in the set.
155/// Warning messages will be printed for dropped items.
156
158 RooAbsCollection(list.GetName())
159{
160 add(list,kTRUE) ; // verbose to catch duplicate errors
162}
163
164
165
166////////////////////////////////////////////////////////////////////////////////
167/// Constructor from a RooArgList. If the list contains multiple
168/// objects with the same name, only the first is store in the set.
169/// Warning messages will be printed for dropped items.
170
171RooArgSet::RooArgSet(const RooArgList& list, const RooAbsArg* var1) :
172 RooAbsCollection(list.GetName())
173{
174 if (var1 && !list.contains(*var1)) {
175 add(*var1,kTRUE) ;
176 }
177 add(list,kTRUE) ; // verbose to catch duplicate errors
179}
180
181
182
183////////////////////////////////////////////////////////////////////////////////
184/// Empty set constructor
185
188{
190}
191
192
193
194
195////////////////////////////////////////////////////////////////////////////////
196/// Construct a set from two existing sets
197
198RooArgSet::RooArgSet(const RooArgSet& set1, const RooArgSet& set2, const char *name) : RooAbsCollection(name)
199{
200 add(set1) ;
201 add(set2) ;
203}
204
205
206
207
208////////////////////////////////////////////////////////////////////////////////
209/// Constructor for set containing 1 initial object
210
212 const char *name) :
214{
215 add(var1);
217}
218
219
220
221////////////////////////////////////////////////////////////////////////////////
222/// Constructor for set containing 2 initial objects
223
224RooArgSet::RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2,
225 const char *name) :
227{
228 add(var1); add(var2);
230}
231
232
233
234////////////////////////////////////////////////////////////////////////////////
235/// Constructor for set containing 3 initial objects
236
237RooArgSet::RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2,
238 const RooAbsArg& var3,
239 const char *name) :
241{
242 add(var1); add(var2); add(var3);
244}
245
246
247
248////////////////////////////////////////////////////////////////////////////////
249/// Constructor for set containing 4 initial objects
250
251RooArgSet::RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2,
252 const RooAbsArg& var3, const RooAbsArg& var4,
253 const char *name) :
255{
256 add(var1); add(var2); add(var3); add(var4);
258}
259
260
261
262////////////////////////////////////////////////////////////////////////////////
263/// Constructor for set containing 5 initial objects
264
266 const RooAbsArg& var2, const RooAbsArg& var3,
267 const RooAbsArg& var4, const RooAbsArg& var5,
268 const char *name) :
270{
271 add(var1); add(var2); add(var3); add(var4); add(var5);
273}
274
275
276
277////////////////////////////////////////////////////////////////////////////////
278/// Constructor for set containing 6 initial objects
279
280RooArgSet::RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2,
281 const RooAbsArg& var3, const RooAbsArg& var4,
282 const RooAbsArg& var5, const RooAbsArg& var6,
283 const char *name) :
285{
286 add(var1); add(var2); add(var3); add(var4); add(var5); add(var6);
288}
289
290
291
292////////////////////////////////////////////////////////////////////////////////
293/// Constructor for set containing 7 initial objects
294
295RooArgSet::RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2,
296 const RooAbsArg& var3, const RooAbsArg& var4,
297 const RooAbsArg& var5, const RooAbsArg& var6,
298 const RooAbsArg& var7,
299 const char *name) :
301{
302 add(var1); add(var2); add(var3); add(var4); add(var5); add(var6); add(var7) ;
304}
305
306
307
308////////////////////////////////////////////////////////////////////////////////
309/// Constructor for set containing 8 initial objects
310
311RooArgSet::RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2,
312 const RooAbsArg& var3, const RooAbsArg& var4,
313 const RooAbsArg& var5, const RooAbsArg& var6,
314 const RooAbsArg& var7, const RooAbsArg& var8,
315 const char *name) :
317{
318 add(var1); add(var2); add(var3); add(var4); add(var5); add(var6); add(var7) ;add(var8) ;
320}
321
322
323
324////////////////////////////////////////////////////////////////////////////////
325/// Constructor for set containing 9 initial objects
326
327RooArgSet::RooArgSet(const RooAbsArg& var1, const RooAbsArg& var2,
328 const RooAbsArg& var3, const RooAbsArg& var4,
329 const RooAbsArg& var5, const RooAbsArg& var6,
330 const RooAbsArg& var7, const RooAbsArg& var8,
331 const RooAbsArg& var9, const char *name) :
333{
334 add(var1); add(var2); add(var3); add(var4); add(var5); add(var6); add(var7); add(var8); add(var9);
336}
337
338
339
340////////////////////////////////////////////////////////////////////////////////
341/// Constructor from a root TCollection. Elements in the collection that
342/// do not inherit from RooAbsArg will be skipped. A warning message
343/// will be printed for every skipped item.
344
345RooArgSet::RooArgSet(const TCollection& tcoll, const char* name) :
347{
348 TIterator* iter = tcoll.MakeIterator() ;
349 TObject* obj ;
350 while((obj=iter->Next())) {
351 if (!dynamic_cast<RooAbsArg*>(obj)) {
352 coutW(InputArguments) << "RooArgSet::RooArgSet(TCollection) element " << obj->GetName()
353 << " is not a RooAbsArg, ignored" << endl ;
354 continue ;
355 }
356 add(*(RooAbsArg*)obj) ;
357 }
358 delete iter ;
360}
361
362
363
364////////////////////////////////////////////////////////////////////////////////
365/// Copy constructor. Note that a copy of a set is always non-owning,
366/// even the source set is owning. To create an owning copy of
367/// a set (owning or not), use the snaphot() method.
368
369RooArgSet::RooArgSet(const RooArgSet& other, const char *name)
370 : RooAbsCollection(other,name)
371{
373}
374
375
376
377////////////////////////////////////////////////////////////////////////////////
378/// Destructor
379
381{
383}
384
385
386
387////////////////////////////////////////////////////////////////////////////////
388/// Add element to non-owning set. The operation will fail if
389/// a similarly named object already exists in the set, or
390/// the set is specified to own its elements. Eventual error messages
391/// can be suppressed with the silent flag
392
394{
395 return checkForDup(var,silent)? kFALSE : RooAbsCollection::add(var,silent) ;
396}
397
398
399
400////////////////////////////////////////////////////////////////////////////////
401/// Add element to an owning set. The operation will fail if
402/// a similarly named object already exists in the set, or
403/// the set is not specified to own its elements. Eventual error messages
404/// can be suppressed with the silent flag
405
407{
408 return checkForDup(var,silent)? kFALSE : RooAbsCollection::addOwned(var,silent) ;
409}
410
411
412
413////////////////////////////////////////////////////////////////////////////////
414/// Add clone of specified element to an owning set. If sucessful, the
415/// set will own the clone, not the original. The operation will fail if
416/// a similarly named object already exists in the set, or
417/// the set is not specified to own its elements. Eventual error messages
418/// can be suppressed with the silent flag
419
421{
422 return checkForDup(var,silent)? 0 : RooAbsCollection::addClone(var,silent) ;
423}
424
425
426
427////////////////////////////////////////////////////////////////////////////////
428/// Array operator. Named element must exist in set, otherwise
429/// code will abort.
430///
431/// When used as lvalue in assignment operations, the element contained in
432/// the list will not be changed, only the value of the existing element!
433
435{
436 RooAbsArg* arg = find(name) ;
437 if (!arg) {
438 coutE(InputArguments) << "RooArgSet::operator[](" << GetName() << ") ERROR: no element named " << name << " in set" << endl ;
440 }
441 return *arg ;
442}
443
444
445
446////////////////////////////////////////////////////////////////////////////////
447/// Check if element with var's name is already in set
448
450{
451 RooAbsArg *other = find(var);
452 if (other) {
453 if (other != &var) {
454 if (!silent) {
455 // print a warning if this variable is not the same one we
456 // already have
457 coutE(InputArguments) << "RooArgSet::checkForDup: ERROR argument with name " << var.GetName() << " is already in this set" << endl;
458 }
459 }
460 // don't add duplicates
461 return kTRUE;
462 }
463 return kFALSE ;
464}
465
466
467
468
469
470
471
472////////////////////////////////////////////////////////////////////////////////
473/// Write contents of the argset to specified file.
474/// See writeToStream() for details
475
476void RooArgSet::writeToFile(const char* fileName) const
477{
478 ofstream ofs(fileName) ;
479 if (ofs.fail()) {
480 coutE(InputArguments) << "RooArgSet::writeToFile(" << GetName() << ") error opening file " << fileName << endl ;
481 return ;
482 }
483 writeToStream(ofs,kFALSE) ;
484}
485
486
487
488////////////////////////////////////////////////////////////////////////////////
489/// Read contents of the argset from specified file.
490/// See readFromStream() for details
491
492Bool_t RooArgSet::readFromFile(const char* fileName, const char* flagReadAtt, const char* section, Bool_t verbose)
493{
494 ifstream ifs(fileName) ;
495 if (ifs.fail()) {
496 coutE(InputArguments) << "RooArgSet::readFromFile(" << GetName() << ") error opening file " << fileName << endl ;
497 return kTRUE ;
498 }
499 return readFromStream(ifs,kFALSE,flagReadAtt,section,verbose) ;
500}
501
502
503
504
505////////////////////////////////////////////////////////////////////////////////
506/// Write the contents of the argset in ASCII form to given stream.
507///
508/// A line is written for each element contained in the form
509/// `<argName> = <argValue>`
510///
511/// The `<argValue>` part of each element is written by the arguments'
512/// writeToStream() function.
513/// \param os The stream to write to.
514/// \param compact Write only the bare values, separated by ' '.
515/// \note In compact mode, the stream cannot be read back into a RooArgSet,
516/// but only into a RooArgList, because the variable names are lost.
517/// \param section If non-null, add a section header like `[<section>]`.
518void RooArgSet::writeToStream(ostream& os, Bool_t compact, const char* section) const
519{
520 if (section && section[0] != '\0')
521 os << '[' << section << ']' << '\n';
522
523 if (compact) {
524 for (const auto next : _list) {
525 next->writeToStream(os, true);
526 os << " ";
527 }
528 os << endl;
529 } else {
530 for (const auto next : _list) {
531 os << next->GetName() << " = " ;
532 next->writeToStream(os,kFALSE) ;
533 os << endl ;
534 }
535 }
536}
537
538
539
540
541////////////////////////////////////////////////////////////////////////////////
542/// Read the contents of the argset in ASCII form from given stream.
543///
544/// The stream is read to end-of-file and each line is assumed to be
545/// of the form
546/// \code
547/// <argName> = <argValue>
548/// \endcode
549/// Lines starting with argNames not matching any element in the list
550/// will be ignored with a warning message. In addition limited C++ style
551/// preprocessing and flow control is provided. The following constructions
552/// are recognized:
553/// \code
554/// include "include.file"
555/// \endcode
556/// Include given file, recursive inclusion OK
557/// \code
558/// if (<boolean_expression>)
559/// <name> = <value>
560/// ....
561/// else if (<boolean_expression>)
562/// ....
563/// else
564/// ....
565/// endif
566/// \endcode
567///
568/// All expressions are evaluated by RooFormula, and may involve any of
569/// the sets variables.
570/// \code
571/// echo <Message>
572/// \endcode
573/// Print console message while reading from stream
574/// \code
575/// abort
576/// \endcode
577/// Force termination of read sequence with error status
578///
579/// The value of each argument is read by the arguments readFromStream
580/// function.
581
582Bool_t RooArgSet::readFromStream(istream& is, Bool_t compact, const char* flagReadAtt, const char* section, Bool_t verbose)
583{
584 if (compact) {
585 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << ") compact mode not supported" << endl ;
586 return kTRUE ;
587 }
588
589 RooStreamParser parser(is) ;
590 parser.setPunctuation("=") ;
591 TString token ;
592 Bool_t retVal(kFALSE) ;
593
594 // Conditional stack and related state variables
595 // coverity[UNINIT]
596 Bool_t anyCondTrue[100] ;
597 Bool_t condStack[100] ;
598 Bool_t lastLineWasElse=kFALSE ;
599 Int_t condStackLevel=0 ;
600 condStack[0]=kTRUE ;
601
602 // Prepare section processing
603 TString sectionHdr("[") ;
604 if (section) sectionHdr.Append(section) ;
605 sectionHdr.Append("]") ;
606 Bool_t inSection(section?kFALSE:kTRUE) ;
607
608 Bool_t reprocessToken = kFALSE ;
609 while (1) {
610
611 if (is.eof() || is.fail() || parser.atEOF()) {
612 break ;
613 }
614
615 // Read next token until memEnd of file
616 if (!reprocessToken) {
617 token = parser.readToken() ;
618 }
619 reprocessToken = kFALSE ;
620
621 // Skip empty lines
622 if (token.IsNull()) {
623 continue ;
624 }
625
626 // Process include directives
627 if (!token.CompareTo("include")) {
628 if (parser.atEOL()) {
629 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName()
630 << "): no filename found after include statement" << endl ;
631 return kTRUE ;
632 }
633 TString filename = parser.readLine() ;
634 ifstream incfs(filename) ;
635 if (!incfs.good()) {
636 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): cannot open include file " << filename << endl ;
637 return kTRUE ;
638 }
639 coutI(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): processing include file "
640 << filename << endl ;
641 if (readFromStream(incfs,compact,flagReadAtt,inSection?0:section,verbose)) return kTRUE ;
642 continue ;
643 }
644
645 // Process section headers if requested
646 if (*token.Data()=='[') {
647 TString hdr(token) ;
648 const char* last = token.Data() + token.Length() -1 ;
649 if (*last != ']') {
650 hdr.Append(" ") ;
651 hdr.Append(parser.readLine()) ;
652 }
653// parser.putBackToken(token) ;
654// token = parser.readLine() ;
655 if (section) {
656 inSection = !sectionHdr.CompareTo(hdr) ;
657 }
658 continue ;
659 }
660
661 // If section is specified, ignore all data outside specified section
662 if (!inSection) {
663 parser.zapToEnd(kTRUE) ;
664 continue ;
665 }
666
667 // Conditional statement evaluation
668 if (!token.CompareTo("if")) {
669
670 // Extract conditional expressions and check validity
671 TString expr = parser.readLine() ;
672 RooFormula form(expr,expr,*this) ;
673 if (!form.ok()) return kTRUE ;
674
675 // Evaluate expression
676 Bool_t status = form.eval()?kTRUE:kFALSE ;
677 if (lastLineWasElse) {
678 anyCondTrue[condStackLevel] |= status ;
679 lastLineWasElse=kFALSE ;
680 } else {
681 condStackLevel++ ;
682 anyCondTrue[condStackLevel] = status ;
683 }
684 condStack[condStackLevel] = status ;
685
686 if (verbose) cxcoutD(Eval) << "RooArgSet::readFromStream(" << GetName()
687 << "): conditional expression " << expr << " = "
688 << (condStack[condStackLevel]?"true":"false") << endl ;
689 continue ; // go to next line
690 }
691
692 if (!token.CompareTo("else")) {
693 // Must have seen an if statement before
694 if (condStackLevel==0) {
695 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): unmatched 'else'" << endl ;
696 }
697
698 if (parser.atEOL()) {
699 // simple else: process if nothing else was true
700 condStack[condStackLevel] = !anyCondTrue[condStackLevel] ;
701 parser.zapToEnd(kFALSE) ;
702 continue ;
703 } else {
704 // if anything follows it should be 'if'
705 token = parser.readToken() ;
706 if (token.CompareTo("if")) {
707 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): syntax error: 'else " << token << "'" << endl ;
708 return kTRUE ;
709 } else {
710 if (anyCondTrue[condStackLevel]) {
711 // No need for further checking, true conditional already processed
712 condStack[condStackLevel] = kFALSE ;
713 parser.zapToEnd(kFALSE) ;
714 continue ;
715 } else {
716 // Process as normal 'if' no true conditional was encountered
717 reprocessToken = kTRUE ;
718 lastLineWasElse=kTRUE ;
719 continue ;
720 }
721 }
722 }
723 }
724
725 if (!token.CompareTo("endif")) {
726 // Must have seen an if statement before
727 if (condStackLevel==0) {
728 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): unmatched 'endif'" << endl ;
729 return kTRUE ;
730 }
731
732 // Decrease stack by one
733 condStackLevel-- ;
734 continue ;
735 }
736
737 // If current conditional is true
738 if (condStack[condStackLevel]) {
739
740 // Process echo statements
741 if (!token.CompareTo("echo")) {
742 TString message = parser.readLine() ;
743 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): >> " << message << endl ;
744 continue ;
745 }
746
747 // Process abort statements
748 if (!token.CompareTo("abort")) {
749 TString message = parser.readLine() ;
750 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): USER ABORT" << endl ;
751 return kTRUE ;
752 }
753
754 // Interpret the rest as <arg> = <value_expr>
755 RooAbsArg *arg ;
756
757 if ((arg = find(token)) && !arg->getAttribute("Dynamic")) {
758 if (parser.expectToken("=",kTRUE)) {
759 parser.zapToEnd(kTRUE) ;
760 retVal=kTRUE ;
761 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName()
762 << "): missing '=' sign: " << arg << endl ;
763 continue ;
764 }
765 Bool_t argRet = arg->readFromStream(is,kFALSE,verbose) ;
766 if (!argRet && flagReadAtt) arg->setAttribute(flagReadAtt,kTRUE) ;
767 retVal |= argRet ;
768 } else {
769 if (verbose) {
770 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): argument "
771 << token << " not in list, ignored" << endl ;
772 }
773 parser.zapToEnd(kTRUE) ;
774 }
775 } else {
776 parser.readLine() ;
777 }
778 }
779
780 // Did we fully unwind the conditional stack?
781 if (condStackLevel!=0) {
782 coutE(InputArguments) << "RooArgSet::readFromStream(" << GetName() << "): missing 'endif'" << endl ;
783 return kTRUE ;
784 }
785
786 return retVal ;
787}
788
789
790Bool_t RooArgSet::isInRange(const char* rangeSpec)
791{
792 char buf[1024] ;
793 strlcpy(buf,rangeSpec,1024) ;
794 char* token = strtok(buf,",") ;
795
796 TIterator* iter = createIterator() ;
797
798 while(token) {
799
800 Bool_t accept=kTRUE ;
801 iter->Reset() ;
802 RooAbsArg* arg ;
803 while((arg=(RooAbsArg*)iter->Next())) {
804 RooAbsRealLValue* lvarg = dynamic_cast<RooAbsRealLValue*>(arg) ;
805 if (lvarg) {
806 if (!lvarg->inRange(token)) {
807 accept=kFALSE ;
808 break ;
809 }
810 }
811 // WVE MUST HANDLE RooAbsCategoryLValue ranges as well
812 }
813 if (accept) {
814 delete iter ;
815 return kTRUE ;
816 }
817
818 token = strtok(0,",") ;
819 }
820
821 delete iter ;
822 return kFALSE ;
823}
int Int_t
Definition: CPyCppyy.h:43
#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:23
#define TRACE_CREATE
Definition: RooTrace.h:22
const Bool_t kFALSE
Definition: RtypesCore.h:90
bool Bool_t
Definition: RtypesCore.h:61
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
char name[80]
Definition: TGX11.cxx:109
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
Definition: TString.cxx:1474
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 (of arbitrary type) an...
Definition: RooAbsArg.h:73
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:257
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Definition: RooAbsArg.cxx:280
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
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.
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:28
RooAbsArg & operator[](const char *name) const
Array operator.
Definition: RooArgSet.cxx:434
RooArgSet()
Default constructor.
Definition: RooArgSet.cxx:144
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:110
virtual Bool_t addOwned(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
Definition: RooArgSet.h:92
virtual ~RooArgSet()
Destructor.
Definition: RooArgSet.cxx:380
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:492
Bool_t isInRange(const char *rangeSpec)
Definition: RooArgSet.cxx:790
void writeToFile(const char *fileName) const
Write contents of the argset to specified file.
Definition: RooArgSet.cxx:476
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.
Definition: RooArgSet.cxx:518
MemPoolForRooSets< RooArgSet, 10 *600 > MemPool
Definition: RooArgSet.h:141
static MemPool * memPool()
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Definition: RooArgSet.h:88
static void cleanup()
Definition: RooArgSet.cxx:71
Bool_t checkForDup(const RooAbsArg &arg, Bool_t silent) const
Check if element with var's name is already in set.
Definition: RooArgSet.cxx:449
virtual void addClone(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
Definition: RooArgSet.h:96
static void softAbort()
RooFormula internally uses ROOT's TFormula to compute user-defined expressions of RooAbsArgs.
Definition: RooFormula.h:28
Double_t eval(const RooArgSet *nset=0) const
Evalute all parameters/observables, and then evaluate formula.
Definition: RooFormula.cxx:340
Bool_t ok() const
Definition: RooFormula.h:53
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
Definition: RooSentinel.cxx:57
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:357
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Definition: TString.cxx:418
const char * Data() const
Definition: TString.h:364
Bool_t IsNull() const
Definition: TString.h:402
TString & Append(const char *cs)
Definition: TString.h:559
@ InputArguments
Definition: RooGlobalFunc.h:68