Logo ROOT   6.14/05
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 "RooAbsAnaConvPdf.h"
32 #include "RooConvCoefVar.h"
33 
34 using namespace std;
35 
37 ;
38 
39 
40 ////////////////////////////////////////////////////////////////////////////////
41 /// Constuctor given a RooAbsAnaConvPdf a coefficient index and a set with the
42 /// convoluted observable(s)
43 
44 RooConvCoefVar::RooConvCoefVar(const char *name, const char *title, const RooAbsAnaConvPdf& input,
45  Int_t coefIdx, const RooArgSet* varList) :
46  RooAbsReal(name,title),
47  _varSet("varSet","Set of coefficient variables",this),
48  _convPdf("convPdf","Convoluted PDF",this,(RooAbsReal&)input,kFALSE,kFALSE),
49  _coefIdx(coefIdx)
50 {
51  if (varList) _varSet.add(*varList) ;
52 }
53 
54 
55 
56 ////////////////////////////////////////////////////////////////////////////////
57 /// Copy constructor
58 
60  RooAbsReal(other,name),
61  _varSet("varSet",this,other._varSet),
62  _convPdf("convPdf",this,other._convPdf),
63  _coefIdx(other._coefIdx)
64 {
65 }
66 
67 
68 
69 ////////////////////////////////////////////////////////////////////////////////
70 /// Return value of chosen coefficient
71 
73 {
74  return evaluate() ;
75 }
76 
77 
78 
79 ////////////////////////////////////////////////////////////////////////////////
80 /// Return value of chosen coefficient
81 
83 {
84  return ((RooAbsAnaConvPdf&)_convPdf.arg()).coefficient(_coefIdx) ;
85 }
86 
87 
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 /// Return analytical integration capabilities of chosen coefficient
91 
92 Int_t RooConvCoefVar::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName) const
93 {
94  Int_t code = ((RooAbsAnaConvPdf&)_convPdf.arg()).getCoefAnalyticalIntegral(_coefIdx,allVars,analVars,rangeName) ;
95  return code ;
96 }
97 
98 
99 
100 ////////////////////////////////////////////////////////////////////////////////
101 /// Return analytical integral of chosen coefficient
102 
103 Double_t RooConvCoefVar::analyticalIntegral(Int_t code, const char* rangeName) const
104 {
105  return ((RooAbsAnaConvPdf&)_convPdf.arg()).coefAnalyticalIntegral(_coefIdx,code,rangeName) ;
106 }
107 
int Int_t
Definition: RtypesCore.h:41
STL namespace.
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Return analytical integral of chosen coefficient.
RooSetProxy _varSet
virtual Double_t getValV(const RooArgSet *nset=0) const
Return value of chosen coefficient.
RooRealProxy _convPdf
RooConvCoefVar is an auxilary class that represents the coefficient of a RooAbsAnaConvPdf implementat...
virtual Double_t evaluate() const
Return value of chosen coefficient.
const Bool_t kFALSE
Definition: RtypesCore.h:88
#define ClassImp(name)
Definition: Rtypes.h:359
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Return analytical integration capabilities of chosen coefficient.
const RooAbsReal & arg() const
Definition: RooRealProxy.h:43
char name[80]
Definition: TGX11.cxx:109
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...