Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
33
34
35////////////////////////////////////////////////////////////////////////////////
36/// Constructor with name argument
37
39{
40 if (strlen(name)>255) {
41 std::cerr << "RooCatType::SetName warning: label '" << name << "' truncated at 255 chars" << std::endl ;
42 _label[255]=0 ;
43 }
44 strncpy(_label,name,255) ;
45}
46
47
48
49////////////////////////////////////////////////////////////////////////////////
50/// Print the name of the state
51
52void RooCatType::printName(ostream& os) const
53{
54 os << GetName() ;
55}
56
57
58
59////////////////////////////////////////////////////////////////////////////////
60/// Print the title of the state
61
62void RooCatType::printTitle(ostream& os) const
63{
64 os << GetTitle() ;
65}
66
67
68
69////////////////////////////////////////////////////////////////////////////////
70/// Print the class name of the state
71
72void RooCatType::printClassName(ostream& os) const
73{
74 os << ClassName() ;
75}
76
77
78
79////////////////////////////////////////////////////////////////////////////////
80/// Print the value (index integer) of the state
81
82void RooCatType::printValue(ostream& os) const
83{
84 os << getVal() ;
85}
86
char Text_t
Definition RtypesCore.h:62
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
char name[80]
Definition TGX11.cxx:110
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:225
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:500