RooConvCoefVar.cxx

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  * @(#)root/roofitcore:$Id: RooConvCoefVar.cxx 24269 2008-06-13 15:37:03Z wouter $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 
00017 //////////////////////////////////////////////////////////////////////////////
00018 // 
00019 // BEGIN_HTML
00020 // RooConvCoefVar is an auxilary class that represents the coefficient
00021 // of a RooAbsAnaConvPdf implementation as a separate RooAbsReal object
00022 // to be able to interface these coefficient terms with the generic
00023 // RooRealIntegral integration mechanism
00024 // END_HTML
00025 //
00026 //
00027 
00028 #include "RooFit.h"
00029 
00030 #include "RooAbsAnaConvPdf.h"
00031 #include "RooAbsAnaConvPdf.h"
00032 #include "RooConvCoefVar.h"
00033 
00034 ClassImp(RooConvCoefVar)
00035 ;
00036 
00037 
00038 //_____________________________________________________________________________
00039 RooConvCoefVar::RooConvCoefVar(const char *name, const char *title, const RooAbsAnaConvPdf& input, 
00040                                Int_t coefIdx, const RooArgSet* varList) :
00041   RooAbsReal(name,title),
00042   _varSet("varSet","Set of coefficient variables",this),
00043   _convPdf("convPdf","Convoluted PDF",this,(RooAbsReal&)input,kFALSE,kFALSE),
00044   _coefIdx(coefIdx)
00045 {
00046   // Constuctor given a RooAbsAnaConvPdf a coefficient index and a set with the
00047   // convoluted observable(s)
00048   if (varList) _varSet.add(*varList) ;
00049 }
00050 
00051 
00052 
00053 //_____________________________________________________________________________
00054 RooConvCoefVar::RooConvCoefVar(const RooConvCoefVar& other, const char* name) :
00055   RooAbsReal(other,name),
00056   _varSet("varSet",this,other._varSet),
00057   _convPdf("convPdf",this,other._convPdf),
00058   _coefIdx(other._coefIdx)
00059 {
00060   // Copy constructor
00061 }
00062 
00063 
00064 
00065 //_____________________________________________________________________________
00066 Double_t RooConvCoefVar::getVal(const RooArgSet*) const 
00067 { 
00068   // Return value of chosen coefficient
00069   return evaluate() ; 
00070 }
00071 
00072 
00073 
00074 //_____________________________________________________________________________
00075 Double_t RooConvCoefVar::evaluate() const 
00076 {
00077   // Return value of chosen coefficient
00078   return ((RooAbsAnaConvPdf&)_convPdf.arg()).coefficient(_coefIdx) ;
00079 }
00080 
00081 
00082 
00083 //_____________________________________________________________________________
00084 Int_t RooConvCoefVar::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName) const 
00085 {
00086   // Return analytical integration capabilities of chosen coefficient
00087 
00088   Int_t code = ((RooAbsAnaConvPdf&)_convPdf.arg()).getCoefAnalyticalIntegral(_coefIdx,allVars,analVars,rangeName) ;
00089   return code ;
00090 }
00091 
00092 
00093 
00094 //_____________________________________________________________________________
00095 Double_t RooConvCoefVar::analyticalIntegral(Int_t code, const char* rangeName) const 
00096 {
00097   // Return analytical integral of chosen coefficient
00098 
00099   return ((RooAbsAnaConvPdf&)_convPdf.arg()).coefAnalyticalIntegral(_coefIdx,code,rangeName) ;
00100 }
00101 

Generated on Tue Jul 5 15:06:20 2011 for ROOT_528-00b_version by  doxygen 1.5.1