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 "Riostream.h"
35
36using std::ostream;
37
39
40
41
42////////////////////////////////////////////////////////////////////////////////
43/// Print binning name
44
45void RooAbsBinning::printName(ostream& os) const
46{
47 os << GetName() ;
48}
49
50
51
52////////////////////////////////////////////////////////////////////////////////
53/// Print binning title
54
55void RooAbsBinning::printTitle(ostream& os) const
56{
57 os << GetTitle() ;
58}
59
60
61
62////////////////////////////////////////////////////////////////////////////////
63/// Print binning class name
64
65void RooAbsBinning::printClassName(ostream& os) const
66{
67 os << ClassName() ;
68}
69
70
71
72////////////////////////////////////////////////////////////////////////////////
73/// Print binning arguments (the RooAbsReal objects represening
74/// the variable bin boundaries for parameterized binning implementations
75
76void RooAbsBinning::printArgs(ostream& os) const
77{
78 os << "[ " ;
79 if (lowBoundFunc()) {
80 os << "lowerBound=" << lowBoundFunc()->GetName() ;
81 }
82 if (highBoundFunc()) {
83 if (lowBoundFunc()) {
84 os << " " ;
85 }
86 os << "upperBound=" << highBoundFunc()->GetName() ;
87 }
88 os << " ]" ;
89}
90
91
92
93////////////////////////////////////////////////////////////////////////////////
94/// Print binning value, i.e the bin boundary positions
95
96void RooAbsBinning::printValue(ostream &os) const
97{
98 Int_t n = numBins() ;
99 os << "B(" ;
100
101 Int_t i ;
102 for (i=0 ; i<n ; i++) {
103 if (i>0) {
104 os << " : " ;
105 }
106 os << binLow(i) ;
107 }
108 os << " : " << binHigh(n-1) ;
109 os << ")" ;
110
111}
112
113
114
115////////////////////////////////////////////////////////////////////////////////
116/// Custom streamer implementing schema evolution between V1 and V2 persistent binnings
117
119{
120 UInt_t R__s;
121 UInt_t R__c;
122 if (R__b.IsReading()) {
123 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
124 if (R__v) {
125 }
126 if (R__v == 1) {
128 } else {
130 }
132 R__b.CheckByteCount(R__s, R__c, RooAbsBinning::IsA());
133 } else {
134 R__c = R__b.WriteVersion(RooAbsBinning::IsA(), true);
137 R__b.SetByteCount(R__c, true);
138 }
139}
140
142{
143 oocoutE(nullptr, InputArguments) << "This binning doesn't support codegen!" << std::endl;
144 return "";
145}
#define oocoutE(o, a)
short Version_t
Definition RtypesCore.h:65
#define ClassImp(name)
Definition Rtypes.h:382
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:79
Abstract base class for RooRealVar binning definitions.
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::Detail::CodeSquashContext &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:47
void Streamer(TBuffer &) override
Stream an object of class TObject.
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
Definition TObject.cxx:894
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:213
const Int_t n
Definition legend1.C:16