Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooLinearVar.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooLinearVar.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_LINEAR_VAR
17#define ROO_LINEAR_VAR
18
19#include <cmath>
20#include <cfloat>
21#include <string>
22#include <list>
23#include "RooAbsRealLValue.h"
24#include "RooRealProxy.h"
25#include "RooLinTransBinning.h"
26
27class RooArgSet ;
28
30public:
31 // Constructors, assignment etc.
33 RooLinearVar(const char *name, const char *title, RooAbsRealLValue& variable, const RooAbsReal& slope, const RooAbsReal& offset, const char *unit= "") ;
34 RooLinearVar(const RooLinearVar& other, const char* name=nullptr);
35 TObject* clone(const char* newname) const override { return new RooLinearVar(*this,newname); }
36 ~RooLinearVar() override ;
37
38 // Parameter value and error accessors
39 void setVal(double value) override ;
40
41 // Jacobian and limits
42 bool hasBinning(const char* name) const override ;
43 const RooAbsBinning& getBinning(const char* name=nullptr, bool verbose=true, bool createOnTheFly=false) const override ;
44 RooAbsBinning& getBinning(const char* name=nullptr, bool verbose=true, bool createOnTheFly=false) override ;
45 std::list<std::string> getBinningNames() const override;
46
47 double jacobian() const override ;
48 bool isJacobianOK(const RooArgSet& depList) const override ;
49
50 // I/O streaming interface (machine readable)
51 bool readFromStream(std::istream& is, bool compact, bool verbose=false) override ;
52 void writeToStream(std::ostream& os, bool compact) const override ;
53
54 // Printing interface (human readable)
55
56 using RooAbsRealLValue::operator= ;
58
59protected:
60
61 double evaluate() const override ;
62
66 RooRealProxy _slope ; ///< Slope of transformation
67 RooRealProxy _offset ; ///< Offset of transformation
68
69 ClassDefOverride(RooLinearVar,2) // Lvalue linear transformation function
70};
71
72#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
Definition TGX11.cxx:110
Abstract base class for RooRealVar binning definitions.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
virtual void setVal(double value)=0
Set the current value of the object. Needs to be overridden by implementations.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
virtual double offset() const
Definition RooAbsReal.h:371
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Special binning implementation for RooLinearVar that transforms the binning of the RooLinearVar input...
RooLinearVar is the most general form of a derived real-valued object that can be used by RooRealInte...
RooRealProxy _slope
Slope of transformation.
bool hasBinning(const char *name) const override
Returns true if binning with given name exists.If a given binning exists on the input variable,...
TObject * clone(const char *newname) const override
RooLinkedList _altBinning
!
std::list< std::string > getBinningNames() const override
Get a list of all binning names.
RooLinTransBinning _binning
double jacobian() const override
Return value of Jacobian associated with the transformation.
double evaluate() const override
Calculate current value of this object.
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to stream.
bool isJacobianOK(const RooArgSet &depList) const override
Returns true if Jacobian term associated with current expression tree is indeed constant.
void setVal(double value) override
Assign given value to linear transformation: sets input variable to (value-offset)/slope If slope is ...
RooRealProxy _offset
Offset of transformation.
bool readFromStream(std::istream &is, bool compact, bool verbose=false) override
Read object contents from stream.
RooTemplateProxy< RooAbsRealLValue > _var
Input observable.
const RooAbsBinning & getBinning(const char *name=nullptr, bool verbose=true, bool createOnTheFly=false) const override
Const version of getBinning()
~RooLinearVar() override
Destructor.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
Mother of all ROOT objects.
Definition TObject.h:41