Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsBinning.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 RooAbsBinning.cxx
19\class RooAbsBinning
20\ingroup Roofitcore
21
22Abstract base class for RooRealVar binning definitions.
23This class defines the interface to retrieve bin boundaries, ranges etc.
24**/
25
26#include "RooAbsBinning.h"
27
28#include "RooAbsReal.h"
29#include "RooMsgService.h"
30
31#include "TBuffer.h"
32#include "TClass.h"
33
34#include <ostream>
35
36using std::ostream;
37
38
39////////////////////////////////////////////////////////////////////////////////
40/// Print binning name
41
42void RooAbsBinning::printName(ostream& os) const
43{
44 os << GetName() ;
45}
46
47
48
49////////////////////////////////////////////////////////////////////////////////
50/// Print binning title
51
52void RooAbsBinning::printTitle(ostream& os) const
53{
54 os << GetTitle() ;
55}
56
57
58
59////////////////////////////////////////////////////////////////////////////////
60/// Print binning class name
61
62void RooAbsBinning::printClassName(ostream& os) const
63{
64 os << ClassName() ;
65}
66
67
68
69////////////////////////////////////////////////////////////////////////////////
70/// Print binning arguments (the RooAbsReal objects represening
71/// the variable bin boundaries for parameterized binning implementations
72
73void RooAbsBinning::printArgs(ostream& os) const
74{
75 os << "[ " ;
76 if (lowBoundFunc()) {
77 os << "lowerBound=" << lowBoundFunc()->GetName() ;
78 }
79 if (highBoundFunc()) {
80 if (lowBoundFunc()) {
81 os << " " ;
82 }
83 os << "upperBound=" << highBoundFunc()->GetName() ;
84 }
85 os << " ]" ;
86}
87
88
89
90////////////////////////////////////////////////////////////////////////////////
91/// Print binning value, i.e the bin boundary positions
92
93void RooAbsBinning::printValue(ostream &os) const
94{
95 Int_t n = numBins() ;
96 os << "B(" ;
97
98 Int_t i ;
99 for (i=0 ; i<n ; i++) {
100 if (i>0) {
101 os << " : " ;
102 }
103 os << binLow(i) ;
104 }
105 os << " : " << binHigh(n-1) ;
106 os << ")" ;
107
108}
109
110
111
112////////////////////////////////////////////////////////////////////////////////
113/// Custom streamer implementing schema evolution between V1 and V2 persistent binnings
114
116{
117 UInt_t R__s;
118 UInt_t R__c;
119 if (R__b.IsReading()) {
120 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
121 if (R__v) {
122 }
123 if (R__v == 1) {
125 } else {
127 }
129 R__b.CheckByteCount(R__s, R__c, RooAbsBinning::IsA());
130 } else {
131 R__c = R__b.WriteVersion(RooAbsBinning::IsA(), true);
134 R__b.SetByteCount(R__c, true);
135 }
136}
137
139{
140 oocoutE(nullptr, InputArguments) << "This binning doesn't support codegen!" << std::endl;
141 return "";
142}
#define oocoutE(o, a)
short Version_t
Class version identifier (short)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:76
void printTitle(std::ostream &os) const override
Print binning title.
Int_t numBins() const
Return number of bins.
void Streamer(TBuffer &) override
Custom streamer implementing schema evolution between V1 and V2 persistent binnings.
virtual double binLow(Int_t bin) const =0
virtual RooAbsReal * highBoundFunc() const
Return pointer to RooAbsReal parameterized upper bound, if any.
virtual double binHigh(Int_t bin) const =0
void printArgs(std::ostream &os) const override
Print binning arguments (the RooAbsReal objects represening the variable bin boundaries for parameter...
virtual std::string translateBinNumber(RooFit::Experimental::CodegenContext &ctx, RooAbsArg const &var, int coef) const
virtual RooAbsReal * lowBoundFunc() const
Return pointer to RooAbsReal parameterized lower bound, if any.
void printClassName(std::ostream &os) const override
Print binning class name.
void printName(std::ostream &os) const override
Print binning name.
TClass * IsA() const override
void printValue(std::ostream &os) const override
Print binning value, i.e the bin boundary positions.
A class to maintain the context for squashing of RooFit models into code.
virtual void Streamer(TBuffer &)
Buffer base class used for serializing objects.
Definition TBuffer.h:43
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
void Streamer(TBuffer &) override
Stream an object of class TObject.
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
Definition TObject.cxx:995
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:226
const Int_t n
Definition legend1.C:16