Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 <assert.h>
20 #include "TObjArray.h"
21 #include "RooTable.h"
22 #include <vector>
23 
24 class Roo1DTable : public RooTable {
25 public:
26 
27  // Constructors, cloning and assignment
28  Roo1DTable() {
29  // Default constructor
30  // coverity[UNINIT_CTOR]
31  } ;
32  virtual ~Roo1DTable();
33  Roo1DTable(const char *name, const char *title, const RooAbsCategory &cat);
34  Roo1DTable(const Roo1DTable& other) ;
35 
36  virtual void fill(RooAbsCategory& cat, Double_t weight=1.0) ;
37  Double_t get(const char* label, Bool_t silent=kFALSE) const ;
38  Double_t getFrac(const char* label, Bool_t silent=kFALSE) const ;
39  Double_t get(const int index, Bool_t silent=kFALSE) const ;
40  Double_t getFrac(const int index, Bool_t silent=kFALSE) const ;
41  Double_t getOverflow() const ;
42 
43  // Printing interface (human readable)
44  virtual void printName(std::ostream& os) const ;
45  virtual void printTitle(std::ostream& os) const ;
46  virtual void printClassName(std::ostream& os) const ;
47  virtual void printValue(std::ostream& os) const ;
48  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
49  virtual Int_t defaultPrintContents(Option_t* opt) const ;
50 
51  inline virtual void Print(Option_t *options= 0) const {
52  // Printing interface (human readable)
53  printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
54  }
55 
56  virtual Bool_t isIdentical(const RooTable& other) ;
57 
58 protected:
59 
60 
61  TObjArray _types ; // Array of defined category states
62  std::vector<Double_t> _count ; // Array of counters for each state
63  Double_t _total ; // Total number of entries
64  Double_t _nOverflow ; // Number of overflow entries
65 
66  ClassDef(Roo1DTable,1) // 1-dimensional table
67 };
68 
69 #endif