Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooNumRunningInt.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 ROONUMRUNNINGINT
0013 #define ROONUMRUNNINGINT
0014 
0015 #include "RooAbsCachedReal.h"
0016 #include "RooRealProxy.h"
0017 #include "RooAbsReal.h"
0018 
0019 #include <string>
0020 #include <vector>
0021 
0022 class RooNumRunningInt : public RooAbsCachedReal {
0023 public:
0024   RooNumRunningInt(const char *name, const char *title, RooAbsReal& _func, RooRealVar& _x, const char* binningName="cache");
0025   RooNumRunningInt(const RooNumRunningInt& other, const char* name=nullptr) ;
0026   TObject *clone(const char *newname = nullptr) const override { return new RooNumRunningInt(*this, newname); }
0027 
0028   protected:
0029   class RICacheElem: public FuncCacheElem {
0030   public:
0031     RICacheElem(const RooNumRunningInt& ri, const RooArgSet* nset) ;
0032     RooArgList containedArgs(Action) override ;
0033     void calculate(bool cdfmode) ;
0034     void addRange(Int_t ixlo, Int_t ixhi, Int_t nbins) ;
0035     void addPoint(Int_t ix) ;
0036 
0037     RooNumRunningInt* _self ;
0038     std::vector<double> _ax ;
0039     std::vector<double> _ay ;
0040     RooArgSet _xx;
0041   } ;
0042 
0043   friend class RICacheElem ;
0044   const char* binningName() const override { return _binningName.c_str() ; }
0045   FuncCacheElem* createCache(const RooArgSet* nset) const override ;
0046   const char* inputBaseName() const override ;
0047   RooFit::OwningPtr<RooArgSet> actualObservables(const RooArgSet& nset) const override ;
0048   RooFit::OwningPtr<RooArgSet> actualParameters(const RooArgSet& nset) const override ;
0049   void fillCacheObject(FuncCacheElem& cacheFunc) const override ;
0050   double evaluate() const override ;
0051 
0052   const char* payloadUniqueSuffix() const override { return func.arg().aggregateCacheUniqueSuffix() ; }
0053 
0054   RooRealProxy func ; ///< Proxy to functions whose running integral is calculated
0055   RooRealProxy x   ; ///< Integrated observable
0056   std::string _binningName ; ///< Name of binning to be used for cache histogram
0057 
0058 private:
0059 
0060   ClassDefOverride(RooNumRunningInt,1) // Numeric calculator for running integral of a given function
0061 
0062 };
0063 
0064 #endif