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