CombineHarvester
MorphFunctions.h
Go to the documentation of this file.
1 #ifndef ICHiggsTauTau_CombineTools_MorphFunctions_h
2 #define ICHiggsTauTau_CombineTools_MorphFunctions_h
3 #include <algorithm>
4 #include <vector>
5 #include "RooWorkspace.h"
6 #include "RooHistPdf.h"
8 #pragma GCC diagnostic push
9 #pragma GCC diagnostic ignored "-Wuninitialized"
10 #pragma GCC diagnostic ignored "-Wignored-qualifiers"
11 #pragma GCC diagnostic ignored "-Wunused-parameter"
12 #include "HiggsAnalysis/CombinedLimit/interface/RooMorphingPdf.h"
13 #include "HiggsAnalysis/CombinedLimit/interface/RooSpline1D.h"
14 #include "HiggsAnalysis/CombinedLimit/interface/VerticalInterpHistPdf.h"
15 #include "HiggsAnalysis/CombinedLimit/interface/AsymPow.h"
16 #pragma GCC diagnostic pop
17 
18 namespace ch {
19 
20 inline TH1F AsTH1F(TH1 const* hist) {
21  TH1F res;
22  TH1F const* test_f = dynamic_cast<TH1F const*>(hist);
23  TH1D const* test_d = dynamic_cast<TH1D const*>(hist);
24  if (test_f) {
25  test_f->Copy(res);
26  } else if (test_d) {
27  test_d->Copy(res);
28  } else {
29  throw std::runtime_error("TH1 is not a TH1F or a TH1D");
30  }
31  return res;
32 }
33 
34 
35 std::string BuildRooMorphing(RooWorkspace& ws, CombineHarvester& cb,
36  std::string const& bin, std::string const& process,
37  RooAbsReal& mass_var, std::string norm_postfix,
38  bool allow_morph, bool verbose, bool force_template_limit=false, TFile * file = nullptr);
39 
40 TGraph GraphFromSpline(RooSpline1D const* spline);
41 
42 void MakeMorphDebugPlots(RooMorphingPdf* pdf, RooAbsReal* mass,
43  std::vector<double> const& masses, TFile* f, TH1 *ref_bins = nullptr);
44 }
45 
46 #endif
Definition: Algorithm.h:10
std::string BuildRooMorphing(RooWorkspace &ws, CombineHarvester &cb, std::string const &bin, std::string const &process, RooAbsReal &mass_var, std::string norm_postfix, bool allow_morph, bool verbose, bool force_template_limit=false, TFile *file=nullptr)
[part1]
void MakeMorphDebugPlots(RooMorphingPdf *pdf, RooAbsReal *mass, std::vector< double > const &masses, TFile *f, TH1 *ref_bins=nullptr)
TGraph GraphFromSpline(RooSpline1D const *spline)
TH1F AsTH1F(TH1 const *hist)