Logo ROOT  
Reference Guide
FlexibleInterpVar.h
Go to the documentation of this file.
1 // @(#)root/roostats:$Id: cranmer $
2 // Author: Kyle Cranmer, Akira Shibata
3 /*************************************************************************
4  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOSTATS_FLEXIBLEINTERPVAR
12 #define ROOSTATS_FLEXIBLEINTERPVAR
13 
14 #include "RooAbsPdf.h"
15 #include "RooRealProxy.h"
16 #include "RooListProxy.h"
17 #include <vector>
18 
19 class RooRealVar;
20 class RooArgList ;
21 
22 namespace RooStats{
23 namespace HistFactory{
24 
25  class FlexibleInterpVar : public RooAbsReal {
26  public:
27 
29  FlexibleInterpVar(const char *name, const char *title,
30  const RooArgList& _paramList,
31  Double_t nominal, const RooArgList& low, const RooArgList& high);
32 
33  FlexibleInterpVar(const char *name, const char *title,
34  const RooArgList& _paramList,
35  double nominal, std::vector<double> low, std::vector<double> high);
36 
37  FlexibleInterpVar(const char *name, const char *title,
38  const RooArgList& _paramList, double nominal, std::vector<double> low,
39  std::vector<double> high,std::vector<int> code);
40 
41  FlexibleInterpVar(const char *name, const char *title);
42  FlexibleInterpVar(const FlexibleInterpVar&, const char*);
43 
44  void setInterpCode(RooAbsReal& param, int code);
45  void setAllInterpCodes(int code);
46  void setGlobalBoundary(double boundary) {_interpBoundary = boundary;}
47  void setNominal(Double_t newNominal);
48  void setLow(RooAbsReal& param, Double_t newLow);
49  void setHigh(RooAbsReal& param, Double_t newHigh);
50 
51  void printAllInterpCodes();
52 
53  virtual TObject* clone(const char* newname) const { return new FlexibleInterpVar(*this, newname); }
54  virtual ~FlexibleInterpVar() ;
55 
56  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose = kFALSE, TString indent = "") const;
57  virtual void printFlexibleInterpVars(std::ostream& os) const;
58 
59  const RooListProxy& variables() const;
60  double nominal() const;
61  const std::vector<double>& low() const;
62  const std::vector<double>& high() const;
63 
64  private:
65 
66  double PolyInterpValue(int i, double x) const;
67 
68  protected:
69 
72  std::vector<double> _low;
73  std::vector<double> _high;
74  std::vector<int> _interpCode;
76 
77  mutable Bool_t _logInit ; //! flag used for caching polynomial coefficients
78  mutable std::vector< double> _polCoeff; //! cached polynomial coefficients
79 
80  Double_t evaluate() const;
81 
82  ClassDef(RooStats::HistFactory::FlexibleInterpVar,2) // flexible interpolation
83  };
84 }
85 }
86 
87 #endif
RooStats::HistFactory::FlexibleInterpVar::_interpCode
std::vector< int > _interpCode
Definition: FlexibleInterpVar.h:74
RooStats::HistFactory::FlexibleInterpVar::_polCoeff
std::vector< double > _polCoeff
flag used for caching polynomial coefficients
Definition: FlexibleInterpVar.h:78
RooStats::HistFactory::FlexibleInterpVar::_nominal
Double_t _nominal
Definition: FlexibleInterpVar.h:71
RooStats::HistFactory::FlexibleInterpVar::setInterpCode
void setInterpCode(RooAbsReal &param, int code)
Definition: FlexibleInterpVar.cxx:195
RooStats::HistFactory::FlexibleInterpVar::setGlobalBoundary
void setGlobalBoundary(double boundary)
Definition: FlexibleInterpVar.h:46
RooStats::HistFactory::FlexibleInterpVar::setHigh
void setHigh(RooAbsReal &param, Double_t newHigh)
Definition: FlexibleInterpVar.cxx:253
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooStats::HistFactory::FlexibleInterpVar::_low
std::vector< double > _low
Definition: FlexibleInterpVar.h:72
x
Double_t x[n]
Definition: legend1.C:17
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooStats::HistFactory::FlexibleInterpVar::printMultiline
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
Definition: FlexibleInterpVar.cxx:461
TString
Basic string class.
Definition: TString.h:136
RooFit::HistFactory
@ HistFactory
Definition: RooGlobalFunc.h:62
RooStats::HistFactory::FlexibleInterpVar::PolyInterpValue
double PolyInterpValue(int i, double x) const
Definition: FlexibleInterpVar.cxx:282
RooStats::HistFactory::FlexibleInterpVar::_paramList
RooListProxy _paramList
Definition: FlexibleInterpVar.h:70
bool
RooStats::HistFactory::FlexibleInterpVar::evaluate
Double_t evaluate() const
cached polynomial coefficients
Definition: FlexibleInterpVar.cxx:370
RooStats::HistFactory::FlexibleInterpVar::FlexibleInterpVar
FlexibleInterpVar()
Default constructor.
Definition: FlexibleInterpVar.cxx:42
RooStats::HistFactory::FlexibleInterpVar::low
const std::vector< double > & low() const
Definition: FlexibleInterpVar.cxx:364
RooStats::HistFactory::FlexibleInterpVar::setLow
void setLow(RooAbsReal &param, Double_t newLow)
Definition: FlexibleInterpVar.cxx:235
RooStats::HistFactory::FlexibleInterpVar::~FlexibleInterpVar
virtual ~FlexibleInterpVar()
Destructor.
Definition: FlexibleInterpVar.cxx:187
RooStats::HistFactory::FlexibleInterpVar::_interpBoundary
Double_t _interpBoundary
Definition: FlexibleInterpVar.h:75
RooAbsPdf.h
RooStats::HistFactory::FlexibleInterpVar::high
const std::vector< double > & high() const
Definition: FlexibleInterpVar.cxx:365
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
RooStats::HistFactory::FlexibleInterpVar
Definition: FlexibleInterpVar.h:25
RooRealProxy.h
RooListProxy
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
RooStats::HistFactory::FlexibleInterpVar::printFlexibleInterpVars
virtual void printFlexibleInterpVars(std::ostream &os) const
Definition: FlexibleInterpVar.cxx:469
RooStats::HistFactory::FlexibleInterpVar::nominal
double nominal() const
Definition: FlexibleInterpVar.cxx:363
RooListProxy.h
RooStats::HistFactory::FlexibleInterpVar::_logInit
Bool_t _logInit
Definition: FlexibleInterpVar.h:77
RooStats::HistFactory::FlexibleInterpVar::_high
std::vector< double > _high
Definition: FlexibleInterpVar.h:73
Double_t
double Double_t
Definition: RtypesCore.h:59
RooStats::HistFactory::FlexibleInterpVar::printAllInterpCodes
void printAllInterpCodes()
Definition: FlexibleInterpVar.cxx:270
RooStats
Namespace for the RooStats classes.
Definition: Asimov.h:19
RooStats::HistFactory::FlexibleInterpVar::variables
const RooListProxy & variables() const
Const getters.
Definition: FlexibleInterpVar.cxx:362
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooStats::HistFactory::FlexibleInterpVar::clone
virtual TObject * clone(const char *newname) const
Definition: FlexibleInterpVar.h:53
RooRealVar
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:39
RooStats::HistFactory::FlexibleInterpVar::setAllInterpCodes
void setAllInterpCodes(int code)
Definition: FlexibleInterpVar.cxx:212
RooStats::HistFactory::FlexibleInterpVar::setNominal
void setNominal(Double_t newNominal)
Definition: FlexibleInterpVar.cxx:224
int