55 _nominal(
"!nominal",
"nominal value", this, (
RooAbsReal&)nominal),
56 _lowSet(
"!lowSet",
"low-side variation",this),
57 _highSet(
"!highSet",
"high-side variation",this),
58 _paramSet(
"!paramSet",
"high-side variation",this),
59 _positiveDefinite(false)
70 coutE(
InputArguments) <<
"PiecewiseInterpolation::ctor(" <<
GetName() <<
") ERROR: input lists should be of equal length" << endl ;
76 while((comp = inputIter1.
next())) {
79 <<
" in first list is not of type RooAbsReal" << endl ;
90 while((comp = inputIter2.
next())) {
93 <<
" in first list is not of type RooAbsReal" << endl ;
104 while((comp = inputIter3.
next())) {
107 <<
" in first list is not of type RooAbsReal" << endl ;
130 _nominal(
"!nominal",this,other._nominal),
131 _lowSet(
"!lowSet",this,other._lowSet),
132 _highSet(
"!highSet",this,other._highSet),
133 _paramSet(
"!paramSet",this,other._paramSet),
134 _positiveDefinite(other._positiveDefinite),
135 _interpCode(other._interpCode)
172 if(param->getVal()>0)
173 sum += param->getVal()*(high->getVal() - nominal );
175 sum += param->getVal()*(nominal - low->getVal());
180 if(param->getVal()>=0)
181 sum *=
pow(high->getVal()/nominal, +param->getVal());
183 sum *=
pow(low->getVal()/nominal, -param->getVal());
188 double a = 0.5*(high->getVal()+low->getVal())-nominal;
189 double b = 0.5*(high->getVal()-low->getVal());
191 if(param->getVal()>1 ){
192 sum += (2*
a+
b)*(param->getVal()-1)+high->getVal()-nominal;
193 }
else if(param->getVal()<-1 ) {
194 sum += -1*(2*
a-
b)*(param->getVal()+1)+low->getVal()-nominal;
196 sum +=
a*
pow(param->getVal(),2) +
b*param->getVal()+
c;
202 double a = 0.5*(high->getVal()+low->getVal())-nominal;
203 double b = 0.5*(high->getVal()-low->getVal());
205 if(param->getVal()>1 ){
206 sum += (2*
a+
b)*(param->getVal()-1)+high->getVal()-nominal;
207 }
else if(param->getVal()<-1 ) {
208 sum += -1*(2*
a-
b)*(param->getVal()+1)+low->getVal()-nominal;
210 sum +=
a*
pow(param->getVal(),2) +
b*param->getVal()+
c;
221 double x = param->getVal();
223 sum +=
x*(high->getVal() - nominal );
225 sum +=
x*(nominal - low->getVal());
227 double eps_plus = high->getVal() - nominal;
228 double eps_minus = nominal - low->getVal();
229 double S = 0.5 * (eps_plus + eps_minus);
230 double A = 0.0625 * (eps_plus - eps_minus);
234 double val = nominal +
x * (
S +
x *
A * ( 15 +
x *
x * (-10 +
x *
x * 3 ) ) );
237 if (val < 0) val = 0;
247 double x = param->getVal();
249 if (
x > x0 ||
x < -x0)
252 sum +=
x*(high->getVal() - nominal );
254 sum +=
x*(nominal - low->getVal());
256 else if (nominal != 0)
258 double eps_plus = high->getVal() - nominal;
259 double eps_minus = nominal - low->getVal();
260 double S = (eps_plus + eps_minus)/2;
261 double A = (eps_plus - eps_minus)/2;
265 double b = 3*
A/(2*x0);
267 double d = -
A/(2*x0*x0*x0);
269 double val = nominal +
a*
x +
b*
pow(
x, 2) + 0 +
d*
pow(
x, 4);
270 if (val < 0) val = 0;
280 <<
" with unknown interpolation code" << icode << endl ;
294 cxcoutD(
Tracing) <<
"PiecewiseInterpolation::evaluate - sum < 0, not forcing positive definite"<<endl;
311 cout <<
"Currently BinIntegrator only knows how to deal with 1-d "<<endl;
321 const RooArgSet* normSet,
const char* )
const
336 if (allVars.
getSize()==0)
return 0 ;
348 while( paramIterExtra.
next() ) {
351 cout <<
"can't factorize integral"<<endl;
358 analVars.
add(allVars) ;
365 Int_t sterileIdx(-1) ;
390 while(paramIter.
next() ) {
488 std::cout <<
"Error: Cache Element is NULL" << std::endl;
489 throw std::exception();
496 RooAbsReal *funcInt(0), *low(0), *high(0), *param(0) ;
503 value += funcInt->getVal() ;
507 if(i==0 || i>1) { cout <<
"problem, wrong number of nominal functions"<<endl; }
519 value += param->
getVal()*(high->getVal() - nominal );
521 value += param->
getVal()*(nominal - low->getVal());
601 <<
" is not in list" << endl ;
604 <<
" is now " << code << endl ;
657void PiecewiseInterpolation::Streamer(
TBuffer &R__b)
674void PiecewiseInterpolation::printMetaArgs(ostream& os) const
681 Bool_t first(kTRUE) ;
683 RooAbsArg* arg1, *arg2 ;
684 if (_highSet.getSize()!=0) {
686 while((arg1=(RooAbsArg*)_lowIter->Next())) {
692 arg2=(RooAbsArg*)_highIter->Next() ;
693 os << arg1->GetName() << " * " << arg2->GetName() ;
698 while((arg1=(RooAbsArg*)_lowIter->Next())) {
704 os << arg1->GetName() ;
double pow(double, double)
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.
std::vector< int > _interpCode
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...
Bool_t setBinIntegrator(RooArgSet &allVars)
void setAllInterpCodes(int code)
RooObjCacheManager _normIntMgr
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Advertise that all integrals can be handled internally.
Double_t evaluate() const
Calculate and return current value of self.
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
void setInterpCode(RooAbsReal ¶m, int code)
virtual ~PiecewiseInterpolation()
Destructor.
virtual Bool_t isBinnedDistribution(const RooArgSet &obs) const
WVE note: assumes nominal and alternates have identical structure, must add explicit check.
void printAllInterpCodes()
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
RooFIter fwdIterator() const R__SUGGEST_ALTERNATIVE("begin()
One-time forward iterator.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Int_t index(const RooAbsArg *arg) const
Returns index of given arg, or -1 if arg is not in the collection.
Storage_t::size_type size() const
RooAbsArg * first() const
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
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 ...
RooNumIntConfig * specialIntegratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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 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...
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
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...
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
const RooArgSet & getConfigSection(const char *name) const
Retrieve configuration information specific to integrator with given name.
RooRealVar represents a variable that can be changed from the outside.
const T & arg() const
Return reference to object held in proxy.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual const char * GetName() const
Returns name of object.
RooArgSet S(const RooAbsArg &v1)
static long int sum(long int i)