ROOT
6.06/04
Reference Guide
ROOT Home Page
Main Page
Related Pages
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
roofit
roofitcore
src
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
//
19
// BEGIN_HTML
20
// Lightweight interface adaptor that binds a RooAbsPdf to TFOAM
21
// END_HTML
22
//
23
24
25
#include "
RooFit.h
"
26
#include "
Riostream.h
"
27
28
#include "
RooTFoamBinding.h
"
29
#include "
RooRealBinding.h
"
30
#include "
RooAbsReal.h
"
31
#include "
RooAbsPdf.h
"
32
#include "
RooArgSet.h
"
33
34
#include <assert.h>
35
36
37
38
using namespace
std
;
39
40
ClassImp
(
RooTFoamBinding
)
41
;
42
43
44
////////////////////////////////////////////////////////////////////////////////
45
46
RooTFoamBinding::RooTFoamBinding
(
const
RooAbsReal
& pdf,
const
RooArgSet
& observables)
47
{
48
_nset.add(observables) ;
49
_binding =
new
RooRealBinding
(pdf,observables,&_nset,
kFALSE
,0) ;
50
}
51
52
53
////////////////////////////////////////////////////////////////////////////////
54
/// Destructor
55
56
RooTFoamBinding::~RooTFoamBinding
()
57
{
58
delete
_binding ;
59
}
60
61
62
63
////////////////////////////////////////////////////////////////////////////////
64
65
Double_t
RooTFoamBinding::Density
(
Int_t
ndim,
Double_t
*xvec)
66
{
67
Double_t
x
[10] ;
68
for
(
int
i=0 ; i<ndim ; i++) {
69
x[i] = xvec[i]*(_binding->getMaxLimit(i)-_binding->getMinLimit(i)) + _binding->getMinLimit(i) ;
70
//cout << "RTFB::Density xvec[" << i << "] = " << xvec[i] << " x[i] = " << x[i] << endl ;
71
}
72
Double_t
ret = (*_binding)(
x
) ;
73
return
ret<0?0:ret ;
74
}
RooArgSet.h
RooArgSet
Definition:
RooArgSet.h:26
Int_t
int Int_t
Definition:
RtypesCore.h:41
kFALSE
const Bool_t kFALSE
Definition:
Rtypes.h:92
std
STL namespace.
x
Double_t x[n]
Definition:
legend1.C:17
RooTFoamBinding::Density
virtual Double_t Density(Int_t ndim, Double_t *)
Definition:
RooTFoamBinding.cxx:65
RooAbsPdf.h
RooTFoamBinding::~RooTFoamBinding
virtual ~RooTFoamBinding()
Destructor.
Definition:
RooTFoamBinding.cxx:56
RooTFoamBinding.h
RooTFoamBinding::RooTFoamBinding
RooTFoamBinding(const RooAbsReal &pdf, const RooArgSet &observables)
Definition:
RooTFoamBinding.cxx:46
Riostream.h
RooAbsReal.h
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:279
Double_t
double Double_t
Definition:
RtypesCore.h:55
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition:
RooAbsReal.h:53
RooRealBinding.h
RooTFoamBinding
Definition:
RooTFoamBinding.h:24
RooFit.h
RooRealBinding
Definition:
RooRealBinding.h:26