Logo ROOT  
Reference Guide
RooRealAnalytic.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 RooRealAnalytic.cxx
19\class RooRealAnalytic
20\ingroup Roofitcore
21
22Lightweight RooAbsFunc interface adaptor that binds an analytic integral of a
23RooAbsReal object (specified by a code) to a set of dependent variables.
24**/
25
26#include "RooRealAnalytic.h"
27#include "RooAbsReal.h"
28#include "RooAbsRealLValue.h"
29
30#include <assert.h>
31
32using namespace std;
33
35;
36
37
38////////////////////////////////////////////////////////////////////////////////
39/// Evaluate our analytic integral at the specified values of the dependents.
40
42{
43 assert(isValid());
44 loadValues(xvector);
45 _ncall++ ;
47}
48
49
50////////////////////////////////////////////////////////////////////////////////
51/// Evaluate the analytic integral of the function at the specified values of the dependents.
53 assert(isValid());
54 _ncall += coordinates.front().size();
55
56 if (!_batchBuffer)
57 _batchBuffer.reset(new std::vector<double>());
58 _batchBuffer->resize(coordinates.front().size());
60
61 for (std::size_t i=0; i < coordinates.front().size(); ++i) {
62 for (unsigned int dim=0; dim < coordinates.size(); ++dim) {
63 _vars[dim]->setVal(coordinates[dim][i]);
64 }
65
66 if (_code == 0) {
67 results[i] = _func->getVal(_nset);
68 } else {
70 }
71 }
72
73 return results;
74}
75
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassImp(name)
Definition: Rtypes.h:375
Bool_t isValid() const
Definition: RooAbsFunc.h:37
Int_t _ncall
Function call counter.
Definition: RooAbsFunc.h:78
virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Definition: RooAbsReal.cxx:420
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition: RooAbsReal.h:93
Lightweight RooAbsFunc interface adaptor that binds an analytic integral of a RooAbsReal object (spec...
RooSpan< const double > getValues(std::vector< RooSpan< const double > > coordinates) const override
Evaluate the analytic integral of the function at the specified values of the dependents.
std::unique_ptr< std::vector< double > > _batchBuffer
! Buffer for handing out spans.
Double_t operator()(const Double_t xvector[]) const override
Evaluate our analytic integral at the specified values of the dependents.
void loadValues(const Double_t xvector[]) const
Load the vector of variable values into the RooRealVars associated as variables with the bound RooAbs...
std::vector< RooAbsRealLValue * > _vars
Non-owned pointers to variables.
const RooArgSet * _nset
const RooAbsReal * _func
const TNamed * _rangeName
!
A simple container to hold a batch of data values.
Definition: RooSpan.h:34
const char * GetName() const override
Returns name of object.
Definition: TNamed.h:47