ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 * @(#)root/roofitcore:$Id: RooAbsIntegrator.cxx 28259 2009-04-16 16:21:16Z wouter $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/

//////////////////////////////////////////////////////////////////////////////
// 
// BEGIN_HTML
// RooAbsIntegrator is the abstract interface for integrators of real-valued
// functions that implement the RooAbsFunc interface.
// END_HTML
//
//

#include "RooFit.h"

#include "Riostream.h"


#include "RooAbsIntegrator.h"
#include "RooAbsIntegrator.h"
#include "RooMsgService.h"
#include "TClass.h"

ClassImp(RooAbsIntegrator)
;


//_____________________________________________________________________________
RooAbsIntegrator::RooAbsIntegrator() : _function(0), _valid(kFALSE), _printEvalCounter(kFALSE) 
{
  // Default constructor
}



//_____________________________________________________________________________
RooAbsIntegrator::RooAbsIntegrator(const RooAbsFunc& function, Bool_t doPrintEvalCounter) :
  _function(&function), _valid(function.isValid()), _printEvalCounter(doPrintEvalCounter)
{
  // Copy constructor
}



//_____________________________________________________________________________
Double_t RooAbsIntegrator::calculate(const Double_t *yvec) 
{
  // Calculate integral value with given array of parameter values

  integrand()->resetNumCall() ;

  integrand()->saveXVec() ;
  Double_t ret = integral(yvec) ; 
  integrand()->restoreXVec() ;
  
  cxcoutD(NumIntegration) << IsA()->GetName() << "::calculate(" << _function->getName() << ") number of function calls = " << integrand()->numCall() << endl ;
  return ret ;
}



//_____________________________________________________________________________
Bool_t RooAbsIntegrator::setLimits(Double_t xmin, Double_t xmax) 
{ 
  // Interface to set limits on integration
  return setLimits(&xmin,&xmax) ; 
}
 


//_____________________________________________________________________________
Bool_t RooAbsIntegrator::setUseIntegrandLimits(Bool_t) 
{ 
  // Interface function that allows to defer limit definition to integrand definition
  return kFALSE ; 
} 
 RooAbsIntegrator.cxx:1
 RooAbsIntegrator.cxx:2
 RooAbsIntegrator.cxx:3
 RooAbsIntegrator.cxx:4
 RooAbsIntegrator.cxx:5
 RooAbsIntegrator.cxx:6
 RooAbsIntegrator.cxx:7
 RooAbsIntegrator.cxx:8
 RooAbsIntegrator.cxx:9
 RooAbsIntegrator.cxx:10
 RooAbsIntegrator.cxx:11
 RooAbsIntegrator.cxx:12
 RooAbsIntegrator.cxx:13
 RooAbsIntegrator.cxx:14
 RooAbsIntegrator.cxx:15
 RooAbsIntegrator.cxx:16
 RooAbsIntegrator.cxx:17
 RooAbsIntegrator.cxx:18
 RooAbsIntegrator.cxx:19
 RooAbsIntegrator.cxx:20
 RooAbsIntegrator.cxx:21
 RooAbsIntegrator.cxx:22
 RooAbsIntegrator.cxx:23
 RooAbsIntegrator.cxx:24
 RooAbsIntegrator.cxx:25
 RooAbsIntegrator.cxx:26
 RooAbsIntegrator.cxx:27
 RooAbsIntegrator.cxx:28
 RooAbsIntegrator.cxx:29
 RooAbsIntegrator.cxx:30
 RooAbsIntegrator.cxx:31
 RooAbsIntegrator.cxx:32
 RooAbsIntegrator.cxx:33
 RooAbsIntegrator.cxx:34
 RooAbsIntegrator.cxx:35
 RooAbsIntegrator.cxx:36
 RooAbsIntegrator.cxx:37
 RooAbsIntegrator.cxx:38
 RooAbsIntegrator.cxx:39
 RooAbsIntegrator.cxx:40
 RooAbsIntegrator.cxx:41
 RooAbsIntegrator.cxx:42
 RooAbsIntegrator.cxx:43
 RooAbsIntegrator.cxx:44
 RooAbsIntegrator.cxx:45
 RooAbsIntegrator.cxx:46
 RooAbsIntegrator.cxx:47
 RooAbsIntegrator.cxx:48
 RooAbsIntegrator.cxx:49
 RooAbsIntegrator.cxx:50
 RooAbsIntegrator.cxx:51
 RooAbsIntegrator.cxx:52
 RooAbsIntegrator.cxx:53
 RooAbsIntegrator.cxx:54
 RooAbsIntegrator.cxx:55
 RooAbsIntegrator.cxx:56
 RooAbsIntegrator.cxx:57
 RooAbsIntegrator.cxx:58
 RooAbsIntegrator.cxx:59
 RooAbsIntegrator.cxx:60
 RooAbsIntegrator.cxx:61
 RooAbsIntegrator.cxx:62
 RooAbsIntegrator.cxx:63
 RooAbsIntegrator.cxx:64
 RooAbsIntegrator.cxx:65
 RooAbsIntegrator.cxx:66
 RooAbsIntegrator.cxx:67
 RooAbsIntegrator.cxx:68
 RooAbsIntegrator.cxx:69
 RooAbsIntegrator.cxx:70
 RooAbsIntegrator.cxx:71
 RooAbsIntegrator.cxx:72
 RooAbsIntegrator.cxx:73
 RooAbsIntegrator.cxx:74
 RooAbsIntegrator.cxx:75
 RooAbsIntegrator.cxx:76
 RooAbsIntegrator.cxx:77
 RooAbsIntegrator.cxx:78
 RooAbsIntegrator.cxx:79
 RooAbsIntegrator.cxx:80
 RooAbsIntegrator.cxx:81
 RooAbsIntegrator.cxx:82
 RooAbsIntegrator.cxx:83
 RooAbsIntegrator.cxx:84
 RooAbsIntegrator.cxx:85
 RooAbsIntegrator.cxx:86
 RooAbsIntegrator.cxx:87
 RooAbsIntegrator.cxx:88