CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/HiggsAnalysis/CombinedLimit/interface/CascadeMinimizer.h

Go to the documentation of this file.
00001 #ifndef HiggsAnalysis_CombinedLimit_CascadeMinimizer_h
00002 #define HiggsAnalysis_CombinedLimit_CascadeMinimizer_h
00003 
00004 class RooAbsReal;
00005 class RooArgSet;
00006 class RooRealVar;
00007 #include <RooArgSet.h>
00008 #include "../interface/RooMinimizerOpt.h"
00009 #include <boost/program_options.hpp>
00010 
00011 class CascadeMinimizer {
00012     public:
00013         enum Mode { Constrained, Unconstrained };
00014         CascadeMinimizer(RooAbsReal &nll, Mode mode, RooRealVar *poi=0, int initialStrategy=0) ;
00015         // do a new minimization, assuming the initial state is random
00016         bool minimize(int verbose=0, bool cascade=true);
00017         // do a new minimization, assuming a plausible initial state
00018         bool improve(int verbose=0, bool cascade=true);
00019         RooMinimizerOpt & minimizer() { return minimizer_; }
00020         RooFitResult *save() { return minimizer().save(); }
00021         void  setStrategy(int strategy) { strategy_ = strategy; }
00022         void  setErrorLevel(float errorLevel) { minimizer_.setErrorLevel(errorLevel); }
00023         static void  initOptions() ;
00024         static void  applyOptions(const boost::program_options::variables_map &vm) ;
00025         static const boost::program_options::options_description & options() { return options_; }
00026         void trivialMinimize(const RooAbsReal &nll, RooRealVar &r, int points=100) const ;
00027     private:
00028         RooAbsReal & nll_;
00029         RooMinimizerOpt minimizer_;
00030         Mode         mode_;
00031         int          strategy_;
00032         RooRealVar * poi_; 
00033 
00034         bool improveOnce(int verbose);
00035         
00037         static boost::program_options::options_description options_;
00039         struct Algo { 
00040             Algo() : algo(), tolerance(), strategy(-1) {}
00041             Algo(const std::string &str, float tol=-1.f, int strategy=-1) : algo(str), tolerance(tol), strategy(-1) {}
00042             std::string algo; float tolerance; int strategy;
00043             static float default_tolerance() { return -1.f; }
00044             static int   default_strategy() { return -1; }
00045         };
00047         static std::vector<Algo> fallbacks_;
00049         static bool preScan_;
00051         static bool poiOnlyFit_;
00053         static bool singleNuisFit_;
00055         static bool setZeroPoint_;
00057         static bool oldFallback_;
00058 
00059         //static void setDefaultIntegrator(RooCategory &cat, const std::string & val) ;
00060 };
00061 
00062 #endif