Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooAbsAnaConvPdf.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: RooAbsAnaConvPdf.h,v 1.8 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_ABS_ANA_CONV_PDF
0017 #define ROO_ABS_ANA_CONV_PDF
0018 
0019 
0020 #include "RooAbsPdf.h"
0021 #include "RooRealProxy.h"
0022 #include "RooListProxy.h"
0023 #include "RooDataSet.h"
0024 #include "RooAICRegistry.h"
0025 #include "RooObjCacheManager.h"
0026 #include "RooAbsCacheElement.h"
0027 
0028 class RooResolutionModel ;
0029 class RooRealVar ;
0030 class RooConvGenContext ;
0031 
0032 class RooAbsAnaConvPdf : public RooAbsPdf {
0033 public:
0034 
0035   // Constructors, assignment etc
0036   RooAbsAnaConvPdf() ;
0037   RooAbsAnaConvPdf(const char *name, const char *title,
0038          const RooResolutionModel& model,
0039          RooRealVar& convVar) ;
0040 
0041   RooAbsAnaConvPdf(const RooAbsAnaConvPdf& other, const char* name=nullptr);
0042   ~RooAbsAnaConvPdf() override;
0043 
0044   Int_t declareBasis(const char* expression, const RooArgList& params) ;
0045   void printMultiline(std::ostream& stream, Int_t contents, bool verbose=false, TString indent= "") const override ;
0046 
0047   // Coefficient normalization access
0048   inline double getCoefNorm(Int_t coefIdx, const RooArgSet& nset, const char* rangeName) const {
0049     // Returns normalization integral for coefficient coefIdx for observables nset in range rangeNae
0050     return getCoefNorm(coefIdx,&nset,rangeName) ;
0051   }
0052   double getCoefNorm(Int_t coefIdx, const RooArgSet* nset=nullptr, const char* rangeName=nullptr) const {
0053        return getCoefNorm(coefIdx,nset,RooNameReg::ptr(rangeName));
0054   }
0055 
0056   // Analytical integration support
0057   Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=nullptr) const override ;
0058   double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=nullptr) const override ;
0059 
0060   // Coefficient Analytical integration support
0061   virtual Int_t getCoefAnalyticalIntegral(Int_t coef, RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=nullptr) const ;
0062   virtual double coefAnalyticalIntegral(Int_t coef, Int_t code, const char* rangeName=nullptr) const ;
0063   bool forceAnalyticalInt(const RooAbsArg& dep) const override ;
0064 
0065   virtual double coefficient(Int_t basisIndex) const = 0 ;
0066   virtual RooFit::OwningPtr<RooArgSet> coefVars(Int_t coefIdx) const ;
0067 
0068   bool isDirectGenSafe(const RooAbsArg& arg) const override ;
0069 
0070   void setCacheAndTrackHints(RooArgSet&) override ;
0071 
0072   RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr,
0073                                        const RooArgSet* auxProto=nullptr, bool verbose= false) const override ;
0074   virtual bool changeModel(const RooResolutionModel& newModel) ;
0075 
0076   /// Retrieve the convolution variable.
0077   RooAbsRealLValue* convVar();
0078   /// Retrieve the convolution variable.
0079   const RooAbsRealLValue* convVar() const {
0080     return const_cast<RooAbsAnaConvPdf*>(this)->convVar();
0081   }
0082 
0083   std::unique_ptr<RooAbsArg> compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext & ctx) const override;
0084 
0085 protected:
0086   double getCoefNorm(Int_t coefIdx, const RooArgSet* nset, const TNamed* rangeName) const ;
0087 
0088   bool _isCopy ;
0089 
0090   double evaluate() const override ;
0091 
0092   void makeCoefVarList(RooArgList&) const ;
0093 
0094   friend class RooConvGenContext ;
0095 
0096   RooRealProxy _model ;   ///< Original model
0097   RooRealProxy _convVar ; ///< Convolution variable
0098 
0099   RooArgSet* parseIntegrationRequest(const RooArgSet& intSet, Int_t& coefCode, RooArgSet* analVars=nullptr) const ;
0100 
0101   RooListProxy _convSet  ;  ///<  Set of (resModel (x) basisFunc) convolution objects
0102   RooArgList _basisList ;   ///<!  List of created basis functions
0103 
0104 
0105   class CacheElem : public RooAbsCacheElement {
0106   public:
0107     RooArgList containedArgs(Action) override {
0108       RooArgList l(_coefVarList) ;
0109       l.add(_normList) ;
0110       return l ;
0111     }
0112 
0113     RooArgList _coefVarList ;
0114     RooArgList _normList ;
0115   } ;
0116   mutable RooObjCacheManager _coefNormMgr ; ///<! Coefficient normalization manager
0117 
0118   mutable RooAICRegistry _codeReg ;         ///<! Registry of analytical integration codes
0119 
0120   ClassDefOverride(RooAbsAnaConvPdf,3) // Abstract Composite Convoluted PDF
0121 };
0122 
0123 #endif