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 
19 class TObject;
20 #include "RooAbsCategoryLValue.h"
21 #include "RooArgSet.h"
22 #include "RooSetProxy.h"
23 #include <string>
24 
25 class RooSuperCategory;
26 
27 
29 public:
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 
47 protected:
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
RooMultiCategory::recomputeShape
void recomputeShape() override
Inspect all the subcategories, and enumerate and name their states.
Definition: RooMultiCategory.cxx:204
RooMultiCategory::_catSet
RooSetProxy _catSet
Definition: RooMultiCategory.h:53
RooMultiCategory::~RooMultiCategory
virtual ~RooMultiCategory()
Destructor.
Definition: RooMultiCategory.cxx:86
RooArgSet.h
RooAbsCategory::value_type
int value_type
The type used to denote a specific category state.
Definition: RooAbsCategory.h:41
RooSetProxy
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:23
RooMultiCategory::clone
virtual TObject * clone(const char *newname) const override
Definition: RooMultiCategory.h:34
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooSetProxy.h
TString
Basic string class.
Definition: TString.h:136
ClassDefOverride
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
RooMultiCategory::RooMultiCategory
RooMultiCategory()
Definition: RooMultiCategory.h:31
bool
RooMultiCategory::getCurrentLabel
const char * getCurrentLabel() const override
Get current label.
Definition: RooMultiCategory.cxx:192
RooAbsCategory
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
Definition: RooAbsCategory.h:38
RooMultiCategory::readFromStream
virtual Bool_t readFromStream(std::istream &, Bool_t, Bool_t) override
Multi categories cannot be read from streams.
Definition: RooMultiCategory.h:41
RooMultiCategory
RooMultiCategory connects several RooAbsCategory objects into a single category.
Definition: RooMultiCategory.h:28
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooMultiCategory::writeToStream
virtual void writeToStream(std::ostream &os, Bool_t compact) const override
Write object contents to given stream.
Definition: RooMultiCategory.cxx:183
RooMultiCategory::createLabel
std::string createLabel() const
Compile a string with all the labels of the serving categories, such as {1Jet;1Lepton;2Tag}.
Definition: RooMultiCategory.cxx:94
RooMultiCategory::printMultiline
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.
Definition: RooMultiCategory.cxx:166
RooMultiCategory::inputCatList
const RooArgSet & inputCatList() const
Definition: RooMultiCategory.h:44
RooAbsArg::setShapeDirty
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
Definition: RooAbsArg.h:512
RooAbsCategoryLValue.h
RooMultiCategory::evaluate
value_type evaluate() const override
Calculate the current value.
Definition: RooMultiCategory.cxx:137
RooSuperCategory
The RooSuperCategory can join several RooAbsCategoryLValue objects into a single category.
Definition: RooSuperCategory.h:27
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
name
char name[80]
Definition: TGX11.cxx:110
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
int