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)
202 }
else if(param->
getVal()<-1 ) {
216 }
else if(param->
getVal()<-1 ) {
236 double eps_plus = high->
getVal() - nominal;
237 double eps_minus = nominal - low->
getVal();
238 double S = 0.5 * (eps_plus + eps_minus);
239 double A = 0.0625 * (eps_plus - eps_minus);
243 double val = nominal +
x * (
S +
x *
A * ( 15 +
x *
x * (-10 +
x *
x * 3 ) ) );
246 if (val < 0) val = 0;
258 if (
x > x0 ||
x < -x0)
265 else if (nominal != 0)
267 double eps_plus = high->
getVal() - nominal;
268 double eps_minus = nominal - low->
getVal();
269 double S = (eps_plus + eps_minus)/2;
270 double A = (eps_plus - eps_minus)/2;
274 double b = 3*
A/(2*x0);
276 double d = -
A/(2*x0*x0*x0);
278 double val = nominal +
a*
x +
b*
pow(
x, 2) + 0 +
d*
pow(
x, 4);
279 if (val < 0) val = 0;
289 <<
" with unknown interpolation code" << icode << endl ;
304 cxcoutD(
Tracing) <<
"PiecewiseInterpolation::evaluate - sum < 0, not forcing positive definite"<<endl;
321 cout <<
"Currently BinIntegrator only knows how to deal with 1-d "<<endl;
331 const RooArgSet* normSet,
const char* )
const
346 if (allVars.
getSize()==0)
return 0 ;
358 while( paramIterExtra.
next() ) {
361 cout <<
"can't factorize integral"<<endl;
368 analVars.
add(allVars) ;
375 Int_t sterileIdx(-1) ;
400 while(paramIter.
next() ) {
498 std::cout <<
"Error: Cache Element is NULL" << std::endl;
499 throw std::exception();
506 RooAbsReal *funcInt(0), *low(0), *high(0), *param(0) ;
513 value += funcInt->getVal() ;
517 if(i==0 || i>1) { cout <<
"problem, wrong number of nominal functions"<<endl; }
529 value += param->
getVal()*(high->getVal() - nominal );
531 value += param->
getVal()*(nominal - low->getVal());
611 <<
" is not in list" << endl ;
614 <<
" is now " << code << endl ;
667void PiecewiseInterpolation::Streamer(
TBuffer &R__b)
684void PiecewiseInterpolation::printMetaArgs(ostream& os) const
691 Bool_t first(kTRUE) ;
693 RooAbsArg* arg1, *arg2 ;
694 if (_highSet.getSize()!=0) {
696 while((arg1=(RooAbsArg*)_lowIter->Next())) {
702 arg2=(RooAbsArg*)_highIter->Next() ;
703 os << arg1->GetName() << " * " << arg2->GetName() ;
708 while((arg1=(RooAbsArg*)_lowIter->Next())) {
714 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...
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooFIter fwdIterator() 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 *set=0) const
Evaluate object. Returns either cached value or triggers a recalculation.
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
RooAbsArg * at(Int_t idx) const
Int_t index(const RooAbsArg *arg) const
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
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...
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.
const RooAbsReal & arg() const
RooRealVar represents a fundamental (non-derived) real valued object.
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)