CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MarkovChainMC.h
Go to the documentation of this file.
1 #ifndef HiggsAnalysis_CombinedLimit_MarkovChainMC_h
2 #define HiggsAnalysis_CombinedLimit_MarkovChainMC_h
3 
11 #include "../interface/LimitAlgo.h"
12 #include <TList.h>
13 class RooArgSet;
14 namespace RooStats { class MarkovChain; }
15 
16 class MarkovChainMC : public LimitAlgo {
17 public:
18  MarkovChainMC() ;
19  virtual void applyOptions(const boost::program_options::variables_map &vm) ;
20  bool run(RooWorkspace *w, RooStats::ModelConfig *mc_s, RooStats::ModelConfig *mc_b, RooAbsData &data, double &limit, double &limitErr, const double *hint);
21  virtual const std::string & name() const {
22  static const std::string name("MarkovChainMC");
23  return name;
24  }
25 private:
27  static std::string proposalTypeName_;
31  static unsigned int iterations_;
33  static unsigned int burnInSteps_;
35  static float burnInFraction_;
37  static bool adaptiveBurnIn_;
39  static unsigned int tries_;
41  static float truncatedMeanFraction_;
43  static bool adaptiveTruncation_;
45  static float hintSafetyFactor_;
47  static bool saveChain_;
49  static bool noSlimChain_;
51  static bool mergeChains_;
53  static bool readChains_;
55  float mass_;
57  int modelNDF_;
58 
59  static unsigned int numberOfBins_;
60  static unsigned int proposalHelperCacheSize_;
61  static bool alwaysStepPoi_;
63  static float cropNSigmas_;
64  static int debugProposal_;
65 
66  mutable TList chains_;
67 
68  // return number of items in chain, 0 for error
69  int runOnce(RooWorkspace *w, RooStats::ModelConfig *mc_s, RooStats::ModelConfig *mc_b, RooAbsData &data, double &limit, double &limitErr, const double *hint) const ;
70 
71  RooStats::MarkovChain *mergeChains(const RooArgSet &poi, const std::vector<double> &limits) const;
72  void readChains(const RooArgSet &poi, std::vector<double> &limits);
73  void limitFromChain(double &limit, double &limitErr, const RooArgSet &poi, RooStats::MarkovChain &chain, int burnInSteps=-1 /* -1 = use default */) ;
74  void limitAndError(double &limit, double &limitErr, const std::vector<double> &limits) const ;
75  RooStats::MarkovChain *slimChain(const RooArgSet &poi, const RooStats::MarkovChain &chain) const;
76  int guessBurnInSteps(const RooStats::MarkovChain &chain) const;
77 
79  int stationarityTest(const RooStats::MarkovChain &chain, const RooArgSet &poi, int nchunks) const ;
80 };
81 
82 #endif
static bool updateProposalParams_
Definition: MarkovChainMC.h:29
static float cropNSigmas_
Definition: MarkovChainMC.h:63
static ProposalType proposalType_
Definition: MarkovChainMC.h:28
void limitFromChain(double &limit, double &limitErr, const RooArgSet &poi, RooStats::MarkovChain &chain, int burnInSteps=-1)
static float proposalHelperWidthRangeDivisor_
Definition: MarkovChainMC.h:62
static bool adaptiveTruncation_
do adaptive truncated mean
Definition: MarkovChainMC.h:43
static float proposalHelperUniformFraction_
Definition: MarkovChainMC.h:62
static float hintSafetyFactor_
Safety factor for hint (integrate up to this number of times the hinted limit)
Definition: MarkovChainMC.h:45
static bool readChains_
Read chains from file instead of running them.
Definition: MarkovChainMC.h:53
static float truncatedMeanFraction_
Ignore up to this fraction of results if they&#39;re too far from the median.
Definition: MarkovChainMC.h:41
static unsigned int iterations_
Propose this number of points for the chain.
Definition: MarkovChainMC.h:31
static bool alwaysStepPoi_
Definition: MarkovChainMC.h:61
RooStats::MarkovChain * mergeChains(const RooArgSet &poi, const std::vector< double > &limits) const
float mass_
Mass of the Higgs boson (goes into the name of the saved chains)
Definition: MarkovChainMC.h:55
static bool runMinos_
Definition: MarkovChainMC.h:29
static float burnInFraction_
Discard these fraction of points.
Definition: MarkovChainMC.h:35
virtual const std::string & name() const
Definition: MarkovChainMC.h:21
static std::string proposalTypeName_
Definition: MarkovChainMC.h:27
static bool adaptiveBurnIn_
Adaptive burn-in (experimental!)
Definition: MarkovChainMC.h:37
static bool saveChain_
Save Markov Chain in output file.
Definition: MarkovChainMC.h:47
static int debugProposal_
Definition: MarkovChainMC.h:64
bool run(RooWorkspace *w, RooStats::ModelConfig *mc_s, RooStats::ModelConfig *mc_b, RooAbsData &data, double &limit, double &limitErr, const double *hint)
static bool updateHint_
Definition: MarkovChainMC.h:29
int stationarityTest(const RooStats::MarkovChain &chain, const RooArgSet &poi, int nchunks) const
note: this is still being developed
static bool noReset_
Definition: MarkovChainMC.h:29
void limitAndError(double &limit, double &limitErr, const std::vector< double > &limits) const
int runOnce(RooWorkspace *w, RooStats::ModelConfig *mc_s, RooStats::ModelConfig *mc_b, RooAbsData &data, double &limit, double &limitErr, const double *hint) const
static bool noSlimChain_
Leave all parameters in the markov chain, not just the POI.
Definition: MarkovChainMC.h:49
RooStats::MarkovChain * slimChain(const RooArgSet &poi, const RooStats::MarkovChain &chain) const
static unsigned int burnInSteps_
Discard these points.
Definition: MarkovChainMC.h:33
virtual void applyOptions(const boost::program_options::variables_map &vm)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int modelNDF_
Number of degrees of freedom of the problem, approximately.
Definition: MarkovChainMC.h:57
static unsigned int tries_
compute the limit N times
Definition: MarkovChainMC.h:39
static unsigned int numberOfBins_
Definition: MarkovChainMC.h:59
int guessBurnInSteps(const RooStats::MarkovChain &chain) const
static bool mergeChains_
Merge chains instead of averaging limits.
Definition: MarkovChainMC.h:51
T w() const
void readChains(const RooArgSet &poi, std::vector< double > &limits)
static unsigned int proposalHelperCacheSize_
Definition: MarkovChainMC.h:60