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 ;
132 _nominal(
"!nominal",this,other._nominal),
133 _lowSet(
"!lowSet",this,other._lowSet),
134 _highSet(
"!highSet",this,other._highSet),
135 _paramSet(
"!paramSet",this,other._paramSet),
136 _positiveDefinite(other._positiveDefinite),
137 _interpCode(other._interpCode)
174 while((param=(
RooAbsReal*)paramIter.next())) {
203 sum += (2*a+b)*(param->
getVal()-1)+high->
getVal()-nominal;
204 }
else if(param->
getVal()<-1 ) {
205 sum += -1*(2*a-b)*(param->
getVal()+1)+low->
getVal()-nominal;
217 sum += (2*a+b)*(param->
getVal()-1)+high->
getVal()-nominal;
218 }
else if(param->
getVal()<-1 ) {
219 sum += -1*(2*a-b)*(param->
getVal()+1)+low->
getVal()-nominal;
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 std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
WVE note: assumes nominal and alternates have identical structure, must add explicit check...
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
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 isBinnedDistribution(const RooArgSet &) const
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooFIter fwdIterator() const
Int_t index(const RooAbsArg *arg) const
virtual Bool_t isBinnedDistribution(const RooArgSet &obs) const
WVE note: assumes nominal and alternates have identical structure, must add explicit check...
Buffer base class used for serializing objects.
Double_t evaluate() const
Calculate and return current value of self.
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
const RooAbsReal & arg() const
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...
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Advertise that all integrals can be handled internally.
RooAbsArg * first() const
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)
Double_t getVal(const RooArgSet *set=0) const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
RooRealVar represents a fundamental (non-derived) real valued object.
void setInterpCode(RooAbsReal ¶m, int code)
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
RooObjCacheManager _normIntMgr
virtual const char * GetName() const
Returns name of object.
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
void printAllInterpCodes()
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
RooAbsArg * at(Int_t idx) const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double func(double *x, double *p)
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
T * getObjByIndex(Int_t index) const
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...
ClassImp(PiecewiseInterpolation)
const RooArgSet & getConfigSection(const char *name) const
Retrieve configuration information specific to integrator with given name.
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...
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
RooNumIntConfig * specialIntegratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
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 ...