Logo ROOT   master
Reference Guide
Roo1DTable.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: Roo1DTable.h,v 1.19 2007/05/11 09:11:30 verkerke Exp $
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 #ifndef ROO_1D_TABLE
17 #define ROO_1D_TABLE
18 
19 #include "TObjArray.h"
20 #include "RooTable.h"
21 #include <vector>
22 
23 class Roo1DTable : public RooTable {
24 public:
25 
26  // Constructors, cloning and assignment
28  // Default constructor
29  // coverity[UNINIT_CTOR]
30  } ;
31  virtual ~Roo1DTable();
32  Roo1DTable(const char *name, const char *title, const RooAbsCategory &cat);
33  Roo1DTable(const Roo1DTable& other) ;
34 
35  virtual void fill(RooAbsCategory& cat, Double_t weight=1.0) ;
36  Double_t get(const char* label, Bool_t silent=kFALSE) const ;
37  Double_t getFrac(const char* label, Bool_t silent=kFALSE) const ;
38  Double_t get(const int index, Bool_t silent=kFALSE) const ;
39  Double_t getFrac(const int index, Bool_t silent=kFALSE) const ;
40  Double_t getOverflow() const ;
41 
42  // Printing interface (human readable)
43  virtual void printName(std::ostream& os) const ;
44  virtual void printTitle(std::ostream& os) const ;
45  virtual void printClassName(std::ostream& os) const ;
46  virtual void printValue(std::ostream& os) const ;
47  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
48  virtual Int_t defaultPrintContents(Option_t* opt) const ;
49 
50  inline virtual void Print(Option_t *options= 0) const {
51  // Printing interface (human readable)
53  }
54 
55  virtual Bool_t isIdentical(const RooTable& other) ;
56 
57 protected:
58 
59 
60  TObjArray _types ; // Array of defined category states
61  std::vector<Double_t> _count ; // Array of counters for each state
62  Double_t _total ; // Total number of entries
63  Double_t _nOverflow ; // Number of overflow entries
64 
65  ClassDef(Roo1DTable,1) // 1-dimensional table
66 };
67 
68 #endif
An array of TObjects.
Definition: TObjArray.h:37
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer, which is interpreted as an OR of &#39;enum ContentsOptions&#39; values and in the style given by &#39;enum StyleOption&#39;.
const char Option_t
Definition: RtypesCore.h:64
Basic string class.
Definition: TString.h:131
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print the formatted table contents on the given stream.
Definition: Roo1DTable.cxx:190
virtual void printValue(std::ostream &os) const
Print the table value, i.e. the contents, in &#39;inline&#39; format.
Definition: Roo1DTable.cxx:159
#define ClassDef(name, id)
Definition: Rtypes.h:322
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default contents to print.
Definition: Roo1DTable.cxx:180
virtual void printClassName(std::ostream &os) const
Print the class name of the table.
Definition: Roo1DTable.cxx:149
std::vector< Double_t > _count
Definition: Roo1DTable.h:61
static void indent(ostringstream &buf, int indent_level)
virtual ~Roo1DTable()
Destructor.
Definition: Roo1DTable.cxx:89
const Bool_t kFALSE
Definition: RtypesCore.h:90
Double_t getOverflow() const
Return the number of overflow entries in the table.
Definition: Roo1DTable.cxx:291
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
virtual Bool_t isIdentical(const RooTable &other)
Return true if table is identical in contents to given reference table.
Definition: Roo1DTable.cxx:335
virtual StyleOption defaultPrintStyle(Option_t *opt) const
TObjArray _types
Definition: Roo1DTable.h:60
virtual void printName(std::ostream &os) const
Print the name of the table.
Definition: Roo1DTable.cxx:129
virtual void printTitle(std::ostream &os) const
Print the title of the table.
Definition: Roo1DTable.cxx:139
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: Roo1DTable.h:50
Double_t _nOverflow
Definition: Roo1DTable.h:63
RooTable is the abstract interface for table objects.
Definition: RooTable.h:23
Double_t getFrac(const char *label, Bool_t silent=kFALSE) const
Return the fraction of entries in the table contained in the slot named &#39;label&#39;.
Definition: Roo1DTable.cxx:303
Roo1DTable implements a one-dimensional table.
Definition: Roo1DTable.h:23
Double_t _total
Definition: Roo1DTable.h:62
char name[80]
Definition: TGX11.cxx:109
virtual void fill(RooAbsCategory &cat, Double_t weight=1.0)
Increment the counter of the table slot with the name corresponding to that of the current category s...
Definition: Roo1DTable.cxx:103