Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooTFoamBinding.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooTFoamBinding.cxx
19\class RooTFoamBinding
20\ingroup Roofitcore
21
22Lightweight interface adaptor that binds a RooAbsPdf to TFOAM
23**/
24
25
26#include "RooFit.h"
27#include "Riostream.h"
28
29#include "RooTFoamBinding.h"
30#include "RooRealBinding.h"
31#include "RooAbsReal.h"
32#include "RooAbsPdf.h"
33#include "RooArgSet.h"
34
35#include <assert.h>
36
37
38
39using namespace std;
40
42;
43
44
45////////////////////////////////////////////////////////////////////////////////
46
48{
49 _nset.add(observables) ;
50 _binding = new RooRealBinding(pdf,observables,&_nset,kFALSE,0) ;
51}
52
53
54////////////////////////////////////////////////////////////////////////////////
55/// Destructor
56
58{
59 delete _binding ;
60}
61
62
63
64////////////////////////////////////////////////////////////////////////////////
65
67{
68 Double_t x[10] ;
69 for (int i=0 ; i<ndim ; i++) {
70 x[i] = xvec[i]*(_binding->getMaxLimit(i)-_binding->getMinLimit(i)) + _binding->getMinLimit(i) ;
71 //cout << "RTFB::Density xvec[" << i << "] = " << xvec[i] << " x[i] = " << x[i] << endl ;
72 }
73 Double_t ret = (*_binding)(x) ;
74 return ret<0?0:ret ;
75}
const Bool_t kFALSE
Definition RtypesCore.h:92
#define ClassImp(name)
Definition Rtypes.h:364
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:61
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:29
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
Lightweight interface adaptor that binds a RooAbsReal object to a subset of its servers and present i...
virtual Double_t getMinLimit(UInt_t dimension) const
Return lower limit on i-th variable.
virtual Double_t getMaxLimit(UInt_t dimension) const
Return upper limit on i-th variable.
Lightweight interface adaptor that binds a RooAbsPdf to TFOAM.
RooRealBinding * _binding
virtual Double_t Density(Int_t ndim, Double_t *)
virtual ~RooTFoamBinding()
Destructor.
RooTFoamBinding(const RooAbsReal &pdf, const RooArgSet &observables)
Double_t x[n]
Definition legend1.C:17