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=nullptr) ;
34 TObject* clone(const char* newname) const override { return new RooMultiCategory(*this,newname); }
35
36 // Printing interface (human readable)
37 void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override;
38
39 /// Multi categories cannot be read from streams.
40 bool readFromStream(std::istream& /*is*/, bool /*compact*/, bool /*verbose=false*/) override { return true; }
41 void writeToStream(std::ostream& os, bool 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
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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:493
A space to attach TBranches.
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:55
Connects several RooAbsCategory objects into a single category.
value_type evaluate() const override
Calculate the current value.
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.
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}.
bool readFromStream(std::istream &, bool, bool) override
Multi categories cannot be read from streams.
TObject * clone(const char *newname) const override
RooSetProxy _catSet
Set of input category.
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to given stream.
void recomputeShape() override
Inspect all the subcategories, and enumerate and name their states.
const RooArgSet & inputCatList() const
Joins several RooAbsCategoryLValue objects into a single category.
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139