Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooSuperCategory.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooSuperCategory.h,v 1.17 2007/05/11 09:11:30 verkerke Exp $
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#ifndef ROO_SUPER_CATEGORY
17#define ROO_SUPER_CATEGORY
18
19class TObject ;
20class TIterator;
21#include "RooMultiCategory.h"
23#include "RooArgSet.h"
24#include "RooTemplateProxy.h"
25
26
28public:
29 // Constructors etc.
31 RooSuperCategory(const char *name, const char *title, const RooArgSet& inputCatList);
32 RooSuperCategory(const RooSuperCategory& other, const char *name=nullptr) ;
33 TObject* clone(const char* newname) const override { return new RooSuperCategory(*this,newname); }
34
35 bool setIndex(value_type index, bool printError = true) override ;
37 bool setLabel(const char* label, bool printError=true) override;
39
40 // Printing interface (human readable)
41 void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override;
42
43 const RooArgSet& inputCatList() const { return _multiCat->inputCatList(); }
44
45 bool inRange(const char* rangeName) const override;
46 bool hasRange(const char* rangeName) const override;
47
48protected:
49 value_type evaluate() const override {
50 return _multiCat->getCurrentIndex();
51 }
52
53 /// Ask server category to recompute shape, and copy its information.
54 void recomputeShape() override {
55 // Propagate up
57 _multiCat->recomputeShape();
58 _stateNames = _multiCat->_stateNames;
59 _insertionOrder = _multiCat->_insertionOrder;
60 }
61
62
63private:
65
66 ClassDefOverride(RooSuperCategory,2) // Lvalue product operator for category lvalues
67};
68
69#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
static void indent(ostringstream &buf, int indent_level)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
char name[80]
Definition TGX11.cxx:110
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
Definition RooAbsArg.h:467
Abstract base class for objects that represent a discrete value that can be set from the outside,...
virtual bool setIndex(value_type index, bool printError=true)=0
Change category state by specifying the index code of the desired state.
virtual bool setLabel(const char *label, bool printError=true)=0
Change category state by specifying a state name.
int value_type
The type used to denote a specific category state.
std::vector< std::string > _insertionOrder
Keeps track in which order state numbers have been inserted. Make sure this is updated in recomputeSh...
std::map< std::string, value_type > _stateNames
Map state names to index numbers. Make sure state names are updated in recomputeShape().
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Joins several RooAbsCategoryLValue objects into a single category.
TObject * clone(const char *newname) const override
bool setIndex(value_type index, bool printError=true) override
Set the value of the super category to the specified index.
bool hasRange(const char *rangeName) const override
Check that any of the input categories has a range with the given name.
void recomputeShape() override
Ask server category to recompute shape, and copy its information.
bool inRange(const char *rangeName) const override
Check that all input category states are in the given range.
const RooArgSet & inputCatList() const
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Print the state of this object to the specified output stream.
bool setLabel(const char *label, bool printError=true) override
Set the value of the super category by specifying the state name.
value_type evaluate() const override
Evaluate the category state and return.
RooTemplateProxy< RooMultiCategory > _multiCat
Iterator abstract base class.
Definition TIterator.h:30
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139