Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
26public:
27 // Constructors etc.
29 RooThresholdCategory(const char *name, const char *title, RooAbsReal& inputVar,
30 const char* defCatName="Default", Int_t defCatIdx=0);
31 RooThresholdCategory(const RooThresholdCategory& other, const char *name=nullptr) ;
32 TObject* clone(const char* newname) const override { return new RooThresholdCategory(*this, newname); }
33
34 // Mapping function
35 bool addThreshold(double upperLimit, const char* catName, Int_t catIdx=-99999) ;
36
37 // Printing interface (human readable)
38 void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override ;
39
40 void writeToStream(std::ostream& os, bool compact) const override ;
41
42protected:
43
45 const value_type _defIndex{std::numeric_limits<value_type>::min()};
46 std::vector<std::pair<double,value_type>> _threshList;
47
48 value_type evaluate() const override ;
49 /// No shape recomputation is necessary. This category does not depend on other categories.
50 void recomputeShape() override { }
51
52 ClassDefOverride(RooThresholdCategory, 3) // Real-to-Category function defined by series of thresholds
53};
54
55#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition TGX11.cxx:110
A space to attach TBranches.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:62
The RooThresholdCategory provides a real-to-category mapping defined by a series of thresholds.
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to given stream.
bool addThreshold(double upperLimit, const char *catName, Int_t catIdx=-99999)
Insert threshold at value upperLimit.
value_type evaluate() const override
Calculate and return the value of the mapping function.
void recomputeShape() override
No shape recomputation is necessary. This category does not depend on other categories.
TObject * clone(const char *newname) const override
std::vector< std::pair< double, value_type > > _threshList
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Print info about this threshold category to the specified stream.
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139