Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 <float.h>
21 #include "TString.h"
22 #include "RooAbsRealLValue.h"
23 #include "RooRealProxy.h"
24 #include "RooFormula.h"
25 #include "RooLinTransBinning.h"
26 
27 class RooArgSet ;
28 
29 class RooLinearVar : public RooAbsRealLValue {
30 public:
31  // Constructors, assignment etc.
32  RooLinearVar() {} ;
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=0);
35  virtual TObject* clone(const char* newname) const { return new RooLinearVar(*this,newname); }
36  virtual ~RooLinearVar() ;
37 
38  // Parameter value and error accessors
39  virtual void setVal(Double_t value) ;
40 
41  // Jacobian and limits
42  virtual Bool_t hasBinning(const char* name) const ;
43  virtual const RooAbsBinning& getBinning(const char* name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const ;
44  virtual RooAbsBinning& getBinning(const char* name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) ;
45  virtual std::list<std::string> getBinningNames() const;
46 
47  virtual Double_t jacobian() const ;
48  virtual Bool_t isJacobianOK(const RooArgSet& depList) const ;
49 
50  // I/O streaming interface (machine readable)
51  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
52  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
53 
54  // Printing interface (human readable)
55 
56  using RooAbsRealLValue::operator= ;
57  using RooAbsRealLValue::setVal ;
58 
59 protected:
60 
61  virtual Double_t evaluate() const ;
62 
63  mutable RooLinTransBinning _binning ;
64  RooLinkedList _altBinning ; //!
65  RooRealProxy _var ; // Input observable
66  RooRealProxy _slope ; // Slope of transformation
67  RooRealProxy _offset ; // Offset of transformation
68 
69  ClassDef(RooLinearVar,1) // Lvalue linear transformation function
70 };
71 
72 #endif