ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooSegmentedIntegrator1D.h,v 1.7 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_SEGMENTED_INTEGRATOR_1D
#define ROO_SEGMENTED_INTEGRATOR_1D

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

class RooSegmentedIntegrator1D : public RooAbsIntegrator {
public:

  // Constructors, assignment etc
  RooSegmentedIntegrator1D() ;
  RooSegmentedIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config) ;
  RooSegmentedIntegrator1D(const RooAbsFunc& function, Double_t xmin, Double_t xmax, const RooNumIntConfig& config) ;

  virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const ;
  virtual ~RooSegmentedIntegrator1D();

  virtual Bool_t checkLimits() const;
  virtual Double_t integral(const Double_t *yvec=0) ;

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

  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 kFALSE ; }

protected:

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

  mutable Double_t _xmin ;
  mutable Double_t _xmax ;
  mutable Double_t _range ;
  Bool_t _valid ;
  Int_t _nseg ; // Number of segments 
  Bool_t _useIntegrandLimits ;

  RooNumIntConfig _config ;  
  RooIntegrator1D** _array ; // Array of segment integrators

  Bool_t initialize();

  ClassDef(RooSegmentedIntegrator1D,0) // 1-dimensional piece-wise numerical integration engine
};

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