Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooExtendPdf.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooExtendPdf.h,v 1.12 2007/07/16 21:04:28 wouter Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_EXTEND_PDF
0017 #define ROO_EXTEND_PDF
0018 
0019 #include "RooAbsPdf.h"
0020 #include "RooRealProxy.h"
0021 
0022 class RooExtendPdf : public RooAbsPdf {
0023 public:
0024 
0025   RooExtendPdf() = default;
0026   // Original constructor without RooAbsReal::Ref for backwards compatibility.
0027   RooExtendPdf(const char *name, const char *title, RooAbsPdf& pdf,
0028                       RooAbsReal& norm, const char* rangeName=nullptr);
0029   RooExtendPdf(const char *name, const char *title, RooAbsPdf& pdf,
0030           RooAbsReal::Ref norm, const char* rangeName=nullptr) ;
0031   RooExtendPdf(const RooExtendPdf& other, const char* name=nullptr) ;
0032   TObject* clone(const char* newname) const override { return new RooExtendPdf(*this,newname) ; }
0033 
0034   double evaluate() const override { return _pdf ; }
0035 
0036   bool forceAnalyticalInt(const RooAbsArg& /*dep*/) const override { return true ; }
0037   /// Forward determination of analytical integration capabilities to input p.d.f
0038   Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=nullptr) const override {
0039     return _pdf->getAnalyticalIntegralWN(allVars, analVars, normSet, rangeName) ;
0040   }
0041   /// Forward calculation of analytical integrals to input p.d.f
0042   double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=nullptr) const override {
0043     return _pdf->analyticalIntegralWN(code, normSet, rangeName) ;
0044   }
0045 
0046   bool selfNormalized() const override { return true ; }
0047   ExtendMode extendMode() const override { return CanBeExtended ; }
0048   double expectedEvents(const RooArgSet* nset) const override ;
0049   std::unique_ptr<RooAbsReal> createExpectedEventsFunc(const RooArgSet* nset) const override;
0050 
0051   void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0052 
0053 protected:
0054 
0055   RooTemplateProxy<RooAbsPdf>  _pdf;  ///< Input p.d.f
0056   RooTemplateProxy<RooAbsReal> _n;    ///< Number of expected events
0057   const TNamed* _rangeName = nullptr; ///< Name of subset range
0058 
0059 
0060   ClassDefOverride(RooExtendPdf,2) // Wrapper p.d.f adding an extended likelihood term to an existing p.d.f
0061 };
0062 
0063 #endif