Logo ROOT   6.14/05
Reference Guide
RooCatType.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 \file RooCatType.cxx
19 \class RooCatType
20 \ingroup Roofitcore
21 
22 RooCatType is an auxilary class for RooAbsCategory and defines a
23 a single category state. The class holds a string label and an integer
24 index value which define the state
25 **/
26 
27 #include "RooFit.h"
28 
29 #include <stdlib.h>
30 #include "TClass.h"
31 #include "RooCatType.h"
32 
33 #include "Riostream.h"
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::cout << "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 
virtual void printTitle(std::ostream &os) const
Print the title of the state.
Definition: RooCatType.cxx:70
std::string GetName(const std::string &scope_name)
Definition: Cppyy.cxx:145
STL namespace.
virtual void printValue(std::ostream &os) const
Print the value (index integer) of the state.
Definition: RooCatType.cxx:90
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
Definition: RooCatType.h:22
virtual void printName(std::ostream &os) const
Print the name of the state.
Definition: RooCatType.cxx:60
#define ClassImp(name)
Definition: Rtypes.h:359
virtual void SetName(const Text_t *name)
Constructor with name argument.
Definition: RooCatType.cxx:46
char Text_t
Definition: RtypesCore.h:58
char name[80]
Definition: TGX11.cxx:109
virtual void printClassName(std::ostream &os) const
Print the class name of the state.
Definition: RooCatType.cxx:80