BCMTFAnalysisFacility.h
1 #ifndef __BCMTFANALYSISFACILITY__H
2 #define __BCMTFANALYSISFACILITY__H
3 
14 /*
15  * Copyright (C) 2007-2018, the BAT core developer team
16  * All rights reserved.
17  *
18  * For the licensing terms see doc/COPYING.
19  * For documentation see http://mpp.mpg.de/bat
20  */
21 
22 // ---------------------------------------------------------
23 #include <string>
24 #include <vector>
25 
26 #include <TH1D.h>
27 
28 #include "../../BAT/BCLog.h"
29 
30 class BCMTF;
31 class TTree;
32 class TRandom3;
33 
34 // ---------------------------------------------------------
36 {
37 
38 public:
39 
47 
51 
59  { return fMTF; };
60 
68  void SetBCMTF(BCMTF* mtf)
69  { fMTF = mtf; };
70 
74  void SetFlagMarginalize(bool flag)
75  { fFlagMarginalize = flag; };
76 
81  // misc
82 
87  { return fLogLevel; };
88 
93  { fLogLevel = level; };
94 
102  void PerformSingleChannelAnalyses(const std::string& dirname, const std::string& options = "");
103 
111  void PerformSingleSystematicAnalyses(const std::string& dirname, const std::string& options = "");
112 
121  void PerformCalibrationAnalysis(const std::string& dirname, const std::vector<double>& default_parameters, int index, const std::vector<double>& parametervalues, int nensembles = 1000);
122 
129  std::vector<TH1D> BuildEnsemble(const std::vector<double>& parameters, const std::string& options = "");
130 
138  TTree* BuildEnsembles(const std::vector<double>& parameters, int nensembles, const std::string& options = "");
139 
147  TTree* BuildEnsembles(TTree* tree, int nensembles, const std::string& options = "");
148 
157  TTree* PerformEnsembleTest(const std::vector<double>& parameters, int nensembles, const std::string& options = "");
158 
168  TTree* PerformEnsembleTest(TTree* tree, int nensembles, int start = 0, const std::string& options = "");
169 
174  std::vector<TH1D> MatrixToHistograms(const std::vector< std::vector<double> >& matrix);
175 
176 private:
177 
180  BCMTF* fMTF;
181 
184  TRandom3* fRandom;
185 
188  bool fFlagMarginalize;
189 
192  BCLog::LogLevel fLogLevel;
193 
194 };
195 // ---------------------------------------------------------
196 
197 #endif
~BCMTFAnalysisFacility()
The default destructor.
void PerformSingleSystematicAnalyses(const std::string &dirname, const std::string &options="")
Perform the analysis using one systematic at a time, without systematic and with all systematics...
void SetFlagMarginalize(bool flag)
Set a flag for using MCMC (true) or not (false).
void PerformCalibrationAnalysis(const std::string &dirname, const std::vector< double > &default_parameters, int index, const std::vector< double > &parametervalues, int nensembles=1000)
Perform the analysis on pseudo-data generated by varying one of the parameters.
TTree * BuildEnsembles(const std::vector< double > &parameters, int nensembles, const std::string &options="")
Build ensembles based on a single set of parameters.
void SetBCMTF(BCMTF *mtf)
Set the pointer to an MTF object.
LogLevel
Enumerator for the amount of details to put into the log file.
Definition: BCLog.h:59
void PerformSingleChannelAnalyses(const std::string &dirname, const std::string &options="")
Perform the full set of single channel analyses and the combination.
BCMTFAnalysisFacility(BCMTF *mtf)
The default constructor.
BCLog::LogLevel GetLogLevel()
Get the log level for the ensemble test.
std::vector< TH1D > MatrixToHistograms(const std::vector< std::vector< double > > &matrix)
Transform a matrix to a set of histograms.
A class summarizing a set of predefined measurements.
void SetLogLevel(BCLog::LogLevel level)
Set the log level for the ensemble test.
A class for fitting several templates to a data set.
Definition: BCMTF.h:38
std::vector< TH1D > BuildEnsemble(const std::vector< double > &parameters, const std::string &options="")
Build a single ensemble based on a single set of parameters.
TTree * PerformEnsembleTest(const std::vector< double > &parameters, int nensembles, const std::string &options="")
Perform ensemble test based on one set of parameters.