29using std::endl, std::ostream;
33bool threshListSorter(
const std::pair<double,RooAbsCategory::value_type>& lhs,
const std::pair<double,RooAbsCategory::value_type>& rhs) {
34 return lhs.first < rhs.first || (lhs.first == rhs.first && lhs.second < rhs.second);
45 const char* defOut,
Int_t defIdx) :
47 _inputVar(
"inputVar",
"Input category",this,inputVar),
64 _threshList.push_back(cat);
78 if (thresh.first == upperLimit) {
79 coutW(InputArguments) <<
"RooThresholdCategory::addThreshold(" <<
GetName()
80 <<
") threshold at " << upperLimit <<
" already defined" << std::endl ;
87 if (newIdx == std::numeric_limits<value_type>::min()) {
88 if (catIdx == -99999) {
111 return thresh.second;
133 os <<
lookupName(thresh.second) <<
'[' << thresh.second <<
"]:<" << thresh.first <<
" ";
154 os <<
indent <<
"--- RooThresholdCategory ---" << std::endl
155 <<
indent <<
" Maps from " ;
158 os <<
indent <<
" Threshold list" << std::endl ;
160 os <<
indent <<
" input < " << thresh.first <<
" --> " ;
161 os <<
lookupName(thresh.second) <<
'[' << thresh.second <<
"]\n";
int Int_t
Signed integer 4 bytes (int).
static void indent(ostringstream &buf, int indent_level)
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.
int value_type
The type used to denote a specific category state.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
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.
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to given stream.
const value_type _defIndex
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.
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.
const char * GetName() const override
Returns name of object.