Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooProjectedPdf.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  *                                                                           *
0004  * Copyright (c) 2000-2005, Regents of the University of California          *
0005  *                          and Stanford University. All rights reserved.    *
0006  *                                                                           *
0007  * Redistribution and use in source and binary forms,                        *
0008  * with or without modification, are permitted according to the terms        *
0009  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0010  *****************************************************************************/
0011 
0012 #ifndef ROOPROJECTEDPDF
0013 #define ROOPROJECTEDPDF
0014 
0015 #include "RooAbsPdf.h"
0016 #include "RooRealProxy.h"
0017 #include "RooAbsReal.h"
0018 #include "RooObjCacheManager.h"
0019 #include "RooSetProxy.h"
0020 
0021 class RooProjectedPdf : public RooAbsPdf {
0022 public:
0023 
0024   RooProjectedPdf() ;
0025   RooProjectedPdf(const char *name, const char *title,  RooAbsReal& _intpdf, const RooArgSet& intObs);
0026   RooProjectedPdf(const RooProjectedPdf& other, const char* name=nullptr) ;
0027   TObject* clone(const char* newname) const override { return new RooProjectedPdf(*this,newname); }
0028 
0029   // Analytical integration support
0030   Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=nullptr) const override ;
0031   double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=nullptr) const override ;
0032   bool forceAnalyticalInt(const RooAbsArg& dep) const override ;
0033 
0034   void initGenerator(Int_t /*code*/) override {} ; // optional pre-generation initialization
0035 
0036   bool selfNormalized() const override { return true ; }
0037 
0038   // Handle projection of projection explicitly
0039   RooAbsPdf* createProjection(const RooArgSet& iset) override ;
0040 
0041   void printMetaArgs(std::ostream& os) const override ;
0042 
0043   std::unique_ptr<RooAbsArg> compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext & ctx) const override;
0044 
0045   // Handle case of projecting an Extended pdf
0046   double expectedEvents(const RooArgSet* nset) const override { return static_cast<RooAbsPdf*>(intpdf.absArg())->expectedEvents(nset); }
0047   ExtendMode extendMode() const override { return static_cast<RooAbsPdf*>(intpdf.absArg())->extendMode(); }
0048   
0049 
0050 protected:
0051 
0052   RooRealProxy intpdf ; ///< p.d.f that is integrated
0053   RooSetProxy intobs ;  ///< observables that p.d.f is integrated over
0054   RooSetProxy deps ;    ///< dependents of this p.d.f
0055 
0056   class CacheElem : public RooAbsCacheElement {
0057   public:
0058     // Payload
0059     std::unique_ptr<RooAbsReal> _projection;
0060     // Cache management functions
0061     RooArgList containedArgs(Action) override ;
0062     void printCompactTreeHook(std::ostream&, const char *, Int_t, Int_t) override ;
0063   } ;
0064   mutable RooObjCacheManager _cacheMgr ; ///<! The cache manager
0065 
0066   bool redirectServersHook(const RooAbsCollection& newServerList, bool /*mustReplaceAll*/, bool /*nameChange*/, bool /*isRecursive*/) override ;
0067 
0068   const RooAbsReal* getProjection(const RooArgSet* iset, const RooArgSet* nset, const char* rangeName, int& code) const ;
0069   double evaluate() const override ;
0070 
0071 private:
0072 
0073   ClassDefOverride(RooProjectedPdf,1) // Operator p.d.f calculating projection of another p.d.f
0074 };
0075 
0076 #endif