Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include <string>
24
26
27
29public:
30 // Constructors etc.
32 RooMultiCategory(const char *name, const char *title, const RooArgSet& inputCatList);
33 RooMultiCategory(const RooMultiCategory& other, const char *name=0) ;
34 virtual TObject* clone(const char* newname) const override { return new RooMultiCategory(*this,newname); }
35 virtual ~RooMultiCategory();
36
37 // Printing interface (human readable)
38 virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const override;
39
40 /// Multi categories cannot be read from streams.
41 virtual Bool_t readFromStream(std::istream& /*is*/, Bool_t /*compact*/, Bool_t /*verbose=kFALSE*/) override { return true; }
42 virtual void writeToStream(std::ostream& os, Bool_t compact) const override;
43
44 const RooArgSet& inputCatList() const { return _catSet ; }
45 const char* getCurrentLabel() const override;
46
47protected:
48
49 std::string createLabel() const;
50 value_type evaluate() const override;
51 void recomputeShape() override;
52
53 RooSetProxy _catSet ; // Set of input category
54
55 friend class RooSuperCategory;
56 ClassDefOverride(RooMultiCategory,1) // Product operator for categories
57};
58
59#endif
const Bool_t kFALSE
Definition RtypesCore.h:92
#define ClassDefOverride(name, id)
Definition Rtypes.h:329
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition TGX11.cxx:110
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
Definition RooAbsArg.h:513
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:29
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.
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:23
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:136