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 "RooFormula.h"
26#include "RooLinTransBinning.h"
27
28class RooArgSet ;
29
31public:
32 // Constructors, assignment etc.
34 RooLinearVar(const char *name, const char *title, RooAbsRealLValue& variable, const RooAbsReal& slope, const RooAbsReal& offset, const char *unit= "") ;
35 RooLinearVar(const RooLinearVar& other, const char* name=nullptr);
36 TObject* clone(const char* newname) const override { return new RooLinearVar(*this,newname); }
37 ~RooLinearVar() override ;
38
39 // Parameter value and error accessors
40 void setVal(double value) override ;
41
42 // Jacobian and limits
43 bool hasBinning(const char* name) const override ;
44 const RooAbsBinning& getBinning(const char* name=nullptr, bool verbose=true, bool createOnTheFly=false) const override ;
45 RooAbsBinning& getBinning(const char* name=nullptr, bool verbose=true, bool createOnTheFly=false) override ;
46 std::list<std::string> getBinningNames() const override;
47
48 double jacobian() const override ;
49 bool isJacobianOK(const RooArgSet& depList) const override ;
50
51 // I/O streaming interface (machine readable)
52 bool readFromStream(std::istream& is, bool compact, bool verbose=false) override ;
53 void writeToStream(std::ostream& os, bool compact) const override ;
54
55 // Printing interface (human readable)
56
57 using RooAbsRealLValue::operator= ;
59
60protected:
61
62 double evaluate() const override ;
63
67 RooRealProxy _slope ; ///< Slope of transformation
68 RooRealProxy _offset ; ///< Offset of transformation
69
70 ClassDefOverride(RooLinearVar,2) // Lvalue linear transformation function
71};
72
73#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual void setVal(double value)=0
Set the current value of the object. Needs to be overridden by implementations.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:62
virtual double offset() const
Definition RooAbsReal.h:386
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
RooLinTransBinning is a special binning implementation for RooLinearVar that transforms the binning o...
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.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Mother of all ROOT objects.
Definition TObject.h:41