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 ~RooMultiCategory() override;
36
37 // Printing interface (human readable)
38 void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override;
39
40 /// Multi categories cannot be read from streams.
41 bool readFromStream(std::istream& /*is*/, bool /*compact*/, bool /*verbose=false*/) override { return true; }
42 void writeToStream(std::ostream& os, bool 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
#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:492
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
RooMultiCategory 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.
~RooMultiCategory() override
Destructor.
const RooArgSet & inputCatList() const
The RooSuperCategory can join several RooAbsCategoryLValue objects into a single category.
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139