Logo ROOT  
Reference Guide
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 
22 RooConvCoefVar is an auxilary class that represents the coefficient
23 of a RooAbsAnaConvPdf implementation as a separate RooAbsReal object
24 to be able to interface these coefficient terms with the generic
25 RooRealIntegral integration mechanism
26 **/
27 
28 #include "RooFit.h"
29 
30 #include "RooAbsAnaConvPdf.h"
31 #include "RooConvCoefVar.h"
32 
33 using 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 
43 RooConvCoefVar::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 
91 Int_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 
102 Double_t RooConvCoefVar::analyticalIntegral(Int_t code, const char* rangeName) const
103 {
104  return ((RooAbsAnaConvPdf&)_convPdf.arg()).coefAnalyticalIntegral(_coefIdx,code,rangeName) ;
105 }
106 
RooConvCoefVar
RooConvCoefVar is an auxilary class that represents the coefficient of a RooAbsAnaConvPdf implementat...
Definition: RooConvCoefVar.h:28
RooFit.h
RooTemplateProxy::arg
const T & arg() const
Return reference to object held in proxy.
Definition: RooTemplateProxy.h:290
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooConvCoefVar::getValV
virtual Double_t getValV(const RooArgSet *nset=0) const
Return value of chosen coefficient.
Definition: RooConvCoefVar.cxx:71
RooConvCoefVar.h
RooConvCoefVar::analyticalIntegral
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Return analytical integral of chosen coefficient.
Definition: RooConvCoefVar.cxx:102
RooConvCoefVar::_convPdf
RooRealProxy _convPdf
Definition: RooConvCoefVar.h:50
RooAbsAnaConvPdf.h
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
RooConvCoefVar::_coefIdx
Int_t _coefIdx
Definition: RooConvCoefVar.h:51
RooConvCoefVar::_varSet
RooSetProxy _varSet
Definition: RooConvCoefVar.h:49
Double_t
double Double_t
Definition: RtypesCore.h:59
RooConvCoefVar::getAnalyticalIntegral
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Return analytical integration capabilities of chosen coefficient.
Definition: RooConvCoefVar.cxx:91
name
char name[80]
Definition: TGX11.cxx:110
RooConvCoefVar::evaluate
virtual Double_t evaluate() const
Return value of chosen coefficient.
Definition: RooConvCoefVar.cxx:81
RooAbsAnaConvPdf
RooAbsAnaConvPdf is the base class for PDFs that represent a physics model that can be analytically c...
Definition: RooAbsAnaConvPdf.h:34
RooSetProxy::add
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...
Definition: RooSetProxy.cxx:165
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:33
int
RooConvCoefVar::RooConvCoefVar
RooConvCoefVar()
Definition: RooConvCoefVar.h:31