Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooConvCoefVar.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 RooConvCoefVar.cxx
19\class RooConvCoefVar
20\ingroup Roofitcore
21
22RooConvCoefVar is an auxilary class that represents the coefficient
23of a RooAbsAnaConvPdf implementation as a separate RooAbsReal object
24to be able to interface these coefficient terms with the generic
25RooRealIntegral integration mechanism
26**/
27
28#include "RooFit.h"
29
30#include "RooAbsAnaConvPdf.h"
31#include "RooConvCoefVar.h"
32
33using namespace std;
34
36;
37
38
39////////////////////////////////////////////////////////////////////////////////
40/// Constuctor given a RooAbsAnaConvPdf a coefficient index and a set with the
41/// convoluted observable(s)
42
43RooConvCoefVar::RooConvCoefVar(const char *name, const char *title, const RooAbsAnaConvPdf& input,
44 Int_t coefIdx, const RooArgSet* varList) :
45 RooAbsReal(name,title),
46 _varSet("varSet","Set of coefficient variables",this),
47 _convPdf("convPdf","Convoluted PDF",this,(RooAbsReal&)input,kFALSE,kFALSE),
48 _coefIdx(coefIdx)
49{
50 if (varList) _varSet.add(*varList) ;
51}
52
53
54
55////////////////////////////////////////////////////////////////////////////////
56/// Copy constructor
57
59 RooAbsReal(other,name),
60 _varSet("varSet",this,other._varSet),
61 _convPdf("convPdf",this,other._convPdf),
62 _coefIdx(other._coefIdx)
63{
64}
65
66
67
68////////////////////////////////////////////////////////////////////////////////
69/// Return value of chosen coefficient
70
72{
73 return evaluate() ;
74}
75
76
77
78////////////////////////////////////////////////////////////////////////////////
79/// Return value of chosen coefficient
80
82{
83 return ((RooAbsAnaConvPdf&)_convPdf.arg()).coefficient(_coefIdx) ;
84}
85
86
87
88////////////////////////////////////////////////////////////////////////////////
89/// Return analytical integration capabilities of chosen coefficient
90
91Int_t RooConvCoefVar::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName) const
92{
93 Int_t code = ((RooAbsAnaConvPdf&)_convPdf.arg()).getCoefAnalyticalIntegral(_coefIdx,allVars,analVars,rangeName) ;
94 return code ;
95}
96
97
98
99////////////////////////////////////////////////////////////////////////////////
100/// Return analytical integral of chosen coefficient
101
102Double_t RooConvCoefVar::analyticalIntegral(Int_t code, const char* rangeName) const
103{
104 return ((RooAbsAnaConvPdf&)_convPdf.arg()).coefAnalyticalIntegral(_coefIdx,code,rangeName) ;
105}
106
const Bool_t kFALSE
Definition RtypesCore.h:101
#define ClassImp(name)
Definition Rtypes.h:364
char name[80]
Definition TGX11.cxx:110
RooAbsAnaConvPdf is the base class for PDFs that represent a physics model that can be analytically c...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:64
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:35
RooConvCoefVar is an auxilary class that represents the coefficient of a RooAbsAnaConvPdf implementat...
virtual Double_t evaluate() const
Return value of chosen coefficient.
virtual Double_t getValV(const RooArgSet *nset=0) const
Return value of chosen coefficient.
RooRealProxy _convPdf
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Return analytical integral of chosen coefficient.
RooSetProxy _varSet
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Return analytical integration capabilities of chosen coefficient.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...
const T & arg() const
Return reference to object held in proxy.