RooProfileLL.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  *                                                                           *
00004  * Copyright (c) 2000-2005, Regents of the University of California          *
00005  *                          and Stanford University. All rights reserved.    *
00006  *                                                                           *
00007  * Redistribution and use in source and binary forms,                        *
00008  * with or without modification, are permitted according to the terms        *
00009  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00010  *****************************************************************************/
00011 
00012 #ifndef ROOPROFILELL
00013 #define ROOPROFILELL
00014 
00015 #include "RooAbsReal.h"
00016 #include "RooRealProxy.h"
00017 #include "RooSetProxy.h"
00018 #include <map>
00019 #include <string>
00020 
00021 class RooMinuit ;
00022  
00023 class RooProfileLL : public RooAbsReal {
00024 public:
00025 
00026   RooProfileLL() ;
00027   RooProfileLL(const char *name, const char *title, RooAbsReal& nll, const RooArgSet& observables);
00028   RooProfileLL(const RooProfileLL& other, const char* name=0) ;
00029   virtual TObject* clone(const char* newname) const { return new RooProfileLL(*this,newname); }
00030   virtual ~RooProfileLL() ;
00031 
00032   void setAlwaysStartFromMin(Bool_t flag) { _startFromMin = flag ; }
00033   Bool_t alwaysStartFromMin() const { return _startFromMin ; }
00034 
00035   RooMinuit* minuit() { return _minuit ; }
00036   RooAbsReal& nll() { return const_cast<RooAbsReal&>(_nll.arg()) ; }
00037   const RooArgSet& bestFitParams() const ;
00038   const RooArgSet& bestFitObs() const ;
00039 
00040   virtual RooAbsReal* createProfile(const RooArgSet& paramsOfInterest) ;
00041   
00042   virtual Bool_t redirectServersHook(const RooAbsCollection& /*newServerList*/, Bool_t /*mustReplaceAll*/, Bool_t /*nameChange*/, Bool_t /*isRecursive*/) ;
00043 
00044   void clearAbsMin() { _absMinValid = kFALSE ; }
00045 
00046 
00047 protected:
00048 
00049   void validateAbsMin() const ;
00050 
00051   RooRealProxy _nll ;    // Input -log(L) function
00052   RooSetProxy _obs ;     // Parameters of profile likelihood
00053   RooSetProxy _par ;     // Marginialized parameters of likelihood
00054   Bool_t _startFromMin ; // Always start minimization for global minimum?
00055 
00056   TIterator* _piter ; //! Iterator over profile likelihood parameters to be minimized 
00057   TIterator* _oiter ; //! Iterator of profile likelihood output parameter(s)
00058 
00059   mutable RooMinuit* _minuit ; //! Internal minuit instance
00060 
00061   mutable Bool_t _absMinValid ; // flag if absmin is up-to-date
00062   mutable Double_t _absMin ; // absolute minimum of -log(L)
00063   mutable RooArgSet _paramAbsMin ; // Parameter values at absolute minimum
00064   mutable RooArgSet _obsAbsMin ; // Observable values at absolute minimum
00065   mutable std::map<std::string,bool> _paramFixed ; // Parameter constant status at last time of use
00066   
00067   Double_t evaluate() const ;
00068 
00069 
00070 private:
00071 
00072   ClassDef(RooProfileLL,0) // Real-valued function representing profile likelihood of external (likelihood) function
00073 };
00074  
00075 #endif

Generated on Tue Jul 5 14:26:18 2011 for ROOT_528-00b_version by  doxygen 1.5.1