ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooImproperIntegrator1D.h,v 1.12 2007/05/11 09:11:30 verkerke Exp $
 * 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)             *
 *****************************************************************************/
#ifndef ROO_IMPROPER_INTEGRATOR_1D
#define ROO_IMPROPER_INTEGRATOR_1D

#include "RooAbsIntegrator.h"
#include "RooNumIntConfig.h"

class RooInvTransform;
class RooIntegrator1D;

class RooImproperIntegrator1D : public RooAbsIntegrator {
public:

  RooImproperIntegrator1D() ;
  RooImproperIntegrator1D(const RooAbsFunc& function);
  RooImproperIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config);
  RooImproperIntegrator1D(const RooAbsFunc& function, Double_t xmin, Double_t xmax, const RooNumIntConfig& config);
  virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const ;
  virtual ~RooImproperIntegrator1D();

  virtual Bool_t checkLimits() const;
  using RooAbsIntegrator::setLimits ;
  Bool_t setLimits(Double_t* xmin, Double_t* xmax);
  virtual Bool_t setUseIntegrandLimits(Bool_t flag) {_useIntegrandLimits = flag ; return kTRUE ; }
  virtual Double_t integral(const Double_t* yvec=0) ;

  virtual Bool_t canIntegrate1D() const { return kTRUE ; }
  virtual Bool_t canIntegrate2D() const { return kFALSE ; }
  virtual Bool_t canIntegrateND() const { return kFALSE ; }
  virtual Bool_t canIntegrateOpenEnded() const { return kTRUE ; }

protected:

  friend class RooNumIntFactory ;
  static void registerIntegrator(RooNumIntFactory& fact) ;	

  void initialize(const RooAbsFunc* function=0) ;

  enum LimitsCase { Invalid, ClosedBothEnds, OpenBothEnds, OpenBelowSpansZero, OpenBelow,
		    OpenAboveSpansZero, OpenAbove };
  LimitsCase limitsCase() const;
  LimitsCase _case; // Configuration of limits
  mutable Double_t _xmin, _xmax;  // Value of limits
  Bool_t _useIntegrandLimits;  // Use limits in function binding?

  RooAbsFunc*      _origFunc ;  // Original function binding
  RooInvTransform *_function;   // Binding with inverse of function
  RooNumIntConfig  _config ;  // Configuration object
  mutable RooIntegrator1D *_integrator1,*_integrator2,*_integrator3; // Piece integrators
  
  ClassDef(RooImproperIntegrator1D,0) // 1-dimensional improper integration engine
};

#endif
 RooImproperIntegrator1D.h:1
 RooImproperIntegrator1D.h:2
 RooImproperIntegrator1D.h:3
 RooImproperIntegrator1D.h:4
 RooImproperIntegrator1D.h:5
 RooImproperIntegrator1D.h:6
 RooImproperIntegrator1D.h:7
 RooImproperIntegrator1D.h:8
 RooImproperIntegrator1D.h:9
 RooImproperIntegrator1D.h:10
 RooImproperIntegrator1D.h:11
 RooImproperIntegrator1D.h:12
 RooImproperIntegrator1D.h:13
 RooImproperIntegrator1D.h:14
 RooImproperIntegrator1D.h:15
 RooImproperIntegrator1D.h:16
 RooImproperIntegrator1D.h:17
 RooImproperIntegrator1D.h:18
 RooImproperIntegrator1D.h:19
 RooImproperIntegrator1D.h:20
 RooImproperIntegrator1D.h:21
 RooImproperIntegrator1D.h:22
 RooImproperIntegrator1D.h:23
 RooImproperIntegrator1D.h:24
 RooImproperIntegrator1D.h:25
 RooImproperIntegrator1D.h:26
 RooImproperIntegrator1D.h:27
 RooImproperIntegrator1D.h:28
 RooImproperIntegrator1D.h:29
 RooImproperIntegrator1D.h:30
 RooImproperIntegrator1D.h:31
 RooImproperIntegrator1D.h:32
 RooImproperIntegrator1D.h:33
 RooImproperIntegrator1D.h:34
 RooImproperIntegrator1D.h:35
 RooImproperIntegrator1D.h:36
 RooImproperIntegrator1D.h:37
 RooImproperIntegrator1D.h:38
 RooImproperIntegrator1D.h:39
 RooImproperIntegrator1D.h:40
 RooImproperIntegrator1D.h:41
 RooImproperIntegrator1D.h:42
 RooImproperIntegrator1D.h:43
 RooImproperIntegrator1D.h:44
 RooImproperIntegrator1D.h:45
 RooImproperIntegrator1D.h:46
 RooImproperIntegrator1D.h:47
 RooImproperIntegrator1D.h:48
 RooImproperIntegrator1D.h:49
 RooImproperIntegrator1D.h:50
 RooImproperIntegrator1D.h:51
 RooImproperIntegrator1D.h:52
 RooImproperIntegrator1D.h:53
 RooImproperIntegrator1D.h:54
 RooImproperIntegrator1D.h:55
 RooImproperIntegrator1D.h:56
 RooImproperIntegrator1D.h:57
 RooImproperIntegrator1D.h:58
 RooImproperIntegrator1D.h:59
 RooImproperIntegrator1D.h:60
 RooImproperIntegrator1D.h:61
 RooImproperIntegrator1D.h:62
 RooImproperIntegrator1D.h:63
 RooImproperIntegrator1D.h:64
 RooImproperIntegrator1D.h:65
 RooImproperIntegrator1D.h:66
 RooImproperIntegrator1D.h:67
 RooImproperIntegrator1D.h:68