Logo ROOT  
Reference Guide
RooMultiCategory.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooMultiCategory.h,v 1.9 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_MULTI_CATEGORY
17#define ROO_MULTI_CATEGORY
18
19class TObject ;
21#include "RooArgSet.h"
22#include "RooSetProxy.h"
23
25
26
28public:
29 // Constructors etc.
31 RooMultiCategory(const char *name, const char *title, const RooArgSet& inputCatList);
32 RooMultiCategory(const RooMultiCategory& other, const char *name=0) ;
33 virtual TObject* clone(const char* newname) const override { return new RooMultiCategory(*this,newname); }
34 virtual ~RooMultiCategory();
35
36 // Printing interface (human readable)
37 virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const override;
38
39 /// Multi categories cannot be read from streams.
40 virtual Bool_t readFromStream(std::istream& /*is*/, Bool_t /*compact*/, Bool_t /*verbose=kFALSE*/) override { return true; }
41 virtual void writeToStream(std::ostream& os, Bool_t compact) const override;
42
43 const RooArgSet& inputCatList() const { return _catSet ; }
44 const char* getCurrentLabel() const override;
45
46protected:
47
48 std::string createLabel() const;
49 value_type evaluate() const override;
50 void recomputeShape() override;
51
52 RooSetProxy _catSet ; // Set of input category
53
54 friend class RooSuperCategory;
55 ClassDefOverride(RooMultiCategory,1) // Product operator for categories
56};
57
58#endif
const Bool_t kFALSE
Definition: RtypesCore.h:90
#define ClassDefOverride(name, id)
Definition: Rtypes.h:326
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition: TGX11.cxx:109
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
Definition: RooAbsArg.h:492
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
int value_type
The type used to denote a specific category state.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooMultiCategory connects several RooAbsCategory objects into a single category.
virtual TObject * clone(const char *newname) const override
value_type evaluate() const override
Calculate the current value.
virtual Bool_t readFromStream(std::istream &, Bool_t, Bool_t) override
Multi categories cannot be read from streams.
const char * getCurrentLabel() const override
Get current label.
std::string createLabel() const
Compile a string with all the labels of the serving categories, such as {1Jet;1Lepton;2Tag}.
virtual ~RooMultiCategory()
Destructor.
RooSetProxy _catSet
void recomputeShape() override
Inspect all the subcategories, and enumerate and name their states.
virtual void writeToStream(std::ostream &os, Bool_t compact) const override
Write object contents to given stream.
const RooArgSet & inputCatList() const
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const override
Print the state of this object to the specified output stream.
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:24
The RooSuperCategory can join several RooAbsCategoryLValue objects into a single category.
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:131