Logo ROOT   6.16/01
Reference Guide
RooAbsCategory.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooAbsCategory.cxx
19\class RooAbsCategory
20\ingroup Roofitcore
21
22RooAbsCategory is the common abstract base class for objects that
23represent a discrete value with a finite number of states. Each
24state consist of a label/index pair, which is stored in a
25RooCatType object.
26
27Implementation of RooAbsCategory may be derived, there no interface
28is provided to modify the contents, nor a public interface to define states.
29**/
30
31#include "RooFit.h"
32
33#include "Compression.h"
34#include "Riostream.h"
35#include "Riostream.h"
36#include <stdlib.h>
37#include "TString.h"
38#include "TH1.h"
39#include "TTree.h"
40#include "TLeaf.h"
41#include "RooAbsCategory.h"
42#include "RooArgSet.h"
43#include "Roo1DTable.h"
44#include "RooCategory.h"
45#include "RooMsgService.h"
46#include "RooVectorDataStore.h"
47
48using namespace std;
49
51;
52
53
54////////////////////////////////////////////////////////////////////////////////
55/// Constructor
56
57RooAbsCategory::RooAbsCategory(const char *name, const char *title) :
58 RooAbsArg(name,title), _value("NULL",0), _treeVar(kFALSE)
59{
63}
64
65
66
67////////////////////////////////////////////////////////////////////////////////
68/// Copy constructor, copies the registered category states from the original.
69
71 RooAbsArg(other,name), _value(other._value), _treeVar(other._treeVar)
72{
74
75 other._typeIter->Reset() ;
76 TObject* obj ;
77 while ((obj=other._typeIter->Next())) {
78 _types.Add(obj->Clone()) ;
79 }
80
83}
84
85
86
87////////////////////////////////////////////////////////////////////////////////
88/// Destructor
89
91{
92 // We own the contents of _types
93 delete _typeIter ;
94 _types.Delete() ;
95}
96
97
98
99////////////////////////////////////////////////////////////////////////////////
100/// Return index number of current state
101
103{
104 if (isValueDirty() || isShapeDirty()) {
105 _value = traceEval() ;
106
109 }
110
111 return _value.getVal() ;
112}
113
114
115
116////////////////////////////////////////////////////////////////////////////////
117/// Return label string of current state
118
119const char* RooAbsCategory::getLabel() const
120{
121 if (isValueDirty() || isShapeDirty()) {
122 _value = traceEval() ;
123
126 }
127
128 const char* ret = _value.GetName() ;
129 // If label is not set, do it now on the fly
130 if (ret==0) {
132 }
133 return _value.GetName() ;
134}
135
136
137
138////////////////////////////////////////////////////////////////////////////////
139/// Recalculate current value and check validity of new result.
140
142{
143 RooCatType value = evaluate() ;
144
145 // Standard tracing code goes here
146 if (!isValid(value)) {
147 }
148
149 // Call optional subclass tracing code
150 traceEvalHook(value) ;
151
152 return value ;
153}
154
155
156
157////////////////////////////////////////////////////////////////////////////////
158/// Return iterator over all defined states
159
161{
162 return _types.MakeIterator() ;
163}
164
165
166////////////////////////////////////////////////////////////////////////////////
167/// Equality operator with a integer (compares with state index number)
168
170{
171 return (index==getIndex()) ;
172}
173
174
175
176////////////////////////////////////////////////////////////////////////////////
177/// Equality operator with a string (compares with state label string)
178
179Bool_t RooAbsCategory::operator==(const char* label) const
180{
181 return !TString(label).CompareTo(getLabel()) ;
182}
183
184
185
186////////////////////////////////////////////////////////////////////////////////
187/// Equality operator with another RooAbsArg. Only functional
188/// is also a RooAbsCategory, will return true if index is the same
189
191{
192 const RooAbsCategory* otherCat = dynamic_cast<const RooAbsCategory*>(&other) ;
193 return otherCat ? operator==(otherCat->getIndex()) : kFALSE ;
194}
195
196
197////////////////////////////////////////////////////////////////////////////////
198
200{
201 if (!assumeSameType) {
202 const RooAbsCategory* otherCat = dynamic_cast<const RooAbsCategory*>(&other) ;
203 return otherCat ? operator==(otherCat->getIndex()) : kFALSE ;
204 } else {
205 return getIndex()==((RooAbsCategory&)other).getIndex() ;
206 }
207}
208
209
210
211
212////////////////////////////////////////////////////////////////////////////////
213/// Check if state with given index is defined
214
216{
217 return lookupType(index,kFALSE)?kTRUE:kFALSE ;
218}
219
220
221
222////////////////////////////////////////////////////////////////////////////////
223/// Check if state with given name is defined
224
225Bool_t RooAbsCategory::isValidLabel(const char* label) const
226{
227 return lookupType(label)?kTRUE:kFALSE ;
228}
229
230
231
232////////////////////////////////////////////////////////////////////////////////
233/// Define a new state with given name. The lowest available
234/// integer number is assigned as index value
235
236const RooCatType* RooAbsCategory::defineType(const char* label)
237{
238 // Find lowest unused index
239 Int_t index(-1) ;
240 while(lookupType(++index,kFALSE)) ;
241
242 // Assign this index to given label
243 return defineType(label,index) ;
244}
245
246
247////////////////////////////////////////////////////////////////////////////////
248/// Internal version of defineType that does not check if type
249/// already exists
250
252{
254 RooCatType *newType = new RooCatType(label,index) ;
255 _types.Add(newType) ;
256
257 if (first) _value = RooCatType(label,index) ;
258 setShapeDirty() ;
259
260 return newType ;
261}
262
263
264
265////////////////////////////////////////////////////////////////////////////////
266/// Define new state with given name and index number.
267
268const RooCatType* RooAbsCategory::defineType(const char* label, Int_t index)
269{
270 if (isValidIndex(index)) {
271 coutE(InputArguments) << "RooAbsCategory::defineType(" << GetName() << "): index "
272 << index << " already assigned" << endl ;
273 return 0 ;
274 }
275
276 if (isValidLabel(label)) {
277 coutE(InputArguments) << "RooAbsCategory::defineType(" << GetName() << "): label "
278 << label << " already assigned or not allowed" << endl ;
279 return 0 ;
280 }
281
282 return defineTypeUnchecked(label,index) ;
283}
284
285
286
287////////////////////////////////////////////////////////////////////////////////
288/// Delete all currently defined states
289
291{
292 _types.Delete() ;
293 _value = RooCatType("",0) ;
294 setShapeDirty() ;
295}
296
297
298
299////////////////////////////////////////////////////////////////////////////////
300/// Find our type that matches the specified type, or return 0 for no match.
301
302const RooCatType* RooAbsCategory::lookupType(const RooCatType &other, Bool_t printError) const
303{
305 _typeIter->Reset() ;
306 while((type=(RooCatType*)_typeIter->Next())){
307 if((*type) == other) return type; // delegate comparison to RooCatType
308 }
309
310 if (printError) {
311 coutE(InputArguments) << ClassName() << "::" << GetName() << ":lookupType: no match for ";
312 if (dologE(InputArguments)) {
314 }
315 }
316 return 0 ;
317}
318
319
320
321////////////////////////////////////////////////////////////////////////////////
322/// Find our type corresponding to the specified index, or return 0 for no match.
323
324const RooCatType* RooAbsCategory::lookupType(Int_t index, Bool_t printError) const
325{
327 _typeIter->Reset() ;
328 while((type=(RooCatType*)_typeIter->Next())){
329 if((*type) == index) return type; // delegate comparison to RooCatType
330 }
331 if (printError) {
332 coutE(InputArguments) << ClassName() << "::" << GetName() << ":lookupType: no match for index "
333 << index << endl;
334 }
335 return 0 ;
336}
337
338
339
340////////////////////////////////////////////////////////////////////////////////
341/// Find our type corresponding to the specified label, or return 0 for no match.
342
343const RooCatType* RooAbsCategory::lookupType(const char* label, Bool_t printError) const
344{
346 _typeIter->Reset() ;
347 while((type=(RooCatType*)_typeIter->Next())){
348 if((*type) == label) return type; // delegate comparison to RooCatType
349 }
350
351 // Try if label represents integer number
352 char* endptr ;
353 Int_t idx=strtol(label,&endptr,10) ;
354 if (endptr==label+strlen(label)) {
355 _typeIter->Reset() ;
356 while((type=(RooCatType*)_typeIter->Next())){
357 if((*type) == idx) return type; // delegate comparison to RooCatType
358 }
359 }
360
361 if (printError) {
362 coutE(InputArguments) << ClassName() << "::" << GetName() << ":lookupType: no match for label "
363 << label << endl;
364 }
365 return 0 ;
366}
367
368
369
370////////////////////////////////////////////////////////////////////////////////
371/// Check if current value is a valid state
372
374{
375 return isValid(_value) ;
376}
377
378
379
380////////////////////////////////////////////////////////////////////////////////
381/// Check if given state is defined for this object
382
384{
385 return isValidIndex(value.getVal()) ;
386}
387
388
389
390////////////////////////////////////////////////////////////////////////////////
391/// Create a table matching the shape of this category
392
394{
395 return new Roo1DTable(GetName(),label,*this) ;
396}
397
398
399
400////////////////////////////////////////////////////////////////////////////////
401/// Read object contents from stream (dummy for now)
402
404{
405 return kFALSE ;
406}
407
408
409
410////////////////////////////////////////////////////////////////////////////////
411/// Write object contents to ostream
412
413void RooAbsCategory::writeToStream(ostream& os, Bool_t compact) const
414{
415 if (compact) {
416 os << getLabel() ;
417 } else {
418 os << getLabel() ;
419 }
420}
421
422
423
424////////////////////////////////////////////////////////////////////////////////
425/// Print value (label name)
426
427void RooAbsCategory::printValue(ostream& os) const
428{
429 os << getLabel() << "(idx = " << getIndex() << ")" << endl ;
430}
431
432
433
434////////////////////////////////////////////////////////////////////////////////
435/// Print info about this object to the specified stream. In addition to the info
436/// from RooAbsArg::printStream() we add:
437///
438/// Shape : label, index, defined types
439
440void RooAbsCategory::printMultiline(ostream& os, Int_t contents, Bool_t verbose, TString indent) const
441{
442 RooAbsArg::printMultiline(os,contents,verbose,indent);
443
444 os << indent << "--- RooAbsCategory ---" << endl;
445 if (_types.GetEntries()==0) {
446 os << indent << " ** No values defined **" << endl;
447 return;
448 }
449 os << indent << " Value is \"" << getLabel() << "\" (" << getIndex() << ")" << endl;
450 os << indent << " Has the following possible values:" << endl;
451 indent.Append(" ");
453 _typeIter->Reset() ;
454 while((type=(RooCatType*)_typeIter->Next())) {
455 os << indent;
456 type->printStream(os,kName|kValue,kSingleLine,indent);
457 }
458}
459
460
461
462////////////////////////////////////////////////////////////////////////////////
463/// Attach the category index and label to as branches to the given vector store
464
466{
467 RooVectorDataStore::CatVector* cv = vstore.addCategory(this) ;
468 cv->setBuffer(&_value) ;
469}
470
471
472
473
474////////////////////////////////////////////////////////////////////////////////
475/// Attach the category index and label to as branches to the given
476/// TTree. The index field will be attached as integer with name
477/// <name>_idx, the label field will be attached as char[] with label
478/// <name>_lbl.
479
480void RooAbsCategory::attachToTree(TTree& t, Int_t bufSize)
481{
482 // First check if there is an integer branch matching the category name
483 TString cleanName(cleanBranchName()) ;
484 TBranch* branch = t.GetBranch(cleanName) ;
485 if (branch) {
486
487 TString typeName(((TLeaf*)branch->GetListOfLeaves()->At(0))->GetTypeName()) ;
488 if (!typeName.CompareTo("Int_t")) {
489 // Imported TTree: attach only index field as branch
490
491 coutI(DataHandling) << "RooAbsCategory::attachToTree(" << GetName() << ") TTree branch " << GetName()
492 << " will be interpreted as category index" << endl ;
493
494 t.SetBranchAddress(cleanName,&((Int_t&)_value._value)) ;
495 setAttribute("INTIDXONLY_TREE_BRANCH",kTRUE) ;
496 _treeVar = kTRUE ;
497 return ;
498 } else if (!typeName.CompareTo("UChar_t")) {
499 coutI(DataHandling) << "RooAbsReal::attachToTree(" << GetName() << ") TTree UChar_t branch " << GetName()
500 << " will be interpreted as category index" << endl ;
501 t.SetBranchAddress(cleanName,&_byteValue) ;
502 setAttribute("UCHARIDXONLY_TREE_BRANCH",kTRUE) ;
503 _treeVar = kTRUE ;
504 return ;
505 }
506
507 if (branch->GetCompressionLevel()<0) {
508 cxcoutD(DataHandling) << "RooAbsCategory::attachToTree(" << GetName() << ") Fixing compression level of branch " << GetName() << endl ;
510 }
511 }
512
513 // Native TTree: attach both index and label of category as branches
514 TString idxName(cleanName) ;
515 TString lblName(cleanName) ;
516 idxName.Append("_idx") ;
517 lblName.Append("_lbl") ;
518
519 // First determine if branch is taken
520 if ((branch = t.GetBranch(idxName))) {
521
522 t.SetBranchAddress(idxName,&((Int_t&)_value._value)) ;
523 if (branch->GetCompressionLevel()<0) {
524 cxcoutD(Contents) << "RooAbsCategory::attachToTree(" << GetName() << ") Fixing compression level of branch " << idxName << endl ;
526 }
527
528 } else {
529 TString format(idxName);
530 format.Append("/I");
531 void* ptr = &(_value._value) ;
532 branch = t.Branch(idxName, ptr, (const Text_t*)format, bufSize);
534 }
535
536 // First determine if branch is taken
537 if ((branch = t.GetBranch(lblName))) {
538
539 t.SetBranchAddress(lblName,_value._label) ;
540 if (branch->GetCompressionLevel()<0) {
541 cxcoutD(DataHandling) << "RooAbsCategory::attachToTree(" << GetName() << ") Fixing compression level of branch " << lblName << endl ;
543 }
544
545 } else {
546 TString format(lblName);
547 format.Append("/C");
548 void* ptr = _value._label ;
549 branch = t.Branch(lblName, ptr, (const Text_t*)format, bufSize);
551 }
552
553}
554
555
556
557////////////////////////////////////////////////////////////////////////////////
558/// Fill tree branches associated with current object with current value
559
561{
562 TString idxName(GetName()) ;
563 TString lblName(GetName()) ;
564 idxName.Append("_idx") ;
565 lblName.Append("_lbl") ;
566
567 // First determine if branch is taken
568 TBranch* idxBranch = t.GetBranch(idxName) ;
569 TBranch* lblBranch = t.GetBranch(lblName) ;
570 if (!idxBranch||!lblBranch) {
571 coutF(DataHandling) << "RooAbsCategory::fillTreeBranch(" << GetName() << ") ERROR: not attached to tree" << endl ;
572 assert(0) ;
573 }
574
575 idxBranch->Fill() ;
576 lblBranch->Fill() ;
577}
578
579
580
581////////////////////////////////////////////////////////////////////////////////
582/// (De)activate associate tree branch
583
585{
586 TBranch* branch = t.GetBranch(Form("%s_idx",GetName())) ;
587 if (branch) {
588 t.SetBranchStatus(Form("%s_idx",GetName()),active?1:0) ;
589 t.SetBranchStatus(Form("%s_lbl",GetName()),active?1:0) ;
590 }
591}
592
593
594
595////////////////////////////////////////////////////////////////////////////////
596/// Explicitly synchronize RooAbsCategory internal cache
597
599{
600 getIndex() ;
601}
602
603
604
605////////////////////////////////////////////////////////////////////////////////
606/// Copy the cached value from given source and raise dirty flag.
607/// It is the callers responsability to ensure that the sources
608/// cache is clean(valid) before this function is called, e.g. by
609/// calling syncCache() on the source.
610
611void RooAbsCategory::copyCache(const RooAbsArg* source, Bool_t /*valueOnly*/, Bool_t setValDirty)
612{
613 RooAbsCategory* other = static_cast<RooAbsCategory*>(const_cast<RooAbsArg*>(source)) ;
614
615 if (!_treeVar) {
616 _value = other->_value ;
617 } else {
618 if (source->getAttribute("INTIDXONLY_TREE_BRANCH")) {
619 // Lookup cat state from other-index because label is missing
620 const RooCatType* type = lookupType(other->_value._value) ;
621 if (type) {
622 _value = *type ;
623 } else {
624 coutE(DataHandling) << "RooAbsCategory::copyCache(" << GetName()
625 << ") ERROR: index of source arg " << source->GetName()
626 << " is invalid (" << other->_value._value
627 << "), value not updated" << endl ;
628 }
629 } if (source->getAttribute("UCHARIDXONLY_TREE_BRANCH")) {
630 // Lookup cat state from other-index because label is missing
631 Int_t tmp = other->_byteValue ;
632 const RooCatType* type = lookupType(tmp) ;
633 if (type) {
634 _value = *type ;
635 } else {
636 coutE(DataHandling) << "RooAbsCategory::copyCache(" << GetName()
637 << ") ERROR: index of source arg " << source->GetName()
638 << " is invalid (" << tmp
639 << "), value not updated" << endl ;
640 }
641 }
642 }
643
644 if (setValDirty) {
645 setValueDirty() ;
646 }
647}
648
649
650
651////////////////////////////////////////////////////////////////////////////////
652/// Return state definition of ordinal nth defined state,
653/// needed by the generator mechanism.
654
655const RooCatType* RooAbsCategory::getOrdinal(UInt_t n, const char* /*rangeName*/) const
656{
657 return (const RooCatType*)_types.At(n);
658}
659
660
661
662////////////////////////////////////////////////////////////////////////////////
663/// Create a RooCategory fundamental object with our properties.
664
666{
667 // Add and precalculate new category column
668 RooCategory *fund= new RooCategory(newname?newname:GetName(),GetTitle()) ;
669
670 // Copy states
671 TIterator* tIter = typeIterator() ;
673 while ((type=(RooCatType*)tIter->Next())) {
674 ((RooAbsCategory*)fund)->defineType(type->GetName(),type->getVal()) ;
675 }
676 delete tIter;
677
678 return fund;
679}
680
681
682
683////////////////////////////////////////////////////////////////////////////////
684/// Determine if category has 2 or 3 states with index values -1,0,1
685
687{
688 if (numTypes()>3||numTypes()<2) return kFALSE ;
689 if (mustHaveZero&&numTypes()!=3) return kFALSE ;
690
691 Bool_t ret(kTRUE) ;
692 TIterator* tIter = typeIterator() ;
694 while((type=(RooCatType*)tIter->Next())) {
695 if (abs(type->getVal())>1) ret=kFALSE ;
696 }
697
698 delete tIter ;
699 return ret ;
700}
#define coutI(a)
Definition: RooMsgService.h:31
#define ccoutE(a)
Definition: RooMsgService.h:41
#define dologE(a)
Definition: RooMsgService.h:67
#define cxcoutD(a)
Definition: RooMsgService.h:79
#define coutF(a)
Definition: RooMsgService.h:35
#define coutE(a)
Definition: RooMsgService.h:34
int Int_t
Definition: RtypesCore.h:41
char Text_t
Definition: RtypesCore.h:58
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:363
int type
Definition: TGX11.cxx:120
char * Form(const char *fmt,...)
Roo1DTable implements a one-dimensional table.
Definition: Roo1DTable.h:24
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Implement multi-line detailed printing.
Definition: RooAbsArg.cxx:1377
Bool_t isShapeDirty() const
Definition: RooAbsArg.h:331
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:241
Bool_t isValueDirty() const
Definition: RooAbsArg.h:336
void clearValueDirty() const
Definition: RooAbsArg.h:449
TString cleanBranchName() const
Construct a mangled name from the actual name that is free of any math symbols that might be interpre...
Definition: RooAbsArg.cxx:1864
void setShapeDirty() const
Definition: RooAbsArg.h:442
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Definition: RooAbsArg.cxx:264
void clearShapeDirty() const
Definition: RooAbsArg.h:452
void setValueDirty() const
Definition: RooAbsArg.h:441
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValueDirty=kTRUE)
Copy the cached value from given source and raise dirty flag.
const RooCatType * getOrdinal(UInt_t n, const char *rangeName=0) const
Return state definition of ordinal nth defined state, needed by the generator mechanism.
TIterator * typeIterator() const
Return iterator over all defined states.
virtual void fillTreeBranch(TTree &t)
Fill tree branches associated with current object with current value.
RooCatType _value
Transient cache for byte values from tree branches.
virtual void attachToVStore(RooVectorDataStore &vstore)
Attach the category index and label to as branches to the given vector store.
Roo1DTable * createTable(const char *label) const
Create a table matching the shape of this category.
virtual Bool_t isValid() const
Check if current value is a valid state.
virtual ~RooAbsCategory()
Destructor.
virtual Int_t getIndex() const
Return index number of current state.
virtual void attachToTree(TTree &t, Int_t bufSize=32000)
Attach the category index and label to as branches to the given TTree.
TIterator * _typeIter
virtual const char * getLabel() const
Return label string of current state.
Bool_t isValidLabel(const char *label) const
Check if state with given name is defined.
RooAbsArg * createFundamental(const char *newname=0) const
Create a RooCategory fundamental object with our properties.
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to ostream.
virtual void setTreeBranchStatus(TTree &t, Bool_t active)
(De)activate associate tree branch
const RooCatType * defineTypeUnchecked(const char *label, Int_t index)
Internal version of defineType that does not check if type already exists.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print info about this object to the specified stream.
TObjArray _types
Int_t numTypes(const char *=0) const
virtual Bool_t isIdentical(const RooAbsArg &other, Bool_t assumeSameType=kFALSE)
RooCatType traceEval() const
Recalculate current value and check validity of new result.
virtual RooCatType evaluate() const =0
virtual void syncCache(const RooArgSet *set=0)
Explicitly synchronize RooAbsCategory internal cache.
const RooCatType * defineType(const char *label)
Define a new state with given name.
Bool_t isSignType(Bool_t mustHaveZero=kFALSE) const
Determine if category has 2 or 3 states with index values -1,0,1.
virtual Bool_t traceEvalHook(RooCatType) const
virtual void printValue(std::ostream &os) const
Print value (label name)
const RooCatType * lookupType(Int_t index, Bool_t printError=kFALSE) const
Find our type corresponding to the specified index, or return 0 for no match.
Bool_t operator==(Int_t index) const
Equality operator with a integer (compares with state index number)
Bool_t isValidIndex(Int_t index) const
Check if state with given index is defined.
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from stream (dummy for now)
void clearTypes()
Delete all currently defined states.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state.
Definition: RooCatType.h:22
char _label[256]
Definition: RooCatType.h:103
virtual const Text_t * GetName() const
Returns name of object.
Definition: RooCatType.h:44
virtual void SetName(const Text_t *name)
Constructor with name argument.
Definition: RooCatType.cxx:46
Int_t getVal() const
Definition: RooCatType.h:79
Int_t _value
Definition: RooCatType.h:102
RooCategory represents a fundamental (non-derived) discrete value object.
Definition: RooCategory.h:24
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
void setBuffer(RooCatType *newBuf)
RooVectorDataStore is the abstract base class for data collection that use a TTree as internal storag...
CatVector * addCategory(RooAbsCategory *cat)
A TTree is a list of TBranches.
Definition: TBranch.h:64
Int_t GetCompressionLevel() const
Definition: TBranch.h:261
TObjArray * GetListOfLeaves()
Definition: TBranch.h:204
Int_t Fill()
Definition: TBranch.h:164
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
Set compression level.
Definition: TBranch.cxx:2366
Iterator abstract base class.
Definition: TIterator.h:30
virtual void Reset()=0
virtual TObject * Next()=0
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:32
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
void Add(TObject *obj)
Definition: TObjArray.h:73
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:522
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
Definition: TObjArray.cxx:355
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
Definition: TObjArray.cxx:633
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
Mother of all ROOT objects.
Definition: TObject.h:37
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition: TObject.cxx:144
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:128
const Int_t n
Definition: legend1.C:16
@ DataHandling
Definition: RooGlobalFunc.h:59
@ InputArguments
Definition: RooGlobalFunc.h:58
Definition: first.py:1
STL namespace.
@ kUseGlobal
Use the global compression setting for this process; may be affected by rootrc.
Definition: Compression.h:47