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 <vector>
22#include <utility>
23
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 value_type _defIndex{std::numeric_limits<value_type>::min()};
48 std::vector<std::pair<double,value_type>> _threshList;
49
50 virtual value_type evaluate() const ;
51 /// No shape recomputation is necessary. This category does not depend on other categories.
52 void recomputeShape() { }
53
54 ClassDef(RooThresholdCategory, 3) // Real-to-Category function defined by series of thresholds
55};
56
57#endif
int Int_t
Definition: CPyCppyy.h:43
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
double Double_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:325
static void indent(ostringstream &buf, int indent_level)
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.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
The 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.
virtual value_type evaluate() const
Calculate and return the value of the mapping function.
const value_type _defIndex
Bool_t addThreshold(Double_t upperLimit, const char *catName, Int_t catIdx=-99999)
Insert threshold at value upperLimit.
virtual TObject * clone(const char *newname) const
void recomputeShape()
No shape recomputation is necessary. This category does not depend on other categories.
std::vector< std::pair< double, value_type > > _threshList
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:136
static const std::string name("name")