43 _positiveDefinite=
false;
57 _nominal(
"!nominal",
"nominal value", this, (
RooAbsReal&)nominal),
58 _lowSet(
"!lowSet",
"low-side variation",this),
59 _highSet(
"!highSet",
"high-side variation",this),
60 _paramSet(
"!paramSet",
"high-side variation",this),
61 _positiveDefinite(false)
72 coutE(
InputArguments) <<
"PiecewiseInterpolation::ctor(" <<
GetName() <<
") ERROR: input lists should be of equal length" << endl ;
78 while((comp = inputIter1.
next())) {
79 if (!dynamic_cast<RooAbsReal*>(comp)) {
81 <<
" in first list is not of type RooAbsReal" << endl ;
92 while((comp = inputIter2.
next())) {
93 if (!dynamic_cast<RooAbsReal*>(comp)) {
95 <<
" in first list is not of type RooAbsReal" << endl ;
106 while((comp = inputIter3.
next())) {
107 if (!dynamic_cast<RooAbsReal*>(comp)) {
109 <<
" in first list is not of type RooAbsReal" << endl ;
174 while((param=(
RooAbsReal*)paramIter.next())) {
204 }
else if(param->
getVal()<-1 ) {
218 }
else if(param->
getVal()<-1 ) {
234 sum += x*(high->
getVal() - nominal );
236 sum += x*(nominal - low->
getVal());
238 double eps_plus = high->
getVal() - nominal;
239 double eps_minus = nominal - low->
getVal();
240 double S = 0.5 * (eps_plus + eps_minus);
241 double A = 0.0625 * (eps_plus - eps_minus);
245 double val = nominal + x * (S + x * A * ( 15 + x * x * (-10 + x * x * 3 ) ) );
248 if (val < 0) val = 0;
260 if (x > x0 || x < -x0)
263 sum += x*(high->
getVal() - nominal );
265 sum += x*(nominal - low->
getVal());
267 else if (nominal != 0)
269 double eps_plus = high->
getVal() - nominal;
270 double eps_minus = nominal - low->
getVal();
271 double S = (eps_plus + eps_minus)/2;
272 double A = (eps_plus - eps_minus)/2;
276 double b = 3*A/(2*x0);
278 double d = -A/(2*x0*x0*x0);
280 double val = nominal + a*x + b*
pow(x, 2) + 0 + d*
pow(x, 4);
281 if (val < 0) val = 0;
291 <<
" with unknown interpolation code" << icode << endl ;
306 cxcoutD(
Tracing) <<
"PiecewiseInterpolation::evaluate - sum < 0, not forcing positive definite"<<endl;
323 cout <<
"Currently BinIntegrator only knows how to deal with 1-d "<<endl;
333 const RooArgSet* normSet,
const char* )
const 348 if (allVars.
getSize()==0)
return 0 ;
360 while( paramIterExtra.next() ) {
363 cout <<
"can't factorize integral"<<endl;
370 analVars.
add(allVars) ;
377 Int_t sterileIdx(-1) ;
402 while(paramIter.next() ) {
500 std::cout <<
"Error: Cache Element is NULL" << std::endl;
501 throw std::exception();
508 RooAbsReal *funcInt(0), *low(0), *high(0), *param(0) ;
515 value += funcInt->getVal() ;
519 if(i==0 || i>1) { cout <<
"problem, wrong number of nominal functions"<<endl; }
526 while( (param=(
RooAbsReal*)paramIter.next()) ) {
531 value += param->
getVal()*(high->getVal() - nominal );
533 value += param->
getVal()*(nominal - low->getVal());
613 <<
" is not in list" << endl ;
616 <<
" is now " << code << endl ;
669 void PiecewiseInterpolation::Streamer(
TBuffer &R__b)
686 void PiecewiseInterpolation::printMetaArgs(ostream& os) const
693 Bool_t first(kTRUE) ;
695 RooAbsArg* arg1, *arg2 ;
696 if (_highSet.getSize()!=0) {
698 while((arg1=(RooAbsArg*)_lowIter->Next())) {
704 arg2=(RooAbsArg*)_highIter->Next() ;
705 os << arg1->GetName() << " * " << arg2->GetName() ;
710 while((arg1=(RooAbsArg*)_lowIter->Next())) {
716 os << arg1->GetName() ;
virtual const char * GetName() const
Returns name of object.
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Advertise that all integrals can be handled internally.
static long int sum(long int i)
Double_t evaluate() const
Calculate and return current value of self.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Bool_t setRealValue(const char *name, Double_t newVal=0, Bool_t verbose=kFALSE)
Set value of a RooAbsRealLValye stored in set with given name to newVal No error messages are printed...
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Int_t index(const RooAbsArg *arg) const
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Double_t getVal(const RooArgSet *set=0) const
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Buffer base class used for serializing objects.
T * getObjByIndex(Int_t index) const
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
WVE note: assumes nominal and alternates have identical structure, must add explicit check...
const RooArgSet & getConfigSection(const char *name) const
Retrieve configuration information specific to integrator with given name.
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)
Set value by specifying the name of the desired state If printError is set, a message will be printed...
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
double pow(double, double)
std::vector< int > _interpCode
virtual ~PiecewiseInterpolation()
Destructor.
void setAllInterpCodes(int code)
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
RooNumIntConfig * specialIntegratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
RooRealVar represents a fundamental (non-derived) real valued object.
void setInterpCode(RooAbsReal ¶m, int code)
RooArgSet S(const RooAbsArg &v1)
RooAbsReal * createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create an object that represents the integral of the function over one or more observables listed in ...
RooAbsArg * at(Int_t idx) const
RooAbsArg * first() const
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implement analytical integrations by doing appropriate weighting from component integrals functions t...
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
RooObjCacheManager _normIntMgr
void printAllInterpCodes()
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooFIter fwdIterator() const
virtual Bool_t isBinnedDistribution(const RooArgSet &obs) const
WVE note: assumes nominal and alternates have identical structure, must add explicit check...
double func(double *x, double *p)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Bool_t setBinIntegrator(RooArgSet &allVars)
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
const RooAbsReal & arg() const