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 
28 public:
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 
44 protected:
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
RooThresholdCategory::evaluate
virtual value_type evaluate() const
Calculate and return the value of the mapping function.
Definition: RooThresholdCategory.cxx:108
RooThresholdCategory::_threshList
std::vector< std::pair< double, value_type > > _threshList
Definition: RooThresholdCategory.h:62
RooThresholdCategory::recomputeShape
void recomputeShape()
No shape recomputation is necessary. This category does not depend on other categories.
Definition: RooThresholdCategory.h:66
RooThresholdCategory::clone
virtual TObject * clone(const char *newname) const
Definition: RooThresholdCategory.h:48
RooThresholdCategory::addThreshold
Bool_t addThreshold(Double_t upperLimit, const char *catName, Int_t catIdx=-99999)
Insert threshold at value upperLimit.
Definition: RooThresholdCategory.cxx:76
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooAbsReal
Definition: RooAbsReal.h:61
TString
Definition: TString.h:136
bool
RooAbsCategory
Definition: RooAbsCategory.h:38
RooThresholdCategory::printMultiline
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.
Definition: RooThresholdCategory.cxx:151
RooThresholdCategory::_defIndex
const value_type _defIndex
Definition: RooThresholdCategory.h:61
RooThresholdCategory::_inputVar
RooRealProxy _inputVar
Definition: RooThresholdCategory.h:60
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooRealProxy.h
RooTemplateProxy< RooAbsReal >
RooThresholdCategory::RooThresholdCategory
RooThresholdCategory()
Definition: RooThresholdCategory.h:44
Double_t
double Double_t
Definition: RtypesCore.h:59
RooAbsCategory.h
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooCatTypeLegacy.h
RooThresholdCategory
Definition: RooThresholdCategory.h:26
RooThresholdCategory::writeToStream
void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to given stream.
Definition: RooThresholdCategory.cxx:125
int