Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
23class Roo1DTable : public RooTable {
24public:
25
26 // Constructors, cloning and assignment
28 // Default constructor
29 // coverity[UNINIT_CTOR]
30 } ;
31 ~Roo1DTable() override;
32 Roo1DTable(const char *name, const char *title, const RooAbsCategory &cat);
33 Roo1DTable(const Roo1DTable& other) ;
34
35 void fill(RooAbsCategory& cat, double weight=1.0) override ;
36 double get(const char* label, bool silent=false) const ;
37 double getFrac(const char* label, bool silent=false) const ;
38 double get(const int index, bool silent=false) const ;
39 double getFrac(const int index, bool silent=false) const ;
40 double getOverflow() const ;
41
42 // Printing interface (human readable)
43 void printName(std::ostream& os) const override ;
44 void printTitle(std::ostream& os) const override ;
45 void printClassName(std::ostream& os) const override ;
46 void printValue(std::ostream& os) const override ;
47 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent="") const override ;
48 Int_t defaultPrintContents(Option_t* opt) const override ;
49
50 inline void Print(Option_t *options= nullptr) const override {
51 // Printing interface (human readable)
53 }
54
55 bool isIdentical(const RooTable& other, bool verbose) override ;
56
57protected:
58
59
60 TObjArray _types ; ///< Array of defined category states
61 std::vector<double> _count ; ///< Array of counters for each state
62 double _total ; ///< Total number of entries
63 double _nOverflow ; ///< Number of overflow entries
64
65 ClassDefOverride(Roo1DTable,1) // 1-dimensional table
66};
67
68#endif
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
static void indent(ostringstream &buf, int indent_level)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
char name[80]
Definition TGX11.cxx:110
One-dimensional table.
Definition Roo1DTable.h:23
std::vector< double > _count
Array of counters for each state.
Definition Roo1DTable.h:61
void printName(std::ostream &os) const override
Print the name of the table.
~Roo1DTable() override
Destructor.
void printValue(std::ostream &os) const override
Print the table value, i.e. the contents, in 'inline' format.
Int_t defaultPrintContents(Option_t *opt) const override
Define default contents to print.
double _total
Total number of entries.
Definition Roo1DTable.h:62
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Print the formatted table contents on the given stream.
double getOverflow() const
Return the number of overflow entries in the table.
double get(const char *label, bool silent=false) const
Return the table entry named 'label'.
double getFrac(const char *label, bool silent=false) const
Return the fraction of entries in the table contained in the slot named 'label'.
bool isIdentical(const RooTable &other, bool verbose) override
Return true if table is identical in contents to given reference table.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
Definition Roo1DTable.h:50
TObjArray _types
Array of defined category states.
Definition Roo1DTable.h:60
double _nOverflow
Number of overflow entries.
Definition Roo1DTable.h:63
void fill(RooAbsCategory &cat, double weight=1.0) override
Increment the counter of the table slot with the name corresponding to that of the current category s...
void printTitle(std::ostream &os) const override
Print the title of the table.
void printClassName(std::ostream &os) const override
Print the class name of the table.
A space to attach TBranches.
virtual StyleOption defaultPrintStyle(Option_t *opt) const
static std::ostream & defaultPrintStream(std::ostream *os=nullptr)
Return a reference to the current default stream to use in Print().
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,...
Abstract interface for table objects.
Definition RooTable.h:32
An array of TObjects.
Definition TObjArray.h:31
Basic string class.
Definition TString.h:139