Logo ROOT  
Reference Guide
RooCatTypeLegacy.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
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
17/**
18\class RooCatType
19\ingroup Roofitlegacy
20
21RooCatType is an auxilary class for RooAbsCategory and defines a
22a single category state. The class holds a string label and an integer
23index value which define the state
24**/
25
27
28#include <iostream>
29
30
31
32using namespace std;
33
35;
36
37
38
39////////////////////////////////////////////////////////////////////////////////
40/// Constructor with name argument
41
43{
44 if (strlen(name)>255) {
45 std::cerr << "RooCatType::SetName warning: label '" << name << "' truncated at 255 chars" << std::endl ;
46 _label[255]=0 ;
47 }
48 strncpy(_label,name,255) ;
49}
50
51
52
53////////////////////////////////////////////////////////////////////////////////
54/// Print the name of the state
55
56void RooCatType::printName(ostream& os) const
57{
58 os << GetName() ;
59}
60
61
62
63////////////////////////////////////////////////////////////////////////////////
64/// Print the title of the state
65
66void RooCatType::printTitle(ostream& os) const
67{
68 os << GetTitle() ;
69}
70
71
72
73////////////////////////////////////////////////////////////////////////////////
74/// Print the class name of the state
75
76void RooCatType::printClassName(ostream& os) const
77{
78 os << ClassName() ;
79}
80
81
82
83////////////////////////////////////////////////////////////////////////////////
84/// Print the value (index integer) of the state
85
86void RooCatType::printValue(ostream& os) const
87{
88 os << getVal() ;
89}
90
char Text_t
Definition: RtypesCore.h:62
#define ClassImp(name)
Definition: Rtypes.h:375
char name[80]
Definition: TGX11.cxx:110
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state.
void printName(std::ostream &os) const override
Print the name of the state.
void printValue(std::ostream &os) const override
Print the value (index integer) of the state.
void printClassName(std::ostream &os) const override
Print the class name of the state.
char _label[256]
State name.
void SetName(const Text_t *name)
Constructor with name argument.
void printTitle(std::ostream &os) const override
Print the title of the state.
Int_t getVal() const
const Text_t * GetName() const override
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:207
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:484