Warning, file /include/root/RooIntegralMorph.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOLINEARMORPH
0013 #define ROOLINEARMORPH
0014
0015 #include "RooAbsCachedPdf.h"
0016 #include "RooRealProxy.h"
0017 #include "RooCategoryProxy.h"
0018 #include "RooAbsReal.h"
0019 #include "RooAbsCategory.h"
0020 #include <vector>
0021
0022 class RooBrentRootFinder;
0023
0024 class TH1D;
0025
0026 class RooIntegralMorph : public RooAbsCachedPdf {
0027 public:
0028 RooIntegralMorph() = default;
0029 RooIntegralMorph(const char *name, const char *title,
0030 RooAbsReal& _pdf1,
0031 RooAbsReal& _pdf2,
0032 RooAbsReal& _x,
0033 RooAbsReal& _alpha, bool cacheAlpha=false);
0034 RooIntegralMorph(const RooIntegralMorph& other, const char* name=nullptr) ;
0035 TObject* clone(const char* newname) const override { return new RooIntegralMorph(*this,newname); }
0036
0037 bool selfNormalized() const override {
0038
0039 return true ;
0040 }
0041 void setCacheAlpha(bool flag) {
0042
0043 _cacheMgr.sterilize() ; _cacheAlpha = flag ;
0044 }
0045 bool cacheAlpha() const {
0046
0047 return _cacheAlpha ;
0048 }
0049
0050 void preferredObservableScanOrder(const RooArgSet& obs, RooArgSet& orderedObs) const override ;
0051
0052 class MorphCacheElem : public RooAbsCachedPdf::PdfCacheElem {
0053 public:
0054 MorphCacheElem(RooIntegralMorph& self, const RooArgSet* nset) ;
0055 ~MorphCacheElem() override ;
0056 void calculate(TIterator* iter) ;
0057 RooArgList containedArgs(Action) override ;
0058
0059 protected:
0060
0061 void findRange() ;
0062 double calcX(double y, bool& ok) ;
0063 Int_t binX(double x) ;
0064 void fillGap(Int_t ixlo, Int_t ixhi,double splitPoint=0.5) ;
0065 void interpolateGap(Int_t ixlo, Int_t ixhi) ;
0066
0067 RooIntegralMorph* _self ;
0068 std::unique_ptr<RooArgSet> _nset ;
0069 RooAbsPdf* _pdf1 ;
0070 RooAbsPdf* _pdf2 ;
0071 RooRealVar* _x ;
0072 RooAbsReal* _alpha ;
0073 std::unique_ptr<RooAbsReal> _c1 ;
0074 std::unique_ptr<RooAbsReal> _c2 ;
0075 std::unique_ptr<RooAbsFunc> _cb1 ;
0076 std::unique_ptr<RooAbsFunc> _cb2 ;
0077 std::unique_ptr<RooBrentRootFinder> _rf1;
0078 std::unique_ptr<RooBrentRootFinder> _rf2;
0079
0080 std::vector<double> _yatX ;
0081 std::vector<double> _calcX;
0082 Int_t _yatXmin, _yatXmax ;
0083 Int_t _ccounter ;
0084
0085 double _ycutoff ;
0086
0087 } ;
0088
0089 protected:
0090
0091 friend class MorphCacheElem ;
0092 PdfCacheElem* createCache(const RooArgSet* nset) const override ;
0093 const char* inputBaseName() const override ;
0094 RooFit::OwningPtr<RooArgSet> actualObservables(const RooArgSet& nset) const override ;
0095 RooFit::OwningPtr<RooArgSet> actualParameters(const RooArgSet& nset) const override ;
0096 void fillCacheObject(PdfCacheElem& cache) const override ;
0097
0098 RooRealProxy pdf1 ;
0099 RooRealProxy pdf2 ;
0100 RooRealProxy x ;
0101 RooRealProxy alpha ;
0102 bool _cacheAlpha ;
0103 mutable MorphCacheElem* _cache = nullptr;
0104
0105
0106 double evaluate() const override ;
0107
0108 private:
0109
0110 ClassDefOverride(RooIntegralMorph,1)
0111 };
0112
0113 #endif