ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: Roo1DTable.h,v 1.19 2007/05/11 09:11:30 verkerke Exp $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_1D_TABLE
#define ROO_1D_TABLE

#include "Riosfwd.h"
#include <assert.h>
#include "TObjArray.h"
#include "RooTable.h"
#include <vector>

class Roo1DTable : public RooTable {
public:

  // Constructors, cloning and assignment
  Roo1DTable() {
    // Default constructor
    // coverity[UNINIT_CTOR]
  } ;
  virtual ~Roo1DTable();
  Roo1DTable(const char *name, const char *title, const RooAbsCategory &cat);
  Roo1DTable(const Roo1DTable& other) ;

  virtual void fill(RooAbsCategory& cat, Double_t weight=1.0) ;
  Double_t get(const char* label, Bool_t silent=kFALSE) const ;
  Double_t getFrac(const char* label, Bool_t silent=kFALSE) const ;
  Double_t get(const int index, Bool_t silent=kFALSE) const ;
  Double_t getFrac(const int index, Bool_t silent=kFALSE) const ;
  Double_t getOverflow() const ;

  // Printing interface (human readable)
  virtual void printName(std::ostream& os) const ;
  virtual void printTitle(std::ostream& os) const ;
  virtual void printClassName(std::ostream& os) const ;
  virtual void printValue(std::ostream& os) const ;
  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
  virtual Int_t defaultPrintContents(Option_t* opt) const ;

  inline virtual void Print(Option_t *options= 0) const {
    // Printing interface (human readable)
    printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
  }

  virtual Bool_t isIdentical(const RooTable& other) ;

protected:

  
  TObjArray _types ;             // Array of defined category states
  std::vector<Double_t> _count ; // Array of counters for each state
  Double_t  _total ;             // Total number of entries
  Double_t  _nOverflow ;         // Number of overflow entries

  ClassDef(Roo1DTable,1) // 1-dimensional table
};

#endif
 Roo1DTable.h:1
 Roo1DTable.h:2
 Roo1DTable.h:3
 Roo1DTable.h:4
 Roo1DTable.h:5
 Roo1DTable.h:6
 Roo1DTable.h:7
 Roo1DTable.h:8
 Roo1DTable.h:9
 Roo1DTable.h:10
 Roo1DTable.h:11
 Roo1DTable.h:12
 Roo1DTable.h:13
 Roo1DTable.h:14
 Roo1DTable.h:15
 Roo1DTable.h:16
 Roo1DTable.h:17
 Roo1DTable.h:18
 Roo1DTable.h:19
 Roo1DTable.h:20
 Roo1DTable.h:21
 Roo1DTable.h:22
 Roo1DTable.h:23
 Roo1DTable.h:24
 Roo1DTable.h:25
 Roo1DTable.h:26
 Roo1DTable.h:27
 Roo1DTable.h:28
 Roo1DTable.h:29
 Roo1DTable.h:30
 Roo1DTable.h:31
 Roo1DTable.h:32
 Roo1DTable.h:33
 Roo1DTable.h:34
 Roo1DTable.h:35
 Roo1DTable.h:36
 Roo1DTable.h:37
 Roo1DTable.h:38
 Roo1DTable.h:39
 Roo1DTable.h:40
 Roo1DTable.h:41
 Roo1DTable.h:42
 Roo1DTable.h:43
 Roo1DTable.h:44
 Roo1DTable.h:45
 Roo1DTable.h:46
 Roo1DTable.h:47
 Roo1DTable.h:48
 Roo1DTable.h:49
 Roo1DTable.h:50
 Roo1DTable.h:51
 Roo1DTable.h:52
 Roo1DTable.h:53
 Roo1DTable.h:54
 Roo1DTable.h:55
 Roo1DTable.h:56
 Roo1DTable.h:57
 Roo1DTable.h:58
 Roo1DTable.h:59
 Roo1DTable.h:60
 Roo1DTable.h:61
 Roo1DTable.h:62
 Roo1DTable.h:63
 Roo1DTable.h:64
 Roo1DTable.h:65
 Roo1DTable.h:66
 Roo1DTable.h:67
 Roo1DTable.h:68
 Roo1DTable.h:69
 Roo1DTable.h:70