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 
21 RooCatType is an auxilary class for RooAbsCategory and defines a
22 a single category state. The class holds a string label and an integer
23 index value which define the state
24 **/
25 
27 
28 #include "RooFit.h"
29 
30 #include "TClass.h"
31 
32 #include <iostream>
33 
34 
35 
36 using namespace std;
37 
39 ;
40 
41 
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 /// Constructor with name argument
45 
47 {
48  if (strlen(name)>255) {
49  std::cerr << "RooCatType::SetName warning: label '" << name << "' truncated at 255 chars" << std::endl ;
50  _label[255]=0 ;
51  }
52  strncpy(_label,name,255) ;
53 }
54 
55 
56 
57 ////////////////////////////////////////////////////////////////////////////////
58 /// Print the name of the state
59 
60 void RooCatType::printName(ostream& os) const
61 {
62  os << GetName() ;
63 }
64 
65 
66 
67 ////////////////////////////////////////////////////////////////////////////////
68 /// Print the title of the state
69 
70 void RooCatType::printTitle(ostream& os) const
71 {
72  os << GetTitle() ;
73 }
74 
75 
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// Print the class name of the state
79 
80 void RooCatType::printClassName(ostream& os) const
81 {
82  os << IsA()->GetName() ;
83 }
84 
85 
86 
87 ////////////////////////////////////////////////////////////////////////////////
88 /// Print the value (index integer) of the state
89 
90 void RooCatType::printValue(ostream& os) const
91 {
92  os << getVal() ;
93 }
94 
RooFit.h
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
RooCatType::printName
virtual void printName(std::ostream &os) const
Print the name of the state.
Definition: RooCatTypeLegacy.cxx:60
RooCatType::printClassName
virtual void printClassName(std::ostream &os) const
Print the class name of the state.
Definition: RooCatTypeLegacy.cxx:80
TClass.h
RooCatType::printTitle
virtual void printTitle(std::ostream &os) const
Print the title of the state.
Definition: RooCatTypeLegacy.cxx:70
RooCatType::SetName
void SetName(const Text_t *name)
Constructor with name argument.
Definition: RooCatTypeLegacy.cxx:46
RooCatType::printValue
virtual void printValue(std::ostream &os) const
Print the value (index integer) of the state.
Definition: RooCatTypeLegacy.cxx:90
name
char name[80]
Definition: TGX11.cxx:110
RooCatType
Definition: RooCatTypeLegacy.h:23
Text_t
char Text_t
Definition: RtypesCore.h:62
RooCatTypeLegacy.h