Loading [MathJax]/extensions/tex2jax.js
ROOT  6.07/01
Reference Guide
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RooLinTransBinning.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooLinTransBinning.h,v 1.9 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_LIN_TRANS_BINNING
17 #define ROO_LIN_TRANS_BINNING
18 
19 #include "Rtypes.h"
20 #include "RooAbsBinning.h"
21 
23 public:
24 
26  // coverity[UNINIT_CTOR]
27  } ;
28  RooLinTransBinning(const RooAbsBinning& input, Double_t slope=1.0, Double_t offset=0.0, const char* name=0) ;
29  RooLinTransBinning(const RooLinTransBinning&, const char* name=0) ;
30  virtual RooAbsBinning* clone(const char* name=0) const { return new RooLinTransBinning(*this,name) ; }
31  virtual ~RooLinTransBinning() ;
32 
33  virtual Int_t numBoundaries() const { return _input->numBoundaries() ; }
34  virtual Int_t binNumber(Double_t x) const { return _input->binNumber(invTrans(x)) ; }
35  virtual Double_t binCenter(Int_t bin) const { return trans(_input->binCenter(binTrans(bin))) ; }
36  virtual Double_t binWidth(Int_t bin) const { return _slope*_input->binWidth(binTrans(bin)) ; }
37  virtual Double_t binLow(Int_t bin) const { if (_slope>0) return trans(_input->binLow(binTrans(bin))) ; else return trans(_input->binHigh(binTrans(bin))) ; }
38  virtual Double_t binHigh(Int_t bin) const { if (_slope>0) return trans(_input->binHigh(binTrans(bin))) ; else return trans(_input->binLow(binTrans(bin))) ; }
39 
40  virtual void setRange(Double_t xlo, Double_t xhi) ;
41  virtual void setMin(Double_t xlo) { setRange(xlo,highBound()) ; }
42  virtual void setMax(Double_t xhi) { setRange(lowBound(),xhi) ; }
43 
44  virtual Double_t lowBound() const { if (_slope>0) return trans(_input->lowBound()) ; else return trans(_input->highBound()) ; }
45  virtual Double_t highBound() const { if (_slope>0) return trans(_input->highBound()) ; else return trans(_input->lowBound()) ; }
46  virtual Double_t averageBinWidth() const { return _slope*_input->averageBinWidth() ; }
47 
48  virtual Double_t* array() const ;
49 
50  void updateInput(const RooAbsBinning& input, Double_t slope=1.0, Double_t offset=0.0) ;
51 
52 protected:
53 
54  inline Int_t binTrans(Int_t bin) const { if (_slope>0) return bin ; else return numBins()-bin-1 ; }
55  inline Double_t trans(Double_t x) const { return x*_slope + _offset ; }
56  inline Double_t invTrans(Double_t x) const { if (_slope==0.) return 0 ; return (x-_offset)/_slope ; }
57 
58  Double_t _slope ; // Slope of transformation
59  Double_t _offset ; // Offset of tranformation
60  RooAbsBinning* _input ; // Input binning
61  mutable Double_t *_array ; //! Array of transformed bin boundaries
62 
63  ClassDef(RooLinTransBinning,1) // Linear transformation of binning specification
64 };
65 
66 #endif
virtual Int_t binNumber(Double_t x) const
virtual Int_t numBoundaries() const
virtual Double_t binLow(Int_t bin) const =0
void updateInput(const RooAbsBinning &input, Double_t slope=1.0, Double_t offset=0.0)
Update the slope and offset parameters and the pointer to the input binning.
tuple offset
Definition: tree.py:93
virtual void setMax(Double_t xhi)
virtual Double_t binCenter(Int_t bin) const
virtual Double_t binHigh(Int_t bin) const
int Int_t
Definition: RtypesCore.h:41
Double_t trans(Double_t x) const
virtual Double_t binLow(Int_t bin) const
RooAbsBinning * _input
virtual Int_t numBoundaries() const =0
Double_t invTrans(Double_t x) const
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual Double_t binWidth(Int_t bin) const
RooLinTransBinning(const char *name=0)
Int_t numBins() const
Definition: RooAbsBinning.h:37
virtual Double_t highBound() const =0
virtual ~RooLinTransBinning()
Destructor.
RooLinTransBinning is a special binning implementation for RooLinearVar that transforms the binning o...
virtual Double_t lowBound() const
virtual Double_t lowBound() const =0
virtual Int_t binNumber(Double_t x) const =0
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
Definition: RooAbsBinning.h:26
virtual RooAbsBinning * clone(const char *name=0) const
double Double_t
Definition: RtypesCore.h:55
virtual Double_t averageBinWidth() const
virtual Double_t binCenter(Int_t bin) const =0
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual void setRange(Double_t xlo, Double_t xhi)
virtual Double_t binWidth(Int_t bin) const =0
virtual Double_t binHigh(Int_t bin) const =0
virtual Double_t * array() const
Return array of bin boundaries.
Int_t binTrans(Int_t bin) const
virtual Double_t averageBinWidth() const =0
virtual void setMin(Double_t xlo)
virtual Double_t highBound() const