File indexing completed on 2025-01-18 10:11:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOPROFILELL
0013 #define ROOPROFILELL
0014
0015 #include "RooAbsReal.h"
0016 #include "RooMinimizer.h"
0017 #include "RooRealProxy.h"
0018 #include "RooSetProxy.h"
0019 #include <map>
0020 #include <string>
0021
0022 class RooProfileLL : public RooAbsReal {
0023 public:
0024
0025 RooProfileLL() ;
0026 RooProfileLL(const char *name, const char *title, RooAbsReal& nll, const RooArgSet& observables);
0027 RooProfileLL(const RooProfileLL& other, const char* name=nullptr) ;
0028 TObject* clone(const char* newname) const override { return new RooProfileLL(*this,newname); }
0029
0030 void setAlwaysStartFromMin(bool flag) { _startFromMin = flag ; }
0031 bool alwaysStartFromMin() const { return _startFromMin ; }
0032
0033 RooMinimizer* minimizer() { if (!_minimizer) initializeMinimizer(); return _minimizer.get() ; }
0034 RooAbsReal& nll() { return const_cast<RooAbsReal&>(_nll.arg()) ; }
0035 const RooArgSet& bestFitParams() const ;
0036 const RooArgSet& bestFitObs() const ;
0037
0038 RooFit::OwningPtr<RooAbsReal> createProfile(const RooArgSet& paramsOfInterest) override ;
0039
0040 bool redirectServersHook(const RooAbsCollection& , bool , bool , bool ) override ;
0041
0042 void clearAbsMin() { _absMinValid = false ; }
0043
0044 Int_t numEval() const { return _neval ; }
0045
0046
0047 protected:
0048
0049 void validateAbsMin() const ;
0050 void initializeMinimizer() const ;
0051
0052 RooRealProxy _nll ;
0053 RooSetProxy _obs ;
0054 RooSetProxy _par ;
0055 bool _startFromMin = true;
0056
0057 mutable std::unique_ptr<RooMinimizer> _minimizer = nullptr ;
0058
0059 mutable bool _absMinValid = false;
0060 mutable double _absMin = 0.0;
0061 mutable RooArgSet _paramAbsMin ;
0062 mutable RooArgSet _obsAbsMin ;
0063 mutable std::map<std::string,bool> _paramFixed ;
0064 mutable Int_t _neval = 0;
0065 double evaluate() const override ;
0066
0067
0068 private:
0069
0070 ClassDefOverride(RooProfileLL,0)
0071 };
0072
0073 #endif