ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooProduct.h,v 1.5 2007/05/11 09:11:30 verkerke Exp $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   GR, Gerhard Raven,   VU Amsterdan,     graven@nikhef.nl                 *
 *                                                                           *
 * Copyright (c) 2000-2007, 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_PRODUCT
#define ROO_PRODUCT

#include "RooAbsReal.h"
#include "RooSetProxy.h"
#include "RooCacheManager.h"
#include "RooObjCacheManager.h"

#include <vector>
#include <utility>


class RooRealVar;
class RooArgList ;


class RooProduct : public RooAbsReal {
public:

  RooProduct() ;
  RooProduct(const char *name, const char *title, const RooArgSet& _prodSet) ;

  RooProduct(const RooProduct& other, const char* name = 0);
  virtual TObject* clone(const char* newname) const { return new RooProduct(*this, newname); }
  virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ;
  virtual Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars,
                                                   const RooArgSet* normSet,
                                                   const char* rangeName=0) const ;
  virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const;


  virtual ~RooProduct() ;

  class ProdMap ;

  void printMetaArgs(ostream& os) const ;

protected:

  RooSetProxy _compRSet ;
  RooSetProxy _compCSet ;
  TIterator* _compRIter ;  //! do not persist
  TIterator* _compCIter ;  //! do not persist

  class CacheElem : public RooAbsCacheElement {
  public:
      virtual ~CacheElem();
      // Payload
      RooArgList _prodList ;
      RooArgList _ownedList ;
      virtual RooArgList containedArgs(Action) ;
  };
  mutable RooObjCacheManager _cacheMgr ; // The cache manager
                                                                                                                                                             

  Double_t calculate(const RooArgList& partIntList) const;
  Double_t evaluate() const;
  const char* makeFPName(const char *pfx,const RooArgSet& terms) const ;
  ProdMap* groupProductTerms(const RooArgSet&) const;
  Int_t getPartIntList(const RooArgSet* iset, const char *rangeName=0) const;
    



  ClassDef(RooProduct,1) // Product of RooAbsReal and/or RooAbsCategory terms
};

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