Logo ROOT  
Reference Guide
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 
28 class RooArgSet ;
29 
31 public:
32  // Constructors, assignment etc.
33  RooLinearVar() {} ;
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=0);
36  virtual TObject* clone(const char* newname) const { return new RooLinearVar(*this,newname); }
37  virtual ~RooLinearVar() ;
38 
39  // Parameter value and error accessors
40  virtual void setVal(Double_t value) ;
41 
42  // Jacobian and limits
43  virtual Bool_t hasBinning(const char* name) const ;
44  virtual const RooAbsBinning& getBinning(const char* name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const ;
45  virtual RooAbsBinning& getBinning(const char* name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) ;
46  virtual std::list<std::string> getBinningNames() const;
47 
48  virtual Double_t jacobian() const ;
49  virtual Bool_t isJacobianOK(const RooArgSet& depList) const ;
50 
51  // I/O streaming interface (machine readable)
52  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
53  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
54 
55  // Printing interface (human readable)
56 
57  using RooAbsRealLValue::operator= ;
59 
60 protected:
61 
62  virtual Double_t evaluate() const ;
63 
66  RooRealProxy _var ; // Input observable
67  RooRealProxy _slope ; // Slope of transformation
68  RooRealProxy _offset ; // Offset of transformation
69 
70  ClassDef(RooLinearVar,1) // Lvalue linear transformation function
71 };
72 
73 #endif
RooLinTransBinning.h
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooLinearVar::isJacobianOK
virtual Bool_t isJacobianOK(const RooArgSet &depList) const
Returns true if Jacobian term associated with current expression tree is indeed constant.
Definition: RooLinearVar.cxx:147
RooLinearVar::setVal
virtual void setVal(Double_t value)
Assign given value to linear transformation: sets input variable to (value-offset)/slope If slope is ...
Definition: RooLinearVar.cxx:126
RooLinearVar::jacobian
virtual Double_t jacobian() const
Return value of Jacobian associated with the transformation.
Definition: RooLinearVar.cxx:174
RooLinearVar::_slope
RooRealProxy _slope
Definition: RooLinearVar.h:67
RooFormula.h
RooAbsReal
Definition: RooAbsReal.h:61
RooLinearVar::getBinningNames
virtual std::list< std::string > getBinningNames() const
Get a list of all binning names.
Definition: RooLinearVar.cxx:252
RooLinearVar::hasBinning
virtual Bool_t hasBinning(const char *name) const
Returns true if binning with given name exists.If a given binning exists on the input variable,...
Definition: RooLinearVar.cxx:271
bool
RooLinearVar::RooLinearVar
RooLinearVar()
Definition: RooLinearVar.h:33
RooLinearVar
Definition: RooLinearVar.h:30
RooLinearVar::_offset
RooRealProxy _offset
Definition: RooLinearVar.h:68
RooLinTransBinning
Definition: RooLinTransBinning.h:22
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooLinearVar::_binning
RooLinTransBinning _binning
Definition: RooLinearVar.h:64
RooLinkedList
Definition: RooLinkedList.h:35
RooAbsBinning
Definition: RooAbsBinning.h:26
RooRealProxy.h
RooLinearVar::evaluate
virtual Double_t evaluate() const
Calculate current value of this object
Definition: RooLinearVar.cxx:115
RooAbsReal::offset
virtual Double_t offset() const
Definition: RooAbsReal.h:345
RooLinearVar::_altBinning
RooLinkedList _altBinning
Definition: RooLinearVar.h:65
RooLinearVar::getBinning
virtual const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const
Const version of getBinning()
Definition: RooLinearVar.cxx:243
RooTemplateProxy< RooAbsReal >
Double_t
double Double_t
Definition: RtypesCore.h:59
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooLinearVar::clone
virtual TObject * clone(const char *newname) const
Definition: RooLinearVar.h:36
name
char name[80]
Definition: TGX11.cxx:110
RooLinearVar::~RooLinearVar
virtual ~RooLinearVar()
Destructor.
Definition: RooLinearVar.cxx:105
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooLinearVar::writeToStream
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to stream.
Definition: RooLinearVar.cxx:194
RooAbsRealLValue::setVal
virtual void setVal(Double_t value)=0
RooAbsRealLValue
Definition: RooAbsRealLValue.h:31
RooAbsRealLValue.h
RooLinearVar::_var
RooRealProxy _var
Definition: RooLinearVar.h:66
RooArgSet
Definition: RooArgSet.h:28
RooLinearVar::readFromStream
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from stream.
Definition: RooLinearVar.cxx:184