ROOT  6.06/09
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  private:
60 
61  double PolyInterpValue(int i, double x) const;
62 
63  protected:
64 
67  std::vector<double> _low;
68  std::vector<double> _high;
69  std::vector<int> _interpCode;
71 
72  TIterator* _paramIter ; //! do not persist
73 
74  mutable Bool_t _logInit ; //! flag used for chaching polynomial coefficients
75  mutable std::vector< double> _polCoeff; //! cached polynomial coefficients
76 
77  Double_t evaluate() const;
78 
79  ClassDef(RooStats::HistFactory::FlexibleInterpVar,2) // flexible interpolation
80  };
81 }
82 }
83 
84 #endif
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
double PolyInterpValue(int i, double x) const
void setInterpCode(RooAbsReal &param, int code)
virtual void printFlexibleInterpVars(std::ostream &os) const
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
Iterator abstract base class.
Definition: TIterator.h:32
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
Double_t evaluate() const
cached polynomial coefficients
void setLow(RooAbsReal &param, Double_t newLow)
bool verbose
static void indent(ostringstream &buf, int indent_level)
Namespace for the RooStats classes.
Definition: Asimov.h:20
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
virtual TObject * clone(const char *newname) const
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
std::vector< double > _polCoeff
flag used for chaching polynomial coefficients
void setHigh(RooAbsReal &param, Double_t newHigh)