Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 auxiliary 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
31using std::ostream;
32
34
35
36////////////////////////////////////////////////////////////////////////////////
37/// Constructor with name argument
38
40{
41 if (strlen(name)>255) {
42 std::cerr << "RooCatType::SetName warning: label '" << name << "' truncated at 255 chars" << std::endl ;
43 _label[255]=0 ;
44 }
45 strncpy(_label,name,255) ;
46}
47
48
49
50////////////////////////////////////////////////////////////////////////////////
51/// Print the name of the state
52
53void RooCatType::printName(ostream& os) const
54{
55 os << GetName() ;
56}
57
58
59
60////////////////////////////////////////////////////////////////////////////////
61/// Print the title of the state
62
63void RooCatType::printTitle(ostream& os) const
64{
65 os << GetTitle() ;
66}
67
68
69
70////////////////////////////////////////////////////////////////////////////////
71/// Print the class name of the state
72
73void RooCatType::printClassName(ostream& os) const
74{
75 os << ClassName() ;
76}
77
78
79
80////////////////////////////////////////////////////////////////////////////////
81/// Print the value (index integer) of the state
82
83void RooCatType::printValue(ostream& os) const
84{
85 os << getVal() ;
86}
87
char Text_t
Definition RtypesCore.h:62
#define ClassImp(name)
Definition Rtypes.h:377
char name[80]
Definition TGX11.cxx:110
RooCatType is an auxiliary 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:483