//this file looks like plain C, but it's actually -*- c++ -*-
#ifndef HYPOTHESIS_TEST
#define HYPOTHESIS_TEST

#include "TSStatisticsCalculator.h"

class TSHypothesisTest : public TSStatisticsCalculator {
public:
  
  class Hypothesis { // nested
  protected:
    std::string fName;
    std::map<std::string,double> fParameters;
  public:
    Hypothesis(const char* hname);
    Hypothesis(const char* hname, const char* pname, double val);
    Hypothesis(TQFolder* h);
    const char* getParameterNameString();    
    void addParameter(const char* pname, double val);    
    const char* name() const;
    void addParametersToList(const RooAbsCollection& allPars, RooAbsCollection& toList);
    void setParameters(RooAbsCollection& pars) const;
    void setParametersConstant(RooAbsCollection& pars, bool setConstant=true) const;
  };

protected:

  void runFit(TQFolder* results, RooDataSet* data, const TString& name, TQFolder* options);
  TQFolder* runFit(RooDataSet* data, TQFolder* options, RooAbsCollection& pois, const std::vector<const TSHypothesisTest::Hypothesis*>& hypotheses);

public: 
  
	TSHypothesisTest(RooWorkspace * ws, TQFolder* snapshots);
	
	virtual TQFolder * runCalculation(TQFolder * options = NULL) override;
  
	virtual ~TSHypothesisTest();
	
	ClassDefOverride(TSHypothesisTest, 0);
	
};

#endif
 TSHypothesisTest.h:1
 TSHypothesisTest.h:2
 TSHypothesisTest.h:3
 TSHypothesisTest.h:4
 TSHypothesisTest.h:5
 TSHypothesisTest.h:6
 TSHypothesisTest.h:7
 TSHypothesisTest.h:8
 TSHypothesisTest.h:9
 TSHypothesisTest.h:10
 TSHypothesisTest.h:11
 TSHypothesisTest.h:12
 TSHypothesisTest.h:13
 TSHypothesisTest.h:14
 TSHypothesisTest.h:15
 TSHypothesisTest.h:16
 TSHypothesisTest.h:17
 TSHypothesisTest.h:18
 TSHypothesisTest.h:19
 TSHypothesisTest.h:20
 TSHypothesisTest.h:21
 TSHypothesisTest.h:22
 TSHypothesisTest.h:23
 TSHypothesisTest.h:24
 TSHypothesisTest.h:25
 TSHypothesisTest.h:26
 TSHypothesisTest.h:27
 TSHypothesisTest.h:28
 TSHypothesisTest.h:29
 TSHypothesisTest.h:30
 TSHypothesisTest.h:31
 TSHypothesisTest.h:32
 TSHypothesisTest.h:33
 TSHypothesisTest.h:34
 TSHypothesisTest.h:35
 TSHypothesisTest.h:36
 TSHypothesisTest.h:37
 TSHypothesisTest.h:38
 TSHypothesisTest.h:39
 TSHypothesisTest.h:40
 TSHypothesisTest.h:41
 TSHypothesisTest.h:42
 TSHypothesisTest.h:43