Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:56:44

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) const override { return new RooNumRunningInt(*this,newname); }
0027   ~RooNumRunningInt() override ;
0028 
0029 protected:
0030 
0031   class RICacheElem: public FuncCacheElem {
0032   public:
0033     RICacheElem(const RooNumRunningInt& ri, const RooArgSet* nset) ;
0034     RooArgList containedArgs(Action) override ;
0035     void calculate(bool cdfmode) ;
0036     void addRange(Int_t ixlo, Int_t ixhi, Int_t nbins) ;
0037     void addPoint(Int_t ix) ;
0038 
0039     RooNumRunningInt* _self ;
0040     std::vector<double> _ax ;
0041     std::vector<double> _ay ;
0042     RooRealVar* _xx ;
0043 
0044   } ;
0045 
0046   friend class RICacheElem ;
0047   const char* binningName() const override { return _binningName.c_str() ; }
0048   FuncCacheElem* createCache(const RooArgSet* nset) const override ;
0049   const char* inputBaseName() const override ;
0050   RooFit::OwningPtr<RooArgSet> actualObservables(const RooArgSet& nset) const override ;
0051   RooFit::OwningPtr<RooArgSet> actualParameters(const RooArgSet& nset) const override ;
0052   void fillCacheObject(FuncCacheElem& cacheFunc) const override ;
0053   double evaluate() const override ;
0054 
0055   const char* payloadUniqueSuffix() const override { return func.arg().aggregateCacheUniqueSuffix() ; }
0056 
0057   RooRealProxy func ; ///< Proxy to functions whose running integral is calculated
0058   RooRealProxy x   ; ///< Integrated observable
0059   std::string _binningName ; ///< Name of binning to be used for cache histogram
0060 
0061 private:
0062 
0063   ClassDefOverride(RooNumRunningInt,1) // Numeric calculator for running integral of a given function
0064 
0065 };
0066 
0067 #endif