Loading [MathJax]/extensions/tex2jax.js
ROOT  6.06/09
Reference Guide
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PiecewiseInterpolation.cxx
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  *****************************************************************************/
4 
5 //////////////////////////////////////////////////////////////////////////////
6 //
7 // BEGIN_HTML
8 // PiecewiseInterpolation
9 // END_HTML
10 //
11 
12 #include <exception>
13 #include "RooFit.h"
14 
15 #include "Riostream.h"
16 #include "Riostream.h"
17 #include <math.h>
18 
20 #include "RooAbsReal.h"
21 #include "RooAbsPdf.h"
22 #include "RooErrorHandler.h"
23 #include "RooArgSet.h"
24 #include "RooNLLVar.h"
25 #include "RooChi2Var.h"
26 #include "RooRealVar.h"
27 #include "RooMsgService.h"
28 #include "RooNumIntConfig.h"
29 #include "RooTrace.h"
30 
31 using namespace std;
32 
34 ;
35 
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 
40 {
41  _positiveDefinite=false;
43 }
44 
45 
46 
47 ////////////////////////////////////////////////////////////////////////////////
48 
49 PiecewiseInterpolation::PiecewiseInterpolation(const char* name, const char* title, const RooAbsReal& nominal,
50  const RooArgList& lowSet,
51  const RooArgList& highSet,
52  const RooArgList& paramSet,
53  Bool_t takeOwnership) :
54  RooAbsReal(name, title),
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)
60 
61 {
62  // Constructor with two set of RooAbsReals. The value of the function will be
63  //
64  // A = sum_i lowSet(i)*highSet(i)
65  //
66  // If takeOwnership is true the PiecewiseInterpolation object will take ownership of the arguments in sumSet
67 
68  // KC: check both sizes
69  if (lowSet.getSize() != highSet.getSize()) {
70  coutE(InputArguments) << "PiecewiseInterpolation::ctor(" << GetName() << ") ERROR: input lists should be of equal length" << endl ;
72  }
73 
74  RooFIter inputIter1 = lowSet.fwdIterator() ;
75  RooAbsArg* comp ;
76  while((comp = inputIter1.next())) {
77  if (!dynamic_cast<RooAbsReal*>(comp)) {
78  coutE(InputArguments) << "PiecewiseInterpolation::ctor(" << GetName() << ") ERROR: component " << comp->GetName()
79  << " in first list is not of type RooAbsReal" << endl ;
81  }
82  _lowSet.add(*comp) ;
83  if (takeOwnership) {
84  _ownedList.addOwned(*comp) ;
85  }
86  }
87 
88 
89  RooFIter inputIter2 = highSet.fwdIterator() ;
90  while((comp = inputIter2.next())) {
91  if (!dynamic_cast<RooAbsReal*>(comp)) {
92  coutE(InputArguments) << "PiecewiseInterpolation::ctor(" << GetName() << ") ERROR: component " << comp->GetName()
93  << " in first list is not of type RooAbsReal" << endl ;
95  }
96  _highSet.add(*comp) ;
97  if (takeOwnership) {
98  _ownedList.addOwned(*comp) ;
99  }
100  }
101 
102 
103  RooFIter inputIter3 = paramSet.fwdIterator() ;
104  while((comp = inputIter3.next())) {
105  if (!dynamic_cast<RooAbsReal*>(comp)) {
106  coutE(InputArguments) << "PiecewiseInterpolation::ctor(" << GetName() << ") ERROR: component " << comp->GetName()
107  << " in first list is not of type RooAbsReal" << endl ;
109  }
110  _paramSet.add(*comp) ;
111  if (takeOwnership) {
112  _ownedList.addOwned(*comp) ;
113  }
114  _interpCode.push_back(0); // default code: linear interpolation
115  }
116 
117 
118  // Choose special integrator by default
119  specialIntegratorConfig(kTRUE)->method1D().setLabel("RooBinIntegrator") ;
121 }
122 
123 
124 
125 ////////////////////////////////////////////////////////////////////////////////
126 /// Copy constructor
127 
129  RooAbsReal(other, name),
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)
136 {
137  // Member _ownedList is intentionally not copy-constructed -- ownership is not transferred
139 }
140 
141 
142 
143 ////////////////////////////////////////////////////////////////////////////////
144 /// Destructor
145 
147 {
149 }
150 
151 
152 
153 
154 ////////////////////////////////////////////////////////////////////////////////
155 /// Calculate and return current value of self
156 
158 {
159  ///////////////////
160  Double_t nominal = _nominal;
161  Double_t sum(nominal) ;
162 
163  RooAbsReal* param ;
164  RooAbsReal* high ;
165  RooAbsReal* low ;
166  int i=0;
167 
168  RooFIter lowIter(_lowSet.fwdIterator()) ;
169  RooFIter highIter(_highSet.fwdIterator()) ;
170  RooFIter paramIter(_paramSet.fwdIterator()) ;
171 
172  while((param=(RooAbsReal*)paramIter.next())) {
173  low = (RooAbsReal*)lowIter.next() ;
174  high = (RooAbsReal*)highIter.next() ;
175 
176  Int_t icode = _interpCode[i] ;
177 
178  switch(icode) {
179  case 0: {
180  // piece-wise linear
181  if(param->getVal()>0)
182  sum += param->getVal()*(high->getVal() - nominal );
183  else
184  sum += param->getVal()*(nominal - low->getVal());
185  break ;
186  }
187  case 1: {
188  // pice-wise log
189  if(param->getVal()>=0)
190  sum *= pow(high->getVal()/nominal, +param->getVal());
191  else
192  sum *= pow(low->getVal()/nominal, -param->getVal());
193  break ;
194  }
195  case 2: {
196  // parabolic with linear
197  double a = 0.5*(high->getVal()+low->getVal())-nominal;
198  double b = 0.5*(high->getVal()-low->getVal());
199  double c = 0;
200  if(param->getVal()>1 ){
201  sum += (2*a+b)*(param->getVal()-1)+high->getVal()-nominal;
202  } else if(param->getVal()<-1 ) {
203  sum += -1*(2*a-b)*(param->getVal()+1)+low->getVal()-nominal;
204  } else {
205  sum += a*pow(param->getVal(),2) + b*param->getVal()+c;
206  }
207  break ;
208  }
209  case 3: {
210  //parabolic version of log-normal
211  double a = 0.5*(high->getVal()+low->getVal())-nominal;
212  double b = 0.5*(high->getVal()-low->getVal());
213  double c = 0;
214  if(param->getVal()>1 ){
215  sum += (2*a+b)*(param->getVal()-1)+high->getVal()-nominal;
216  } else if(param->getVal()<-1 ) {
217  sum += -1*(2*a-b)*(param->getVal()+1)+low->getVal()-nominal;
218  } else {
219  sum += a*pow(param->getVal(),2) + b*param->getVal()+c;
220  }
221  break ;
222  }
223  case 4: {
224 
225  // WVE ****************************************************************
226  // WVE *** THIS CODE IS CRITICAL TO HISTFACTORY FIT CPU PERFORMANCE ***
227  // WVE *** Do not modify unless you know what you are doing... ***
228  // WVE ****************************************************************
229 
230  double x = param->getVal();
231  if (x>1) {
232  sum += x*(high->getVal() - nominal );
233  } else if (x<-1) {
234  sum += x*(nominal - low->getVal());
235  } else {
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);
240 
241  //fcns+der+2nd_der are eq at bd
242 
243  double val = nominal + x * (S + x * A * ( 15 + x * x * (-10 + x * x * 3 ) ) );
244 
245 
246  if (val < 0) val = 0;
247  sum += val-nominal;
248  }
249  break ;
250 
251  // WVE ****************************************************************
252  }
253  case 5: {
254 
255  double x0 = 1.0;//boundary;
256  double x = param->getVal();
257 
258  if (x > x0 || x < -x0)
259  {
260  if(x>0)
261  sum += x*(high->getVal() - nominal );
262  else
263  sum += x*(nominal - low->getVal());
264  }
265  else if (nominal != 0)
266  {
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;
271 
272  //fcns+der are eq at bd
273  double a = S;
274  double b = 3*A/(2*x0);
275  //double c = 0;
276  double d = -A/(2*x0*x0*x0);
277 
278  double val = nominal + a*x + b*pow(x, 2) + 0/*c*pow(x, 3)*/ + d*pow(x, 4);
279  if (val < 0) val = 0;
280 
281  //cout << "Using interp code 5, val = " << val << endl;
282 
283  sum += val-nominal;
284  }
285  break ;
286  }
287  default: {
288  coutE(InputArguments) << "PiecewiseInterpolation::evaluate ERROR: " << param->GetName()
289  << " with unknown interpolation code" << icode << endl ;
290  break ;
291  }
292  }
293  ++i;
294  }
295 
296  if(_positiveDefinite && (sum<0)){
297  sum = 1e-6;
298  sum = 0;
299  // cout <<"sum < 0 forcing positive definite"<<endl;
300  // int code = 1;
301  // RooArgSet* myset = new RooArgSet();
302  // cout << "integral = " << analyticalIntegralWN(code, myset) << endl;
303  } else if(sum<0){
304  cxcoutD(Tracing) <<"PiecewiseInterpolation::evaluate - sum < 0, not forcing positive definite"<<endl;
305  }
306  return sum;
307 
308 }
309 
310 ////////////////////////////////////////////////////////////////////////////////
311 
313 {
314  if(allVars.getSize()==1){
315  RooAbsReal* temp = const_cast<PiecewiseInterpolation*>(this);
316  temp->specialIntegratorConfig(kTRUE)->method1D().setLabel("RooBinIntegrator") ;
317  int nbins = ((RooRealVar*) allVars.first())->numBins();
318  temp->specialIntegratorConfig(kTRUE)->getConfigSection("RooBinIntegrator").setRealValue("numBins",nbins);
319  return true;
320  }else{
321  cout << "Currently BinIntegrator only knows how to deal with 1-d "<<endl;
322  return false;
323  }
324  return false;
325 }
326 
327 ////////////////////////////////////////////////////////////////////////////////
328 /// Advertise that all integrals can be handled internally.
329 
331  const RooArgSet* normSet, const char* /*rangeName*/) const
332 {
333  /*
334  cout << "---------------------------\nin PiecewiseInterpolation get analytic integral " <<endl;
335  cout << "all vars = "<<endl;
336  allVars.Print("v");
337  cout << "anal vars = "<<endl;
338  analVars.Print("v");
339  cout << "normset vars = "<<endl;
340  if(normSet2)
341  normSet2->Print("v");
342  */
343 
344 
345  // Handle trivial no-integration scenario
346  if (allVars.getSize()==0) return 0 ;
347  if (_forceNumInt) return 0 ;
348 
349 
350  // Force using numeric integration
351  // use special numeric integrator
352  return 0;
353 
354 
355  // KC: check if interCode=0 for all
356  RooFIter paramIterExtra(_paramSet.fwdIterator()) ;
357  int i=0;
358  while( paramIterExtra.next() ) {
359  if(!_interpCode.empty() && _interpCode[i]!=0){
360  // can't factorize integral
361  cout <<"can't factorize integral"<<endl;
362  return 0;
363  }
364  ++i;
365  }
366 
367  // Select subset of allVars that are actual dependents
368  analVars.add(allVars) ;
369  // RooArgSet* normSet = normSet2 ? getObservables(normSet2) : 0 ;
370  // RooArgSet* normSet = getObservables();
371  // RooArgSet* normSet = 0;
372 
373 
374  // Check if this configuration was created before
375  Int_t sterileIdx(-1) ;
376  CacheElem* cache = (CacheElem*) _normIntMgr.getObj(normSet,&analVars,&sterileIdx) ;
377  if (cache) {
378  return _normIntMgr.lastIndex()+1 ;
379  }
380 
381  // Create new cache element
382  cache = new CacheElem ;
383 
384  // Make list of function projection and normalization integrals
385  RooAbsReal *func ;
386  // const RooArgSet* nset = _paramList.nset() ;
387 
388  // do nominal
389  func = (RooAbsReal*)(&_nominal.arg()) ;
390  RooAbsReal* funcInt = func->createIntegral(analVars) ;
391  cache->_funcIntList.addOwned(*funcInt) ;
392 
393  // do variations
394  RooFIter lowIter(_lowSet.fwdIterator()) ;
395  RooFIter highIter(_highSet.fwdIterator()) ;
396  RooFIter paramIter(_paramSet.fwdIterator()) ;
397 
398  // int i=0;
399  i=0;
400  while(paramIter.next() ) {
401  func = (RooAbsReal*)lowIter.next() ;
402  funcInt = func->createIntegral(analVars) ;
403  cache->_lowIntList.addOwned(*funcInt) ;
404 
405  func = (RooAbsReal*)highIter.next() ;
406  funcInt = func->createIntegral(analVars) ;
407  cache->_highIntList.addOwned(*funcInt) ;
408  ++i;
409  }
410 
411  // Store cache element
412  Int_t code = _normIntMgr.setObj(normSet,&analVars,(RooAbsCacheElement*)cache,0) ;
413 
414  return code+1 ;
415 }
416 
417 
418 
419 
420 ////////////////////////////////////////////////////////////////////////////////
421 /// Implement analytical integrations by doing appropriate weighting from component integrals
422 /// functions to integrators of components
423 
424 Double_t PiecewiseInterpolation::analyticalIntegralWN(Int_t code, const RooArgSet* /*normSet2*/,const char* /*rangeName*/) const
425 {
426  /*
427  cout <<"Enter analytic Integral"<<endl;
428  printDirty(true);
429  // _nominal.arg().setDirtyInhibit(kTRUE) ;
430  _nominal.arg().setShapeDirty() ;
431  RooAbsReal* temp ;
432  RooFIter lowIter(_lowSet.fwdIterator()) ;
433  while((temp=(RooAbsReal*)lowIter.next())) {
434  // temp->setDirtyInhibit(kTRUE) ;
435  temp->setShapeDirty() ;
436  }
437  RooFIter highIter(_highSet.fwdIterator()) ;
438  while((temp=(RooAbsReal*)highIter.next())) {
439  // temp->setDirtyInhibit(kTRUE) ;
440  temp->setShapeDirty() ;
441  }
442  */
443 
444  /*
445  RooAbsArg::setDirtyInhibit(kTRUE);
446  printDirty(true);
447  cout <<"done setting dirty inhibit = true"<<endl;
448 
449  // old integral, only works for linear and not positive definite
450  CacheElem* cache = (CacheElem*) _normIntMgr.getObjByIndex(code-1) ;
451 
452 
453  std::auto_ptr<RooArgSet> vars2( getParameters(RooArgSet()) );
454  std::auto_ptr<RooArgSet> iset( _normIntMgr.nameSet2ByIndex(code-1)->select(*vars2) );
455  cout <<"iset = "<<endl;
456  iset->Print("v");
457 
458  double sum = 0;
459  RooArgSet* vars = getVariables();
460  vars->remove(_paramSet);
461  _paramSet.Print("v");
462  vars->Print("v");
463  if(vars->getSize()==1){
464  RooRealVar* obs = (RooRealVar*) vars->first();
465  for(int i=0; i<obs->numBins(); ++i){
466  obs->setVal( obs->getMin() + (.5+i)*(obs->getMax()-obs->getMin())/obs->numBins());
467  sum+=evaluate()*(obs->getMax()-obs->getMin())/obs->numBins();
468  cout << "obs = " << obs->getVal() << " sum = " << sum << endl;
469  }
470  } else{
471  cout <<"only know how to deal with 1 observable right now"<<endl;
472  }
473  */
474 
475  /*
476  _nominal.arg().setDirtyInhibit(kFALSE) ;
477  RooFIter lowIter2(_lowSet.fwdIterator()) ;
478  while((temp=(RooAbsReal*)lowIter2.next())) {
479  temp->setDirtyInhibit(kFALSE) ;
480  }
481  RooFIter highIter2(_highSet.fwdIterator()) ;
482  while((temp=(RooAbsReal*)highIter2.next())) {
483  temp->setDirtyInhibit(kFALSE) ;
484  }
485  */
486 
487  /*
488  RooAbsArg::setDirtyInhibit(kFALSE);
489  printDirty(true);
490  cout <<"done"<<endl;
491  cout << "sum = " <<sum<<endl;
492  //return sum;
493  */
494 
495  // old integral, only works for linear and not positive definite
496  CacheElem* cache = (CacheElem*) _normIntMgr.getObjByIndex(code-1) ;
497  if( cache==NULL ) {
498  std::cout << "Error: Cache Element is NULL" << std::endl;
499  throw std::exception();
500  }
501 
502  // old integral, only works for linear and not positive definite
503  RooFIter funcIntIter = cache->_funcIntList.fwdIterator() ;
504  RooFIter lowIntIter = cache->_lowIntList.fwdIterator() ;
505  RooFIter highIntIter = cache->_highIntList.fwdIterator() ;
506  RooAbsReal *funcInt(0), *low(0), *high(0), *param(0) ;
507  Double_t value(0) ;
508  Double_t nominal(0);
509 
510  // get nominal
511  int i=0;
512  while(( funcInt = (RooAbsReal*)funcIntIter.next())) {
513  value += funcInt->getVal() ;
514  nominal = value;
515  i++;
516  }
517  if(i==0 || i>1) { cout << "problem, wrong number of nominal functions"<<endl; }
518 
519  // now get low/high variations
520  i = 0;
521  RooFIter paramIter(_paramSet.fwdIterator()) ;
522 
523  // KC: old interp code with new iterator
524  while( (param=(RooAbsReal*)paramIter.next()) ) {
525  low = (RooAbsReal*)lowIntIter.next() ;
526  high = (RooAbsReal*)highIntIter.next() ;
527 
528  if(param->getVal()>0) {
529  value += param->getVal()*(high->getVal() - nominal );
530  } else {
531  value += param->getVal()*(nominal - low->getVal());
532  }
533  ++i;
534  }
535 
536  /* // MB : old bit of interpolation code
537  while( (param=(RooAbsReal*)_paramIter->Next()) ) {
538  low = (RooAbsReal*)lowIntIter->Next() ;
539  high = (RooAbsReal*)highIntIter->Next() ;
540 
541  if(param->getVal()>0) {
542  value += param->getVal()*(high->getVal() - nominal );
543  } else {
544  value += param->getVal()*(nominal - low->getVal());
545  }
546  ++i;
547  }
548  */
549 
550  /* KC: the code below is wrong. Can't pull out a constant change to a non-linear shape deformation.
551  while( (param=(RooAbsReal*)paramIter.next()) ) {
552  low = (RooAbsReal*)lowIntIter.next() ;
553  high = (RooAbsReal*)highIntIter.next() ;
554 
555  if(_interpCode.empty() || _interpCode.at(i)==0){
556  // piece-wise linear
557  if(param->getVal()>0)
558  value += param->getVal()*(high->getVal() - nominal );
559  else
560  value += param->getVal()*(nominal - low->getVal());
561  } else if(_interpCode.at(i)==1){
562  // pice-wise log
563  if(param->getVal()>=0)
564  value *= pow(high->getVal()/nominal, +param->getVal());
565  else
566  value *= pow(low->getVal()/nominal, -param->getVal());
567  } else if(_interpCode.at(i)==2){
568  // parabolic with linear
569  double a = 0.5*(high->getVal()+low->getVal())-nominal;
570  double b = 0.5*(high->getVal()-low->getVal());
571  double c = 0;
572  if(param->getVal()>1 ){
573  value += (2*a+b)*(param->getVal()-1)+high->getVal()-nominal;
574  } else if(param->getVal()<-1 ) {
575  value += -1*(2*a-b)*(param->getVal()+1)+low->getVal()-nominal;
576  } else {
577  value += a*pow(param->getVal(),2) + b*param->getVal()+c;
578  }
579  } else if(_interpCode.at(i)==3){
580  //parabolic version of log-normal
581  double a = 0.5*(high->getVal()+low->getVal())-nominal;
582  double b = 0.5*(high->getVal()-low->getVal());
583  double c = 0;
584  if(param->getVal()>1 ){
585  value += (2*a+b)*(param->getVal()-1)+high->getVal()-nominal;
586  } else if(param->getVal()<-1 ) {
587  value += -1*(2*a-b)*(param->getVal()+1)+low->getVal()-nominal;
588  } else {
589  value += a*pow(param->getVal(),2) + b*param->getVal()+c;
590  }
591 
592  } else {
593  coutE(InputArguments) << "PiecewiseInterpolation::analyticalIntegralWN ERROR: " << param->GetName()
594  << " with unknown interpolation code" << endl ;
595  }
596  ++i;
597  }
598  */
599 
600  // cout << "value = " << value <<endl;
601  return value;
602 }
603 
604 
605 ////////////////////////////////////////////////////////////////////////////////
606 
608  int index = _paramSet.index(&param);
609  if(index<0){
610  coutE(InputArguments) << "PiecewiseInterpolation::setInterpCode ERROR: " << param.GetName()
611  << " is not in list" << endl ;
612  } else {
613  coutW(InputArguments) << "PiecewiseInterpolation::setInterpCode : " << param.GetName()
614  << " is now " << code << endl ;
615  _interpCode.at(index) = code;
616  }
617 }
618 
619 
620 ////////////////////////////////////////////////////////////////////////////////
621 
623  for(unsigned int i=0; i<_interpCode.size(); ++i){
624  _interpCode.at(i) = code;
625  }
626 }
627 
628 
629 ////////////////////////////////////////////////////////////////////////////////
630 
632  for(unsigned int i=0; i<_interpCode.size(); ++i){
633  coutI(InputArguments) <<"interp code for " << _paramSet.at(i)->GetName() << " = " << _interpCode.at(i) <<endl;
634  }
635 }
636 
637 
638 ////////////////////////////////////////////////////////////////////////////////
639 /// WVE note: assumes nominal and alternates have identical structure, must add explicit check
640 
641 std::list<Double_t>* PiecewiseInterpolation::binBoundaries(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const
642 {
643  return _nominal.arg().binBoundaries(obs,xlo,xhi) ;
644 }
645 
646 
647 ////////////////////////////////////////////////////////////////////////////////
648 /// WVE note: assumes nominal and alternates have identical structure, must add explicit check
649 
651 {
652  return _nominal.arg().isBinnedDistribution(obs) ;
653 }
654 
655 
656 
657 ////////////////////////////////////////////////////////////////////////////////
658 
660 {
661  return _nominal.arg().plotSamplingHint(obs,xlo,xhi) ;
662 }
663 
664 ////////////////////////////////////////////////////////////////////////////////
665 /// Stream an object of class PiecewiseInterpolation.
666 
667 void PiecewiseInterpolation::Streamer(TBuffer &R__b)
668 {
669  if (R__b.IsReading()) {
671  specialIntegratorConfig(kTRUE)->method1D().setLabel("RooBinIntegrator") ;
672  if (_interpCode.empty()) _interpCode.resize(_paramSet.getSize());
673  } else {
675  }
676 }
677 
678 
679 /*
680 ////////////////////////////////////////////////////////////////////////////////
681 /// Customized printing of arguments of a PiecewiseInterpolation to more intuitively reflect the contents of the
682 /// product operator construction
683 
684 void PiecewiseInterpolation::printMetaArgs(ostream& os) const
685 {
686  _lowIter->Reset() ;
687  if (_highIter) {
688  _highIter->Reset() ;
689  }
690 
691  Bool_t first(kTRUE) ;
692 
693  RooAbsArg* arg1, *arg2 ;
694  if (_highSet.getSize()!=0) {
695 
696  while((arg1=(RooAbsArg*)_lowIter->Next())) {
697  if (!first) {
698  os << " + " ;
699  } else {
700  first = kFALSE ;
701  }
702  arg2=(RooAbsArg*)_highIter->Next() ;
703  os << arg1->GetName() << " * " << arg2->GetName() ;
704  }
705 
706  } else {
707 
708  while((arg1=(RooAbsArg*)_lowIter->Next())) {
709  if (!first) {
710  os << " + " ;
711  } else {
712  first = kFALSE ;
713  }
714  os << arg1->GetName() ;
715  }
716 
717  }
718 
719  os << " " ;
720 }
721 
722 */
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...
#define coutE(a)
Definition: RooMsgService.h:35
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooAbsReal.h:278
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
static void softAbort()
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...
Definition: RooArgSet.cxx:548
Bool_t IsReading() const
Definition: TBuffer.h:81
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
Definition: RooAbsReal.h:277
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
#define coutI(a)
Definition: RooMsgService.h:32
RooFIter fwdIterator() const
#define cxcoutD(a)
Definition: RooMsgService.h:80
Int_t index(const RooAbsArg *arg) const
Definition: RooArgList.h:76
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.
Definition: TBuffer.h:40
Int_t lastIndex() const
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
int nbins[3]
Double_t evaluate() const
Calculate and return current value of self.
STL namespace.
#define coutW(a)
Definition: RooMsgService.h:34
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
Definition: TIterator.cxx:20
static double A[]
const RooAbsReal & arg() const
Definition: RooRealProxy.h:43
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
RooCategory & method1D()
#define TRACE_CREATE
Definition: RooTrace.h:23
Double_t x[n]
Definition: legend1.C:17
void Class()
Definition: Class.C:29
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
double pow(double, double)
std::vector< int > _interpCode
virtual ~PiecewiseInterpolation()
Destructor.
Double_t getVal(const RooArgSet *set=0) const
Definition: RooAbsReal.h:64
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
void setInterpCode(RooAbsReal &param, int code)
Bool_t _forceNumInt
Definition: RooAbsReal.h:392
RooObjCacheManager _normIntMgr
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooAbsReal.h:279
RooAbsArg * next()
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
RooAbsArg * at(Int_t idx) const
Definition: RooArgList.h:84
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
static const float S
Definition: mandel.cpp:113
double func(double *x, double *p)
Definition: stressTF1.cxx:213
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
#define TRACE_DESTROY
Definition: RooTrace.h:24
#define name(a, b)
Definition: linkTestLib0.cpp:5
T * getObjByIndex(Int_t index) const
#define NULL
Definition: Rtypes.h:82
Bool_t setBinIntegrator(RooArgSet &allVars)
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
Int_t getSize() const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
const Bool_t kTRUE
Definition: Rtypes.h:91
float value
Definition: math.cpp:443
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.
Definition: RooArgSet.cxx:448
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 ...
Definition: RooAbsReal.cxx:503