35bool threshListSorter(
const std::pair<double,RooAbsCategory::value_type>& lhs,
const std::pair<double,RooAbsCategory::value_type>& rhs) {
36 return lhs.first < rhs.first || (lhs.first == rhs.first && lhs.second < rhs.second);
47 const char* defOut,
Int_t defIdx) :
49 _inputVar(
"inputVar",
"Input category",this,inputVar),
62 _inputVar(
"inputVar",this,other._inputVar),
63 _defIndex(other._defIndex)
80 if (thresh.first == upperLimit) {
81 coutW(InputArguments) <<
"RooThresholdCategory::addThreshold(" <<
GetName()
82 <<
") threshold at " << upperLimit <<
" already defined" << endl ;
89 if (newIdx == std::numeric_limits<value_type>::min()) {
90 if (catIdx == -99999) {
113 return thresh.second;
135 os <<
lookupName(thresh.second) <<
'[' << thresh.second <<
"]:<" << thresh.first <<
" ";
156 os <<
indent <<
"--- RooThresholdCategory ---" << endl
157 <<
indent <<
" Maps from " ;
160 os <<
indent <<
" Threshold list" << endl ;
162 os <<
indent <<
" input < " << thresh.first <<
" --> " ;
163 os <<
lookupName(thresh.second) <<
'[' << thresh.second <<
"]\n";
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 ...
virtual const char * getCurrentLabel() const
Return label string of current state.
const std::string & lookupName(value_type index) const
Get the name corresponding to the given index.
virtual const std::map< std::string, RooAbsCategory::value_type >::value_type & defineState(const std::string &label)
Define a new state with given label.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print info about this object to the specified stream.
value_type lookupIndex(const std::string &stateName) const
Find the index number corresponding to the state name.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
const T & arg() const
Return reference to object held in proxy.
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.
std::vector< std::pair< double, value_type > > _threshList
virtual const char * GetName() const
Returns name of object.