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
22Auxiliary 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 "RooAbsAnaConvPdf.h"
29#include "RooConvCoefVar.h"
30
31using namespace std;
32
34
35
36////////////////////////////////////////////////////////////////////////////////
37/// Constructor given a RooAbsAnaConvPdf a coefficient index and a set with the
38/// convoluted observable(s).
39
40RooConvCoefVar::RooConvCoefVar(const char *name, const char *title, const RooAbsAnaConvPdf& input,
41 Int_t coefIdx, const RooArgSet* varList) :
42 RooAbsReal(name,title),
43 _varSet("varSet","Set of coefficient variables",this),
44 _convPdf("convPdf","Convoluted PDF",this,(RooAbsReal&)input,false,false),
45 _coefIdx(coefIdx)
46{
47 if (varList) _varSet.add(*varList) ;
48}
49
50
51
52////////////////////////////////////////////////////////////////////////////////
53/// Copy constructor
54
56 RooAbsReal(other,name),
57 _varSet("varSet",this,other._varSet),
58 _convPdf("convPdf",this,other._convPdf),
59 _coefIdx(other._coefIdx)
60{
61}
62
63
64
65////////////////////////////////////////////////////////////////////////////////
66/// Return value of chosen coefficient
67
69{
70 return evaluate() ;
71}
72
73
74
75////////////////////////////////////////////////////////////////////////////////
76/// Return value of chosen coefficient
77
79{
80 return (const_cast<RooAbsAnaConvPdf &>(static_cast<RooAbsAnaConvPdf const&>(_convPdf.arg()))).coefficient(_coefIdx) ;
81}
82
83
84
85////////////////////////////////////////////////////////////////////////////////
86/// Return analytical integration capabilities of chosen coefficient
87
88Int_t RooConvCoefVar::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName) const
89{
90 Int_t code = (static_cast<RooAbsAnaConvPdf const&>(_convPdf.arg())).getCoefAnalyticalIntegral(_coefIdx,allVars,analVars,rangeName) ;
91 return code ;
92}
93
94
95
96////////////////////////////////////////////////////////////////////////////////
97/// Return analytical integral of chosen coefficient
98
99double RooConvCoefVar::analyticalIntegral(Int_t code, const char* rangeName) const
100{
101 return (static_cast<RooAbsAnaConvPdf const&>(_convPdf.arg())).coefAnalyticalIntegral(_coefIdx,code,rangeName) ;
102}
#define ClassImp(name)
Definition Rtypes.h:377
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
char name[80]
Definition TGX11.cxx:110
Base class for PDFs that represent a physics model that can be analytically convolved with a resoluti...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
Auxiliary class that represents the coefficient of a RooAbsAnaConvPdf implementation as a separate Ro...
double getValV(const RooArgSet *nset=nullptr) const override
Return value of chosen coefficient.
RooRealProxy _convPdf
RooAbsAnaConv object implementing our coefficient.
RooConvCoefVar()
Default constructor.
Int_t _coefIdx
Index code of the coefficient.
RooSetProxy _varSet
Not used anymore?
double evaluate() const override
Return value of chosen coefficient.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Return analytical integral of chosen coefficient.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Return analytical integration capabilities of chosen coefficient.
const T & arg() const
Return reference to object held in proxy.