Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
19class RooRealVar;
20class RooArgList ;
21
22namespace RooStats{
23namespace HistFactory{
24
26 public:
27
29 FlexibleInterpVar(const char *name, const char *title,
31 double nominal, const RooArgList& low, const RooArgList& high);
32
33 FlexibleInterpVar(const char *name, const char *title,
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 newNominal);
48 void setLow(RooAbsReal& param, double newLow);
49 void setHigh(RooAbsReal& param, double newHigh);
50
52 const std::vector<int>& interpolationCodes() const { return _interpCode; }
53
54 TObject* clone(const char* newname) const override { return new FlexibleInterpVar(*this, newname); }
55 ~FlexibleInterpVar() override ;
56
57 void printMultiline(std::ostream& os, Int_t contents, bool verbose = false, TString indent = "") const override;
58 virtual void printFlexibleInterpVars(std::ostream& os) const;
59
60 const RooListProxy& variables() const;
61 double nominal() const;
62 const std::vector<double>& low() const;
63 const std::vector<double>& high() const;
64
65 void computeBatch(cudaStream_t*, double* output, size_t size, RooFit::Detail::DataMap const&) const override;
66
67 private:
68
69 double PolyInterpValue(int i, double x) const;
70
71 void processParam(std::size_t i, double paramVal, double &total) const;
72
73 protected:
74
76 double _nominal;
77 std::vector<double> _low;
78 std::vector<double> _high;
79 std::vector<int> _interpCode;
81
82 mutable bool _logInit ; ///<! flag used for caching polynomial coefficients
83 mutable std::vector< double> _polCoeff; ///<! cached polynomial coefficients
84
85 double evaluate() const override;
86
88 };
89}
90}
91
92#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
static void indent(ostringstream &buf, int indent_level)
static unsigned int total
char name[80]
Definition TGX11.cxx:110
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:62
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:40
std::vector< double > _polCoeff
! cached polynomial coefficients
bool _logInit
! flag used for caching polynomial coefficients
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Interface for detailed printing of object.
void setInterpCode(RooAbsReal &param, int code)
const std::vector< double > & high() const
void setLow(RooAbsReal &param, double newLow)
const std::vector< double > & low() const
void setHigh(RooAbsReal &param, double newHigh)
const std::vector< int > & interpolationCodes() const
void processParam(std::size_t i, double paramVal, double &total) const
void computeBatch(cudaStream_t *, double *output, size_t size, RooFit::Detail::DataMap const &) const override
Base function for computing multiple values of a RooAbsReal.
double evaluate() const override
Calculate and return value of polynomial.
TObject * clone(const char *newname) const override
double PolyInterpValue(int i, double x) const
virtual void printFlexibleInterpVars(std::ostream &os) const
const RooListProxy & variables() const
Const getters.
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139
Double_t x[n]
Definition legend1.C:17
Namespace for the RooStats classes.
Definition Asimov.h:19
static void output()