Logo ROOT  
Reference Guide
RooThresholdCategory.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooThresholdCategory.h,v 1.8 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_THRESHOLD_CATEGORY
17#define ROO_THRESHOLD_CATEGORY
18
19#include "RooAbsCategory.h"
20#include "RooRealProxy.h"
21#include "RooCatType.h"
22
23#include <vector>
24#include <utility>
25
27
28public:
29 // Constructors etc.
31 RooThresholdCategory(const char *name, const char *title, RooAbsReal& inputVar,
32 const char* defCatName="Default", Int_t defCatIdx=0);
33 RooThresholdCategory(const RooThresholdCategory& other, const char *name=0) ;
34 virtual TObject* clone(const char* newname) const { return new RooThresholdCategory(*this, newname); }
35
36 // Mapping function
37 Bool_t addThreshold(Double_t upperLimit, const char* catName, Int_t catIdx=-99999) ;
38
39 // Printing interface (human readable)
40 virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
41
42 void writeToStream(std::ostream& os, Bool_t compact) const ;
43
44protected:
45
47 const RooCatType* _defCat{nullptr};
48 std::vector<std::pair<double,RooCatType>> _threshList;
49
50 virtual RooCatType evaluate() const ;
51
52 ClassDef(RooThresholdCategory, 2) // Real-to-Category function defined by series of thresholds
53};
54
55#endif
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:326
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition: TGX11.cxx:109
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:59
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state.
Definition: RooCatType.h:22
Class RooThresholdCategory provides a real-to-category mapping defined by a series of thresholds.
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print info about this threshold category to the specified stream.
void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to given stream.
const RooCatType * _defCat
Bool_t addThreshold(Double_t upperLimit, const char *catName, Int_t catIdx=-99999)
Insert threshold at value upperLimit.
std::vector< std::pair< double, RooCatType > > _threshList
virtual TObject * clone(const char *newname) const
virtual RooCatType evaluate() const
Calculate and return the value of the mapping function.
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:131